/**
 * COSMOPeople Intranet — Frontend Stylesheet v1.4
 * Body: Helvetica, Arial, sans-serif — 16px base
 * Titles: Canela Light (OTF)
 * Brand: #E87722 orange, white backgrounds, premium editorial
 */

/* ============================================================
   CANELA FONT
   ============================================================ */
@font-face {
    font-family: 'Canela';
    src: url('../fonts/Canela-Light.otf') format('opentype');
    font-weight: 300;
    font-style: normal;
    font-display: block;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
.cosmo-app *,
.cosmo-app *::before,
.cosmo-app *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    /* v3.2.0: prevent theme fonts (e.g. Montserrat) from bleeding in */
    font-family: inherit;
}

.cosmo-app {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    color: #2a2a2a;
    background: #f7f7f5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    opacity: 0;
    transition: opacity 0.18s ease;
}

/* ============================================================
   HEADER
   ============================================================ */
.cosmo-header {
    background: #ffffff;
    border-bottom: 1px solid #e8e8e8;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}

.cosmo-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 40px;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 24px;
}

/* Logo — rendered as a <button> for accessibility */
.cosmo-logo-wrap {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
    cursor: pointer;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    outline: none;
}
.cosmo-logo-wrap:focus-visible {
    outline: 2px solid #E87722;
    outline-offset: 3px;
    border-radius: 2px;
}

.cosmo-logo-img img {
    max-height: 38px;
    max-width: 160px;
    object-fit: contain;
    display: block;
}

.cosmo-logo-mark {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.cosmo-logo-cosmo {
    font-family: 'Canela', Helvetica, Arial, sans-serif;
    font-weight: 300;
    font-size: 26px;
    color: #E87722;
    letter-spacing: 0.5px;
    line-height: 1;
}

.cosmo-logo-sub {
    font-size: 9px;
    font-weight: 400;
    color: #E87722;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 3px;
    opacity: 0.8;
}

/* "People" text + divider hidden by default in v1.3 */
.cosmo-logo-divider,
.cosmo-logo-people {
    display: none;
}

/* Notification text indicator — "3 new" pill, shown only when there are new articles */
.cosmo-notif-indicator {
    background: #E87722;
    border: none;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 2px;
    flex-shrink: 0;
    line-height: 1;
}
.cosmo-notif-indicator span {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #fff;
    white-space: nowrap;
}
.cosmo-notif-indicator:hover {
    background: #c5611a;
}

/* Notification dropdown */
.cosmo-notif-dropdown {
    position: fixed;
    top: 60px;
    right: 40px;
    width: 320px;
    background: #fff;
    border: 1px solid #e8e8e8;
    box-shadow: 0 8px 32px rgba(0,0,0,0.10);
    z-index: 200;
    padding: 0;
    font-family: Helvetica, Arial, sans-serif;
}
.cosmo-notif-header {
    padding: 14px 18px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #888;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.cosmo-notif-mark-seen {
    font-size: 10px;
    font-weight: 600;
    color: #E87722;
    background: none;
    border: none;
    cursor: pointer;
    letter-spacing: 0.5px;
    padding: 0;
}
.cosmo-notif-item {
    padding: 10px 18px;
    border-bottom: 1px solid #f7f7f5;
    cursor: pointer;
    transition: background 0.12s;
}
.cosmo-notif-item:hover { background: #fafaf8; }
.cosmo-notif-item-title {
    font-size: 13px;
    color: #1a1a1a;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 2px;
}
.cosmo-notif-item-date {
    font-size: 11px;
    color: #bbb;
}
.cosmo-notif-empty {
    padding: 20px 18px;
    font-size: 13px;
    color: #bbb;
    text-align: center;
}

/* Quick Links bar — Resources dropdown trigger */
.cosmo-quick-links-bar {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    padding: 0 40px;
}
.cosmo-quick-links-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    min-height: 38px;
}
.cosmo-resources-wrap {
    position: relative;
}
.cosmo-resources-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #555;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.15s;
    white-space: nowrap;
}
.cosmo-resources-btn:hover,
.cosmo-resources-btn--open { color: #E87722; }
.cosmo-resources-arrow { font-size: 10px; }
.cosmo-resources-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 180px;
    background: #fff;
    border: 1px solid #e8e8e8;
    box-shadow: 0 6px 24px rgba(0,0,0,0.09);
    z-index: 150;
    padding: 6px 0;
}
.cosmo-quick-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #2a2a2a;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.12s, color 0.12s;
}
.cosmo-quick-link:hover { background: #fafaf8; color: #E87722; }
.cosmo-quick-link-icon { font-size: 14px; }

/* "New" article badge — shown on cards for articles the user hasn't seen yet */
.cosmo-new-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #fff;
    background: #E87722;
    padding: 2px 7px;
    margin-bottom: 4px;
    margin-right: 4px;
}

/* Pinned badge */
.cosmo-pinned-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #555;
    background: #f0eee9;
    padding: 2px 7px;
    margin-bottom: 4px;
}

/* Draft badge */
.cosmo-draft-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff;
    background: #bbb;
    padding: 2px 7px;
    margin-left: 6px;
    vertical-align: middle;
}

/* Admin quick links section */
.cosmo-quick-link-admin-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}
.cosmo-quick-link-admin-item:last-child { border-bottom: none; }
.cosmo-quick-link-admin-grip {
    color: #ccc;
    cursor: grab;
    font-size: 16px;
    flex-shrink: 0;
}
.cosmo-quick-link-admin-info { flex: 1; min-width: 0; }
.cosmo-quick-link-admin-title { font-size: 13px; font-weight: 600; color: #1a1a1a; }
.cosmo-quick-link-admin-url { font-size: 11px; color: #bbb; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Search */
.cosmo-search-wrap {
    flex: 1;
    max-width: 400px;
    position: relative;
    display: flex;
    align-items: center;
}

.cosmo-search-icon {
    position: absolute;
    left: 12px;
    font-size: 13px;
    pointer-events: none;
    opacity: 0.35;
}

.cosmo-search-input {
    width: 100%;
    padding: 8px 14px 8px 34px;
    border: 1px solid #e8e8e8;
    border-radius: 0;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #2a2a2a;
    background: #fafaf8;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.cosmo-search-input:focus {
    border-color: #E87722;
    background: #fff;
}

.cosmo-search-input::placeholder { color: #c0c0c0; }

/* Language selector — segmented pill control */
.cosmo-lang-selector {
    display: flex;
    align-items: center;
    gap: 0;
    margin-right: 16px;
    border: 1.5px solid #ebebeb;
    border-radius: 20px;
    overflow: hidden;
    background: #fafaf8;
}

.cosmo-lang-btn {
    padding: 5px 12px;
    border: none;
    border-right: 1px solid #ebebeb;
    background: transparent;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: #c0c0c0;
    cursor: pointer;
    transition: background .15s, color .15s;
    line-height: 1.2;
}

.cosmo-lang-btn:last-child {
    border-right: none;
}

.cosmo-lang-btn:hover:not(.active) {
    color: #666;
    background: #f0eee9;
}

.cosmo-lang-btn.active {
    background: #E87722;
    color: #fff;
    border-right-color: transparent;
}

/* Header right */
.cosmo-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
    flex-shrink: 0;
}

.cosmo-admin-btn {
    padding: 7px 16px;
    background: #E87722;
    color: #fff;
    border: none;
    border-radius: 0;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s ease;
}

.cosmo-admin-btn:hover { background: #c5611a; transform: translateY(-1px); }
.cosmo-admin-btn:active { transform: translateY(0); }

.cosmo-user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 16px;
    border-left: 1px solid #ebebeb;
}

.cosmo-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #4a4a4a;
    letter-spacing: 0.1px;
}

.cosmo-logout-btn {
    padding: 6px 14px;
    background: transparent;
    color: #999;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-block;
}

.cosmo-logout-btn:hover {
    border-color: #E87722;
    color: #E87722;
}

.cosmo-user-greeting {
    font-size: 12px;
    font-weight: 600;
    color: #2a2a2a;
    letter-spacing: 0.3px;
    margin-right: 4px;
    position: relative;
    cursor: default;
    white-space: nowrap;
}

/* BU hover tooltip */
.cosmo-user-greeting[data-bu]:not([data-bu=''])::after {
    content: attr(data-bu);
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #1a1a1a;
    color: #fff;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.5px;
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: 2px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 200;
}
.cosmo-user-greeting[data-bu]:not([data-bu='']):hover::after {
    opacity: 1;
}

/* ============================================================
   HERO BANNER MODULE
   ============================================================ */
.cosmo-banner-section {
    position: relative;
    overflow: hidden;
    background: #1a1a1a;
    height: 480px;
    /* Bleed past .cosmo-main's 40px horizontal padding — overridden at each mobile breakpoint */
    width: calc(100% + 80px);
    margin-left: -40px;
    margin-right: -40px;
}

.cosmo-banner-track {
    display: flex;
    height: 100%;
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cosmo-banner-slide {
    min-width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

/* Image slide */
.cosmo-banner-slide img.cosmo-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 8s ease;
}

.cosmo-banner-slide.active img.cosmo-banner-img {
    transform: scale(1.04);
}

/* Video slide (iframe embed) */
.cosmo-banner-video-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.cosmo-banner-video-wrap iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 177.78vh; /* 16/9 * 100vh */
    height: 100%;
    min-width: 100%;
    min-height: 56.25vw;
    border: none;
    pointer-events: none;
}

/* Overlay gradient */
.cosmo-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        rgba(0,0,0,0.62) 0%,
        rgba(0,0,0,0.35) 45%,
        rgba(0,0,0,0.08) 100%
    );
    z-index: 1;
}

/* Text content */
.cosmo-banner-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: 640px;
    padding: 0 56px 52px;
    z-index: 2;
}

.cosmo-banner-cat {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #E87722;
    margin-bottom: 14px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s 0.2s, transform 0.6s 0.2s;
}

.cosmo-banner-title {
    font-family: 'Canela', Helvetica, Arial, sans-serif;
    font-weight: 300;
    font-size: 46px;
    color: #ffffff;
    line-height: 1.1;
    margin-bottom: 14px;
    letter-spacing: -0.5px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s 0.35s, transform 0.6s 0.35s;
}

.cosmo-banner-subtitle {
    font-size: 15px;
    color: rgba(255,255,255,0.78);
    line-height: 1.55;
    margin-bottom: 24px;
    max-width: 420px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s 0.5s, transform 0.6s 0.5s;
}

.cosmo-banner-cta {
    display: inline-block;
    padding: 11px 28px;
    background: #E87722;
    color: #fff;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s 0.62s, transform 0.6s 0.62s, background 0.2s;
}

.cosmo-banner-cta:hover { background: #c5611a; }

/* Animate in on active slide */
.cosmo-banner-slide.active .cosmo-banner-cat,
.cosmo-banner-slide.active .cosmo-banner-title,
.cosmo-banner-slide.active .cosmo-banner-subtitle,
.cosmo-banner-slide.active .cosmo-banner-cta {
    opacity: 1;
    transform: translateY(0);
}

/* Prev/Next buttons */
.cosmo-banner-prev,
.cosmo-banner-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.9);
    width: 44px;
    height: 44px;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
    border-radius: 0;
    backdrop-filter: blur(4px);
}

.cosmo-banner-prev { left: 20px; }
.cosmo-banner-next { right: 20px; }
.cosmo-banner-prev:hover,
.cosmo-banner-next:hover {
    background: rgba(232,119,34,0.8);
    border-color: #E87722;
}

/* Dots */
.cosmo-banner-dots {
    position: absolute;
    bottom: 20px;
    right: 36px;
    display: flex;
    gap: 8px;
    z-index: 10;
    align-items: center;
}

.cosmo-banner-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    border: none;
    padding: 0;
    transition: background 0.3s, transform 0.3s;
}

.cosmo-banner-dot.active {
    background: #E87722;
    transform: scale(1.5);
}

/* Progress bar at bottom */
.cosmo-banner-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: #E87722;
    z-index: 10;
    width: 0%;
    transition: none;
}

.cosmo-banner-progress.running {
    transition: width 5s linear;
    width: 100%;
}

/* ============================================================
   CATEGORY BAR
   ============================================================ */
.cosmo-cat-bar {
    background: #fff;
    border-bottom: 1px solid #ebebeb;
}

.cosmo-cat-bar-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.cosmo-cat-bar-inner::-webkit-scrollbar { display: none; }

.cosmo-cat-btn {
    padding: 14px 18px;
    background: transparent;
    color: #999;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    margin-bottom: -1px;
}

.cosmo-cat-btn:hover { color: #E87722; }
.cosmo-cat-btn.active { color: #E87722; border-bottom-color: #E87722; }

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
.cosmo-main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 44px 40px 80px;
}

.cosmo-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.cosmo-section-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #bbb;
}

.cosmo-count-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #efefed;
    color: #aaa;
    font-size: 11px;
    font-weight: 700;
}

/* ============================================================
   ARTICLE GRID
   ============================================================ */
.cosmo-article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.cosmo-article-card.cosmo-featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.cosmo-article-card.cosmo-featured .cosmo-card-img-wrap { height: 340px; }

.cosmo-article-card {
    background: #fff;
    border: 1px solid #ebebeb;
    cursor: pointer;
    transition: box-shadow 0.22s ease, transform 0.22s ease, border-color 0.22s ease;
    overflow: hidden;
}

.cosmo-article-card:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.10);
    transform: translateY(-3px);
}

.cosmo-card-img-wrap {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #efefed;
}

.cosmo-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s;
}

.cosmo-article-card:hover .cosmo-card-img { transform: scale(1.04); }

.cosmo-card-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f3f1;
    font-size: 28px;
    opacity: 0.25;
}

.cosmo-card-body { padding: 22px 24px 20px; }

.cosmo-article-card.cosmo-featured .cosmo-card-body {
    padding: 40px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cosmo-card-cat {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: #E87722;
    margin-bottom: 10px;
}

.cosmo-card-title {
    font-family: 'Canela', Helvetica, Arial, sans-serif;
    font-weight: 300;
    font-size: 20px;
    color: #1a1a1a;
    line-height: 1.3;
    margin-bottom: 10px;
    letter-spacing: -0.2px;
}

.cosmo-article-card.cosmo-featured .cosmo-card-title {
    font-size: 32px;
    line-height: 1.2;
    margin-bottom: 14px;
    letter-spacing: -0.5px;
}

.cosmo-card-excerpt {
    font-size: 14px;
    color: #888;
    line-height: 1.65;
    margin-bottom: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cosmo-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #c0c0c0;
    border-top: 1px solid #f3f3f1;
    padding-top: 14px;
    margin-top: auto;
}

.cosmo-card-reactions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cosmo-card-reaction-item {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
}

.cosmo-featured-badge {
    display: inline-block;
    padding: 3px 8px;
    background: #E87722;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.cosmo-empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #ccc;
}

.cosmo-empty-icon { font-size: 32px; margin-bottom: 14px; opacity: 0.4; }
.cosmo-empty-text { font-size: 14px; font-weight: 500; color: #bbb; }

/* ============================================================
   ARTICLE DETAIL
   ============================================================ */
.cosmo-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
    background: transparent;
    border: none;
    color: #bbb;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    margin-bottom: 32px;
    transition: color 0.2s;
}

.cosmo-back-btn:hover { color: #E87722; }

.cosmo-article-detail { max-width: 780px; }

.cosmo-detail-img-wrap {
    width: 100%;
    height: 420px;
    overflow: hidden;
    background: #efefed;
    margin-bottom: 36px;
}

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

.cosmo-detail-cat {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #E87722;
    margin-bottom: 12px;
    display: block;
}

.cosmo-detail-title {
    font-family: 'Canela', Helvetica, Arial, sans-serif;
    font-weight: 300;
    font-size: 42px;
    color: #1a1a1a;
    line-height: 1.15;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.cosmo-detail-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    color: #c0c0c0;
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid #ebebeb;
}

.cosmo-detail-body {
    font-size: 16px;
    line-height: 1.7;
    color: #3a3a3a;
    margin-bottom: 48px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.cosmo-detail-body p { margin-bottom: 1.1em; }
.cosmo-detail-body h2 {
    font-family: 'Canela', Helvetica, Arial, sans-serif;
    font-weight: 300;
    font-size: 28px;
    margin: 2.2em 0 0.7em;
    color: #1a1a1a;
    letter-spacing: -0.3px;
    line-height: 1.2;
}
.cosmo-detail-body h3 {
    font-family: 'Canela', Helvetica, Arial, sans-serif;
    font-weight: 300;
    font-size: 22px;
    margin: 1.8em 0 0.6em;
    color: #1a1a1a;
    line-height: 1.25;
}
.cosmo-detail-body ul, .cosmo-detail-body ol { padding-left: 24px; margin-bottom: 1.4em; }
.cosmo-detail-body li { margin-bottom: 0.4em; }
.cosmo-detail-body a { color: #E87722; text-decoration: underline; }
.cosmo-detail-body iframe { max-width: 100%; border: none; display: block; margin: 28px 0; }
.cosmo-detail-body blockquote {
    border-left: 3px solid #E87722;
    padding-left: 20px;
    margin: 1.6em 0;
    color: #666;
    font-style: italic;
}

/* ============================================================
   REACTIONS
   ============================================================ */
.cosmo-reactions-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 20px 0;
    border-top: 1px solid #ebebeb;
    border-bottom: 1px solid #ebebeb;
    margin-bottom: 40px;
}

.cosmo-reaction-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    background: #fafaf8;
    border: 1px solid #e8e8e8;
    border-radius: 0;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    color: #666;
}

.cosmo-reaction-btn:hover { border-color: #E87722; color: #E87722; background: #fff9f5; }
.cosmo-reaction-btn.reacted { border-color: #E87722; background: #fff9f5; color: #E87722; font-weight: 700; }
.cosmo-reaction-emoji { font-size: 16px; line-height: 1; }
.cosmo-reaction-count { font-size: 13px; font-weight: 600; }

/* ============================================================
   COMMENTS
   ============================================================ */
/* ============================================================
   COMMENTS SECTION (v2.5.1 — proper vertical composer)
   ============================================================ */

.cosmo-comments-section {
    margin-top: 48px;
    padding-top: 40px;
    border-top: 1px solid #e8e8e8;
}

.cosmo-comments-title {
    font-family: 'Canela', Helvetica, Arial, sans-serif;
    font-weight: 300;
    font-size: 24px;
    color: #2a2a2a;
    margin-bottom: 28px;
    letter-spacing: -0.2px;
}

/* ═══════════════════════════════════════
   COMMENT COMPOSER CARD
   ═══════════════════════════════════════ */

.cosmo-comment-composer {
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    background: #fff;
    margin-bottom: 48px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Profile row (top of card) ── */
.cosmo-composer-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #fafaf8;
    border-bottom: 1px solid #eee;
}

/* ── Shared avatar style ── */
.cosmo-comment-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #E87722;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Textarea (full width, large) ── */
.cosmo-comment-textarea {
    display: block;
    width: 100%;
    min-height: 140px;
    padding: 16px 18px;
    border: none;
    border-bottom: 1px solid #eee;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #2a2a2a;
    line-height: 1.65;
    resize: vertical;
    outline: none;
    background: #fff;
    box-sizing: border-box;
    transition: background 0.15s;
}

.cosmo-comment-textarea:focus { background: #fffdf9; }
.cosmo-comment-textarea::placeholder { color: #c0c0c0; }

/* ── Actions row (bottom of card) ── */
.cosmo-composer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #fafaf8;
}

.cosmo-composer-extras {
    display: flex;
    gap: 4px;
    /* reserved for future emoji / GIF buttons */
}

/* ── Post button ── */
.cosmo-comment-submit {
    padding: 9px 26px;
    background: #E87722;
    color: #fff;
    border: none;
    border-radius: 0;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.18s;
}

.cosmo-comment-submit:hover { background: #c5611a; }
.cosmo-comment-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* ═══════════════════════════════════════
   COMMENT LIST
   ═══════════════════════════════════════ */

.cosmo-comment-list {
    display: flex;
    flex-direction: column;
}

.cosmo-comment-item {
    display: flex;
    gap: 14px;
    padding: 13px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cosmo-comment-item:first-child {
    border-top: 1px solid #f0f0f0;
}

.cosmo-comment-body {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0;
}

.cosmo-comment-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.cosmo-comment-author {
    font-size: 13px;
    font-weight: 700;
    color: #1a1a1a;
}

.cosmo-comment-bu {
    font-size: 11px;
    font-weight: 400;
    color: #b8b8b8;
}

.cosmo-comment-date {
    font-size: 11px;
    color: #cacaca;
    margin-left: auto;
}

.cosmo-comment-text {
    font-size: 14px;
    color: #4a4a4a;
    line-height: 1.7;
    margin-bottom: 12px;
}

/* ── Comment action buttons ── */
.cosmo-comment-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.cosmo-comment-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: transparent;
    border: 1px solid #e8e8e8;
    border-radius: 0;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 12px;
    color: #aaa;
    cursor: pointer;
    transition: border-color 0.18s, color 0.18s;
}

.cosmo-comment-like-btn:hover { border-color: #E87722; color: #E87722; }
.cosmo-comment-like-btn.liked { border-color: #E87722; color: #E87722; font-weight: 700; }

.cosmo-comment-delete-btn {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: transparent;
    border: 1px solid #e8e8e8;
    border-radius: 0;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 12px;
    color: #cc3333;
    cursor: pointer;
    transition: all 0.18s;
    margin-left: auto;
}

.cosmo-comment-delete-btn:hover { background: #cc3333; color: #fff; border-color: #cc3333; }

/* ── Legacy wrappers (kept for no-op compat) ── */
.cosmo-comment-form,
.cosmo-comment-form-main,
.cosmo-comment-input-wrap { all: unset; display: block; }

/* ── Emoji toggle button ── */
.cosmo-emoji-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 17px;
    padding: 3px 6px;
    border-radius: 2px;
    opacity: 0.45;
    line-height: 1;
    transition: opacity 0.15s;
    font-style: normal;
}
.cosmo-emoji-toggle:hover { opacity: 0.9; }

/* ── Emoji picker panel ── */
.cosmo-emoji-panel {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 10px 14px;
    border-top: 1px solid #eee;
    background: #fafaf8;
}

.cosmo-emoji-btn {
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    padding: 5px;
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.12s;
}
.cosmo-emoji-btn:hover { background: #ece9e3; }

/* ── See more comments button ── */
.cosmo-comments-see-more {
    display: block;
    width: 100%;
    padding: 12px 0;
    background: none;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #E87722;
    cursor: pointer;
    text-align: left;
    transition: color 0.15s;
}
.cosmo-comments-see-more:hover { color: #c5611a; }

/* ============================================================
   ADMIN PANEL
   ============================================================ */
.cosmo-admin-panel {
    background: #fff;
    border: 1px solid #e8e8e8;
    min-height: 600px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}

.cosmo-admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 32px;
    border-bottom: 1px solid #ebebeb;
    background: #fff;
}

.cosmo-admin-header h1 {
    font-family: 'Canela', Helvetica, Arial, sans-serif;
    font-weight: 300;
    font-size: 24px;
    color: #2a2a2a;
    letter-spacing: -0.2px;
}

.cosmo-close-admin {
    padding: 6px 16px;
    background: transparent;
    color: #999;
    border: 1px solid #e8e8e8;
    border-radius: 0;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s;
}

.cosmo-close-admin:hover { color: #E87722; border-color: #E87722; }

.cosmo-admin-layout {
    display: grid;
    grid-template-columns: 210px 1fr;
    min-height: 560px;
}

.cosmo-admin-sidebar {
    background: #fafaf8;
    border-right: 1px solid #ebebeb;
    padding: 24px 0;
}

.cosmo-admin-nav-item {
    display: block;
    width: 100%;
    padding: 10px 24px;
    background: transparent;
    border: none;
    border-left: 2px solid transparent;
    text-align: left;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #777;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.2px;
}

.cosmo-admin-nav-item:hover { color: #E87722; background: #fff; }
.cosmo-admin-nav-item.active { color: #E87722; border-left-color: #E87722; background: #fff; }

.cosmo-admin-main { padding: 32px 36px; overflow-y: auto; }

.cosmo-admin-section-title {
    font-family: 'Canela', Helvetica, Arial, sans-serif;
    font-weight: 300;
    font-size: 22px;
    color: #2a2a2a;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f0f0f0;
    letter-spacing: -0.2px;
}

/* Stats */
.cosmo-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 32px;
}

.cosmo-stat-card {
    background: #fafaf8;
    border: 1px solid #ebebeb;
    padding: 20px;
    text-align: center;
}

.cosmo-stat-value { font-size: 30px; font-weight: 700; color: #E87722; line-height: 1; margin-bottom: 6px; }
.cosmo-stat-label { font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: #bbb; }

/* Admin article list */
.cosmo-admin-article-list { display: flex; flex-direction: column; gap: 8px; }

.cosmo-admin-article-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #fafaf8;
    border: 1px solid #ebebeb;
    transition: border-color 0.2s;
}

.cosmo-admin-article-item:hover { border-color: #E87722; }

.cosmo-admin-article-thumb {
    width: 60px;
    height: 46px;
    object-fit: cover;
    flex-shrink: 0;
    background: #e8e8e8;
    display: block;
}

.cosmo-admin-article-info { flex: 1; min-width: 0; }

.cosmo-admin-article-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cosmo-admin-article-meta { font-size: 12px; color: #c0c0c0; }

.cosmo-admin-article-actions { display: flex; gap: 6px; flex-shrink: 0; }

.cosmo-admin-btn-sm {
    padding: 6px 12px;
    border: none;
    border-radius: 0;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
}

.cosmo-btn-edit { background: #555; color: #fff; }
.cosmo-btn-edit:hover { background: #E87722; }
.cosmo-btn-delete { background: #fafaf8; color: #c0392b; border: 1px solid #e8e8e8; }
.cosmo-btn-delete:hover { background: #c0392b; color: #fff; border-color: #c0392b; }
.cosmo-btn-feature { background: #fafaf8; color: #888; border: 1px solid #e8e8e8; }
.cosmo-btn-feature.is-featured { background: #E87722; color: #fff; border-color: #E87722; }
.cosmo-btn-feature:hover { border-color: #E87722; color: #E87722; }

/* Form */
.cosmo-admin-form { display: flex; flex-direction: column; gap: 18px; }

.cosmo-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.cosmo-field-group { display: flex; flex-direction: column; gap: 6px; }

.cosmo-field-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #aaa;
}

.cosmo-field-input,
.cosmo-field-select,
.cosmo-field-textarea {
    padding: 10px 14px;
    border: 1px solid #e8e8e8;
    border-radius: 0;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #2a2a2a;
    outline: none;
    transition: border-color 0.2s;
    background: #fff;
}

.cosmo-field-input:focus,
.cosmo-field-select:focus,
.cosmo-field-textarea:focus { border-color: #E87722; }

.cosmo-field-textarea { min-height: 88px; resize: vertical; }

/* RTE */
.cosmo-rte-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    padding: 7px 10px;
    background: #fafaf8;
    border: 1px solid #e8e8e8;
    border-bottom: none;
}

.cosmo-rte-btn {
    padding: 4px 9px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 0;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    color: #555;
    transition: all 0.15s;
    min-width: 28px;
    text-align: center;
}

.cosmo-rte-btn:hover { background: #E87722; color: #fff; border-color: #E87722; }

.cosmo-rte-editor {
    min-height: 220px;
    padding: 14px;
    border: 1px solid #e8e8e8;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #2a2a2a;
    line-height: 1.75;
    outline: none;
    overflow-y: auto;
}

.cosmo-rte-editor:focus { border-color: #E87722; }
.cosmo-rte-editor:empty::before { content: attr(data-placeholder); color: #d0d0d0; }

/* Image upload */
.cosmo-img-upload-area {
    border: 2px dashed #e8e8e8;
    padding: 28px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafaf8;
    position: relative;
}

.cosmo-img-upload-area:hover,
.cosmo-img-upload-area.drag-over { border-color: #E87722; background: #fff9f5; }

.cosmo-img-upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.cosmo-img-upload-icon { font-size: 24px; margin-bottom: 10px; opacity: 0.3; }
.cosmo-img-upload-text { font-size: 13px; color: #c0c0c0; font-weight: 500; }

.cosmo-img-preview-wrap { position: relative; display: inline-block; margin-top: 12px; }
.cosmo-img-preview { max-width: 100%; max-height: 180px; object-fit: contain; display: block; border: 1px solid #e8e8e8; }

.cosmo-img-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    background: #c0392b;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Buttons — base reset used in modals alongside modifier classes */
.cosmo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    background: #fff;
    color: #555;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color 0.18s, color 0.18s, background 0.18s;
    white-space: nowrap;
    text-decoration: none;
    outline: none;
}
.cosmo-btn:hover { border-color: #aaa; color: #333; }
.cosmo-btn:focus-visible { outline: 2px solid #E87722; outline-offset: 2px; }

.cosmo-btn-primary {
    padding: 10px 24px;
    background: #E87722;
    color: #fff;
    border: none;
    border-radius: 0;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s ease, box-shadow 0.2s;
}

.cosmo-btn-primary:hover { background: #c5611a; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(232,119,34,0.25); }
.cosmo-btn-primary:active { transform: translateY(0); box-shadow: none; }
.cosmo-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.cosmo-btn-secondary {
    padding: 10px 24px;
    background: transparent;
    color: #777;
    border: 1px solid #e8e8e8;
    border-radius: 0;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, transform 0.15s ease;
}

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

.cosmo-btn-secondary:hover { border-color: #E87722; color: #E87722; transform: translateY(-1px); }

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

/* Toggle */
.cosmo-toggle-group { display: flex; align-items: center; gap: 10px; }
.cosmo-toggle-label { font-size: 14px; color: #666; }
.cosmo-toggle { position: relative; width: 38px; height: 22px; flex-shrink: 0; }
.cosmo-toggle input { opacity: 0; width: 0; height: 0; }
.cosmo-toggle-slider { position: absolute; inset: 0; background: #e0e0e0; cursor: pointer; transition: background 0.2s; border-radius: 11px; }
.cosmo-toggle-slider::before { content: ''; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px; background: #fff; transition: transform 0.2s; border-radius: 50%; }
.cosmo-toggle input:checked + .cosmo-toggle-slider { background: #E87722; }
.cosmo-toggle input:checked + .cosmo-toggle-slider::before { transform: translateX(16px); }

/* Analytics table */
.cosmo-analytics-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cosmo-analytics-table th { text-align: left; padding: 10px 14px; background: #fafaf8; font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: #bbb; border-bottom: 1px solid #ebebeb; }
.cosmo-analytics-table td { padding: 12px 14px; border-bottom: 1px solid #f5f5f3; color: #3a3a3a; }
.cosmo-analytics-table tr:hover td { background: #fafaf8; }
.cosmo-analytics-table td:last-child { text-align: right; font-weight: 700; color: #E87722; }

/* Settings */
.cosmo-settings-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 20px; }
.cosmo-settings-field label { font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: #aaa; }
.cosmo-settings-field input[type="text"],
.cosmo-settings-field input[type="password"],
.cosmo-settings-field input[type="color"],
.cosmo-settings-field select,
.cosmo-settings-field textarea {
    padding: 10px 14px;
    border: 1px solid #e8e8e8;
    border-radius: 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #2a2a2a;
    outline: none;
    background: #fafaf8;
    transition: border-color 0.18s, background 0.18s;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
}
.cosmo-settings-field input:focus,
.cosmo-settings-field textarea:focus,
.cosmo-settings-field select:focus { border-color: #E87722; background: #fff; }
.cosmo-settings-field input[type="color"] { padding: 4px 8px; height: 42px; cursor: pointer; }
.cosmo-settings-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23aaa' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
}

/* Admin list */
.cosmo-admin-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 20px; }
.cosmo-admin-list-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: #fafaf8; border: 1px solid #ebebeb; font-size: 14px; }
.cosmo-master-badge { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: #E87722; padding: 2px 6px; border: 1px solid #E87722; margin-left: 8px; }
.cosmo-admin-list-item button { padding: 4px 10px; background: #fafaf8; border: 1px solid #e8e8e8; color: #c0392b; font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; cursor: pointer; transition: all 0.2s; border-radius: 0; font-family: Helvetica, Arial, sans-serif; }
.cosmo-admin-list-item button:hover { background: #c0392b; color: #fff; border-color: #c0392b; }

/* Category list */
.cosmo-cat-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 20px; }
.cosmo-cat-list-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #fafaf8; border: 1px solid #ebebeb; font-size: 14px; }
.cosmo-cat-list-name { flex: 1; font-weight: 600; color: #1a1a1a; }
.cosmo-cat-list-count { font-size: 12px; color: #c0c0c0; }
.cosmo-cat-list-actions { display: flex; gap: 5px; }

/* Gallery / Banner admin grid */
.cosmo-gallery-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.cosmo-gallery-thumb-wrap {
    position: relative;
    aspect-ratio: 16/9;
    background: #f0f0f0;
    border: 1px solid #e8e8e8;
    overflow: hidden;
}

.cosmo-gallery-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cosmo-gallery-thumb-delete {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: rgba(192,57,43,0.85);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Banner slide admin item */
.cosmo-banner-slide-item {
    background: #fafaf8;
    border: 1px solid #ebebeb;
    padding: 16px;
    margin-bottom: 12px;
}

.cosmo-banner-slide-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.cosmo-banner-slide-drag {
    cursor: grab;
    color: #ccc;
    font-size: 16px;
    flex-shrink: 0;
}

.cosmo-banner-slide-title-preview {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #2a2a2a;
}

.cosmo-banner-slide-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.cosmo-banner-slide-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.cosmo-banner-slide-fields .cosmo-field-group {
    gap: 5px;
}

.cosmo-banner-slide-fields .cosmo-field-group.full-width {
    grid-column: 1 / -1;
}

/* Toast */
.cosmo-toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    padding: 12px 22px;
    background: #fff;
    color: #2a2a2a;
    border: 1px solid #e8e8e8;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    transition: opacity 0.3s, transform 0.3s;
    letter-spacing: 0.1px;
}

.cosmo-toast.cosmo-toast-success { border-left: 3px solid #27ae60; }
.cosmo-toast.cosmo-toast-error { border-left: 3px solid #c0392b; }
.cosmo-toast.cosmo-toast-hide { opacity: 0; transform: translateY(8px); }

/* Spinner */
.cosmo-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e8e8e8;
    border-top-color: #E87722;
    border-radius: 50%;
    animation: cosmo-spin 0.7s linear infinite;
}

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

.cosmo-loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 20px;
    gap: 14px;
    color: #c0c0c0;
    font-size: 14px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .cosmo-banner-section { height: 380px; }
    .cosmo-banner-title { font-size: 36px; }
}

@media (max-width: 900px) {
    .cosmo-article-card.cosmo-featured { grid-template-columns: 1fr; }
    .cosmo-article-card.cosmo-featured .cosmo-card-img-wrap { height: 220px; }
    .cosmo-article-card.cosmo-featured .cosmo-card-title { font-size: 22px; }
    .cosmo-admin-layout { grid-template-columns: 1fr; }
    .cosmo-admin-sidebar { border-right: none; border-bottom: 1px solid #ebebeb; display: flex; flex-wrap: wrap; padding: 8px 0; }
    .cosmo-admin-nav-item { border-left: none; border-bottom: 2px solid transparent; display: inline-block; }
    .cosmo-admin-nav-item.active { border-left-color: transparent; border-bottom-color: #E87722; }
    .cosmo-banner-section { height: 320px; }
    .cosmo-banner-content { padding: 0 32px 36px; }
    .cosmo-banner-title { font-size: 30px; }
}

@media (max-width: 640px) {
    .cosmo-header-inner { padding: 0 20px; height: auto; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; gap: 12px; }
    .cosmo-search-wrap { order: 3; max-width: 100%; width: 100%; }
    .cosmo-user-name { display: none; }
    .cosmo-user-menu { padding-left: 0; border-left: none; }
    .cosmo-main { padding: 24px 20px 48px; }
    .cosmo-cat-bar-inner { padding: 0 20px; }
    .cosmo-article-grid { grid-template-columns: 1fr; }
    .cosmo-detail-title { font-size: 28px; }
    .cosmo-detail-img-wrap { height: 220px; }
    .cosmo-detail-body { font-size: 15px; }
    .cosmo-form-row { grid-template-columns: 1fr; }
    .cosmo-admin-main { padding: 20px; }
    .cosmo-stats-grid { grid-template-columns: repeat(2,1fr); }
    .cosmo-banner-section { height: 260px; }
    .cosmo-banner-content { padding: 0 20px 28px; }
    .cosmo-banner-title { font-size: 24px; }
    .cosmo-banner-subtitle { display: none; }
    .cosmo-banner-slide-fields { grid-template-columns: 1fr; }
}

/* ============================================================
   CONFIRM MODAL
   ============================================================ */
.cosmo-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.48);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cosmo-modal {
    background: #fff;
    padding: 36px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.18);
}

.cosmo-modal-title {
    font-family: 'Canela', Helvetica, Arial, sans-serif;
    font-weight: 300;
    font-size: 24px;
    color: #2a2a2a;
    margin-bottom: 12px;
    letter-spacing: -0.2px;
}

.cosmo-modal-msg {
    font-size: 14px;
    color: #888;
    margin-bottom: 28px;
    line-height: 1.65;
}

.cosmo-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ============================================================
   DANGER BUTTON
   ============================================================ */
.cosmo-btn-danger {
    background: #c0392b;
    color: #fff;
    border: none;
    padding: 10px 22px;
    font-size: 11px;
    font-family: Helvetica, Arial, sans-serif;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s;
}
.cosmo-btn-danger:hover { background: #a93226; }

/* ============================================================
   GALLERY ADMIN GRID — drag reorder
   ============================================================ */
.cosmo-gallery-thumb-wrap.dragging {
    opacity: 0.4;
}
.cosmo-gallery-thumb-wrap.drag-over {
    outline: 2px dashed #E87722;
    outline-offset: 2px;
}

.cosmo-banner-slide-item.dragging { opacity: 0.4; }
.cosmo-banner-slide-item.drag-over { outline: 2px dashed #E87722; outline-offset: 2px; }

/* Load More button */
.cosmo-load-more-wrap {
    text-align: center;
    padding: 32px 0 12px;
}
.cosmo-btn-load-more {
    display: inline-block;
    padding: 12px 36px;
    border: 1.5px solid #e8e8e8;
    background: #fff;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #555;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.cosmo-btn-load-more:hover {
    border-color: #E87722;
    color: #E87722;
    background: #fdfaf7;
}

/* Dashboard top-5 lists */
.cosmo-dashboard-top5-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 24px;
}
@media (max-width: 900px) {
    .cosmo-dashboard-top5-grid { grid-template-columns: 1fr; }
}
.cosmo-dashboard-top5 {
    background: #fff;
    border: 1px solid #e8e8e8;
    padding: 18px 20px 14px;
}
.cosmo-dashboard-top5-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}
.cosmo-dashboard-top5-list {
    font-family: Helvetica, Arial, sans-serif;
}

/* ============================================================
   RESPONSIVE DESIGN — TABLET LANDSCAPE (1024px and below)
   ============================================================ */

@media (max-width: 1024px) {
    .cosmo-header-inner {
        padding: 16px 32px;
        gap: 20px;
    }

    .cosmo-header-right {
        gap: 12px;
    }

    .cosmo-logo-cosmo {
        font-size: 28px;
    }

    .cosmo-logo-sub {
        font-size: 8px;
    }

    .cosmo-admin-btn {
        font-size: 11px;
        padding: 8px 12px;
    }

    .cosmo-cat-bar {
        padding: 12px 32px;
    }

    .cosmo-article-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .cosmo-featured {
        height: 320px;
    }

    .cosmo-admin-panel {
        width: 90%;
        max-width: 900px;
    }

    .cosmo-admin-layout {
        flex-direction: column;
    }

    .cosmo-admin-sidebar {
        width: 100%;
        border-bottom: 1px solid #e8e8e8;
        flex-direction: row;
        overflow-x: auto;
        margin-bottom: 24px;
    }

    .cosmo-admin-nav-item {
        min-width: 150px;
    }

    .cosmo-admin-main {
        width: 100%;
    }

    .cosmo-detail-wrap {
        padding: 40px;
    }

    .cosmo-banner-section {
        height: 300px;
    }
}

/* ============================================================
   RESPONSIVE DESIGN — TABLET PORTRAIT / LARGE MOBILE (768px and below)
   ============================================================ */

@media (max-width: 768px) {
    body {
        font-size: 15px;
    }

    /* Header adjustments */
    .cosmo-header-inner {
        padding: 12px 20px;
        gap: 12px;
    }

    .cosmo-logo-wrap {
        min-width: 40px;
    }

    .cosmo-logo-cosmo {
        font-size: 20px;
        letter-spacing: 2px;
    }

    .cosmo-logo-sub {
        font-size: 7px;
        letter-spacing: 2px;
    }

    .cosmo-search-wrap {
        flex: 1;
        max-width: 200px;
    }

    .cosmo-search-input {
        font-size: 13px;
        padding: 8px 10px;
    }

    .cosmo-lang-selector {
        gap: 4px;
    }

    .cosmo-lang-btn {
        font-size: 10px;
        padding: 6px 8px;
    }

    .cosmo-admin-btn {
        font-size: 10px;
        padding: 6px 10px;
    }

    .cosmo-user-name {
        display: none;
    }

    .cosmo-logout-btn {
        font-size: 12px;
    }

    /* Category bar */
    .cosmo-cat-bar {
        padding: 8px 20px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .cosmo-cat-btn {
        font-size: 11px;
        padding: 8px 16px;
        white-space: nowrap;
    }

    /* Quick links */
    .cosmo-quick-links-bar {
        padding: 12px 20px !important;
    }

    .cosmo-quick-link-item {
        min-width: 120px;
        font-size: 12px;
        padding: 8px 12px;
    }

    /* Main content */
    .cosmo-main {
        padding: 20px;
    }

    .cosmo-section-header {
        padding: 16px 0 12px 0;
    }

    .cosmo-section-title {
        font-size: 16px;
    }

    /* Article grid */
    .cosmo-article-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .cosmo-article-card {
        border-radius: 6px;
    }

    .cosmo-article-image {
        height: 200px;
    }

    .cosmo-featured {
        height: 250px;
    }

    .cosmo-article-body {
        padding: 16px;
    }

    .cosmo-article-title {
        font-size: 15px;
        margin-bottom: 8px;
    }

    .cosmo-article-excerpt {
        font-size: 12px;
        line-height: 1.4;
    }

    .cosmo-article-meta {
        font-size: 11px;
        gap: 8px;
        margin-top: 8px;
    }

    /* Detail view */
    .cosmo-detail-wrap {
        padding: 20px;
    }

    .cosmo-detail-header {
        margin-bottom: 20px;
    }

    .cosmo-detail-title {
        font-size: 20px;
        margin-bottom: 12px;
    }

    .cosmo-detail-meta {
        font-size: 12px;
        gap: 12px;
    }

    .cosmo-detail-image {
        max-height: 300px;
        margin: 16px 0;
    }

    .cosmo-detail-content {
        font-size: 14px;
        line-height: 1.6;
    }

    /* Banner */
    .cosmo-banner-section {
        height: 220px;
        margin-left: -20px;
        margin-right: -20px;
        width: calc(100% + 40px);
    }

    .cosmo-banner-text {
        padding: 20px;
    }

    .cosmo-banner-title {
        font-size: 24px;
    }

    .cosmo-banner-desc {
        font-size: 12px;
    }

    /* Comments and reactions */
    .cosmo-comments-section {
        margin-top: 20px;
    }

    .cosmo-reaction-bar {
        gap: 8px;
        flex-wrap: wrap;
    }

    .cosmo-reaction-btn {
        font-size: 13px;
        padding: 6px 10px;
        min-height: 36px;
    }

    .cosmo-comment-box {
        margin-top: 16px;
    }

    .cosmo-comment-input {
        font-size: 13px;
        padding: 10px;
        min-height: 80px;
    }

    .cosmo-comment {
        padding: 12px;
        margin-bottom: 12px;
    }

    .cosmo-comment-name {
        font-size: 13px;
    }

    .cosmo-comment-text {
        font-size: 12px;
    }

    /* Admin panel */
    .cosmo-admin-panel {
        width: 95%;
        max-height: 90vh;
        border-radius: 4px;
    }

    .cosmo-admin-header {
        padding: 16px;
    }

    .cosmo-admin-header h1 {
        font-size: 18px;
    }

    .cosmo-close-admin {
        font-size: 20px;
        padding: 4px 8px;
    }

    .cosmo-admin-nav-item {
        font-size: 12px;
        padding: 8px 12px;
        min-width: 100%;
    }

    .cosmo-admin-main {
        max-height: calc(90vh - 120px);
        padding: 16px;
    }

    /* Forms in admin */
    .cosmo-form-group {
        margin-bottom: 16px;
    }

    .cosmo-form-label {
        font-size: 10px;
    }

    .cosmo-form-input,
    .cosmo-form-textarea {
        font-size: 13px;
        padding: 10px;
    }

    .cosmo-btn {
        font-size: 12px;
        padding: 10px 16px;
        min-height: 40px;
    }

    /* Notification dropdown */
    .cosmo-notif-dropdown {
        max-width: calc(100vw - 40px);
        right: 20px;
        max-height: 60vh;
        overflow-y: auto;
    }

    .cosmo-notif-item {
        padding: 12px;
        font-size: 12px;
    }

    /* Dashboard stats */
    .cosmo-dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .cosmo-stat-card {
        padding: 16px;
    }

    .cosmo-stat-number {
        font-size: 24px;
    }

    .cosmo-stat-label {
        font-size: 11px;
    }

    .cosmo-dashboard-top5-grid {
        grid-template-columns: 1fr;
    }

    .cosmo-dashboard-top5 {
        padding: 12px 14px 10px;
    }

    .cosmo-dashboard-top5-title {
        font-size: 10px;
    }
}

/* ============================================================
   RESPONSIVE DESIGN — SMALL MOBILE (480px and below)
   ============================================================ */

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    body {
        font-size: 14px;
    }

    /* Header — minimal */
    .cosmo-header {
        padding: 8px 0;
    }

    .cosmo-header-inner {
        padding: 8px 12px;
        gap: 8px;
    }

    .cosmo-logo-wrap {
        min-width: 36px;
    }

    .cosmo-logo-cosmo {
        font-size: 16px;
        letter-spacing: 1px;
    }

    .cosmo-logo-sub {
        font-size: 6px;
        letter-spacing: 1px;
    }

    .cosmo-search-wrap {
        max-width: 120px;
        min-height: 28px;
    }

    .cosmo-search-input {
        font-size: 12px;
        padding: 6px 8px;
        border-radius: 4px;
    }

    .cosmo-lang-selector {
        gap: 2px;
    }

    .cosmo-lang-btn {
        font-size: 9px;
        padding: 4px 6px;
    }

    .cosmo-admin-btn {
        display: none;
    }

    .cosmo-notif-indicator {
        font-size: 12px;
    }

    .cosmo-notif-badge {
        font-size: 10px;
    }

    /* Category bar — horizontal scroll */
    .cosmo-cat-bar {
        padding: 6px 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-bottom: 1px solid #f0f0f0;
    }

    .cosmo-cat-bar-inner {
        gap: 8px;
    }

    .cosmo-cat-btn {
        font-size: 10px;
        padding: 6px 12px;
        white-space: nowrap;
        border-radius: 3px;
    }

    /* Main content */
    .cosmo-main {
        padding: 12px;
        margin: 0;
    }

    .cosmo-section-header {
        padding: 12px 0 10px 0;
    }

    .cosmo-section-title {
        font-size: 14px;
        font-weight: 600;
    }

    /* Article grid — single column */
    .cosmo-article-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .cosmo-article-card {
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }

    .cosmo-article-image {
        height: 160px;
    }

    .cosmo-featured {
        height: 200px;
        margin-bottom: 12px;
    }

    .cosmo-article-body {
        padding: 12px;
    }

    .cosmo-article-title {
        font-size: 13px;
        margin-bottom: 6px;
        font-weight: 600;
        line-height: 1.3;
    }

    .cosmo-article-excerpt {
        font-size: 11px;
        line-height: 1.4;
        color: #666;
    }

    .cosmo-article-meta {
        font-size: 10px;
        gap: 6px;
        margin-top: 8px;
    }

    .cosmo-article-meta-item {
        display: block;
    }

    /* Detail view — full width */
    .cosmo-detail-wrap {
        padding: 12px;
        max-width: 100%;
    }

    .cosmo-detail-header {
        margin-bottom: 16px;
    }

    .cosmo-detail-title {
        font-size: 18px;
        margin-bottom: 10px;
        line-height: 1.3;
    }

    .cosmo-detail-meta {
        font-size: 11px;
        flex-direction: column;
        gap: 4px;
    }

    .cosmo-detail-image {
        max-height: 240px;
        margin: 12px 0;
        border-radius: 4px;
    }

    .cosmo-detail-content {
        font-size: 13px;
        line-height: 1.6;
    }

    .cosmo-detail-content p {
        margin-bottom: 10px;
    }

    /* Banner */
    .cosmo-banner-section {
        height: 180px;
        margin-left: -12px;
        margin-right: -12px;
        width: calc(100% + 24px);
    }

    .cosmo-banner-text {
        padding: 12px;
        text-align: center;
    }

    .cosmo-banner-title {
        font-size: 18px;
        line-height: 1.3;
    }

    .cosmo-banner-desc {
        font-size: 11px;
        margin-top: 6px;
    }

    .cosmo-banner-btn {
        font-size: 11px;
        padding: 8px 14px;
        margin-top: 8px;
    }

    /* Reactions */
    .cosmo-reactions-section {
        margin: 12px 0;
    }

    .cosmo-reaction-bar {
        gap: 6px;
    }

    .cosmo-reaction-btn {
        font-size: 12px;
        padding: 5px 8px;
        min-height: 36px;
        flex: 1;
        text-align: center;
    }

    .cosmo-reaction-emoji {
        font-size: 14px;
    }

    /* Comments */
    .cosmo-comments-section {
        margin-top: 16px;
    }

    .cosmo-comments-title {
        font-size: 12px;
        margin-bottom: 12px;
    }

    .cosmo-comment-box {
        margin-top: 12px;
    }

    .cosmo-comment-input {
        font-size: 12px;
        padding: 8px;
        min-height: 70px;
        border-radius: 4px;
    }

    .cosmo-comment-btn {
        font-size: 11px;
        padding: 8px 12px;
        margin-top: 8px;
        min-height: 36px;
    }

    .cosmo-comment-list {
        margin-top: 12px;
    }

    .cosmo-comment {
        padding: 10px;
        margin-bottom: 10px;
        border-left: 2px solid #E87722;
        background: #fafaf8;
        border-radius: 3px;
    }

    .cosmo-comment-name {
        font-size: 12px;
        font-weight: 600;
    }

    .cosmo-comment-date {
        font-size: 10px;
        color: #999;
    }

    .cosmo-comment-text {
        font-size: 12px;
        margin-top: 6px;
        line-height: 1.4;
    }

    .cosmo-comment-like-btn {
        font-size: 10px;
        padding: 4px 8px;
    }

    /* Admin panel — full width overlay */
    .cosmo-admin-panel {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        z-index: 10000;
    }

    .cosmo-admin-header {
        padding: 12px;
        border-bottom: 1px solid #e8e8e8;
    }

    .cosmo-admin-header h1 {
        font-size: 16px;
        margin-bottom: 0;
    }

    .cosmo-close-admin {
        font-size: 24px;
        padding: 0;
    }

    .cosmo-admin-content {
        max-height: calc(100vh - 50px);
        overflow-y: auto;
    }

    .cosmo-admin-layout {
        flex-direction: column;
    }

    .cosmo-admin-sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-bottom: 1px solid #e8e8e8;
        margin-bottom: 12px;
    }

    .cosmo-admin-nav-item {
        font-size: 11px;
        padding: 8px 10px;
        white-space: nowrap;
        border: none;
        border-bottom: 2px solid transparent;
        background: none;
    }

    .cosmo-admin-nav-item.active {
        border-bottom-color: #E87722;
    }

    .cosmo-admin-main {
        width: 100%;
        max-height: auto;
        padding: 12px;
    }

    .cosmo-loading-state {
        padding: 40px 20px;
        text-align: center;
    }

    /* Forms */
    .cosmo-form-group {
        margin-bottom: 12px;
    }

    .cosmo-form-label {
        font-size: 10px;
        margin-bottom: 4px;
    }

    .cosmo-form-input,
    .cosmo-form-textarea,
    .cosmo-form-select {
        font-size: 13px;
        padding: 9px;
        width: 100%;
        border-radius: 4px;
        border: 1px solid #ddd;
    }

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

    .cosmo-btn,
    .cosmo-login-btn,
    .cosmo-btn-primary {
        font-size: 12px;
        padding: 10px 14px;
        width: 100%;
        min-height: 44px;
        border-radius: 4px;
        cursor: pointer;
        font-weight: 600;
    }

    .cosmo-btn-secondary {
        font-size: 11px;
        padding: 8px 12px;
        min-height: 36px;
    }

    /* Dashboard */
    .cosmo-dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 16px;
    }

    .cosmo-stat-card {
        padding: 12px;
        border-radius: 4px;
    }

    .cosmo-stat-number {
        font-size: 22px;
    }

    .cosmo-stat-label {
        font-size: 10px;
    }

    .cosmo-dashboard-top5-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .cosmo-dashboard-top5 {
        padding: 10px 12px;
    }

    .cosmo-dashboard-top5-title {
        font-size: 9px;
        margin-bottom: 8px;
    }

    /* Notification dropdown */
    .cosmo-notif-dropdown {
        position: fixed;
        top: 50px;
        right: 12px;
        left: 12px;
        max-width: calc(100vw - 24px);
        max-height: 50vh;
        border-radius: 4px;
        z-index: 5000;
    }

    .cosmo-notif-item {
        padding: 10px;
        font-size: 11px;
        border-bottom: 1px solid #f0f0f0;
    }

    .cosmo-notif-item:last-child {
        border-bottom: none;
    }

    .cosmo-notif-item-title {
        font-weight: 600;
        margin-bottom: 4px;
    }

    .cosmo-notif-item-time {
        font-size: 10px;
        color: #999;
    }

    /* Tables */
    .cosmo-table {
        font-size: 11px;
        border-collapse: collapse;
    }

    .cosmo-table th,
    .cosmo-table td {
        padding: 8px 10px;
        text-align: left;
        border-bottom: 1px solid #e8e8e8;
    }

    .cosmo-table th {
        background: #fafaf8;
        font-weight: 600;
        font-size: 10px;
    }

    /* Ensure all touch targets are at least 44px */
    button,
    a[role="button"],
    .cosmo-cat-btn,
    .cosmo-lang-btn,
    .cosmo-reaction-btn,
    .cosmo-comment-like-btn {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Typography tweaks for readability */
    h1, h2, h3, h4, h5, h6 {
        word-break: break-word;
    }

    /* Ensure images and videos are responsive */
    img, video {
        max-width: 100%;
        height: auto;
        display: block;
    }

    /* Overflow handling */
    table {
        width: 100%;
        overflow-x: auto;
        display: block;
        border-collapse: collapse;
    }

    pre {
        overflow-x: auto;
        font-size: 11px;
        padding: 8px;
    }
}

/* ============================================================
   SAVE THE DATE — Events Widget (v2.7 — month tabs, 2-col grid)
   ============================================================ */

#cosmo-events-widget {
    margin: 0 0 40px;
    padding: 0;
    background: transparent;
    border: none;
}

#cosmo-events-widget-inner {
    display: flex;
    flex-direction: column;
}

/* ── Year label ── */
.cosmo-events-year-label {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 3px;
    color: #999;
    line-height: 1;
    margin-bottom: 10px;
}

/* ── Month filter tabs ── */
.cosmo-events-month-filter {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 2px;
    margin-bottom: 20px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.cosmo-events-month-filter::-webkit-scrollbar { display: none; }

.cosmo-events-month-tab {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 5px 9px;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #c0c0c0;
    cursor: pointer;
    border-radius: 2px;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
}
.cosmo-events-month-tab:hover { color: #888; }
.cosmo-events-month-tab.cosmo-events-month-active {
    color: #E87722;
    background: rgba(232, 119, 34, 0.08);
}

/* ── Carousel container ── */
.cosmo-events-grid-wrap { position: relative; }

.cosmo-events-carousel-wrap {
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.cosmo-events-carousel-viewport {
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

.cosmo-events-carousel-track {
    display: flex;
    transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    align-items: flex-start;
}

/* ── Nav arrows ── */
.cosmo-events-nav {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    padding: 0;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 26px;
    font-weight: 400;
    line-height: 32px;
    text-align: center;
    color: #E87722;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.15s ease, color 0.15s ease;
    margin-top: 16px;
    user-select: none;
    -webkit-user-select: none;
    opacity: 0.85;
}
.cosmo-events-nav:hover { opacity: 1; color: #c05a10; }
.cosmo-events-nav--prev:hover { transform: translateX(-2px); }
.cosmo-events-nav--next:hover { transform: translateX(2px); }
.cosmo-events-nav[style*="hidden"] { pointer-events: none; }

/* ── Event card — editorial, open feel ── */
.cosmo-events-carousel-viewport .cosmo-event-card {
    flex: 0 0 calc(33.333%);
    min-width: 0;
    box-sizing: border-box;
    padding: 0 24px 24px 0;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: background 0.18s ease;
}
.cosmo-events-carousel-viewport .cosmo-event-card:last-child {
    padding-right: 0;
}
.cosmo-events-carousel-viewport .cosmo-event-card:hover {
    background: rgba(0, 0, 0, 0.018);
}

/* ── Card inner: date column + content column ── */
.cosmo-event-card-inner {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

/* ── Editorial date block: month label above large day ── */
.cosmo-event-card-date-block {
    flex-shrink: 0;
    flex-basis: 46px;
    width: 46px;         /* fixed — all titles start at the same x position */
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 2px;
    padding-bottom: 16px; /* reserves space for the hint without layout shift */
    position: relative;
}

.cosmo-event-card-month-label {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: #E87722;
    line-height: 1;
    margin-bottom: 3px;
    display: block;
}

.cosmo-event-card-day-num {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 30px;
    font-weight: 300;
    color: #1a1a1a;
    line-height: 1;
    display: block;
    letter-spacing: -1px;
    white-space: nowrap;
}

/* Range (e.g. 17–20): scaled to match visual mass of a single day */
.cosmo-event-card-day-num--range {
    font-size: 20px;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

/* ── Hover micro-hint on date area ── */
.cosmo-event-card-hint {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 7px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #E87722;
    opacity: 0;
    transition: opacity 0.14s ease;
    pointer-events: none;
    line-height: 1;
}
.cosmo-event-card:hover .cosmo-event-card-hint { opacity: 0.6; }
.cosmo-event-card--open .cosmo-event-card-hint { opacity: 0; }

/* ── Card content column ── */
.cosmo-event-card-content {
    flex: 1;
    min-width: 0;
    padding-top: 3px;
}

.cosmo-event-card-title {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.35;
    margin-bottom: 4px;
}

.cosmo-event-card-meta {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 11px;
    color: #bbb;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Inline expand detail ── */
.cosmo-event-card-detail {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f4f4f4;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.cosmo-event-detail-row {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 12px;
    color: #555;
    margin-bottom: 4px;
    display: flex;
    gap: 8px;
}

.cosmo-event-detail-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #bbb;
    flex-shrink: 0;
    min-width: 56px;
}

.cosmo-event-detail-note {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 12px;
    color: #888;
    line-height: 1.55;
    margin-top: 6px;
    font-style: italic;
}

/* open state: left accent line on date block */
.cosmo-event-card--open .cosmo-event-card-month-label {
    color: #E87722;
}
.cosmo-event-card--open .cosmo-event-card-day-num {
    color: #E87722;
}

/* ── Empty month state ── */
.cosmo-events-empty {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 12px;
    color: #ccc;
    padding: 20px 0;
    text-align: center;
}

/* ── Mobile: 1-up carousel + swipe ── */
@media (max-width: 640px) {
    .cosmo-events-carousel-viewport .cosmo-event-card {
        flex: 0 0 100%;
        padding-right: 0;
    }
    .cosmo-events-nav {
        margin-top: 14px;
        width: 26px;
        font-size: 21px;
    }
    .cosmo-events-month-tab {
        padding: 5px 7px;
        font-size: 9px;
    }
}

/* ============================================================
   COMMENT POSTER BAR (replaces inline identity fields)
   ============================================================ */
.cosmo-comment-poster-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e8e8e8;
}

.cosmo-comment-poster-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cosmo-comment-poster-name {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
}

.cosmo-comment-poster-bu {
    font-size: 11px;
    color: #999;
    letter-spacing: 0.3px;
}

.cosmo-comment-edit-profile-btn {
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    padding: 4px 10px;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #888;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}
.cosmo-comment-edit-profile-btn:hover {
    border-color: #E87722;
    color: #E87722;
}

#cosmo-calendar-widget {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    padding: 16px;
    margin: 20px 0;
}

.cosmo-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8e8e8;
}

.cosmo-calendar-month-year {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}

.cosmo-calendar-nav-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    color: #E87722;
}

.cosmo-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.cosmo-calendar-weekday {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    padding: 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cosmo-calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
    background: #fafaf8;
    position: relative;
    cursor: default;
    min-height: 50px;
}

.cosmo-calendar-day--other-month {
    color: #ccc;
    background: #fff;
}

.cosmo-calendar-day--today {
    background: #f0f0f0;
    font-weight: 600;
    color: #1a1a1a;
}

.cosmo-calendar-day--has-event {
    background: #fff8f0;
    border-color: #E87722;
}

.cosmo-calendar-dot {
    width: 4px;
    height: 4px;
    background: #E87722;
    border-radius: 50%;
    position: absolute;
    bottom: 4px;
}

.cosmo-calendar-tooltip {
    display: none;
    position: absolute;
    background: #1a1a1a;
    color: #fff;
    padding: 6px 10px;
    border-radius: 3px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 100;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.cosmo-calendar-day:hover .cosmo-calendar-tooltip,
.cosmo-calendar-tooltip--visible {
    display: block;
}

/* Calendar day number */
.cosmo-calendar-day-num {
    font-size: 13px;
    line-height: 1;
}

@media (max-width: 768px) {
    #cosmo-calendar-widget {
        padding: 12px;
    }

    .cosmo-calendar-grid {
        gap: 6px;
    }

    .cosmo-calendar-day {
        min-height: 44px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    #cosmo-calendar-widget {
        padding: 8px;
    }

    .cosmo-calendar-grid {
        gap: 4px;
    }

    .cosmo-calendar-day {
        min-height: 40px;
        font-size: 10px;
    }

    .cosmo-calendar-weekday {
        padding: 4px 0;
        font-size: 9px;
    }
}

/* ============================================================
   ADMIN PASSWORD MODAL
   ============================================================ */
.cosmo-admin-auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cosmo-admin-auth-box {
    background: #fff;
    width: 100%;
    max-width: 380px;
    padding: 36px 36px 28px;
    box-shadow: 0 16px 60px rgba(0,0,0,0.18);
}

.cosmo-admin-auth-title {
    font-family: 'Canela', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 22px;
    font-weight: 300;
    letter-spacing: 2px;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.cosmo-admin-auth-sub {
    font-size: 13px;
    color: #888;
    margin-bottom: 20px;
    line-height: 1.5;
}

.cosmo-admin-auth-input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #e8e8e8;
    border-radius: 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #1a1a1a;
    background: #fafaf8;
    margin-bottom: 12px;
    outline: none;
    transition: border-color 0.18s, background 0.18s;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
}
.cosmo-admin-auth-input:focus {
    border-color: #E87722;
    background: #ffffff;
}
select.cosmo-admin-auth-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23aaa' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
}

.cosmo-admin-auth-error {
    font-size: 12px;
    color: #c0392b;
    margin-bottom: 14px;
    padding: 9px 12px;
    background: #fff5f5;
    border-left: 3px solid #c0392b;
    line-height: 1.4;
}

.cosmo-admin-auth-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
}

/* ============================================================
   ARTICLE GALLERY — Admin Editor
   ============================================================ */

.cosmo-gallery-admin-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    min-height: 24px;
}

.cosmo-gallery-admin-empty {
    font-size: 12px;
    color: #bbb;
    padding: 6px 0;
}

.cosmo-gallery-admin-thumb {
    position: relative;
    width: 82px;
    height: 82px;
    border-radius: 4px;
    overflow: hidden;
    border: 1.5px solid #e0e0e0;
    background: #f5f5f5;
    flex-shrink: 0;
}

.cosmo-gallery-admin-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cosmo-gallery-thumb-remove {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 22px;
    height: 22px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s;
}

.cosmo-gallery-thumb-remove:hover {
    background: #c0392b;
}

.cosmo-gallery-add-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #E87722;
    padding: 7px 14px;
    border: 1.5px dashed #E87722;
    border-radius: 4px;
    transition: background 0.15s;
    user-select: none;
}

.cosmo-gallery-add-label:hover {
    background: rgba(232,119,34,0.06);
}

/* ============================================================
   ARTICLE GALLERY — Frontend Display (editorial)
   ============================================================ */

.cosmo-gallery-section {
    margin: 40px 0 32px;
}

.cosmo-gallery-section-label {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #aaa;
    margin-bottom: 14px;
}

.cosmo-article-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

@media (max-width: 640px) {
    .cosmo-article-gallery {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

.cosmo-gallery-thumb {
    aspect-ratio: 4 / 3;
    border-radius: 2px;
    overflow: hidden;
    cursor: zoom-in;
    background: #f2f2f0;
    display: block;
    outline: none;
    border: 1px solid rgba(0,0,0,0.05);
}

.cosmo-gallery-thumb:focus-visible {
    box-shadow: 0 0 0 3px rgba(232,119,34,0.4);
}

.cosmo-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease, filter 0.35s ease;
}

.cosmo-gallery-thumb:hover img {
    transform: scale(1.04);
    filter: brightness(1.03);
}

/* ============================================================
   LIGHTBOX
   ============================================================ */

.cosmo-lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.88);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: cosmoLightboxIn 0.18s ease;
}

@keyframes cosmoLightboxIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.cosmo-lightbox-inner {
    position: relative;
    cursor: default;
    max-width: 90vw;
    max-height: 90vh;
}

.cosmo-lightbox-inner img {
    display: block;
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.cosmo-lightbox-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 30px;
    height: 30px;
    background: #fff;
    color: #333;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: background 0.15s;
}

.cosmo-lightbox-close:hover {
    background: #eee;
}

/* ============================================================
   MOBILE NAVIGATION — HAMBURGER MENU
   Added v3.1.0: replaces crammed header-right with a clean
   slide-down drawer at ≤768 px.  Desktop behaviour is unchanged.
   ============================================================ */

/* Hamburger trigger — hidden on desktop */
.cosmo-hamburger-btn {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    flex-shrink: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    transition: background 0.15s;
}
.cosmo-hamburger-btn:hover { background: #f5f5f3; }
.cosmo-hamburger-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: #2a2a2a;
    border-radius: 1px;
    transition: transform 0.22s ease, opacity 0.18s ease;
    transform-origin: center;
}
.cosmo-hamburger-btn.cosmo-menu-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.cosmo-hamburger-btn.cosmo-menu-open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.cosmo-hamburger-btn.cosmo-menu-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Overlay — transparent tap-to-close layer */
.cosmo-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 97;
}
.cosmo-menu-overlay.active { display: block; }

/* ── 768 px and below ── */
@media (max-width: 768px) {

    /* Show hamburger */
    .cosmo-hamburger-btn { display: flex; }

    /* Header: single row, no wrap — Logo | Search | Hamburger */
    .cosmo-header-inner {
        height: 56px !important;
        flex-wrap: nowrap !important;
        padding: 0 16px !important;
        gap: 10px !important;
    }

    /* Search: fills remaining space */
    .cosmo-search-wrap {
        flex: 1 1 auto !important;
        max-width: none !important;
        width: auto !important;
        order: 0 !important;
        min-height: 0;
    }
    .cosmo-search-input {
        padding: 7px 10px !important;
        font-size: 13px !important;
    }

    /* Logo: compact but legible */
    .cosmo-logo-cosmo  { font-size: 22px !important; }
    .cosmo-logo-sub    { font-size: 7px !important; letter-spacing: 2px !important; }

    /* Header-right: transforms into slide-down drawer */
    .cosmo-header-right {
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: #ffffff;
        border-top: 1px solid #f0f0f0;
        border-bottom: 2px solid #e8e8e8;
        box-shadow: 0 10px 28px rgba(0,0,0,0.12);
        padding: 12px 20px 20px;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin-left: 0;
        z-index: 98;
        /* Smooth reveal — invisible by default */
        display: flex;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-6px);
        transition: opacity 0.18s ease, transform 0.18s ease;
    }
    .cosmo-header-right.cosmo-mobile-menu-open {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    /* Language selector: full-width segmented control */
    .cosmo-header-right .cosmo-lang-selector {
        margin: 0 0 10px 0;
        padding: 0;
        border-radius: 4px;
        justify-content: stretch;
        border: 1.5px solid #e8e8e8;
        overflow: hidden;
        background: #fafaf8;
        margin-right: 0;
    }
    .cosmo-header-right .cosmo-lang-btn {
        flex: 1;
        text-align: center;
        padding: 10px 0;
        font-size: 11px;
        min-height: 40px;
        border-radius: 0;
        border-right: 1px solid #e8e8e8;
    }
    .cosmo-header-right .cosmo-lang-btn:last-child { border-right: none; }
    .cosmo-header-right .cosmo-lang-btn.active {
        background: #E87722;
        color: #fff;
        border-right-color: transparent;
    }

    /* Notification pill: full-width */
    .cosmo-header-right .cosmo-notif-indicator {
        width: 100%;
        padding: 10px 16px;
        text-align: center;
        border-radius: 4px;
        margin-bottom: 8px;
    }

    /* User menu: stacked column */
    .cosmo-header-right .cosmo-user-menu {
        flex-direction: column;
        align-items: stretch;
        padding: 0;
        border-left: none;
        gap: 8px;
    }
    .cosmo-header-right .cosmo-user-greeting {
        font-size: 14px;
        padding: 8px 0 2px;
        color: #1a1a1a;
        white-space: normal;
        font-weight: 600;
    }
    .cosmo-header-right .cosmo-logout-btn,
    .cosmo-header-right #cosmo-edit-profile-btn {
        display: block !important;
        width: 100%;
        padding: 11px 16px;
        text-align: center;
        font-size: 11px;
        min-height: 44px;
        border-radius: 2px;
    }

    /* Admin button: prominent full-width CTA */
    .cosmo-header-right .cosmo-admin-btn {
        display: block !important;
        width: 100%;
        padding: 13px 16px;
        text-align: center;
        font-size: 11px;
        letter-spacing: 1.5px;
        min-height: 44px;
        border-radius: 2px;
        margin-top: 4px;
    }

    /* Admin panel: near full-screen on tablet */
    .cosmo-admin-panel {
        width: 100% !important;
        max-width: 100% !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        display: flex;
        flex-direction: column;
    }
    .cosmo-admin-layout {
        flex: 1;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    .cosmo-admin-main {
        flex: 1 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        max-height: none !important;
        padding: 16px !important;
    }
    .cosmo-admin-sidebar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-shrink: 0;
    }
    .cosmo-admin-nav-item {
        min-width: 120px !important;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Banner bleed: matches 20px padding of .cosmo-main at this breakpoint */
    .cosmo-banner-section {
        width: calc(100% + 40px) !important;
        margin-left: -20px !important;
        margin-right: -20px !important;
    }

    /* Modal: full-width at tablet */
    .cosmo-modal {
        padding: 24px 20px;
        border-radius: 4px;
    }

    /* Category bar: touch-scroll without visible scrollbar */
    .cosmo-cat-bar {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .cosmo-cat-bar::-webkit-scrollbar { display: none; }

    /* Touch target improvements */
    .cosmo-cat-btn      { min-height: 40px; padding: 8px 16px; }
    .cosmo-reaction-btn { min-height: 44px; }
    .cosmo-comment-btn  { min-height: 44px; }
}

/* ── 480 px and below (phones in portrait) ── */
@media (max-width: 480px) {

    /* Header height */
    .cosmo-header-inner {
        height: 52px !important;
        padding: 0 12px !important;
        gap: 8px !important;
    }
    .cosmo-header-right { top: 52px; padding: 10px 16px 18px; }

    /* Logo: minimum size */
    .cosmo-logo-cosmo { font-size: 18px !important; }
    .cosmo-logo-sub   { font-size: 6px !important; }

    /* Search */
    .cosmo-search-input { font-size: 12px !important; padding: 6px 8px !important; }

    /* Admin button was previously hidden at 480px — now lives in drawer; keep that override gone */
    /* (it is shown via .cosmo-header-right .cosmo-admin-btn { display: block !important } above) */

    /* Main content padding */
    .cosmo-main { padding: 12px 12px 48px !important; }

    /* Banner bleed: matches 12px padding */
    .cosmo-banner-section {
        width: calc(100% + 24px) !important;
        margin-left: -12px !important;
        margin-right: -12px !important;
        height: 200px;
    }

    /* Events carousel: 1-up with clear arrows */
    .cosmo-events-nav { min-height: 44px; min-width: 44px; font-size: 22px; }

    /* Comments: comfortable reading */
    .cosmo-comment { border-left: 3px solid #E87722; }
    .cosmo-comment-input { min-height: 80px; font-size: 14px; }
    .cosmo-comment-btn { width: 100%; text-align: center; }

    /* Reaction bar: equal-width buttons */
    .cosmo-reaction-btn { flex: 1; min-height: 44px; padding: 8px 4px; }

    /* Article detail: comfortable reading width */
    .cosmo-detail-body { font-size: 15px; line-height: 1.7; }
    .cosmo-detail-title { font-size: 20px; line-height: 1.3; }

    /* Article gallery: 2-up instead of 1-up for a nicer layout */
    .cosmo-article-gallery { grid-template-columns: repeat(2, 1fr); gap: 5px; }

    /* Forms and modals */
    .cosmo-modal { padding: 20px 16px; }
    .cosmo-modal-actions { flex-direction: column; gap: 8px; }
    .cosmo-modal-actions button { width: 100%; min-height: 44px; }

    /* Comment poster bar: stack on very small screens */
    .cosmo-comment-poster-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
    .cosmo-comment-edit-profile-btn { align-self: flex-start; }

    /* Profile / identity modal inputs */
    .cosmo-id-field { min-height: 44px; font-size: 15px; }

    /* Quick-links: horizontal scroll, show 2 at a time */
    .cosmo-quick-links-inner { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .cosmo-resources-btn { min-height: 40px; }

    /* Admin: tighter padding */
    .cosmo-admin-header { padding: 12px 16px; }
    .cosmo-admin-header h1 { font-size: 16px; }
    .cosmo-close-admin { font-size: 18px; min-height: 40px; min-width: 44px; }
    .cosmo-form-input,
    .cosmo-form-textarea,
    .cosmo-form-select { font-size: 15px; min-height: 44px; }
    .cosmo-btn { min-height: 44px; padding: 10px 16px; }
    .cosmo-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .cosmo-stat-number { font-size: 26px; }
}

/* ── Prevent zoom on input focus (iOS) ── */
@media (max-width: 768px) {
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="search"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* ============================================================
   v3.1.1 MOBILE REFINEMENTS
   Three targeted fixes — desktop untouched.
   ============================================================ */

/* ── 1. FEATURED CARD — always shows text below image ─────── */

/*
 * Earlier breakpoints set .cosmo-featured { height: Xpx } on the
 * whole card, leaving zero room for the card-body text.
 * These rules clear that so the body expands naturally.
 */
@media (max-width: 900px) {
    .cosmo-article-card.cosmo-featured { height: auto; }
    .cosmo-article-card.cosmo-featured .cosmo-card-body {
        padding: 22px 24px 20px;
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .cosmo-featured                     { height: auto; }
    .cosmo-article-card.cosmo-featured  { height: auto; }
    .cosmo-article-card.cosmo-featured .cosmo-card-img-wrap { height: 220px; }
    .cosmo-article-card.cosmo-featured .cosmo-card-body {
        padding: 20px 20px 16px;
        justify-content: flex-start;
    }
    .cosmo-article-card.cosmo-featured .cosmo-card-cat {
        font-size: 10px;
        margin-bottom: 8px;
    }
    .cosmo-article-card.cosmo-featured .cosmo-card-title {
        font-size: 20px;
        line-height: 1.25;
        margin-bottom: 10px;
    }
    .cosmo-article-card.cosmo-featured .cosmo-card-excerpt {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: 13px;
    }
    .cosmo-article-card.cosmo-featured .cosmo-featured-badge {
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .cosmo-featured                    { height: auto; margin-bottom: 8px; }
    .cosmo-article-card.cosmo-featured { height: auto; }
    .cosmo-article-card.cosmo-featured .cosmo-card-img-wrap { height: 200px; }
    .cosmo-article-card.cosmo-featured .cosmo-card-body     { padding: 16px 16px 14px; }
    .cosmo-article-card.cosmo-featured .cosmo-card-title    { font-size: 18px; }
}

/* ── 2. PREMIUM FULL-SCREEN MOBILE MENU ────────────────────── */

/*
 * Override v3.1.0's position:absolute dropdown with a full-height
 * fixed panel that slides in from the right — feels native and calm.
 */
@media (max-width: 768px) {

    /* Panel: full-height, slide from right */
    .cosmo-header-right {
        position: fixed;
        top: 56px;
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        border: none;
        border-top: 3px solid #E87722;
        box-shadow: none;
        padding: 0;
        gap: 0;
        opacity: 1;                                          /* clear v3.1.0 fade */
        transform: translateX(100%);                         /* slide instead   */
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        pointer-events: none;
    }
    .cosmo-header-right.cosmo-mobile-menu-open {
        transform: translateX(0);
        pointer-events: auto;
    }

    /* Semi-dark overlay for depth */
    .cosmo-menu-overlay { background: rgba(0,0,0,0.42); }

    /* Re-order sections: greeting → lang → notif → admin */
    .cosmo-header-right .cosmo-user-menu        { order: 1; }
    .cosmo-header-right .cosmo-lang-selector    { order: 2; }
    .cosmo-header-right .cosmo-notif-indicator  { order: 3; }
    .cosmo-header-right .cosmo-admin-btn        { order: 4; }

    /* Greeting section — warm background, generous padding */
    .cosmo-header-right .cosmo-user-menu {
        background: #f7f4f0;
        padding: 28px 28px 24px;
        border-bottom: 1px solid #e8e8e8;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        border-left: none;
    }
    .cosmo-header-right .cosmo-user-greeting {
        font-family: 'Canela', Helvetica, Arial, sans-serif;
        font-weight: 300;
        font-size: 26px;
        letter-spacing: -0.3px;
        color: #1a1a1a;
        padding: 0;
        white-space: normal;
        line-height: 1.2;
    }
    /* Small ghost buttons for Edit Profile & Logout inside greeting area */
    .cosmo-header-right #cosmo-edit-profile-btn.cosmo-logout-btn,
    .cosmo-header-right #cosmo-logout-btn.cosmo-logout-btn {
        display: inline-flex !important;
        align-items: center;
        width: auto;
        padding: 8px 16px;
        font-size: 10px;
        letter-spacing: 1px;
        min-height: 36px;
        border-radius: 2px;
        border: 1px solid #d0d0d0;
        color: #666;
        text-align: center;
    }
    .cosmo-header-right #cosmo-logout-btn.cosmo-logout-btn { color: #999; }

    /* Language selector — section padding, pill style */
    .cosmo-header-right .cosmo-lang-selector {
        margin: 28px 28px 0;
        padding: 0;
        width: calc(100% - 56px);
        border-radius: 4px;
        border: 1.5px solid #e0e0e0;
        overflow: hidden;
        background: #fafaf8;
        margin-right: 28px;
        flex-shrink: 0;
    }
    .cosmo-header-right .cosmo-lang-btn {
        flex: 1;
        text-align: center;
        padding: 12px 0;
        font-size: 11px;
        letter-spacing: 1.5px;
        min-height: 46px;
        border-radius: 0;
        border-right: 1px solid #e0e0e0;
    }
    .cosmo-header-right .cosmo-lang-btn:last-child { border-right: none; }
    .cosmo-header-right .cosmo-lang-btn.active {
        background: #E87722;
        color: #fff;
        border-right-color: transparent;
    }

    /* Notification pill */
    .cosmo-header-right .cosmo-notif-indicator {
        margin: 16px 28px 0;
        width: calc(100% - 56px);
        padding: 12px 20px;
        text-align: center;
        border-radius: 4px;
    }

    /* Admin — large primary CTA */
    .cosmo-header-right .cosmo-admin-btn {
        display: block !important;
        margin: 24px 28px 0;
        width: calc(100% - 56px);
        padding: 16px 20px;
        text-align: center;
        font-size: 11px;
        letter-spacing: 2px;
        min-height: 52px;
        border-radius: 2px;
    }

    /* Breathing room at the bottom */
    .cosmo-header-right::after {
        content: '';
        display: block;
        height: 40px;
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .cosmo-header-right { top: 52px; }
    .cosmo-header-right .cosmo-user-menu    { padding: 24px 20px 20px; }
    .cosmo-header-right .cosmo-lang-selector,
    .cosmo-header-right .cosmo-notif-indicator,
    .cosmo-header-right .cosmo-admin-btn {
        margin-left: 20px;
        margin-right: 20px;
        width: calc(100% - 40px);
    }
    .cosmo-header-right .cosmo-user-greeting { font-size: 22px; }
    .cosmo-header-right .cosmo-admin-btn     { margin-top: 20px; }
}

/* ── 3. CATEGORY BAR — pill tabs, sticky, elegant ──────────── */

@media (max-width: 768px) {
    /* Stick the cat bar just below the header */
    .cosmo-cat-bar {
        position: sticky;
        top: 56px;
        z-index: 90;
        background: #fff;
        border-bottom: 1px solid #ebebeb;
        padding: 0 16px;
    }
    .cosmo-cat-bar-inner {
        gap: 6px;
        padding: 10px 0;
        overflow-x: auto;
        scroll-behavior: smooth;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .cosmo-cat-bar-inner::-webkit-scrollbar { display: none; }

    /* Pill-style tabs — more readable and distinctive */
    .cosmo-cat-btn {
        font-size: 11px !important;
        font-weight: 700;
        letter-spacing: 1.2px !important;
        padding: 8px 18px !important;
        min-height: 36px !important;
        border-radius: 20px !important;
        border: 1.5px solid #e0e0e0 !important;
        border-bottom: 1.5px solid #e0e0e0 !important;  /* override underline style */
        background: transparent !important;
        color: #777 !important;
        white-space: nowrap;
        flex-shrink: 0;
        transition: background 0.15s, color 0.15s, border-color 0.15s !important;
    }
    .cosmo-cat-btn.active {
        background: #E87722 !important;
        color: #fff !important;
        border-color: #E87722 !important;
    }
    .cosmo-cat-btn:hover:not(.active) {
        background: #fdf3ec !important;
        color: #E87722 !important;
        border-color: #f0c09a !important;
    }
}

@media (max-width: 480px) {
    .cosmo-cat-bar { top: 52px; padding: 0 12px; }
    .cosmo-cat-btn {
        font-size: 10px !important;
        padding: 7px 14px !important;
        min-height: 34px !important;
    }
}


/* ============================================================
   v3.1.2 — EDITORIAL FULL-SCREEN MOBILE NAV
   ============================================================ */

/* ── Base: hidden on desktop ── */
.cosmo-mobile-nav,
.cosmo-mobile-nav-overlay {
    display: none;
}

@media (max-width: 768px) {

    /* ── Hide the old header-right on mobile entirely ── */
    .cosmo-header-right {
        display: none !important;
    }

    /* ── Overlay (darkens background) ── */
    .cosmo-mobile-nav-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.35);
        z-index: 1100;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.30s ease;
    }
    .cosmo-mobile-nav-overlay.cosmo-mnav-open {
        opacity: 1;
        pointer-events: auto;
    }

    /* ── Panel ── */
    .cosmo-mobile-nav {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 88vw;
        max-width: 360px;
        background: #ffffff;
        z-index: 1200;
        transform: translateX(100%);
        transition: transform 0.30s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0 0 env(safe-area-inset-bottom, 0);
    }
    .cosmo-mobile-nav.cosmo-mnav-open {
        transform: translateX(0);
    }

    /* ── Top bar: close button ── */
    .cosmo-mobile-nav-top {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        padding: 20px 24px 8px;
        flex-shrink: 0;
    }
    .cosmo-mobile-nav-close-btn {
        display: flex;
        align-items: center;
        gap: 6px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 8px 0;
        min-height: 44px;
        color: #999;
        transition: color 0.15s;
    }
    .cosmo-mobile-nav-close-btn:hover {
        color: #1a1a1a;
    }
    .cosmo-mobile-nav-close-text {
        font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
        font-size: 11px;
        letter-spacing: 2px;
        text-transform: uppercase;
        color: inherit;
    }
    .cosmo-mobile-nav-close-x {
        font-size: 22px;
        line-height: 1;
        color: inherit;
        font-weight: 300;
    }

    /* ── Category nav items (Canela editorial style) ── */
    .cosmo-mobile-nav-cats {
        flex: 1;
        display: flex;
        flex-direction: column;
        padding: 12px 28px 24px;
        gap: 0;
    }
    .cosmo-mobile-nav-cat-item {
        display: block;
        width: 100%;
        background: none;
        border: none;
        border-bottom: 1px solid #f0f0ee;
        padding: 18px 0;
        text-align: left;
        font-family: 'Canela', 'Helvetica Neue', Helvetica, Arial, sans-serif;
        font-weight: 300;
        font-size: 28px;
        letter-spacing: 0.5px;
        color: #1a1a1a;
        cursor: pointer;
        transition: color 0.15s;
        line-height: 1.1;
    }
    .cosmo-mobile-nav-cat-item:first-child {
        border-top: 1px solid #f0f0ee;
    }
    .cosmo-mobile-nav-cat-item:hover,
    .cosmo-mobile-nav-cat-item.active {
        color: #E87722;
    }
    .cosmo-mobile-nav-cat-item.active {
        font-weight: 300;
    }

    /* ── Footer area ── */
    .cosmo-mobile-nav-footer {
        flex-shrink: 0;
        padding: 0 28px 28px;
        display: flex;
        flex-direction: column;
        gap: 20px;
        border-top: 1px solid #f0f0ee;
        padding-top: 24px;
    }

    /* ── Search row ── */
    .cosmo-mobile-nav-search-row {
        position: relative;
        display: flex;
        align-items: center;
    }
    .cosmo-mobile-nav-search {
        width: 100%;
        border: none;
        border-bottom: 1.5px solid #ddd;
        border-radius: 0;
        padding: 8px 32px 8px 0;
        font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
        font-size: 14px;
        color: #1a1a1a;
        background: transparent;
        outline: none;
        transition: border-color 0.15s;
        -webkit-appearance: none;
    }
    .cosmo-mobile-nav-search::placeholder {
        color: #bbb;
        font-size: 13px;
        letter-spacing: 0.5px;
    }
    .cosmo-mobile-nav-search:focus {
        border-bottom-color: #E87722;
    }
    .cosmo-mobile-nav-search-icon {
        position: absolute;
        right: 0;
        font-size: 18px;
        color: #bbb;
        pointer-events: none;
        line-height: 1;
    }

    /* ── Greeting ── */
    .cosmo-mobile-nav-meta {
        min-height: 0;
    }
    .cosmo-mobile-nav-greeting {
        font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
        font-size: 11px;
        letter-spacing: 1.5px;
        text-transform: uppercase;
        color: #aaa;
        display: block;
    }

    /* ── Action links (Log Out, Edit Profile, Admin) ── */
    .cosmo-mobile-nav-actions {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    .cosmo-mobile-nav-link {
        display: block;
        background: none;
        border: none;
        padding: 0;
        text-align: left;
        font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
        font-size: 11px;
        letter-spacing: 2px;
        text-transform: uppercase;
        color: #888;
        cursor: pointer;
        min-height: 44px;
        display: flex;
        align-items: center;
        transition: color 0.15s;
    }
    .cosmo-mobile-nav-link:hover {
        color: #1a1a1a;
    }
    .cosmo-mobile-nav-admin {
        display: block;
        background: none;
        border: 1.5px solid #E87722;
        border-radius: 2px;
        padding: 10px 16px;
        text-align: left;
        font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
        font-size: 10px;
        letter-spacing: 2px;
        text-transform: uppercase;
        color: #E87722;
        cursor: pointer;
        transition: background 0.15s, color 0.15s;
        align-self: flex-start;
    }
    .cosmo-mobile-nav-admin:hover {
        background: #E87722;
        color: #fff;
    }

    /* ── Lang switcher ── */
    .cosmo-mobile-nav-lang {
        display: flex;
        gap: 12px;
    }
    .cosmo-mobile-nav-lang-btn {
        background: none;
        border: none;
        padding: 0;
        font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
        font-size: 11px;
        letter-spacing: 2px;
        color: #bbb;
        cursor: pointer;
        transition: color 0.15s;
        min-height: 36px;
    }
    .cosmo-mobile-nav-lang-btn.active {
        color: #1a1a1a;
        font-weight: 600;
    }
    .cosmo-mobile-nav-lang-btn:hover:not(.active) {
        color: #E87722;
    }

} /* end @media (max-width: 768px) */

/* ── Prevent background scroll when nav is open ── */
body.cosmo-mnav-body-lock {
    overflow: hidden;
    position: fixed;
    width: 100%;
}


/* ============================================================
   v3.1.3 — POLISH MICRO-ADJUSTMENTS
   ============================================================ */

/* ── 1. Hide header search icon on mobile ── */
@media (max-width: 768px) {
    .cosmo-search-icon {
        display: none !important;
    }
}

/* ── 2. Lang selector moved to top of mobile nav ── */
@media (max-width: 768px) {
    /* Top bar: lang left, close right */
    .cosmo-mobile-nav-top {
        justify-content: space-between;
        align-items: center;
        padding: 18px 24px 10px;
    }
    .cosmo-mobile-nav-top .cosmo-mobile-nav-lang {
        display: flex;
        gap: 14px;
    }
    /* Remove the footer lang block (it's now at top — block kept hidden via no footer .cosmo-mobile-nav-lang) */
    .cosmo-mobile-nav-footer .cosmo-mobile-nav-lang {
        display: none;
    }
}
