/* ============================================
   The World Decides - Beautiful Voting Platform Styles
   Inspired by minimalist design principles
   ============================================ */

/* ============================================
   BASE RESET & TYPOGRAPHY
   ============================================ */
   
/* ============================================
   VARIABLES
   ============================================ */

:root {
    /* Polymarket-inspired design tokens */
    --pm-bg-primary: #15191d;
    --pm-bg-secondary: #1e2328;
    --pm-surface: #242930;
    --pm-border: #2e343c;
    --pm-border-hover: #3d4752;
    --pm-text-primary: #c5c9d0;
    --pm-text-secondary: #8a919e;
    --pm-text-muted: #4e5762;
    --pm-green: #16c784;
    --pm-red: #ea3943;
    --pm-blue: #3b82f6;
    --pm-purple: #8b5cf6;

    /* Legacy variable mapping (dark terminal aesthetic) */
    --color-one: #c5c9d0;
    --color-two: #3b82f6;
    --color-three: #4f8ef7;
    --color-four: #8a919e;
    --color-five: #7a8494;
    --color-seven: #2e343c;
    --color-eight: #15191d;
    --color-danger: #ea3943;
    --color-danger-hover: #d62f38;
    --color-nine: #2e343c;
    --color-ten: #16c784;
    --color-eleven: rgba(22, 199, 132, 0.2);
    --color-twelve: rgba(59, 130, 246, 0.15);
    --color-thirteen: #3b82f6;
    --color-fourteen: #f59e0b;
    --color-fifteen: rgba(139, 92, 246, 0.15);
    --color-sixteen: #8b5cf6;
    --color-seventeen: #f59e0b;
    --background-one: #15191d;
    --background-two: #1e2328;
    --background-three: #2e343c;
    --background-four: #3b82f6;
    --background-five: #2563eb;
    --background-six: #4e5762;
    --background-seven: #2e343c;
    --background-nine: rgba(59, 130, 246, 0.12);
    --background-eleven: rgba(234, 57, 67, 0.1);
    --background-success: #16c784;
    --background-success-hover: #12a86d;
    --background-thirteen: rgba(22, 199, 132, 0.15);
    --background-fifteen: rgba(234, 57, 67, 0.12);
    --background-seventeen: rgba(245, 158, 11, 0.12);
    --background-eighteen: rgba(245, 158, 11, 0.2);
    --background-nineteen: #d97706;
    --background-twenty: #f59e0b;
    --background-twenty-one: #f97316;
    --background-black: #000000;
}

/* ============================================
   MAIN CSS
   ============================================ */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: visible;
}

html {
    overflow-y: auto;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--color-one);
    background: var(--background-one);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

img {
    max-width: 100%;
    display: block;
    height: auto;
}

/* ============================================
   LAYOUT
   ============================================ */
.page-wrapper {
    min-height: 100vh;
    background: var(--background-one);
    position: relative;
    overflow: visible;
}

/* Outer app shell only — nested page-wrappers in views stay block-level
   so .container margin:auto does not shrink to content width. */
.page-wrapper:has(> .main) {
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    overflow: visible;
    box-sizing: border-box;
}
.container-width{
    max-width: 1400px;
}

.main {
    display: block;
}

/* ============================================
   NAVIGATION
   ============================================ */
.nav {
    background: var(--pm-bg-primary);
    border-bottom: 1px solid var(--pm-border);
    box-shadow: none;
    position: sticky;
    top: 0;
    z-index: 100;
    overflow: visible;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    position: relative;
    overflow: visible;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 20px;
    font-weight: 700;
    color: var(--pm-text-primary);
    transition: color 0.15s ease;
}

.nav-brand:hover {
    color: var(--pm-blue);
}

.app-logo {
    display: block;
    width: auto;
    height: auto;
}

.app-logo-nav {
    height: 44px;
    width: auto;
}

.app-logo-auth {
    height: 96px;
    width: auto;
}

.app-logo-mark {
    height: 44px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 24px;
    margin-left: 24px;
    align-items: center;
}

.nav-link {
    color: var(--pm-text-secondary);
    font-size: 13px;
    font-weight: 500;
    padding: 8px 0;
    text-decoration: none;
    transition: color 0.15s ease;
    border: none;
}

.nav-link:hover {
    color: var(--pm-text-primary);
}

.nav-link.is-active {
    color: var(--pm-text-primary);
    font-weight: 600;
}

.nav-links a:not(.nav-link) {
    color: var(--pm-text-secondary);
    font-size: 13px;
    font-weight: 500;
    padding: 8px 0;
    position: relative;
}

.nav-links a:not(.nav-link):hover {
    color: var(--pm-text-primary);
}

/* Mobile Visible Links */
.nav-links-mobile {
    display: none;
    gap: 10px;
    margin-left: 4px;
    align-items: center;
    flex-wrap: nowrap;
    min-width: 0;
    justify-content: flex-start;
}

.nav-links-mobile a,
.nav-links-mobile .nav-link {
    color: var(--pm-text-secondary);
    font-size: 13px;
    font-weight: 500;
    padding: 6px 0;
    text-decoration: none;
    white-space: nowrap;
}

.nav-links-mobile a:hover,
.nav-links-mobile .nav-link:hover,
.nav-links-mobile .nav-link.is-active {
    color: var(--pm-text-primary);
}

.nav-links-mobile .nav-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 6px;
}

.nav-links-mobile .nav-link-icon-svg {
    width: 18px;
    height: 18px;
}

.nav-links-mobile .nav-link-icon:hover,
.nav-links-mobile .nav-link-icon.is-active {
    color: var(--pm-text-primary);
    background: var(--pm-surface);
}

.nav-end {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 102;
    overflow: visible;
    flex-shrink: 0;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 102;
    overflow: visible;
}

.nav-user > div {
    overflow: visible;
}

.nav-user .btn {
    padding: 6px 14px;
    font-size: 13px;
    line-height: 1.2;
}

.nav-user .nav-dropdown-arrow svg {
    width: 14px;
    height: 14px;
}

@media (max-width: 767px) {
    .nav-user {
        display: none !important;
    }

    .nav-end {
        gap: 6px;
    }

    .language-switcher-trigger {
        gap: 4px;
        padding: 4px 7px;
        border-radius: 6px;
        font-size: 11px;
        min-height: 32px;
    }

    .language-switcher-trigger .language-switcher-label {
        font-size: 10px;
        line-height: 1;
    }

    .language-switcher-trigger .language-flag-img,
    .language-switcher-trigger .language-flag-placeholder {
        width: 14px;
        height: 10px;
    }

    .language-switcher-trigger .language-flag-emoji {
        font-size: 12px;
    }

    .nav-icon-btn {
        width: 34px;
        height: 34px;
        border-radius: 6px;
    }

    .nav-icon-btn-svg {
        width: 18px;
        height: 18px;
    }

    .nav-badge {
        top: 0;
        right: 0;
        min-width: 15px;
        height: 15px;
        padding: 0 4px;
        font-size: 9px;
        line-height: 15px;
        border-width: 1px;
    }

    .nav-mobile-btn {
        padding: 5px 8px;
        border-radius: 6px;
        min-height: 32px;
        min-width: 34px;
    }

    .nav-mobile-icon {
        width: 18px;
        height: 18px;
    }

    .nav-links-mobile {
        gap: 8px;
        margin-left: 2px;
    }

    .nav-links-mobile a,
    .nav-links-mobile .nav-link {
        font-size: 12px;
    }

    .nav-links-mobile .nav-link-icon {
        width: 30px;
        height: 30px;
    }

    .nav-links-mobile .nav-link-icon-svg {
        width: 17px;
        height: 17px;
    }
}

@media (max-width: 400px) {
    .nav-links-mobile {
        gap: 6px;
        margin-left: 0;
    }

    .nav-links-mobile a,
    .nav-links-mobile .nav-link {
        font-size: 11px;
    }

    .nav-end {
        gap: 4px;
    }

    .language-switcher-trigger {
        padding: 3px 6px;
        min-height: 30px;
    }

    .language-switcher-trigger .language-switcher-label {
        display: none;
    }

    .nav-icon-btn,
    .nav-mobile-btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
        padding: 0;
    }

    .nav-links-mobile .nav-link-icon {
        width: 28px;
        height: 28px;
    }

    .nav-links-mobile .nav-link-icon-svg {
        width: 16px;
        height: 16px;
    }
}

.nav-mobile {
    display: flex;
    align-items: center;
}

@media (min-width: 768px) {
    .nav-mobile {
        display: none !important;
    }
    
    .nav-links-mobile {
        display: none !important;
    }
}

.nav-mobile-btn {
    background: var(--pm-surface);
    border: 1px solid var(--pm-border);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--pm-text-secondary);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-mobile-icon {
    display: block;
}

.nav-mobile-icon-close {
    display: none;
}

.nav-mobile-btn.is-open .nav-mobile-icon-menu {
    display: none;
}

.nav-mobile-btn.is-open .nav-mobile-icon-close {
    display: block;
}

.nav-mobile-btn.is-open {
    color: var(--pm-text-primary);
    border-color: var(--pm-border-hover);
    background: var(--pm-bg-secondary);
}

.nav-mobile-btn:hover {
    background: var(--pm-bg-secondary);
    border-color: var(--pm-border-hover);
    color: var(--pm-text-primary);
}

.nav-dropdown-btn {
    background: var(--pm-surface);
    border: 1px solid var(--pm-border);
    color: var(--pm-text-primary);
    border-radius: 8px;
    padding: 5px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 13px;
    line-height: 1.2;
    min-width: 0;
    max-width: 200px;
    white-space: nowrap;
}

.nav-dropdown-btn > div:first-child {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.nav-dropdown-btn > div:first-child span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.nav-dropdown-btn:hover {
    background: var(--pm-bg-secondary);
    border-color: var(--pm-border-hover);
    color: var(--pm-text-primary);
}

.nav-dropdown-btn:hover .nav-dropdown-arrow svg {
    transform: rotate(180deg);
}

.nav-user-avatar {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--background-four) 0%, var(--background-five) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.nav-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.nav-user-avatar > div {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-dropdown-arrow {
    display: flex;
    align-items: center;
    color: var(--color-four);
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.nav-dropdown-btn:hover .nav-dropdown-arrow,
.nav-dropdown-btn-active .nav-dropdown-arrow {
    color: var(--color-two);
}

/* Dropdown Menu Styles */
.user-dropdown-flyout {
    position: absolute;
    z-index: 9999;
    top: 100%;
    margin-top: 8px;
}

.user-dropdown-flyout--right {
    inset-inline-end: 0;
    transform-origin: top right;
}

.user-dropdown-flyout--left {
    inset-inline-start: 0;
    transform-origin: top left;
}

.user-dropdown .is-open .nav-dropdown-arrow svg {
    transform: rotate(180deg);
    color: var(--pm-blue);
}

.user-dropdown-menu {
    min-width: 240px;
    width: 240px;
}

.user-dropdown-panel {
    background: var(--pm-bg-secondary);
    border: 1px solid var(--pm-border);
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
    padding: 6px;
    overflow: hidden;
}

.dropdown-header {
    display: block;
    padding: 12px;
    margin-bottom: 4px;
    background: var(--pm-surface);
    border: 1px solid var(--pm-border);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.dropdown-header:hover,
.dropdown-header:focus {
    background: var(--pm-bg-secondary);
    border-color: var(--pm-border-hover);
    outline: none;
}

.dropdown-header-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dropdown-user-avatar {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--pm-border-hover);
    position: relative;
    background: linear-gradient(135deg, var(--pm-blue) 0%, var(--pm-purple) 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.dropdown-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dropdown-user-avatar > div,
.dropdown-user-avatar-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--pm-blue) 0%, var(--pm-purple) 100%);
}

.dropdown-user-info {
    flex: 1;
    min-width: 0;
}

.dropdown-user-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
    color: var(--pm-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-user-email {
    font-size: 12px;
    color: var(--pm-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-divider {
    height: 1px;
    background: var(--pm-border);
    margin: 4px 6px;
}

.dropdown-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    text-align: start;
    font-size: 13px;
    font-weight: 500;
    color: var(--pm-text-secondary);
    background: transparent;
    transition: background 0.15s ease, color 0.15s ease;
    text-decoration: none;
    cursor: pointer;
}

.dropdown-link:hover {
    background: var(--pm-surface);
    color: var(--pm-text-primary);
}

.dropdown-link:focus {
    outline: none;
    background: var(--pm-surface);
    color: var(--pm-text-primary);
}

.dropdown-link-danger {
    color: var(--pm-red);
}

.dropdown-link-danger:hover,
.dropdown-link-danger:focus {
    background: rgba(234, 57, 67, 0.12);
    color: var(--pm-red);
}

.dropdown-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: currentColor;
    opacity: 0.9;
}

.user-dropdown-flyout form {
    margin: 0;
}

/* User Avatar Small (for comments and topics) */
.user-avatar-small {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--background-four) 0%, var(--background-five) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.user-avatar-initial {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.user-avatar-guest {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    background: linear-gradient(135deg, var(--background-six) 0%, var(--color-four) 100%);
}

.user-avatar-guest svg {
    width: 60%;
    height: 60%;
}

.nav-responsive {
    display: none;
    border-top: 1px solid var(--background-three);
    background: var(--background-two);
}

.nav-responsive.open {
    display: block;
}

@media (min-width: 768px) {
    .nav-responsive {
        display: none !important;
    }
}

.nav-responsive-section {
    padding: 12px 0;
}

.nav-responsive-section a {
    display: block !important;
    padding: 12px 20px !important;
    color: var(--color-five) !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    transition: all 0.2s ease;
    border-left: 4px solid transparent !important;
    width: 100% !important;
    text-align: left !important;
    line-height: 1.5 !important;
}

.nav-responsive-section a:hover {
    background: var(--background-one) !important;
    color: var(--color-two) !important;
    border-left-color: var(--color-two) !important;
}

.nav-responsive-section a.active,
.nav-responsive-section a[aria-current="page"] {
    background: var(--background-nine) !important;
    color: var(--color-two) !important;
    border-left-color: var(--color-two) !important;
    font-weight: 600 !important;
}

.nav-responsive-user {
    padding: 16px 0;
    border-top: 1px solid var(--background-three);
    background: var(--background-one);
}

.nav-responsive-user-info {
    padding: 0 20px;
}

.nav-responsive-user-name {
    font-weight: 600;
    color: var(--color-one);
    font-size: 16px;
}

.nav-responsive-user-email {
    font-size: 14px;
    color: var(--color-four);
    margin-top: 4px;
}

.nav-responsive-user-actions {
    margin-top: 12px;
    padding: 0 20px;
}

.nav-responsive-user-actions a {
    display: block !important;
    padding: 12px 0 12px 16px !important;
    color: var(--color-five) !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    transition: all 0.2s ease;
    border-left: 4px solid transparent !important;
    width: 100% !important;
    text-align: left !important;
    line-height: 1.5 !important;
}

.nav-responsive-user-actions a:hover {
    color: var(--color-two) !important;
    border-left-color: var(--color-two) !important;
}

.nav-responsive-user-actions form {
    margin: 0;
}

.nav-responsive-user-actions button,
.nav-responsive-user-actions form button {
    display: block !important;
    width: 100% !important;
    text-align: left !important;
    padding: 12px 0 12px 16px !important;
    color: var(--color-five) !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    background: none !important;
    border: none !important;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 4px solid transparent !important;
    font-family: inherit !important;
    line-height: 1.5 !important;
}

.nav-responsive-user-actions button:hover,
.nav-responsive-user-actions form button:hover {
    color: var(--color-two) !important;
    border-left-color: var(--color-two) !important;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    background: var(--pm-bg-secondary);
    color: var(--pm-text-primary);
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--pm-border);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.04)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 1;
    pointer-events: none;
}

.hero-inner {
    padding: 28px 0;
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 36px;
    line-height: 1.15;
    margin: 0 0 10px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.hero-subtitle {
    font-size: 15px;
    color: var(--pm-text-secondary);
    margin: 0 0 20px;
    font-weight: 400;
}

.hero-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.hero-actions .btn {
    white-space: nowrap;
}

@media (min-width: 640px) {
    .hero-title {
        font-size: 48px;
    }

    .hero-inner {
        padding: 32px 0;
    }
}

/* ============================================
   HERO SEARCH BAR
   ============================================ */
.hero-search {
    margin: 0 auto 20px;
    max-width: 600px;
    width: 100%;
}

.hero-search-form {
    width: 100%;
}

.hero-search-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

@media (min-width: 640px) {
    .hero-search-group {
        flex-direction: row;
        align-items: stretch;
    }
}

.hero-search-input {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
    border: 1px solid var(--pm-border);
    border-radius: 8px;
    background: var(--pm-surface);
    color: var(--pm-text-primary);
    box-shadow: none;
    transition: border-color 0.15s ease;
    font-weight: 400;
}

.hero-search-input::placeholder {
    color: var(--pm-text-muted);
}

.hero-search-input:focus {
    outline: none;
    background: var(--pm-surface);
    border-color: var(--pm-blue);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    transform: none;
}

.hero-search-button {
    background: var(--pm-surface);
    border: 1px solid var(--pm-border);
    color: var(--pm-text-primary);
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    backdrop-filter: none;
    white-space: nowrap;
}

@media (min-width: 640px) {
    .hero-search-button {
        flex-shrink: 0;
    }
}

.hero-search-button:hover {
    background: var(--pm-border-hover);
    border-color: var(--pm-border-hover);
    color: var(--pm-text-primary);
    transform: none;
    box-shadow: none;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-block;
    font-weight: 600;
    border-radius: 8px;
    padding: 10px 20px;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
    position: relative;
    overflow: hidden;
    text-align: center;
    line-height: 1.5;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
}

.btn-primary {
    background: var(--pm-blue);
    color: #fff;
    box-shadow: none;
    border: 1px solid var(--pm-blue);
}

.btn-primary:hover {
    background: var(--color-three);
    border-color: var(--color-three);
    transform: none;
    box-shadow: none;
}

.btn-primary:active {
    transform: none;
    box-shadow: none;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--pm-border);
    color: var(--pm-text-primary);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--pm-surface);
    border-color: var(--pm-border-hover);
    transform: none;
    color: var(--pm-text-primary);
}

.hero .btn-outline {
    border-color: var(--pm-border);
    color: var(--pm-text-primary);
}

.hero .btn-outline:hover {
    background: var(--pm-surface);
    border-color: var(--pm-border-hover);
}

.hero .btn-primary,
.page-header-actions .btn-primary {
    background: rgba(59, 130, 246, 0.12);
    color: var(--pm-text-primary);
    border: 1px solid rgba(59, 130, 246, 0.28);
    box-shadow: none;
}

.hero .btn-primary:hover,
.page-header-actions .btn-primary:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    color: var(--pm-text-primary);
    transform: none;
    box-shadow: none;
}

.hero .btn-primary:active,
.page-header-actions .btn-primary:active {
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: var(--pm-surface);
    color: var(--pm-text-primary);
    border: 1px solid var(--pm-border);
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
}

.btn-secondary.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-secondary:hover {
    background: var(--pm-border-hover);
    transform: none;
}

.btn-danger {
    background: var(--pm-red);
    color: #fff;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
}

.btn-danger.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-danger:hover {
    background: var(--color-danger-hover);
    transform: none;
}

.btn-danger-soft {
    background: var(--pm-surface);
    background: color-mix(in srgb, var(--pm-bg-primary) 90%, var(--pm-red) 10%);
    color: var(--pm-text-primary);
    border: 1px solid var(--pm-border);
    border-color: color-mix(in srgb, var(--pm-border) 88%, var(--pm-red) 12%);
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
}

.btn-danger-soft.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-danger-soft:hover {
    background: color-mix(in srgb, var(--pm-bg-primary) 82%, var(--pm-red) 18%);
    border-color: color-mix(in srgb, var(--pm-border) 70%, var(--pm-red) 30%);
}

@media (max-width: 768px) {
    .btn-secondary.btn-sm,
    .btn-danger.btn-sm,
    .btn-danger-soft.btn-sm {
        padding: 4px 8px;
        font-size: 11px;
    }
}

.btn-link {
    padding: 8px 12px;
    color: var(--pm-blue);
    background: transparent;
    border: none;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
}

.btn-link:hover {
    color: var(--color-three);
    text-decoration: none;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 6px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .btn-sm {
        padding: 4px 8px;
        font-size: 11px;
    }
}

.btn-icon {
    padding: 6px 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: auto;
}

.btn-icon-sm {
    padding: 4px 6px;
    font-size: 12px;
    border-radius: 4px;
    min-width: auto;
}

.btn-icon-sm svg {
    width: 14px;
    height: 14px;
}

.btn-secondary.btn-icon-sm {
    color: var(--pm-text-secondary);
}

.btn-secondary.btn-icon-sm:hover {
    color: var(--pm-text-primary);
}

.btn-success {
    background: var(--background-success);
    color: #fff;
    border: none;
    font-weight: 600;
}

.btn-success:hover {
    background: var(--background-success-hover);
    transform: none;
    box-shadow: none;
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
    padding: 48px 0;
}

.container.section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 20px;
}

.section-header {
    margin-bottom: 32px;
}

.section-header .h2 {
    margin: 0;
}

.section-header .muted {
    margin: 8px 0 0;
    font-size: 15px;
}

.section--light {
    background: var(--pm-bg-secondary);
    border-top: 1px solid var(--pm-border);
    border-bottom: 1px solid var(--pm-border);
}

/* ============================================
   HEADINGS & TEXT
   ============================================ */
.h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--pm-text-primary);
    margin: 0 0 12px;
    line-height: 1.3;
}

.muted {
    color: var(--pm-text-secondary);
    font-size: 13px;
}

/* ============================================
   GRID
   ============================================ */
.grid {
    display: grid;
    gap: 14px;
}

@media (min-width: 768px) {
    .grid--2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid--3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--pm-bg-secondary);
    border-radius: 8px;
    box-shadow: none;
    padding: 16px;
    transition: border-color 0.15s ease;
    border: 1px solid var(--pm-border);
    position: relative;
    overflow: hidden;
}

/* Native video controls (left play) get clipped by overflow:hidden + radius */
.card:has(video),
.card.topic-media-card {
    overflow: visible;
}

.card[onclick] {
    cursor: pointer;
}

.card::before {
    display: none;
}

.card:hover {
    box-shadow: none;
    transform: none;
    border-color: var(--pm-border-hover);
}

.card:hover::before {
    display: none;
}

.card[onclick]:hover {
    cursor: pointer;
}

.card-light {
    background: var(--pm-surface);
}

.badge {
    display: inline-block;
    background: var(--pm-surface);
    color: var(--pm-text-secondary);
    border: 1px solid var(--pm-border);
    border-radius: 999px;
    font-weight: 500;
    font-size: 11px;
    padding: 4px 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-success {
    background: rgba(22, 199, 132, 0.12);
    color: var(--pm-green);
    border-color: rgba(22, 199, 132, 0.3);
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--pm-text-primary);
    margin: 12px 0 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-text {
    color: var(--pm-text-secondary);
    font-size: 13px;
    margin: 0 0 12px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--pm-text-secondary);
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--pm-border);
}

.card-footer-stats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
}

.card-footer-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.card-footer-stat-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.85;
}

.topic-card-image {
    margin-bottom: 12px;
    border-radius: 6px;
    aspect-ratio: 16 / 9;
    background: var(--pm-surface);
    position: relative;
}

.topic-card-image:has(video) {
    border-radius: 0;
}

.topic-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 6px;
}

.topic-card-image .video-player {
    width: 100%;
    height: 100%;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
}

.topic-card-image .video-player video,
.topic-card-image video {
    width: 100%;
    height: auto;
    max-height: 100%;
    /* Fixed 100% height + object-fit:cover mispositions Chromium native controls */
    object-fit: contain;
    background: #0b0d10;
    display: block;
    border-radius: 0;
    overflow: visible;
}

.video-player {
    position: relative;
    width: 100%;
    display: block;
    background: #0b0d10;
    overflow: visible;
    padding: 0;
    box-sizing: border-box;
}

.video-player video {
    width: 100%;
    height: auto;
    max-height: 100%;
    display: block;
    vertical-align: middle;
    color-scheme: dark;
    border-radius: 0;
    overflow: visible;
    object-fit: contain;
    background: #0b0d10;
    /* box-sizing + inline padding pulls Chromium controls off the clipped left edge */
    box-sizing: border-box;
    padding-inline: 12px;
}

/* Prefer clipping secondary controls on the right over eating the left play button */
.video-player video::-webkit-media-controls-enclosure {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Keep native control bar fully visible (avoid overflow clipping the left play button) */
.topic-card-image,
.result-card-image,
.topic-image-container {
    overflow: visible;
}

.result-card-image {
    border-radius: 8px;
}

.result-card-image .video-player,
.result-card-image .video-player video {
    width: 100%;
    height: 200px;
    max-height: 200px;
    object-fit: contain;
    background: #0b0d10;
    border-radius: 0;
    overflow: visible;
}

@media (max-width: 768px) {
    .topic-card-image .video-player video,
    .topic-card-image video,
    .result-card-image .video-player video {
        object-fit: contain;
        background: #0b0d10;
    }
}

/* ============================================
   LISTS & CHIPS
   ============================================ */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.chip {
    display: inline-flex;
    align-items: center;
    background: var(--pm-surface);
    color: var(--pm-text-secondary);
    border: 1px solid var(--pm-border);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    cursor: pointer;
}

a.chip {
    color: var(--pm-text-secondary);
}

a.chip:hover {
    text-decoration: none;
    color: var(--pm-text-primary);
}

.chip:hover,
.chip.is-active {
    background: rgba(59, 130, 246, 0.12);
    border-color: var(--pm-blue);
    color: var(--pm-text-primary);
    transform: none;
}

/* ============================================
   PAGE HEADERS
   ============================================ */
.page-header {
    background: var(--pm-bg-primary);
    box-shadow: none;
    border-bottom: 1px solid var(--pm-border);
}

.page-header-content {
    padding: 20px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.page-header-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-one);
    margin: 0;
    line-height: 1.2;
}

.page-header-subtitle {
    color: var(--color-four);
    margin: 8px 0 0;
    font-size: 15px;
}

.page-header-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-weight: 500;
    color: var(--pm-text-primary);
    margin-bottom: 8px;
    font-size: 13px;
}

/* Profile picture chooser (account settings) */
.profile-picture-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.profile-picture-avatar {
    width: 96px;
    height: 96px;
    border-radius: 9999px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--pm-border);
    background: var(--pm-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.profile-picture-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.profile-picture-img[hidden],
.profile-picture-initials[hidden] {
    display: none !important;
}

.profile-picture-initials {
    font-size: 32px;
    font-weight: 600;
    line-height: 1;
    color: var(--pm-text-secondary);
    user-select: none;
}

.profile-picture-actions {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.profile-picture-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.profile-picture-choose {
    cursor: pointer;
    margin: 0;
}

.profile-picture-hint {
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
    color: var(--pm-text-secondary);
}

.profile-picture-remove {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    font-size: 13px;
    color: var(--color-danger);
    cursor: pointer;
    user-select: none;
}

.profile-picture-remove input {
    accent-color: var(--color-danger);
    width: 14px;
    height: 14px;
    margin: 0;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 8px;
    flex-wrap: wrap;
}

.form-success {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #22c55e;
}

.form-success-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .profile-picture-row {
        gap: 14px;
    }

    .profile-picture-avatar {
        width: 80px;
        height: 80px;
    }

    .profile-picture-initials {
        font-size: 28px;
    }
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--pm-border);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    background: var(--pm-surface);
    color: var(--pm-text-primary);
    font-family: inherit;
}

.form-select {
    appearance: none;
    -webkit-appearance: none;
    padding-inline-end: 40px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a919e' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

html.rtl .form-select,
html[dir="rtl"] .form-select {
    background-position: left 12px center;
    padding-inline-end: 14px;
    padding-inline-start: 40px;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--pm-blue);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Suppress browser default red border on empty required fields until server error */
.form-input:invalid,
.form-textarea:invalid,
.form-select:invalid {
    border-color: var(--pm-border);
    box-shadow: none;
}

.form-input:invalid:focus,
.form-textarea:invalid:focus,
.form-select:invalid:focus {
    border-color: var(--pm-blue);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.6;
}

.form-error {
    color: var(--color-danger);
    font-size: 14px;
    margin-top: 6px;
    font-weight: 500;
}

.form-input-error {
    border-color: var(--color-danger) !important;
}

.form-input-error:focus {
    border-color: var(--color-danger) !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

.debate-options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.debate-option-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.debate-option-row .form-input {
    flex: 1;
    min-width: 0;
}

.debate-option-remove {
    flex-shrink: 0;
    align-self: stretch;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 8px;
    background: color-mix(in srgb, var(--pm-bg-primary) 90%, var(--pm-red) 10%);
    border: 1px solid color-mix(in srgb, var(--pm-border) 88%, var(--pm-red) 12%);
    color: var(--pm-red);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.debate-option-remove:hover {
    background: color-mix(in srgb, var(--pm-bg-primary) 82%, var(--pm-red) 18%);
    border-color: color-mix(in srgb, var(--pm-border) 70%, var(--pm-red) 30%);
    color: #fff;
}

.debate-option-remove svg {
    width: 18px;
    height: 18px;
}

.debate-option-remove.is-hidden {
    display: none;
}

.debate-option-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 16px;
    width: 100%;
    border: 1px dashed var(--pm-border);
    border-radius: 8px;
    background: transparent;
    color: var(--pm-blue);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.debate-option-add:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.35);
    color: var(--color-three);
}

.debate-option-add svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .debate-option-remove {
        width: 40px;
        min-height: 40px;
    }
}

/* Modern custom select */
.tot-select {
    position: relative;
    width: 100%;
}

.tot-select-native {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.tot-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--pm-border);
    border-radius: 8px;
    background: var(--pm-surface);
    color: var(--pm-text-primary);
    font-size: 14px;
    font-family: inherit;
    text-align: start;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.tot-select-trigger:hover {
    border-color: var(--pm-border-hover);
    background: var(--pm-bg-secondary);
}

.tot-select.is-open .tot-select-trigger,
.tot-select-trigger:focus-visible {
    outline: none;
    border-color: var(--pm-blue);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.tot-select.is-disabled .tot-select-trigger {
    opacity: 0.55;
    cursor: not-allowed;
}

.tot-select-value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tot-select-value.is-placeholder {
    color: var(--pm-text-muted);
}

.tot-select-chevron {
    flex-shrink: 0;
    display: inline-flex;
    color: var(--pm-text-muted);
    transition: transform 0.15s ease, color 0.15s ease;
}

.tot-select-chevron svg {
    width: 16px;
    height: 16px;
}

.tot-select.is-open .tot-select-chevron {
    transform: rotate(180deg);
    color: var(--pm-blue);
}

.tot-select-menu {
    position: absolute;
    top: calc(100% + 6px);
    inset-inline: 0;
    z-index: 10050;
    display: none;
    max-height: 260px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6px;
    background: var(--pm-bg-secondary);
    border: 1px solid var(--pm-border);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    scrollbar-width: thin;
    scrollbar-color: rgba(138, 145, 158, 0.28) transparent;
}

.tot-select.is-open .tot-select-menu {
    display: block;
}

.tot-select-menu::-webkit-scrollbar {
    width: 3px;
}

.tot-select-menu::-webkit-scrollbar-thumb {
    background: rgba(138, 145, 158, 0.28);
    border-radius: 999px;
}

.tot-select-option {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--pm-text-secondary);
    font-size: 14px;
    font-family: inherit;
    text-align: start;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.tot-select-option:hover:not(.is-disabled) {
    background: var(--pm-surface);
    color: var(--pm-text-primary);
}

.tot-select-option.is-selected {
    background: rgba(59, 130, 246, 0.12);
    color: var(--pm-text-primary);
    font-weight: 600;
}

.tot-select-option.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.tot-select--filter .tot-select-trigger {
    padding: 11px 12px;
}

.tot-select--filter .tot-select-menu {
    max-height: 220px;
}

/* ============================================
   VOTE OPTIONS
   ============================================ */
.vote-option-wrapper {
    margin-bottom: 12px;
}

.vote-option {
    display: flex;
    align-items: flex-start;
    padding: 12px 14px;
    border: 1px solid var(--pm-border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
    background: var(--pm-surface);
    position: relative;
}

.vote-option:hover {
    border-color: var(--pm-border-hover);
    background: var(--pm-bg-secondary);
    transform: none;
}

.vote-option.selected {
    border-color: var(--pm-blue);
    background: rgba(59, 130, 246, 0.08);
    box-shadow: none;
}

.vote-option.vote-option-locked {
    cursor: default;
    pointer-events: none;
}

.vote-option.vote-option-locked:hover {
    border-color: var(--pm-border);
    background: var(--pm-surface);
}

.vote-option.vote-option-locked.selected:hover {
    border-color: var(--pm-blue);
    background: rgba(59, 130, 246, 0.08);
}

.vote-option input {
    margin-right: 12px;
    margin-top: 2px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--color-two);
    align-self: flex-start;
}

.vote-option-content {
    flex: 1;
    width: 100%;
}

.vote-option-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.vote-option-text {
    color: var(--color-one);
    flex: 1;
    min-width: 0;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
}

.vote-option-header .vote-count-badge {
    flex-shrink: 0;
    margin-left: auto;
    padding: 3px 10px;
    background: var(--background-one);
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-five);
    white-space: nowrap;
    transition: opacity 0.3s ease, height 0.3s ease;
}

.vote-option-header .vote-count-pct {
    font-weight: 700;
}

.vote-option-header .vote-count-meta {
    font-size: 0.85em;
    font-weight: 500;
    opacity: 0.85;
}

.vote-result-bar {
    transition: opacity 0.3s ease, height 0.3s ease;
}

.vote-result-fill {
    transition: width 0.5s ease;
}

.vote-option .vote-result-bar {
    width: 100%;
    background: var(--pm-border);
    border-radius: 9999px;
    height: 5px;
    overflow: hidden;
    margin-top: 6px;
    transition: opacity 0.15s ease;
}

.vote-option .vote-result-fill {
    background: var(--pm-green);
    height: 5px;
    border-radius: 9999px;
    transition: width 0.4s ease;
}

@media (max-width: 768px) {
    .vote-option-wrapper {
        margin-bottom: 10px;
    }

    .vote-option {
        padding: 10px 12px;
    }

    .vote-option input {
        width: 16px;
        height: 16px;
        margin-right: 10px;
        margin-top: 1px;
    }

    .vote-option-header {
        flex-wrap: wrap;
        gap: 6px;
        margin-bottom: 6px;
    }

    .vote-option-text {
        font-size: 14px;
        line-height: 1.35;
    }

    .vote-option-header .vote-count-badge {
        font-size: 11px;
        padding: 2px 8px;
        margin-left: 0;
        white-space: normal;
        max-width: 100%;
    }

    .vote-option .vote-result-bar {
        margin-top: 4px;
        height: 4px;
    }

    .vote-option .vote-result-fill {
        height: 4px;
    }
}

/* ============================================
   VOTE RESULTS
   ============================================ */
.vote-results {
    margin-bottom: 32px;
}

.vote-result-item {
    margin-bottom: 20px;
}

.vote-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--pm-text-secondary);
    margin-bottom: 8px;
    font-weight: 400;
}

.vote-result-header > span:last-child,
.vote-result-header .vote-pct {
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--pm-text-primary);
    flex-shrink: 0;
}

.vote-result-bar {
    width: 100%;
    background: var(--pm-border);
    border-radius: 9999px;
    height: 6px;
    overflow: hidden;
    position: relative;
    transition: opacity 0.15s ease;
}

.vote-result-fill {
    background: var(--pm-green);
    height: 6px;
    border-radius: 9999px;
    transition: width 0.4s ease;
}

.vote-result-total {
    margin-top: 16px;
    font-size: 14px;
    color: var(--color-four);
    font-weight: 500;
}

/* ============================================
   COMMENTS (social thread)
   ============================================ */
.comments-section {
    background: var(--pm-bg-secondary);
    border: 1px solid var(--pm-border);
    border-radius: 8px;
    padding: 20px;
}

.comments-section-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px;
    color: var(--pm-text-primary);
}

.comments-composer {
    margin-bottom: 20px;
}

.comments-composer .form-textarea,
.reply-form-textarea,
.contact-form-textarea,
.auto-grow-textarea {
    min-height: 72px;
    max-height: 220px;
    resize: none;
    overflow-x: hidden;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.comments-composer .form-textarea::-webkit-scrollbar,
.reply-form-textarea::-webkit-scrollbar,
.contact-form-textarea::-webkit-scrollbar,
.auto-grow-textarea::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.comments-composer-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.comments-empty {
    text-align: center;
    padding: 28px 12px;
    color: var(--pm-text-secondary);
    font-size: 14px;
}

.comment {
    display: block;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.comment-avatar {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    line-height: 0;
}

.comment-avatar .user-avatar-small {
    width: 22px;
    height: 22px;
}

.comment-reply .comment-avatar .user-avatar-small {
    width: 20px;
    height: 20px;
}

.comment-bubble {
    background: var(--pm-surface);
    border: 1px solid var(--pm-border);
    border-radius: 16px;
    padding: 8px 12px 10px;
}

.comment-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.comment-meta-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 6px;
    min-width: 0;
}

.comment-meta-dot {
    color: var(--pm-text-secondary);
    font-size: 12px;
    line-height: 1;
}

.comment-reply-to-arrow {
    display: none;
}

.comment-menu {
    position: relative;
    flex-shrink: 0;
}

.comment-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 9999px;
    background: transparent;
    color: var(--pm-text-secondary);
    cursor: pointer;
    opacity: 0.55;
    transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.comment:hover .comment-menu-toggle,
.comment:focus-within .comment-menu-toggle,
.comment-menu.is-open .comment-menu-toggle {
    opacity: 1;
}

.comment-menu-toggle:hover,
.comment-menu.is-open .comment-menu-toggle {
    background: var(--pm-bg-secondary);
    color: var(--pm-text-primary);
}

.comment-menu-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 30;
    min-width: 148px;
    padding: 4px;
    border: 1px solid var(--pm-border);
    border-radius: 10px;
    background: var(--pm-bg-secondary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.comment-menu-dropdown[hidden] {
    display: none !important;
}

.comment-menu-item {
    display: block;
    width: 100%;
    padding: 8px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--pm-text-primary);
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.comment-menu-item:hover {
    background: var(--pm-surface);
}

.comment-menu-item--danger {
    color: var(--color-danger);
}

.comment-menu-item--danger:hover {
    background: rgba(234, 57, 67, 0.12);
}

html.rtl .comment-menu-dropdown,
html[dir="rtl"] .comment-menu-dropdown {
    right: auto;
    left: 0;
}

html.rtl .comment-menu-item,
html[dir="rtl"] .comment-menu-item {
    text-align: right;
}

.comment-author {
    font-weight: 650;
    color: var(--pm-text-primary);
    font-size: 13px;
    line-height: 1.3;
}

.comment-author a {
    color: inherit;
}

.comment-author a:hover {
    text-decoration: underline;
}

.comment-time {
    color: var(--pm-text-secondary);
    font-size: 12px;
}

.comment-reply-to {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    min-width: 0;
    color: var(--pm-text-secondary);
    font-size: 12px;
}

.comment-reply-to a {
    color: var(--pm-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 14em;
    text-decoration: none;
}

.comment-reply-to a:hover {
    color: var(--pm-text-primary);
}

.comment-content {
    color: var(--pm-text-primary);
    font-size: 14px;
    line-height: 1.45;
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.comment-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-top: 4px;
    padding-left: 4px;
}

.comment-action-link,
.show-replies-btn {
    appearance: none;
    border: none;
    background: transparent;
    padding: 4px 6px;
    margin: 0;
    font-size: 12px;
    font-weight: 650;
    color: var(--pm-text-secondary);
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
}

.comment-action-link:hover,
.show-replies-btn:hover {
    color: var(--pm-text-primary);
    background: transparent;
}

.show-replies-btn {
    margin-top: 4px;
    color: var(--pm-text-secondary);
    font-weight: 650;
}

/* ============================================
   COMMENT VOTING
   ============================================ */
.comment-voting {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 6px;
    border: none;
    border-radius: 9999px;
    background: transparent;
    color: var(--pm-text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
    font-weight: 600;
}

.vote-btn svg {
    width: 14px;
    height: 14px;
}

.vote-btn:hover {
    background: var(--pm-surface);
    color: var(--pm-text-primary);
}

.vote-btn.upvote:hover {
    color: var(--background-success, #16c784);
}

.vote-btn.downvote:hover {
    color: var(--color-danger);
}

.vote-btn.active.upvote {
    background: rgba(22, 199, 132, 0.12);
    color: var(--background-success, #16c784);
}

.vote-btn.active.downvote {
    background: rgba(234, 57, 67, 0.12);
    color: var(--color-danger);
}

.vote-count {
    font-weight: 650;
    color: inherit;
    font-size: 12px;
}

.comment-score {
    min-width: 1.25em;
    text-align: center;
    font-size: 12px;
    font-weight: 650;
    color: var(--pm-text-secondary);
    padding: 0 2px;
}

.reply-form {
    margin-top: 8px;
}

.reply-form[hidden],
.comment-replies[hidden],
.reply-item[hidden] {
    display: none !important;
}

.reply-form-textarea {
    font-size: 14px;
    min-height: 56px;
}

.reply-form-textarea.form-textarea {
    min-height: 56px;
}

.reply-form-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.comment-replies {
    margin-top: 8px;
    margin-left: 8px;
    padding-left: 8px;
    border-left: 1px solid var(--pm-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comment--depth-1,
.comment--depth-2,
.comment--depth-3,
.comment--depth-4 {
    margin-top: 0;
}

@media (max-width: 640px) {
    .comments-section {
        padding: 16px;
    }

    .comment-avatar .user-avatar-small {
        width: 18px;
        height: 18px;
    }

    .comment-reply .comment-avatar .user-avatar-small {
        width: 18px;
        height: 18px;
    }

    .comment-bubble {
        border-radius: 14px;
        padding: 6px 9px 8px;
    }

    .comment-meta {
        gap: 4px;
        margin-bottom: 2px;
        align-items: center;
    }

    .comment-meta-left {
        flex-wrap: nowrap;
        gap: 4px;
        overflow: hidden;
        white-space: nowrap;
    }

    .comment-replies {
        margin-left: 4px;
        padding-left: 6px;
        gap: 6px;
    }

    .comment-author {
        font-size: 12px;
        flex-shrink: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .comment-author a {
        display: inline-block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        vertical-align: bottom;
    }

    .comment-reply-to {
        flex-shrink: 1;
        min-width: 0;
        font-size: 11px;
        overflow: hidden;
    }

    .comment-reply-to-label {
        display: none;
    }

    .comment-reply-to-arrow {
        display: inline;
        flex-shrink: 0;
    }

    .comment-reply-to a {
        max-width: 7.5em;
        font-size: 11px;
    }

    .comment-meta-dot,
    .comment-time {
        flex-shrink: 0;
        font-size: 11px;
    }

    .comment-menu-toggle {
        width: 24px;
        height: 24px;
        opacity: 0.75;
    }
}

/* ============================================
   STATUS MESSAGES
   ============================================ */
.status-success {
    padding: 16px 20px;
    background: var(--background-thirteen);
    border: 1px solid var(--color-eleven);
    border-radius: 8px;
    color: var(--color-ten);
    font-weight: 500;
    margin-bottom: 20px;
}

.status-info {
    padding: 16px 20px;
    background: var(--color-twelve);
    border: 1px solid var(--color-twelve);
    border-radius: 8px;
    color: var(--color-thirteen);
    font-weight: 500;
    margin-bottom: 20px;
}

.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 15px;
    font-weight: 500;
}

.alert-success {
    background: var(--background-thirteen);
    color: var(--pm-green);
    border: 1px solid var(--color-eleven);
    box-shadow: none;
}

.alert-info {
    background: var(--color-twelve);
    color: var(--pm-blue);
    border: 1px solid var(--color-twelve);
    box-shadow: none;
}

.alert-warning {
    background: var(--pm-surface);
    color: var(--pm-text-primary);
    border: 1px solid var(--pm-border);
    box-shadow: none;
}

/* ============================================
   BACK LINK
   ============================================ */
.back-link {
    color: var(--color-four);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--color-two);
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-top: 40px;
    width: 100%;
}

.pagination nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.pagination-info {
    font-size: 14px;
    color: var(--color-four);
    width: 100%;
    text-align: center;
    display: block;
    line-height: 1.5;
}

.pagination-info span {
    font-weight: 600;
    color: var(--color-one);
}

.pagination-links {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

.pagination-links a,
.pagination-links span[aria-current="page"],
.pagination-links span[aria-current="page"] span,
.pagination [rel="prev"],
.pagination [rel="next"] {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--background-three);
    border-radius: 8px;
    color: var(--color-five);
    background: var(--background-two);
    transition: all 0.2s ease;
    text-decoration: none;
}

.pagination a:hover {
    background: var(--background-one);
    color: var(--color-two);
    border-color: var(--color-two);
}

.pagination-links span[aria-current="page"],
.pagination span[aria-current="page"] span {
    background: var(--color-nine);
    color: var(--color-four);
    border-color: var(--background-three);
    cursor: default;
    opacity: 0.7;
    font-weight: 600;
}

.pagination-links span[aria-disabled="true"],
.pagination span[aria-disabled="true"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--background-three);
    border-radius: 8px;
    background: var(--color-nine);
    color: var(--color-four);
    cursor: default;
    opacity: 0.7;
    height: auto;
    line-height: 1;
}

.pagination-links span[aria-disabled="true"] span[aria-hidden="true"],
.pagination span[aria-disabled="true"] span[aria-hidden="true"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.pagination-links span[aria-disabled="true"] svg,
.pagination span[aria-disabled="true"] svg {
    width: 16px;
    height: 16px;
    color: var(--color-four);
    fill: currentColor;
    display: block;
}

.pagination svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   RECENT ACTIVITY
   ============================================ */
.recent-activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recent-activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--background-one);
    border: 1px solid var(--color-nine);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.recent-activity-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--color-two);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.recent-activity-item:hover {
    background: var(--background-two);
    border-color: var(--color-two);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
    transform: translateX(2px);
}

.recent-activity-item:hover::before {
    transform: scaleY(1);
}

.activity-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--background-nine);
    color: var(--color-two);
}

.activity-icon-wrapper svg {
    width: 16px;
    height: 16px;
}

.activity-icon-wrapper.activity-topic_created {
    background: var(--background-nine);
    color: var(--color-two);
}

.activity-icon-wrapper.activity-vote_cast {
    background: var(--color-fifteen);
    color: var(--color-sixteen);
}

.activity-icon-wrapper.activity-comment_created {
    background: var(--background-thirteen);
    color: var(--background-success);
}

.activity-icon-wrapper.activity-comment_vote_cast {
    background: var(--background-seventeen);
    color: var(--color-seventeen);
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-one);
    margin: 0 0 2px;
    line-height: 1.4;
    transition: color 0.2s;
}

.recent-activity-item:hover .activity-title {
    color: var(--color-two);
}

.activity-date {
    font-size: 12px;
    color: var(--color-four);
    margin: 0;
}

.activity-arrow {
    flex-shrink: 0;
    color: var(--background-six);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.activity-arrow svg {
    width: 14px;
    height: 14px;
}

.recent-activity-item:hover .activity-arrow {
    color: var(--color-two);
    transform: translateX(2px);
}

/* ============================================
   PROFILE TOPICS
   ============================================ */
.profile-topics-mobile {
    display: none;
}

.profile-topic-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--background-one);
    border: 1px solid var(--color-nine);
    border-radius: 8px;
}

.profile-topic-link {
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.profile-topic-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-one);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-topic-meta {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.35;
    color: var(--color-four);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-topic-edit {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--pm-surface);
    border: 1px solid var(--pm-border);
    color: var(--pm-text-primary);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.profile-topic-edit:hover {
    background: var(--pm-border-hover);
}

.profile-topic-row {
    cursor: pointer;
}

@media (min-width: 769px) {
    .profile-topics-desktop .admin-table {
        background: transparent;
        border-radius: 0;
    }

    .profile-topics-desktop .admin-table th {
        font-size: 10px;
        font-weight: 500;
        padding: 8px 12px 6px;
        letter-spacing: 0.04em;
        color: var(--pm-text-muted);
        text-transform: uppercase;
        border-bottom: 1px solid var(--pm-border);
        background: transparent;
    }

    .profile-topics-desktop .admin-table td {
        font-size: 13px;
        padding: 10px 12px;
        color: var(--pm-text-primary);
        vertical-align: middle;
        border-bottom: 1px solid var(--pm-border);
    }

    .profile-topics-desktop .admin-table td:first-child {
        font-weight: 600;
        font-size: 14px;
    }

    .profile-topics-desktop .admin-table tr:last-child td {
        border-bottom: none;
    }

    .profile-topics-desktop .admin-table tr:hover td {
        background: var(--pm-surface);
    }

    .profile-topics-desktop .status-badge {
        padding: 3px 8px;
        font-size: 11px;
        border-radius: 9999px;
    }

    .profile-topics-desktop .profile-topic-edit {
        font-size: 12px;
        padding: 5px 12px;
    }
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 20px;
    background: var(--pm-bg-secondary);
    border: 1px solid var(--pm-border);
    border-radius: 10px;
    overflow: hidden;
}

.profile-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 12px 6px;
    text-align: center;
    border-right: 1px solid var(--pm-border);
}

.profile-stat:last-child {
    border-right: none;
}

.profile-stat-value {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--pm-text-primary);
    font-variant-numeric: tabular-nums;
}

.profile-stat-value--green {
    color: var(--pm-green);
}

.profile-stat-value--amber {
    color: #f59e0b;
}

.profile-stat-value--blue {
    color: var(--pm-blue);
}

.profile-stat-label {
    font-size: 10px;
    line-height: 1.25;
    color: var(--pm-text-secondary);
    letter-spacing: 0.02em;
}

.user-profile-link {
    color: var(--color-one, #2563eb);
    font-weight: 600;
    text-decoration: none;
}

.user-profile-link:hover {
    text-decoration: underline;
}

.user-profile-link--heading {
    color: inherit;
}

.public-profile-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.public-profile-avatar {
    flex-shrink: 0;
}

.public-profile-avatar-img,
.public-profile-avatar-fallback {
    width: 72px;
    height: 72px;
    border-radius: 9999px;
    object-fit: cover;
}

.public-profile-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pm-bg-secondary);
    border: 1px solid var(--pm-border);
    font-size: 28px;
    font-weight: 700;
    color: var(--color-one, #2563eb);
}

.public-profile-meta {
    margin-top: 4px;
    font-size: 14px;
    color: var(--pm-text-secondary);
}

.public-profile-bio {
    margin-top: 8px;
    max-width: 640px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--color-five, #374151);
}

@media (max-width: 768px) {
    .profile-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-bottom: 16px;
    }

    .profile-stat {
        padding: 10px 6px;
    }

    .profile-stat:nth-child(odd) {
        border-right: 1px solid var(--pm-border);
    }

    .profile-stat:nth-child(even) {
        border-right: none;
    }

    .profile-stat:nth-child(-n+2) {
        border-bottom: 1px solid var(--pm-border);
    }

    .profile-stat-value {
        font-size: 15px;
    }

    .profile-stat-label {
        font-size: 9px;
    }

    .profile-topics-desktop {
        display: none;
    }

    .profile-topics-mobile {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .stat-card .quick-actions-title {
        margin-bottom: 12px;
    }
}

@media (max-width: 640px) {
    .recent-activity-item {
        padding: 10px;
        gap: 10px;
    }
    
    .activity-icon-wrapper {
        width: 32px;
        height: 32px;
    }
    
    .activity-icon-wrapper svg {
        width: 14px;
        height: 14px;
    }
    
    .activity-title {
        font-size: 13px;
    }
    
    .activity-date {
        font-size: 11px;
    }
    
    .activity-arrow {
        display: none;
    }
}

/* ============================================
   ADMIN DASHBOARD
   ============================================ */
.admin-header {
    background: var(--pm-bg-primary);
    box-shadow: none;
    border-bottom: 1px solid var(--pm-border);
    padding: 24px 0;
    margin-bottom: 32px;
}

.admin-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

.admin-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--color-one);
    margin: 0;
}

.admin-subtitle {
    color: var(--color-four);
    margin-top: 8px;
    font-size: 15px;
}

.admin-actions {
    display: flex;
    gap: 16px;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.admin-stat-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    border-radius: 12px;
}

.admin-stat-card-link:focus-visible {
    outline: 2px solid var(--color-two, #3b82f6);
    outline-offset: 2px;
}

.admin-stat-card-link:hover .admin-stat-card--clickable {
    border-color: var(--pm-blue);
    transform: none;
    box-shadow: none;
}

.stat-hint {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--pm-text-secondary);
}

.admin-pending-queue {
    scroll-margin-top: 24px;
    border-left: 3px solid var(--pm-blue);
}

.admin-pending-queue .admin-pending-row {
    margin: 0;
    box-shadow: none;
    border: 1px solid var(--pm-border);
}

.admin-pending-queue .admin-pending-row-inner {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    align-items: start;
}

.admin-pending-queue .admin-pending-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 120px;
}

.admin-pending-queue .admin-pending-btn {
    width: 100%;
    justify-content: center;
}

@media (max-width: 640px) {
    .admin-pending-queue .admin-pending-row-inner {
        grid-template-columns: 1fr;
    }

    .admin-pending-queue .admin-pending-actions {
        flex-direction: row;
        flex-wrap: wrap;
        min-width: 0;
    }

    .admin-pending-queue .admin-pending-btn {
        flex: 1 1 auto;
        min-width: 100px;
    }
}

/* ============================================
   ADMIN TOPICS PAGE
   ============================================ */
.admin-topics-page .admin-title {
    font-size: 28px;
    color: var(--pm-text-primary);
}

.admin-topics-page .admin-subtitle {
    color: var(--pm-text-secondary);
    font-size: 14px;
}

.admin-topics-panel {
    padding: 16px;
}

.admin-topic-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.admin-topics-table {
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    margin: 0;
}

.admin-topics-table th {
    font-size: 10px;
    font-weight: 500;
    padding: 8px 12px 6px;
    letter-spacing: 0.04em;
    color: var(--pm-text-muted);
    text-transform: uppercase;
    border-bottom: 1px solid var(--pm-border);
    background: transparent;
}

.admin-topics-table td {
    font-size: 13px;
    padding: 10px 12px;
    color: var(--pm-text-primary);
    vertical-align: middle;
    border-bottom: 1px solid var(--pm-border);
}

.admin-topics-table tr:last-child td {
    border-bottom: none;
}

.admin-topics-table tr:hover td {
    background: var(--pm-surface);
}

.admin-topics-table .status-badge {
    padding: 3px 8px;
    font-size: 11px;
    border-radius: 9999px;
    white-space: nowrap;
}

.admin-topic-link {
    color: var(--pm-text-primary);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    line-height: 1.35;
}

.admin-topic-link:hover {
    color: var(--pm-blue);
}

.admin-topic-meta {
    color: var(--pm-text-secondary);
    font-size: 12px;
    white-space: nowrap;
}

.admin-topic-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 220px;
    max-width: 340px;
}

.vote-breakdown--compact {
    flex-wrap: wrap;
    gap: 4px 6px;
    font-size: 11px;
}

.vote-breakdown--compact .vote-count {
    font-size: 11px;
}

.admin-topics-pagination {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--pm-border);
}

@media (max-width: 768px) {
    .admin-topics-page .admin-header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .admin-topics-page .admin-title {
        font-size: 22px;
    }

    .admin-topics-panel {
        padding: 12px;
    }

    .admin-topics-table th,
    .admin-topics-table td {
        padding: 8px 10px;
    }

    .admin-topic-link {
        font-size: 13px;
    }

    .admin-topic-actions {
        min-width: 180px;
        max-width: 260px;
    }
}

.stat-card {
    background: var(--pm-bg-secondary);
    border-radius: 8px;
    padding: 20px;
    box-shadow: none;
    border: 1px solid var(--pm-border);
    transition: border-color 0.15s ease;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.stat-card:hover {
    box-shadow: none;
    transform: none;
    border-color: var(--pm-border-hover);
}

.stat-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 28px;
    height: 28px;
}

.stat-icon.blue,
.stat-icon.green,
.stat-icon.yellow,
.stat-icon.purple {
    background: var(--background-nine);
    color: var(--pm-blue);
}

.stat-info {
    flex: 1;
}

.stat-label {
    color: var(--color-four);
    font-size: 14px;
    margin-bottom: 6px;
    font-weight: 500;
}

.stat-value {
    color: var(--color-one);
    font-size: 28px;
    font-weight: 700;
}

.admin-table {
    width: 100%;
    max-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 20px 0;
    background: var(--background-two);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    table-layout: auto;
}

.stat-card .overflow-x-auto {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.stat-card .admin-table {
    margin: 0;
    box-shadow: none;
    border-radius: 8px;
}

.admin-table th {
    background: var(--background-one);
    color: var(--color-five);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px;
    text-align: left;
    border-bottom: 2px solid var(--background-three);
    white-space: nowrap;
}

.admin-table td {
    padding: 8px;
    color: var(--color-one);
    border-bottom: 1px solid var(--color-nine);
    font-size: 10px;
}

.admin-table tr:hover td {
    background: var(--background-one);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    background: var(--pm-surface);
    color: var(--pm-text-secondary);
    border: 1px solid var(--pm-border);
}

.status-badge.approved {
    background: rgba(22, 199, 132, 0.12);
    color: var(--pm-green);
    border-color: transparent;
}

.status-badge.pending {
    background: var(--background-nine);
    color: var(--pm-blue);
    border-color: transparent;
}

.status-badge--neutral {
    background: var(--pm-surface);
    color: var(--pm-text-secondary);
    border: 1px solid var(--pm-border);
}

.status-badge--active,
.status-badge--visible,
.status-badge--bot-on {
    background: rgba(22, 199, 132, 0.12);
    color: var(--pm-green);
    border-color: transparent;
}

.status-badge--frozen,
.status-badge--hidden {
    background: rgba(234, 57, 67, 0.12);
    color: var(--pm-red);
    border-color: transparent;
}

.status-badge--bot-off {
    background: rgba(138, 145, 158, 0.12);
    color: var(--pm-text-secondary);
    border-color: transparent;
}

.vote-breakdown {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.vote-breakdown .vote-count {
    font-weight: 500;
    font-size: 13px;
}

.vote-breakdown .real-votes {
    color: var(--pm-green);
}

.vote-breakdown .fake-votes {
    color: var(--pm-text-secondary);
}

.vote-breakdown .total-votes {
    color: var(--color-one);
    font-weight: 600;
}

.vote-breakdown .vote-separator {
    color: var(--color-four);
    font-weight: 300;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 12px;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.3;
}

.action-btn.primary,
.action-btn.info {
    background: var(--pm-blue);
    color: #fff;
    border-color: var(--pm-blue);
}

.action-btn.primary:hover,
.action-btn.info:hover {
    background: var(--color-three);
    border-color: var(--color-three);
}

.action-btn.warning,
.action-btn.secondary {
    background: var(--pm-surface);
    color: var(--pm-text-primary);
    border-color: var(--pm-border);
}

.action-btn.warning:hover,
.action-btn.secondary:hover {
    background: var(--pm-border-hover);
    border-color: var(--pm-border-hover);
}

.action-btn.success {
    background: var(--pm-blue);
    color: #fff;
    border-color: var(--pm-blue);
}

.action-btn.success:hover {
    background: var(--color-three);
    border-color: var(--color-three);
}

.action-btn.danger {
    background: var(--color-danger);
    color: #fff;
    border-color: var(--color-danger);
}

.action-btn.danger:hover {
    background: var(--color-danger-hover);
    border-color: var(--color-danger-hover);
}

.action-btn.sm {
    padding: 5px 10px;
    font-size: 11px;
    border-radius: 6px;
    line-height: 1.3;
}

.admin-api-token-result {
    border-color: var(--pm-blue);
}

.admin-api-token-input {
    font-family: monospace;
    background: var(--pm-bg-primary);
    color: var(--pm-text-primary);
    border: 1px solid var(--pm-border);
    border-radius: 8px;
}

.admin-api-token-examples {
    font-family: monospace;
    font-size: 0.9em;
    padding: 12px;
    border-radius: 8px;
    background: var(--pm-bg-primary);
    border: 1px solid var(--pm-border);
    color: var(--pm-text-secondary);
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: var(--color-nine);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.3s ease;
    background: var(--pm-blue);
}

.progress-bar-fill.blue,
.progress-bar-fill.green {
    background: var(--pm-blue);
}

/* ============================================
   AUTHENTICATION PAGES
   ============================================ */
.auth-container {
    min-height: calc(100vh - 53px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pm-bg-primary);
    padding: 32px 20px;
    position: relative;
}

.auth-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(59, 130, 246, 0.12), transparent),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(139, 92, 246, 0.08), transparent);
    pointer-events: none;
}

.auth-card {
    background: var(--pm-bg-secondary);
    border: 1px solid var(--pm-border);
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
    padding: 36px 32px;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.auth-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
}

.auth-brand a {
    display: inline-flex;
    align-items: center;
    color: var(--pm-text-primary);
    transition: opacity 0.15s ease;
}

.auth-brand a:hover {
    opacity: 0.85;
}

.auth-brand svg,
.auth-brand img,
.auth-brand .app-logo {
    display: block;
    height: 96px;
    width: auto;
    fill: currentColor;
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--pm-text-primary);
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    color: var(--pm-text-secondary);
    font-size: 14px;
    margin: 0;
    font-weight: 400;
}

.auth-form {
    margin-bottom: 8px;
}

.auth-form .form-group {
    margin-bottom: 18px;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    gap: 12px;
    flex-wrap: wrap;
}

.auth-link {
    color: var(--pm-blue);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.15s ease;
}

.auth-link:hover {
    color: var(--color-three);
    text-decoration: none;
}

.auth-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--pm-border);
    margin-top: 20px;
}

.auth-footer p {
    margin: 0;
    color: var(--pm-text-secondary);
    font-size: 13px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
    color: var(--pm-text-secondary);
    gap: 10px;
}

.checkbox-input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--pm-blue);
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-text {
    cursor: pointer;
    user-select: none;
}

.password-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrap .password-input {
    padding-inline-end: 44px;
}

.password-toggle-btn {
    position: absolute;
    inset-inline-end: 4px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--pm-text-muted);
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.password-toggle-btn:hover {
    color: var(--pm-text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.password-icon {
    width: 18px;
    height: 18px;
}

.password-icon-hide {
    display: none;
}

.password-toggle-btn.is-visible .password-icon-show {
    display: none;
}

.password-toggle-btn.is-visible .password-icon-hide {
    display: block;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 20px;
    background: var(--pm-surface);
    border: 1px solid var(--pm-border);
    border-radius: 8px;
    color: var(--pm-text-primary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.btn-google:hover {
    background: var(--pm-bg-secondary);
    border-color: var(--pm-border-hover);
    text-decoration: none;
    color: var(--pm-text-primary);
}

.btn-google svg {
    flex-shrink: 0;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: var(--pm-text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--pm-border);
}

.divider span {
    padding: 0 14px;
}

.auth-card .btn-primary {
    min-width: 110px;
}

.auth-card .alert-success {
    background: rgba(22, 199, 132, 0.12);
    color: var(--pm-green);
    border: 1px solid rgba(22, 199, 132, 0.25);
    box-shadow: none;
    font-size: 14px;
    padding: 12px 14px;
}

/* ============================================
   TRENDING PAGE
   ============================================ */
.trending-card {
    background: var(--pm-bg-secondary);
    border-radius: 8px;
    box-shadow: none;
    padding: 16px;
    margin-bottom: 14px;
    transition: border-color 0.15s ease;
    border: 1px solid var(--pm-border);
    position: relative;
    overflow: hidden;
}

.trending-card[onclick] {
    cursor: pointer;
}

.trending-card::before {
    display: none;
}

.trending-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--pm-border-hover);
}

.trending-card:hover::before {
    display: none;
}

.trending-card[onclick]:hover {
    cursor: pointer;
}

.trending-card-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.trending-rank {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.trending-rank-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: var(--background-two);
    position: relative;
    z-index: 1;
}

.trending-rank-top {
    background: linear-gradient(135deg, var(--background-twenty), var(--background-twenty-one));
    color: var(--color-one);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.trending-rank-normal {
    background: linear-gradient(135deg, var(--color-two), var(--color-three));
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.trending-card-content {
    flex: 1;
    min-width: 0;
}

.trending-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-one);
    margin: 0 0 12px;
    line-height: 1.3;
}

.trending-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.trending-title a:hover {
    color: var(--color-two);
}

.trending-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.trending-category {
    background: linear-gradient(135deg, var(--color-two), var(--color-three));
    color: var(--background-two);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trending-time {
    color: var(--color-four);
    font-size: 14px;
    font-weight: 500;
}

.trending-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-four);
    font-size: 14px;
    font-weight: 500;
}

.trending-description {
    color: var(--color-five);
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 16px;
}

.trending-options {
    background: var(--background-one);
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
    border: 1px solid var(--color-nine);
}

.trending-options-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-one);
    margin: 0 0 16px;
}

.trending-options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.trending-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--background-two);
    padding: 14px 18px;
    border-radius: 8px;
    border: 1px solid var(--color-nine);
    transition: all 0.2s ease;
}

.trending-option:hover {
    border-color: var(--color-two);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.trending-option-text {
    color: var(--color-one);
    font-size: 15px;
    font-weight: 500;
    flex: 1;
}

.trending-option-votes {
    color: var(--color-four);
    font-size: 13px;
    font-weight: 600;
    background: var(--background-one);
    padding: 4px 12px;
    border-radius: 20px;
}

.trending-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.trending-actions .btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

/* ============================================
   SEARCH PAGE
   ============================================ */
.search-container {
    background: var(--pm-bg-secondary);
    border: 1px solid var(--pm-border);
    border-radius: 12px;
    box-shadow: none;
    margin-bottom: 24px;
    overflow: hidden;
}

.search-form {
    padding: 32px;
    background: var(--pm-bg-secondary);
    color: var(--pm-text-primary);
    border-bottom: 1px solid var(--pm-border);
}

.search-input-group {
    position: relative;
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border: 1px solid var(--pm-border);
    border-radius: 12px;
    font-size: 14px;
    background: var(--pm-surface);
    color: var(--pm-text-primary);
    box-shadow: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    background: var(--pm-surface);
    border-color: var(--pm-border-hover);
    box-shadow: 0 0 0 2px rgba(61, 71, 82, 0.28);
    transform: none;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-four);
    width: 18px;
    height: 18px;
}

.search-button {
    background: var(--pm-surface);
    border: 1px solid var(--pm-border);
    color: var(--pm-text-primary);
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-button:hover {
    background: var(--pm-bg-secondary);
    border-color: var(--pm-border-hover);
}

.search-filters {
    background: var(--background-one);
    padding: 24px;
    border-top: 1px solid var(--color-nine);
}

.topics-toolbar {
    padding-top: 20px;
    padding-bottom: 20px;
}

.topics-toolbar .search-container {
    margin-bottom: 0;
}

.topics-toolbar .topics-filters {
    margin-top: 16px;
    padding: 0;
    border-top: none;
    background: transparent;
}

.topics-toolbar .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 0;
}

.topics-filters-clear {
    margin-top: 16px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-label {
    font-weight: 600;
    color: var(--color-one);
    margin-bottom: 8px;
    font-size: 14px;
}

.filter-select,
.filter-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--pm-border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--pm-surface);
    color: var(--pm-text-primary);
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.filter-select {
    appearance: none;
    -webkit-appearance: none;
    padding-inline-end: 40px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a919e' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

html.rtl .filter-select,
html[dir="rtl"] .filter-select {
    background-position: left 12px center;
    padding-inline-end: 14px;
    padding-inline-start: 40px;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--pm-blue);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.result-card {
    background: var(--pm-bg-secondary);
    border: 1px solid var(--pm-border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 14px;
    transition: border-color 0.15s ease;
    box-shadow: none;
    cursor: pointer;
    position: relative;
}

.result-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--pm-border-hover);
}

.result-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--pm-text-primary);
    margin: 0 0 8px;
    line-height: 1.4;
    transition: color 0.15s ease;
}

.result-card:hover .result-title {
    color: var(--pm-text-primary);
}

.people-results-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 8px;
}

.person-result-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--pm-bg-secondary);
    border: 1px solid var(--pm-border);
    border-radius: 8px;
    padding: 16px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease;
}

.person-result-card:hover {
    border-color: var(--pm-border-hover);
}

.person-result-avatar {
    flex-shrink: 0;
}

.person-result-avatar-img,
.person-result-avatar-fallback {
    width: 56px;
    height: 56px;
    border-radius: 9999px;
    object-fit: cover;
}

.person-result-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pm-bg-primary, #f3f4f6);
    border: 1px solid var(--pm-border);
    font-size: 20px;
    font-weight: 700;
    color: var(--color-one, #2563eb);
}

.person-result-body {
    min-width: 0;
    flex: 1;
}

.person-result-name {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--pm-text-primary);
    line-height: 1.3;
}

.person-result-username {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--pm-text-secondary);
}

.person-result-bio {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--pm-text-secondary);
}

.person-result-meta {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--pm-text-secondary);
}

.people-see-all {
    margin: 8px 0 20px;
}

.results-header--spaced {
    margin-top: 28px;
}

.result-description {
    color: var(--pm-text-secondary);
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 12px;
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
}

.result-badge {
    background: var(--background-nine);
    color: var(--color-three);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.no-results {
    text-align: center;
    padding: 80px 24px;
    color: var(--color-four);
}

.no-results h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--color-one);
    margin: 0 0 12px;
}

.no-results p {
    font-size: 16px;
    margin: 0 0 32px;
}

/* ============================================
   SEARCH PAGES - NEUTRAL TONE
   ============================================ */
.search-page .search-container {
    background: var(--pm-bg-secondary);
    border: 1px solid var(--pm-border);
    box-shadow: none;
}

.search-page .search-form {
    background: var(--pm-bg-secondary);
    color: var(--pm-text-primary);
    border-bottom: 1px solid var(--pm-border);
}

.search-page .search-input {
    background: var(--pm-surface);
    border: 1px solid var(--pm-border);
    color: var(--pm-text-primary);
    box-shadow: none;
}

.search-page .search-input:focus {
    background: var(--pm-surface);
    border-color: var(--pm-border-hover);
    box-shadow: 0 0 0 2px rgba(61, 71, 82, 0.28);
    transform: none;
}

.search-page .search-button {
    background: var(--pm-surface);
    border: 1px solid var(--pm-border);
    color: var(--pm-text-primary);
    backdrop-filter: none;
}

.search-page .search-button:hover {
    background: var(--pm-border-hover);
    border-color: var(--pm-border-hover);
    transform: none;
    box-shadow: none;
}

.search-page .filter-select:focus,
.search-page .filter-input:focus {
    border-color: var(--pm-border-hover);
    box-shadow: 0 0 0 2px rgba(61, 71, 82, 0.28);
}

.search-page .result-badge,
.search-page .trending-category {
    background: var(--pm-surface);
    color: var(--pm-text-secondary);
    border: 1px solid var(--pm-border);
    text-transform: none;
    letter-spacing: 0;
}

.search-page .trending-rank-top,
.search-page .trending-rank-normal {
    background: var(--pm-surface);
    color: var(--pm-text-primary);
    box-shadow: none;
    border: 1px solid var(--pm-border);
}

.search-page .trending-title a:hover {
    color: inherit;
}

.search-page .trending-creator svg,
.search-page .trending-stats svg,
.search-page .sidebar-link svg,
.search-page .trending-actions .btn svg,
.search-page .no-results-icon svg,
.search-page .no-results-actions .btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.search-page .no-results-icon svg {
    width: 36px;
    height: 36px;
}

.search-page svg.no-results-icon {
    width: 36px;
    height: 36px;
    display: inline-block;
}

.search-page .trending-option:hover {
    border-color: var(--pm-border-hover);
    box-shadow: none;
}

.search-page .trending-actions .btn-primary,
.search-page .search-results .btn-primary,
.search-page .no-results .btn-primary {
    background: var(--pm-surface);
    color: var(--pm-text-primary);
    border: 1px solid var(--pm-border);
}

.search-page .trending-actions .btn-primary:hover,
.search-page .search-results .btn-primary:hover,
.search-page .no-results .btn-primary:hover {
    background: var(--pm-border-hover);
    border-color: var(--pm-border-hover);
    color: var(--pm-text-primary);
}

.search-page .search-filters .btn-primary {
    background: var(--pm-surface);
    color: var(--pm-text-primary);
    border: 1px solid var(--pm-border);
}

.search-page .search-filters .btn-primary:hover {
    background: var(--pm-border-hover);
    border-color: var(--pm-border-hover);
    color: var(--pm-text-primary);
}

.search-page .btn-success {
    background: var(--pm-surface);
    color: var(--pm-text-primary);
    border: 1px solid var(--pm-border);
}

.search-page .btn-success:hover {
    background: var(--pm-border-hover);
    border-color: var(--pm-border-hover);
}

.search-filter-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.search-clear-filters {
    color: var(--pm-text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.search-clear-filters:hover {
    color: var(--pm-text-primary);
}

.search-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 28px;
    align-items: start;
    margin-top: 8px;
    margin-bottom: 40px;
}

.search-layout-sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 88px;
}

.search-sidebar-card {
    background: var(--pm-bg-secondary);
    border: 1px solid var(--pm-border);
    border-radius: 12px;
    padding: 16px;
}

.search-sidebar-title {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--pm-text-secondary);
}

.search-sidebar-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.search-sidebar-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--pm-border);
    background: var(--pm-surface);
    color: var(--pm-text-secondary);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.search-sidebar-chip:hover {
    color: var(--pm-text-primary);
    border-color: var(--pm-border-hover);
    background: var(--pm-bg-primary);
}

.search-sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.search-sidebar-link {
    display: block;
    padding: 9px 10px;
    border-radius: 8px;
    color: var(--pm-text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    transition: color 0.15s ease, background 0.15s ease;
}

.search-sidebar-link:hover {
    color: var(--pm-text-primary);
    background: var(--pm-surface);
}

.search-prompt {
    border: 1px dashed var(--pm-border);
    border-radius: 12px;
    background: var(--pm-bg-secondary);
}

@media (max-width: 960px) {
    .search-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .search-layout-sidebar {
        position: static;
        order: 2;
    }

    .search-layout-main {
        order: 1;
    }

    .search-sidebar-links {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }
}

@media (max-width: 520px) {
    .search-sidebar-links {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   MODAL
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--pm-bg-secondary);
    border: 1px solid var(--pm-border);
    border-radius: 8px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1001;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--pm-border);
}

.modal-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--color-one);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-four);
    transition: color 0.2s;
    border-radius: 6px;
}

.modal-close:hover {
    color: var(--color-one);
    background: var(--background-one);
}

.modal-content form {
    padding: 24px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 24px;
    border-top: 1px solid var(--color-nine);
    margin-top: 24px;
}

.btn-outline-danger {
    background-color: var(--background-two);
    color: var(--color-danger);
    border: 2px solid var(--color-danger);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
}

.btn-outline-danger.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    border-width: 1.5px;
}

@media (max-width: 768px) {
    .btn-outline-danger.btn-sm {
        padding: 4px 8px;
        font-size: 11px;
    }
}

.btn-outline-danger:hover {
    background-color: var(--color-danger);
    color: var(--background-two);
}

/* ============================================
   TOPIC IMAGES
   ============================================ */
.topic-image-container {
    overflow: visible;
    width: 100%;
    background: var(--background-black);
    display: flex;
    align-items: center;
    justify-content: center;
}

.topic-image {
    width: 100%;
    max-height: 500px;
    min-height: 350px;
    object-fit: contain;
    display: block;
    background: var(--background-one);
}

.topic-image-container .video-player {
    width: 100%;
}

.topic-image-container .video-player video.topic-image {
    width: 100%;
    max-height: 500px;
    min-height: 350px;
    object-fit: contain;
    box-sizing: border-box;
    padding-inline: 12px;
}

.card .topic-image-container {
    margin: -28px -28px 0 -28px;
    width: calc(100% + 56px);
}

/* Topic show cards use padding:0 — don't pull media outside the card */
.card.topic-media-card .topic-image-container,
.card:has(video) .topic-image-container {
    margin: 0;
    width: 100%;
}

.card .topic-image-container .topic-image {
    width: 100%;
    max-height: 500px;
    min-height: 350px;
    object-fit: contain;
}

.result-card-image .video-player,
.result-card-image .video-player video {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: #0b0d10;
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center {
    text-align: center;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.mb-8 {
    margin-bottom: 32px;
}

.mb-6 {
    margin-bottom: 24px;
}

.mb-4 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 12px;
}

.mt-4 {
    margin-top: 16px;
}

.mt-8 {
    margin-top: 32px;
}

.py-12 {
    padding-top: 48px;
    padding-bottom: 48px;
}

.py-16 {
    padding-top: 64px;
    padding-bottom: 64px;
}

.w-full {
    width: 100%;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-4 {
    gap: 16px;
}

.gap-8 {
    gap: 32px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }
    
    .nav-inner {
        height: 56px;
        gap: 8px;
    }
    
    .nav-brand {
        font-size: 18px;
        gap: 14px;
        min-width: 0;
        flex: 1;
        justify-content: flex-start;
    }

    .nav-brand > div:first-child {
        flex-shrink: 0;
    }

    .nav-brand > div:first-child a {
        display: flex;
        align-items: center;
    }

    .nav-brand > div:first-child svg,
    .nav-brand > div:first-child img,
    .nav-brand .app-logo-nav {
        height: 32px;
        width: auto;
    }
    
    .nav-links {
        display: none;
    }
    
    .nav-links-mobile {
        display: flex;
    }
    
    .hero-title {
        font-size: 26px;
        margin-bottom: 6px;
    }
    
    .hero-subtitle {
        font-size: 13px;
        margin-bottom: 14px;
        line-height: 1.4;
    }
    
    .hero-inner {
        padding: 16px 0 18px;
    }

    .hero-search {
        margin-bottom: 12px;
    }

    .hero-actions {
        gap: 8px;
        width: 100%;
        max-width: 100%;
        padding: 0 4px;
        box-sizing: border-box;
    }

    .hero-actions .btn {
        padding: 8px 12px;
        font-size: 13px;
        flex: 1 1 0;
        min-width: 0;
        text-align: center;
    }

    .hero-search-input {
        padding: 10px 14px;
        font-size: 14px;
    }

    .hero-search-button {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .section {
        padding: 28px 0;
    }

    .container.section {
        padding: 28px 16px;
    }

    .section-header {
        margin-bottom: 16px;
        padding-left: 4px;
    }

    .section-header .h2,
    .h2 {
        font-size: 20px;
        line-height: 1.25;
    }

    .section-header .muted {
        margin-top: 4px;
        font-size: 13px;
        line-height: 1.35;
    }
    
    .card {
        padding: 20px;
    }
    
    .trending-card {
        padding: 20px;
    }
    
    .trending-card-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 16px;
    }
    
    .trending-title {
        font-size: 20px;
    }
    
    .trending-actions {
        flex-direction: column;
    }
    
    .trending-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .auth-card {
        padding: 32px 24px;
        margin: 16px;
    }
    
    .search-container {
        margin-bottom: 12px;
    }

    .search-form {
        padding: 14px;
        text-align: center;
    }

    .search-form form {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .search-form .search-input-group {
        width: 100%;
        margin-bottom: 12px;
    }

    .search-form .search-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto;
        padding: 9px 22px;
        font-size: 13px;
    }
    
    .filter-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 0;
        align-items: stretch;
    }

    .search-filters {
        padding: 0;
        border-top: none;
    }

    .filter-group {
        min-width: 0;
        gap: 0;
    }

    .filter-label {
        margin-bottom: 2px;
        font-size: 10px;
        font-weight: 600;
        line-height: 1.2;
        color: var(--pm-text-secondary);
        letter-spacing: 0.02em;
        text-transform: uppercase;
    }

    .filter-select,
    .filter-input {
        padding: 6px 8px;
        font-size: 12px;
        border-radius: 7px;
        min-height: 32px;
        line-height: 1.2;
    }

    .filter-select {
        padding-inline-end: 26px;
        background-size: 12px;
        background-position: right 8px center;
    }

    html.rtl .filter-select,
    html[dir="rtl"] .filter-select {
        background-position: left 8px center;
        padding-inline-end: 8px;
        padding-inline-start: 26px;
    }

    .search-page .search-container {
        margin-bottom: 16px;
    }

    .search-page .search-form {
        padding: 14px 14px 12px;
        border-bottom: 1px solid var(--pm-border);
    }

    .search-page .search-filters {
        padding: 12px 14px 14px;
        border-top: none;
        background: transparent;
    }

    .search-page .filter-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-bottom: 0;
    }

    .search-page .filter-group--sort {
        grid-column: 1 / -1;
    }

    .search-page .filter-label {
        margin-bottom: 4px;
        font-size: 10px;
    }

    .search-page .filter-select,
    .search-page .filter-input {
        min-height: 32px;
        padding: 6px 8px;
        font-size: 12px;
        border-radius: 7px;
    }

    .search-page .filter-select {
        padding-inline-end: 26px;
        background-size: 12px;
        background-position: right 8px center;
    }

    .search-page .search-filter-actions {
        margin-top: 10px;
        gap: 8px;
    }

    .search-page .search-filter-actions .btn-primary {
        flex: 1 1 auto;
        justify-content: center;
        min-height: 34px;
        padding: 7px 14px;
        font-size: 12px;
    }

    .search-page .search-clear-filters {
        font-size: 12px;
        white-space: nowrap;
    }
    
    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .modal-content {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }
    
    .modal-header,
    .modal-content form,
    .modal-footer {
        padding: 20px;
    }
    
    .topic-image {
        max-height: 400px;
        min-height: 250px;
    }
    
    .card .topic-image-container .topic-image {
        max-height: 400px;
        min-height: 250px;
    }
    
    .page-header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .page-header-actions {
        width: 100%;
    }
    
    .admin-header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .admin-stats {
        grid-template-columns: 1fr;
    }
    
    .admin-table {
        font-size: 14px;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 22px;
    }

    .hero-inner {
        padding: 12px 0 14px;
    }

    .hero-subtitle {
        font-size: 12px;
        margin-bottom: 12px;
    }
    
    .h2 {
        font-size: 18px;
    }

    .section-header {
        margin-bottom: 12px;
        padding-left: 6px;
    }

    .section-header .muted {
        font-size: 12px;
    }
    
    .page-header-title {
        font-size: 24px;
    }
    
    .card-title {
        font-size: 18px;
    }
}

/* ============================================
   ANIMATIONS & TRANSITIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card,
.trending-card,
.result-card {
    animation: fadeIn 0.4s ease-out;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Focus visible for accessibility */
*:focus-visible {
    outline: 2px solid var(--color-two);
    outline-offset: 2px;
}

/* Selection color */
::selection {
    background: var(--color-two);
    color: var(--background-two);
}

::-moz-selection {
    background: var(--color-two);
    color: var(--background-two);
}

/* ============================================
   SHARING BUTTONS
   ============================================ */
.sharing-section {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.sharing-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
}

.share-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-color: #d1d5db;
}

.share-btn:active {
    transform: translateY(0);
}

.share-btn svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.share-btn-facebook {
    color: #1877f2;
    border-color: #e5e7eb;
}

.share-btn-facebook:hover {
    background: #f0f7ff;
    border-color: #1877f2;
    color: #1877f2;
}

.share-btn-twitter {
    color: #1da1f2;
    border-color: #e5e7eb;
}

.share-btn-twitter:hover {
    background: #f0f9ff;
    border-color: #1da1f2;
    color: #1da1f2;
}

.share-btn-linkedin {
    color: #0a66c2;
    border-color: #e5e7eb;
}

.share-btn-linkedin:hover {
    background: #f0f7ff;
    border-color: #0a66c2;
    color: #0a66c2;
}

.share-btn-whatsapp {
    color: #25d366;
    border-color: #e5e7eb;
}

.share-btn-whatsapp:hover {
    background: #f0fdf4;
    border-color: #25d366;
    color: #25d366;
}

.share-btn-copy {
    color: #6b7280;
    border-color: #e5e7eb;
}

.share-btn-copy:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #374151;
}

.share-btn-copy.copied {
    background: #d1fae5;
    border-color: #10b981;
    color: #059669;
}

.share-btn-copy.copied:hover {
    background: #a7f3d0;
}

@media (max-width: 640px) {
    .sharing-section {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .sharing-buttons {
        width: 100%;
    }
    
    .share-btn {
        flex: 1;
        justify-content: center;
        min-width: 0;
    }
    
    .share-btn span {
        display: none;
    }
    
    .share-btn svg {
        margin: 0 auto;
    }
}

/* ============================================
   MULTI-LANGUAGE & RTL SUPPORT
   ============================================ */

.language-switcher {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.language-switcher-trigger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border: 1px solid var(--pm-border);
    border-radius: 8px;
    background: var(--pm-surface);
    color: var(--pm-text-primary);
    font-size: 12px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.language-switcher-trigger .language-switcher-label {
    font-size: 11px;
}

.language-switcher-trigger .language-flag-img,
.language-switcher-trigger .language-flag-placeholder {
    width: 16px;
    height: 12px;
}

.language-switcher-trigger .language-flag-emoji {
    font-size: 14px;
}

.language-switcher-trigger:hover {
    border-color: var(--pm-border-hover);
    background: var(--pm-bg-secondary);
}

.language-switcher-chevron {
    transition: transform 0.2s;
}

.language-switcher-chevron.is-open {
    transform: rotate(180deg);
}

.language-switcher-menu {
    position: absolute;
    top: calc(100% + 6px);
    inset-inline-end: 0;
    min-width: 120px;
    max-height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--pm-bg-secondary);
    border: 1px solid var(--pm-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    padding: 6px;
    display: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(138, 145, 158, 0.28) transparent;
}

.language-switcher.is-open .language-switcher-menu {
    display: block;
}

.language-switcher.is-open .language-switcher-trigger {
    border-color: var(--pm-border-hover);
    background: var(--pm-bg-secondary);
}

.language-switcher-menu::-webkit-scrollbar {
    width: 3px;
}

.language-switcher-menu::-webkit-scrollbar-track {
    background: transparent;
    margin: 4px 0;
}

.language-switcher-menu::-webkit-scrollbar-thumb {
    background: rgba(138, 145, 158, 0.22);
    border-radius: 999px;
}

.language-switcher-menu:hover::-webkit-scrollbar-thumb {
    background: rgba(138, 145, 158, 0.38);
}

.language-switcher-menu::-webkit-scrollbar-thumb:active {
    background: rgba(138, 145, 158, 0.5);
}

.language-switcher-item-form {
    margin: 0;
}

.language-switcher-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--color-one);
    font-size: 14px;
    cursor: pointer;
    text-align: start;
}

.language-switcher-item:hover {
    background: var(--pm-surface);
}

.language-switcher-item.is-active {
    background: rgba(59, 130, 246, 0.1);
    font-weight: 600;
}

.language-switcher-item-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.language-switcher-label,
.language-switcher-item-code {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: lowercase;
}

.language-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.language-flag-img {
    display: block;
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.language-flag-emoji {
    font-size: 18px;
    line-height: 1;
}

.language-flag-placeholder {
    display: block;
    width: 20px;
    height: 15px;
    border-radius: 2px;
    border: 1px dashed var(--background-seven);
    background: var(--background-one);
}

.language-switcher-check {
    margin-inline-start: auto;
    color: var(--color-two);
}

.locale-banner {
    background: var(--pm-bg-secondary);
    color: var(--pm-text-primary);
    padding: 14px 0;
    border-bottom: 1px solid var(--pm-border);
}

.locale-banner-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.locale-banner-message p {
    margin: 0 0 4px;
    font-size: 14px;
}

.locale-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.locale-banner .btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.locale-banner .btn-outline {
    border-color: rgba(255, 255, 255, 0.6);
    color: #fff;
}

.auth-locale-bar {
    display: flex;
    justify-content: flex-end;
    padding: 10px 20px;
    background: var(--pm-bg-primary);
    border-bottom: 1px solid var(--pm-border);
}

.language-settings-grid {
    display: grid;
    gap: 12px;
}

.language-settings-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--background-seven);
    border-radius: 10px;
}

.language-settings-flag {
    font-size: 24px;
}

.language-settings-badges {
    margin-inline-start: auto;
    display: flex;
    gap: 6px;
}

.language-settings-default {
    display: flex;
    align-items: center;
    gap: 10px;
}

.content-translate-actions {
    margin-top: 8px;
}

.auto-translated-badge {
    font-size: 12px;
    color: var(--color-four);
    font-style: italic;
}

html.rtl body,
html[dir="rtl"] body {
    font-family: 'Noto Sans Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow-y: hidden;
}

html.rtl .nav-inner,
html[dir="rtl"] .nav-inner {
    flex-direction: row-reverse;
}

html.rtl .nav-user,
html[dir="rtl"] .nav-user {
    flex-direction: row-reverse;
}

html.rtl .nav-end,
html[dir="rtl"] .nav-end {
    flex-direction: row-reverse;
}

html.rtl .nav-dropdown-panel,
html[dir="rtl"] .nav-dropdown-panel {
    right: auto;
    left: 0;
}

html.rtl .vote-result-header,
html[dir="rtl"] .vote-result-header {
    flex-direction: row-reverse;
}

html.rtl .card-footer,
html[dir="rtl"] .card-footer {
    flex-direction: row-reverse;
}

html.rtl .page-header-content,
html[dir="rtl"] .page-header-content {
    flex-direction: row-reverse;
}

html.rtl .admin-header-content,
html[dir="rtl"] .admin-header-content {
    flex-direction: row-reverse;
}

.nav-responsive-language {
    padding: 12px 16px;
}

.nav-responsive-language .language-switcher-menu {
    position: static;
    box-shadow: none;
    border: 1px solid var(--background-seven);
    margin-top: 8px;
    max-height: none;
}

html.rtl .auth-locale-bar,
html[dir="rtl"] .auth-locale-bar {
    justify-content: flex-start;
}

[x-cloak] {
    display: none !important;
}

/* Arabic user-generated content: direction scoped to the element, independent of site locale */
.user-content-rtl,
.user-content-ltr {
    unicode-bidi: isolate;
}

.user-content-rtl[dir="rtl"],
.user-content-ltr[dir="ltr"] {
    text-align: start;
}

/* Polymarket-inspired polish */
.vote-pct {
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--pm-text-primary);
}

.trending-title a {
    color: var(--pm-text-primary);
    font-size: 15px;
    font-weight: 600;
}

.trending-description,
.trending-meta,
.trending-creator {
    color: var(--pm-text-secondary);
    font-size: 12px;
}

.trending-category {
    background: var(--pm-surface);
    border: 1px solid var(--pm-border);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.page-header-title {
    color: var(--pm-text-primary);
}

.page-header-subtitle {
    color: var(--pm-text-secondary);
}

/* ============================================
   TOT DIALOG & TOAST
   ============================================ */
body.tot-dialog-open {
    overflow: hidden;
}

#tot-dialog-root {
    position: relative;
    z-index: 10000;
}

.tot-dialog {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.tot-dialog--visible {
    opacity: 1;
}

.tot-dialog--closing {
    opacity: 0;
}

.tot-dialog-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(6px);
}

.tot-dialog-panel {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--pm-bg-secondary);
    border: 1px solid var(--pm-border);
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
    padding: 28px 28px 24px;
    transform: translateY(12px) scale(0.97);
    transition: transform 0.18s ease;
    text-align: center;
}

.tot-dialog--visible .tot-dialog-panel {
    transform: translateY(0) scale(1);
}

.tot-dialog-panel--error {
    border-color: rgba(234, 57, 67, 0.35);
}

.tot-dialog-panel--success {
    border-color: rgba(22, 199, 132, 0.35);
}

.tot-dialog-panel--confirm {
    border-color: rgba(59, 130, 246, 0.35);
}

.tot-dialog-panel--plain {
    padding-top: 24px;
}

.tot-dialog-panel--plain .tot-dialog-message {
    margin: 0 0 4px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--pm-text-primary);
}

.tot-dialog-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tot-dialog-icon svg {
    width: 26px;
    height: 26px;
}

.tot-dialog-icon--info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--pm-blue);
}

.tot-dialog-icon--error {
    background: rgba(234, 57, 67, 0.15);
    color: var(--pm-red);
}

.tot-dialog-icon--success {
    background: rgba(22, 199, 132, 0.15);
    color: var(--pm-green);
}

.tot-dialog-icon--warning,
.tot-dialog-icon--confirm {
    background: rgba(245, 158, 11, 0.15);
    color: var(--color-fourteen);
}

.tot-dialog-title {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 600;
    color: var(--pm-text-primary);
}

.tot-dialog-message {
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
    color: var(--pm-text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
}

.tot-dialog-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.tot-dialog-btn {
    min-width: 96px;
}

.tot-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(420px, calc(100vw - 40px));
    pointer-events: none;
}

html.rtl .tot-toast-container,
html[dir="rtl"] .tot-toast-container {
    right: auto;
    left: 20px;
}

.tot-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--pm-bg-secondary);
    border: 1px solid var(--pm-border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(16px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

html.rtl .tot-toast,
html[dir="rtl"] .tot-toast {
    transform: translateX(-16px);
}

.tot-toast--visible {
    opacity: 1;
    transform: translateX(0);
}

.tot-toast--closing {
    opacity: 0;
    transform: translateY(-8px);
}

.tot-toast--success {
    border-color: rgba(22, 199, 132, 0.35);
}

.tot-toast--error {
    border-color: rgba(234, 57, 67, 0.35);
}

.tot-toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}

.tot-toast-icon svg {
    width: 20px;
    height: 20px;
}

.tot-toast--success .tot-toast-icon {
    color: var(--pm-green);
}

.tot-toast--error .tot-toast-icon {
    color: var(--pm-red);
}

.tot-toast--info .tot-toast-icon {
    color: var(--pm-blue);
}

.tot-toast-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.45;
    color: var(--pm-text-primary);
    word-break: break-word;
}

.tot-toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--pm-text-muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 0 0 4px;
}

.tot-toast-close:hover {
    color: var(--pm-text-primary);
}

@media (max-width: 480px) {
    .tot-dialog-panel {
        padding: 24px 20px 20px;
    }

    .tot-toast-container {
        top: auto;
        bottom: 20px;
        right: 12px;
        left: 12px;
        max-width: none;
    }

    html.rtl .tot-toast-container,
    html[dir="rtl"] .tot-toast-container {
        left: 12px;
        right: 12px;
    }
}

/* Messaging & notifications */
.nav-notifications {
    position: relative;
}

.nav-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    color: var(--pm-text-secondary);
    background: transparent;
    border: 1px solid transparent;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nav-icon-btn:hover {
    background: var(--pm-surface);
    border-color: var(--pm-border);
    color: var(--pm-text-primary);
}

.nav-icon-btn-svg {
    width: 22px;
    height: 22px;
}

.nav-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--pm-red);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border: 2px solid var(--pm-bg-primary);
}

.nav-dropdown-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(360px, calc(100vw - 24px));
    background: var(--pm-bg-secondary);
    border: 1px solid var(--pm-border);
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
    z-index: 60;
    overflow: hidden;
}

.nav-dropdown-header,
.nav-dropdown-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: var(--pm-surface);
    border-bottom: 1px solid var(--pm-border);
}

.nav-dropdown-footer {
    border-bottom: 0;
    border-top: 1px solid var(--pm-border);
}

.nav-dropdown-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--pm-text-primary);
}

.nav-dropdown-action,
.nav-dropdown-footer-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--pm-blue);
    background: none;
    border: 0;
    cursor: pointer;
    text-decoration: none;
    padding: 0;
}

.nav-dropdown-action:hover,
.nav-dropdown-footer-link:hover {
    color: var(--pm-text-primary);
}

.nav-dropdown-list {
    max-height: 360px;
    overflow-y: auto;
    padding: 6px;
}

.nav-dropdown-item {
    display: block;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    color: inherit;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.nav-dropdown-item + .nav-dropdown-item {
    margin-top: 2px;
}

.nav-dropdown-item:hover {
    background: var(--pm-surface);
    border-color: var(--pm-border);
}

.nav-dropdown-item--unread {
    background: color-mix(in srgb, var(--pm-blue) 12%, var(--pm-bg-secondary));
    border-color: color-mix(in srgb, var(--pm-blue) 22%, var(--pm-border));
}

.nav-dropdown-item--unread:hover {
    background: color-mix(in srgb, var(--pm-blue) 16%, var(--pm-surface));
    border-color: color-mix(in srgb, var(--pm-blue) 28%, var(--pm-border-hover));
}

.nav-dropdown-item-title {
    font-weight: 600;
    font-size: 13px;
    line-height: 1.4;
    color: var(--pm-text-primary);
}

.nav-dropdown-item-title .user-profile-link {
    color: var(--pm-blue);
}

.nav-dropdown-item-title .user-profile-link:hover {
    color: var(--pm-text-primary);
    text-decoration: none;
}

.nav-dropdown-item-meta,
.nav-dropdown-item-time {
    font-size: 12px;
    color: var(--pm-text-secondary);
    margin-top: 4px;
    line-height: 1.4;
}

.nav-dropdown-item-time {
    color: var(--pm-text-muted);
}

.nav-dropdown-empty,
.empty-state {
    padding: 28px 16px;
    text-align: center;
    color: var(--pm-text-secondary);
}

.messages-inbox-wrap {
    max-width: 680px;
}

.messages-inbox {
    background: var(--pm-bg-secondary);
    border: 1px solid var(--pm-border);
    border-radius: 12px;
    overflow: hidden;
}

.messages-inbox-empty {
    padding: 56px 24px;
    text-align: center;
    color: var(--pm-text-secondary);
}

.messages-inbox-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pm-surface);
    border: 1px solid var(--pm-border);
    color: var(--pm-text-muted);
}

.messages-inbox-empty-icon svg {
    width: 28px;
    height: 28px;
}

.messages-inbox-empty-title {
    margin: 0;
    font-size: 15px;
    color: var(--pm-text-secondary);
}

.messages-inbox-pagination {
    padding: 12px 16px 16px;
    border-top: 1px solid var(--pm-border);
}

.inbox-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid color-mix(in srgb, var(--pm-border) 70%, transparent);
    transition: background 0.15s ease;
}

.inbox-item:last-child {
    border-bottom: 0;
}

.inbox-item:hover {
    background: color-mix(in srgb, var(--pm-surface) 80%, transparent);
}

.inbox-item--unread {
    background: color-mix(in srgb, var(--pm-blue) 6%, var(--pm-bg-secondary));
}

.inbox-item--unread:hover {
    background: color-mix(in srgb, var(--pm-blue) 10%, var(--pm-surface));
}

.inbox-item-avatar {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
}

.inbox-avatar-img,
.inbox-avatar-fallback {
    width: 56px;
    height: 56px;
    border-radius: 999px;
    object-fit: cover;
}

.inbox-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--pm-blue) 0%, var(--pm-purple) 100%);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.inbox-item-body {
    flex: 1;
    min-width: 0;
}

.inbox-item-top,
.inbox-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.inbox-item-identity {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}

.inbox-item-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--pm-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inbox-item--unread .inbox-item-name {
    font-weight: 700;
}

.inbox-item-username {
    font-size: 13px;
    color: var(--pm-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inbox-item-time {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--pm-text-muted);
}

.inbox-item--unread .inbox-item-time {
    color: var(--pm-blue);
    font-weight: 600;
}

.inbox-item-bottom {
    margin-top: 4px;
}

.inbox-item-preview {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    line-height: 1.35;
    color: var(--pm-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inbox-item--unread .inbox-item-preview {
    color: var(--pm-text-primary);
    font-weight: 500;
}

.inbox-item-preview--empty {
    font-style: italic;
    color: var(--pm-text-muted);
}

.inbox-item-you {
    color: var(--pm-text-muted);
    font-weight: 500;
}

.inbox-item--unread .inbox-item-you {
    color: var(--pm-text-secondary);
}

.inbox-unread-badge {
    flex-shrink: 0;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--pm-blue);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}

@media (max-width: 640px) {
    .container.section.messages-inbox-wrap {
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
    }

    .messages-inbox {
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }

    .inbox-item {
        padding: 12px 14px;
        gap: 12px;
    }

    .inbox-item-avatar,
    .inbox-avatar-img,
    .inbox-avatar-fallback {
        width: 48px;
        height: 48px;
    }

    .inbox-avatar-fallback {
        font-size: 17px;
    }

    .inbox-item-username {
        display: none;
    }
}

.chat-page {
    --chat-header-height: auto;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: 100%;
    overflow: hidden;
}

body:has(.chat-page) {
    overflow: hidden;
    height: 100%;
}

html:has(.chat-page) {
    height: 100%;
    overflow: hidden;
}

body:has(.chat-page) .page-wrapper {
    height: 100dvh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body:has(.chat-page) .main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body:has(.chat-page) .locale-banner {
    flex-shrink: 0;
}

.chat-page-header {
    flex-shrink: 0;
    border-bottom: 1px solid var(--pm-border);
    background: var(--pm-bg-primary);
    z-index: 5;
}

.chat-page-header-inner {
    max-width: 896px;
    margin: 0 auto;
    padding: 12px 20px;
}

.chat-back-link {
    margin-bottom: 4px;
}

.chat-page-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--pm-text-primary);
}

.chat-page-frame {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    max-width: 896px;
    width: 100%;
    margin: 0 auto;
    padding: 12px 20px 16px;
    box-sizing: border-box;
}

.chat-card {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    background: var(--pm-bg-secondary);
    border: 1px solid var(--pm-border);
    border-radius: 12px;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 16px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--pm-text-muted) 55%, transparent) transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
    margin: 8px 0;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--pm-text-muted) 45%, transparent);
    border-radius: 999px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--pm-text-secondary) 70%, transparent);
}

.chat-message {
    max-width: 78%;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
}

.chat-message--mine {
    margin-left: auto;
    align-items: flex-end;
}

.chat-message--theirs {
    margin-right: auto;
    align-items: flex-start;
}

.chat-message-body {
    padding: 10px 14px;
    border-radius: 16px;
    background: var(--pm-surface);
    color: var(--pm-text-primary);
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 14px;
    line-height: 1.4;
}

.chat-message--mine .chat-message-body {
    background: var(--pm-blue);
    color: #fff;
    border-bottom-right-radius: 6px;
}

.chat-message--theirs .chat-message-body {
    border-bottom-left-radius: 6px;
}

.chat-message-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    font-size: 11px;
    color: var(--pm-text-muted);
    line-height: 1;
}

.chat-message--mine .chat-message-meta {
    justify-content: flex-end;
}

.chat-message-receipt {
    display: inline-flex;
    align-items: center;
    color: var(--pm-text-muted);
}

.chat-message--read .chat-message-receipt {
    color: #60a5fa;
}

.chat-receipt-icon {
    width: 14px;
    height: 10px;
    display: block;
}

.chat-compose {
    flex-shrink: 0;
    border-top: 1px solid var(--pm-border);
    padding: 12px 14px;
    background: var(--pm-bg-secondary);
}

.chat-compose-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.chat-input {
    flex: 1;
    min-width: 0;
    width: auto;
    min-height: 44px;
    max-height: 140px;
    resize: none;
    padding: 11px 14px;
    border-radius: 22px;
    line-height: 1.4;
}

.chat-send-btn {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--pm-blue);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.chat-send-btn:hover {
    background: color-mix(in srgb, var(--pm-blue) 85%, #fff);
}

.chat-send-btn:active {
    transform: scale(0.96);
}

.chat-send-icon {
    width: 20px;
    height: 20px;
}

.chat-compose .form-error {
    margin-top: 8px;
}

.chat-compose .form-error[hidden] {
    display: none;
}

.chat-send-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.chat-load-more-wrap {
    text-align: center;
    margin-bottom: 12px;
}

.chat-load-status {
    text-align: center;
    padding: 8px 0 12px;
    font-size: 12px;
    color: var(--pm-text-muted);
}

.chat-load-status[hidden] {
    display: none;
}

.chat-day-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 14px 0 12px;
}

.chat-day-separator-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--pm-surface);
    border: 1px solid var(--pm-border);
    color: var(--pm-text-secondary);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.2;
    text-transform: capitalize;
}

@media (max-width: 768px) {
    .chat-page-header-inner {
        padding: 10px 12px;
    }

    .chat-page-title {
        font-size: 17px;
    }

    .chat-page-frame {
        padding: 0;
    }

    .chat-card {
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
    }

    .chat-messages {
        padding: 12px;
    }

    .chat-compose {
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    }
}

.notification-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 12px;
    margin: 0 -4px 2px;
    border-radius: 8px;
    border: 1px solid transparent;
    color: inherit;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.notification-item:last-child {
    margin-bottom: 0;
}

.notification-item:hover {
    background: var(--pm-surface);
    border-color: var(--pm-border);
}

.notification-item--unread {
    background: color-mix(in srgb, var(--pm-blue) 10%, var(--pm-bg-secondary));
    border-color: color-mix(in srgb, var(--pm-blue) 20%, var(--pm-border));
}

.notification-item--unread:hover {
    background: color-mix(in srgb, var(--pm-blue) 14%, var(--pm-surface));
    border-color: color-mix(in srgb, var(--pm-blue) 26%, var(--pm-border-hover));
}

.notification-item-content {
    min-width: 0;
    flex: 1;
}

.notification-item-title {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.4;
    color: var(--pm-text-primary);
}

.notification-item-title .user-profile-link {
    color: var(--pm-blue);
}

.notification-item-title .user-profile-link:hover {
    color: var(--pm-text-primary);
    text-decoration: none;
}

.notification-item-meta,
.notification-item-time {
    font-size: 13px;
    color: var(--pm-text-secondary);
    margin-top: 4px;
    line-height: 1.4;
}

.notification-item-time {
    color: var(--pm-text-muted);
    font-size: 12px;
}

.notification-unread-dot {
    width: 8px;
    height: 8px;
    margin-top: 6px;
    border-radius: 999px;
    flex-shrink: 0;
    background: var(--pm-blue);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--pm-blue) 20%, transparent);
}

.preference-list {
    display: grid;
    gap: 14px;
}

.preference-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--pm-text-primary);
}

.back-link {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--pm-blue);
    text-decoration: none;
    font-size: 14px;
}

.back-link:hover {
    color: var(--pm-text-primary);
    text-decoration: none;
}

/* ============================================
   SITE FOOTER / LEGAL / CONTACT
   ============================================ */
.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--pm-border);
    background: var(--pm-bg-secondary);
    padding: 36px 0 28px;
}

.site-footer-inner {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.site-footer-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.site-footer-brand {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 640px;
}

.site-footer-logo {
    display: inline-flex;
    flex-shrink: 0;
    margin-inline-start: auto;
    text-decoration: none;
    line-height: 0;
}

.app-logo-footer {
    height: 112px;
    width: auto;
}

.site-footer-tagline {
    margin: 0 0 14px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--pm-text-secondary);
}

.site-footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
}

.site-footer-nav a {
    color: var(--pm-text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.site-footer-nav a:hover {
    color: var(--pm-text-primary);
}

.site-footer-copy {
    margin: 0;
    padding-top: 4px;
    border-top: 1px solid var(--pm-border);
    font-size: 12px;
    color: var(--pm-text-muted);
}

.page-wrapper > .main {
    flex: 1 0 auto;
}

.contact-page {
    max-width: 640px;
}

.contact-card {
    padding: 24px;
}

.contact-privacy-label {
    align-items: flex-start;
    line-height: 1.45;
}

.contact-privacy-label a,
.auth-legal-links a,
.legal-content a {
    color: var(--pm-text-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.contact-privacy-label a:hover,
.auth-legal-links a:hover,
.legal-content a:hover {
    color: var(--pm-blue);
}

.auth-legal-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 13px;
    color: var(--pm-text-muted);
}

.legal-content {
    max-width: 760px;
    margin: 0 auto;
    padding: 28px;
}

.legal-content h2 {
    margin: 28px 0 10px;
    font-size: 17px;
    font-weight: 650;
    color: var(--pm-text-primary);
}

.legal-content h2:first-of-type {
    margin-top: 20px;
}

.legal-content p,
.legal-content li {
    font-size: 14px;
    line-height: 1.65;
    color: var(--pm-text-secondary);
}

.legal-content p {
    margin: 0 0 12px;
}

.legal-content ul {
    margin: 0 0 12px;
    padding-inline-start: 1.25em;
}

.legal-content li + li {
    margin-top: 6px;
}

@media (max-width: 768px) {
    .site-footer {
        padding: 28px 0 22px;
    }

    .site-footer-top {
        gap: 16px;
        align-items: flex-start;
    }

    .app-logo-footer {
        height: 56px;
    }

    .site-footer-tagline {
        margin-bottom: 10px;
        font-size: 12px;
    }

    .site-footer-nav {
        gap: 6px 12px;
    }

    .site-footer-nav a {
        font-size: 11px;
    }

    .site-footer-copy {
        font-size: 11px;
    }

    .contact-card,
    .legal-content {
        padding: 18px;
    }
}

.contact-message-row--unread td {
    background: color-mix(in srgb, var(--pm-blue) 8%, transparent);
}

.contact-message-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}

.contact-message-meta p {
    margin: 4px 0 0;
    color: var(--pm-text-primary);
    font-size: 14px;
    word-break: break-word;
}

.contact-message-body {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 14px;
    line-height: 1.6;
    color: var(--pm-text-primary);
    background: var(--pm-bg-primary);
    border: 1px solid var(--pm-border);
    border-radius: 8px;
    padding: 14px 16px;
    max-height: 360px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.contact-message-body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}
