/* =================================================================
   Author Profile Pro v1.0 — Public CSS
   Bell in nav | Author box | Author page | Widget | Integrations
   ================================================================= */

:root {
    --app-red:        #e53e3e;
    --app-red-dark:   #c53030;
    --app-red-light:  #fed7d7;
    --app-text:       #2d3748;
    --app-muted:      #718096;
    --app-bg:         #ffffff;
    --app-bg-alt:     #f7fafc;
    --app-border:     #e2e8f0;
    --app-radius:     12px;
    --app-radius-sm:  6px;
    --app-shadow:     0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
    --app-shadow-lg:  0 10px 30px rgba(0,0,0,.13);
    --app-ease:       .2s ease;
}

/* =================================================================
   NOTIFICATION BELL
   Positioned as <li> inside nav menu UL — right next to burger/menu
   On mobile: fixed top-right, visually between burger and search
   ================================================================= */

/* The <li> container */
.app-bell-nav-item {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    vertical-align: middle;
}

/* Bell button */
.app-bell-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    transition: background var(--app-ease);
    -webkit-tap-highlight-color: transparent;
    outline: none;
}
.app-bell-btn:hover,
.app-bell-btn:focus-visible { background: rgba(0,0,0,.07); }

.app-bell-btn svg {
    width: 22px;
    height: 22px;
    display: block;
    pointer-events: none;
    transition: stroke var(--app-ease);
}
/* Grey = no notifications */
.app-bell-btn.app-bell-inactive svg { stroke: #9ca3af; fill: none; }
/* Dark = has notifications */
.app-bell-btn.app-bell-active svg   { stroke: var(--app-text); fill: none; }

/* Red badge */
.app-bell-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--app-red);
    color: #fff;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 0 0 2px var(--app-bg);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-style: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* =================================================================
   BELL PANEL — dropdown panel
   Desktop: drops below button
   Mobile: positioned to stay within viewport
   ================================================================= */
.app-bell-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    max-height: 420px;
    background: var(--app-bg);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow-lg);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 99999;
}
.app-bell-panel::before {
    content: '';
    position: absolute;
    top: -7px;
    right: 12px;
    width: 12px;
    height: 12px;
    background: var(--app-bg);
    border-left: 1px solid var(--app-border);
    border-top: 1px solid var(--app-border);
    transform: rotate(45deg);
    z-index: 1;
}
.app-bell-panel.app-open { display: flex; }

.app-bell-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 15px 11px;
    border-bottom: 1px solid var(--app-border);
    font-weight: 700;
    font-size: .88rem;
    color: var(--app-text);
    flex-shrink: 0;
    background: var(--app-bg);
    position: relative;
    z-index: 2;
}
.app-mark-read {
    font-size: .72rem;
    color: var(--app-red);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-weight: 600;
    font-family: inherit;
}
.app-mark-read:hover { text-decoration: underline; }

.app-bell-list { overflow-y: auto; flex: 1; }

.app-notif-item {
    display: flex;
    gap: 10px;
    padding: 10px 13px;
    cursor: pointer;
    transition: background .15s;
    text-decoration: none !important;
    color: var(--app-text) !important;
    border-bottom: 1px solid var(--app-border);
}
.app-notif-item:last-child { border-bottom: none; }
.app-notif-item:hover   { background: var(--app-bg-alt); }
.app-notif-item.app-unread { background: #fff5f5; }

.app-notif-thumb {
    width: 42px; height: 42px; min-width: 42px;
    border-radius: var(--app-radius-sm);
    object-fit: cover;
    background: var(--app-bg-alt);
    display: block;
}
.app-notif-body    { flex: 1; min-width: 0; }
.app-notif-author  { font-size: .71rem; font-weight: 700; color: var(--app-red); margin-bottom: 2px; }
.app-notif-title   { font-size: .82rem; color: var(--app-text); font-weight: 600; line-height: 1.35;
                     white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.app-notif-date    { font-size: .7rem; color: var(--app-muted); }
.app-unread-dot    { width: 7px; height: 7px; min-width: 7px; border-radius: 50%; background: var(--app-red); margin-top: 6px; flex-shrink: 0; }
.app-no-notif      { text-align: center; padding: 26px 16px; color: var(--app-muted); font-size: .87rem; margin: 0 !important; }

/* =================================================================
   FLOATING FALLBACK BELL (for themes without wp_nav_menu)
   Fixed position top-right near header area
   ================================================================= */
#app-bell-float {
    position: fixed;
    top: 12px;
    right: 16px;
    z-index: 9998;
}
#app-bell-float .app-bell-btn {
    width: 40px;
    height: 40px;
    background: var(--app-bg);
    border: 1px solid var(--app-border);
    border-radius: 50%;
    box-shadow: var(--app-shadow);
}
#app-bell-float .app-bell-btn.app-bell-active {
    border-color: var(--app-red-light);
    box-shadow: 0 0 0 3px var(--app-red-light);
}
#app-bell-float .app-bell-panel {
    top: calc(100% + 8px);
    right: 0;
}
#app-bell-float .app-bell-badge { box-shadow: 0 0 0 2px var(--app-bg); }

/* Mobile: panel always fits screen */
@media (max-width: 600px) {
    .app-bell-panel {
        /* Pin to right edge of screen, never overflow left */
        position: fixed !important;
        top: 58px !important;
        right: 8px !important;
        left: 8px !important;
        width: auto !important;
        max-height: 70vh !important;
        /* hide arrow on mobile since position changes */
    }
    .app-bell-panel::before { display: none; }

    /* Float bell on mobile */
    #app-bell-float { top: 10px; right: 10px; }
}

/* =================================================================
   SOCIAL LINKS
   ================================================================= */
.app-social-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.app-social {
    display: flex; align-items: center; justify-content: center;
    width: 30px; height: 30px;
    border-radius: var(--app-radius-sm);
    background: var(--app-bg);
    border: 1px solid var(--app-border);
    color: var(--app-muted);
    transition: var(--app-ease);
    text-decoration: none !important;
    flex-shrink: 0;
}
.app-social svg { width: 14px; height: 14px; flex-shrink: 0; }
.app-social:hover                   { background: var(--app-red); border-color: var(--app-red); color: #fff; }
.app-social.app-social-twitter:hover  { background: #000; border-color: #000; }
.app-social.app-social-facebook:hover { background: #1877f2; border-color: #1877f2; }
.app-social.app-social-instagram:hover{ background: linear-gradient(135deg,#e1306c,#f77737); border-color:transparent; }
.app-social.app-social-linkedin:hover { background: #0a66c2; border-color: #0a66c2; }
.app-social.app-social-youtube:hover  { background: #ff0000; border-color: #ff0000; }
.app-social.app-social-telegram:hover { background: #2ca5e0; border-color: #2ca5e0; }
.app-social.app-social-rss            { color: #f26522; border-color: #f2652240; }
.app-social.app-social-rss:hover      { background: #f26522; border-color: #f26522; color: #fff; }

/* =================================================================
   SUBSCRIBE BUTTON
   ================================================================= */
.app-sub-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 17px;
    background: var(--app-red);
    color: #fff !important;
    border: none;
    border-radius: 50px;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--app-ease);
    text-decoration: none !important;
    white-space: nowrap;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}
.app-sub-btn:hover          { background: var(--app-red-dark); transform: translateY(-1px); box-shadow: var(--app-shadow); }
.app-sub-btn.app-subscribed { background: #48bb78; }
.app-sub-btn.app-subscribed:hover { background: #38a169; }
.app-sub-btn.app-loading    { opacity: .65; pointer-events: none; }
.app-sub-btn svg,.app-sub-icon { width: 15px; height: 15px; flex-shrink: 0; display: inline-flex; }

/* Small variant for widget */
.app-sub-btn-sm {
    width: 32px; height: 32px; padding: 0;
    border-radius: 50%; justify-content: center; flex-shrink: 0;
}
.app-sub-btn-sm svg { width: 15px; height: 15px; }

.app-sub-btn-lg { padding: 11px 24px; font-size: .95rem; }

/* =================================================================
   AUTHOR BOX (under post content)
   ================================================================= */
.app-author-box {
    background: var(--app-bg-alt);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    padding: 20px 22px;
    margin: 36px 0 22px;
    box-sizing: border-box;
}
.app-author-box-inner { display: flex; gap: 16px; align-items: flex-start; }
.app-box-avatar-wrap { flex-shrink: 0; }
.app-box-avatar-wrap img,.app-box-avatar-wrap .app-avatar {
    width: 76px !important; height: 76px !important;
    border-radius: 50%; object-fit: cover; display: block;
    border: 3px solid var(--app-red-light);
}
.app-box-info { flex: 1; min-width: 0; }
.app-box-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-bottom: 7px; }
.app-box-name { margin: 0 0 2px !important; font-size: 1rem !important; font-weight: 700 !important; line-height: 1.3 !important; }
.app-box-name a { color: var(--app-text) !important; text-decoration: none !important; }
.app-box-name a:hover { color: var(--app-red) !important; }
.app-box-title { display: block; font-size: .78rem; color: var(--app-muted); font-style: italic; }
.app-box-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.app-stat { display: flex; align-items: center; gap: 4px; font-size: .78rem; color: var(--app-muted); }
.app-stat svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--app-red); }
.app-box-bio { font-size: .86rem; color: var(--app-muted); margin: 5px 0 12px !important; line-height: 1.6; }
.app-box-footer { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* =================================================================
   AUTHOR PAGE — HERO (uses theme colors, not hardcoded red)
   ================================================================= */
.app-author-page { max-width: 1100px; margin: 0 auto; padding: 0 16px 60px; box-sizing: border-box; }

.app-author-hero {
    /* Use theme's primary color via currentColor, fallback to neutral */
    background: var(--wp--preset--color--primary,
                var(--color-primary,
                var(--primary-color,
                var(--theme-color,
                #2d3748))));
    border-radius: var(--app-radius);
    padding: 34px 38px;
    margin-bottom: 30px;
    color: #fff;
    /* If theme sets a dark background, lighten the overlay */
    position: relative;
    overflow: hidden;
}
/* Subtle pattern overlay for depth */
.app-author-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.08) 0%, rgba(0,0,0,.08) 100%);
    pointer-events: none;
}
.app-author-hero > * { position: relative; z-index: 1; }

.app-author-hero-inner { display: flex; gap: 24px; align-items: flex-start; }

/* Avatar */
.app-hero-avatar-block { position: relative; flex-shrink: 0; }
.app-hero-avatar-block img,.app-author-page-avatar {
    width: 108px !important; height: 108px !important;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,.35) !important;
    object-fit: cover; display: block;
}
.app-avatar-cam-btn {
    position: absolute; bottom: 2px; right: 2px;
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(0,0,0,.6); border: 2px solid #fff;
    color: #fff; display: flex; align-items: center; justify-content: center;
    cursor: pointer; padding: 0; transition: var(--app-ease);
}
.app-avatar-cam-btn:hover { background: rgba(0,0,0,.85); }
.app-avatar-cam-btn svg { width: 13px; height: 13px; pointer-events: none; }
#app-avatar-input { display: none; }
.app-avatar-loading {
    position: absolute; inset: 0; border-radius: 50%;
    background: rgba(0,0,0,.5); display: none; align-items: center; justify-content: center;
}
.app-avatar-loading.on { display: flex; }
.app-avatar-loading::after {
    content: ''; width: 22px; height: 22px;
    border: 3px solid rgba(255,255,255,.3); border-top-color: #fff;
    border-radius: 50%; animation: app-spin .7s linear infinite;
}
@keyframes app-spin { to { transform: rotate(360deg); } }

.app-hero-info { flex: 1; min-width: 0; }
.app-hero-name { margin: 0 0 4px !important; font-size: 1.65rem !important; font-weight: 800 !important; color: #fff !important; line-height: 1.2 !important; }
.app-hero-title { font-size: .93rem; opacity: .88; margin: 0 0 4px !important; color: rgba(255,255,255,.9); }
.app-hero-expertise { font-size: .82rem; opacity: .8; margin: 0 0 14px !important; color: rgba(255,255,255,.85); }

.app-hero-stats { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.app-hero-stat {
    display: flex; flex-direction: column; align-items: center;
    background: rgba(255,255,255,.14); border-radius: 8px;
    padding: 8px 14px; min-width: 66px;
}
.app-hero-stat-num   { font-size: 1.35rem; font-weight: 800; color: #fff; line-height: 1; }
.app-hero-stat-label { font-size: .67rem; opacity: .82; text-transform: uppercase; letter-spacing: .4px; color: rgba(255,255,255,.85); margin-top: 2px; text-align: center; }

.app-hero-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 13px; align-items: center; }

/* myCred badge in hero */
.app-mycred-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px;
    background: rgba(246,224,94,.2); border: 1.5px solid rgba(246,224,94,.5);
    border-radius: 50px; color: #fff; font-size: .83rem; font-weight: 700;
}
.app-mycred-badge svg { width: 15px; height: 15px; flex-shrink: 0; }

/* Edit + RSS */
.app-hero-edit-btn,.app-rss-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 17px;
    background: rgba(255,255,255,.17); color: #fff !important;
    border: 1.5px solid rgba(255,255,255,.38);
    border-radius: 50px; font-size: .84rem; font-weight: 600;
    cursor: pointer; transition: var(--app-ease);
    text-decoration: none !important; font-family: inherit;
}
.app-hero-edit-btn:hover { background: rgba(255,255,255,.28); }
.app-rss-btn { border-color: rgba(242,101,34,.6); background: rgba(242,101,34,.18); }
.app-rss-btn:hover { background: rgba(242,101,34,.36); }
.app-hero-edit-btn svg,.app-rss-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Social row in hero */
.app-hero-socials { margin-top: 3px; }
.app-hero-socials .app-social { background: rgba(255,255,255,.17); border-color: rgba(255,255,255,.28); color: #fff; }
.app-hero-socials .app-social:hover { background: rgba(255,255,255,.36); }
.app-hero-socials .app-social.app-social-rss { border-color: rgba(242,101,34,.5); }

/* Bio in hero */
.app-hero-bio {
    margin-top: 15px; padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,.18);
    font-size: .89rem; color: rgba(255,255,255,.9); line-height: 1.7;
}
.app-hero-bio p { margin: 0; }

/* =================================================================
   EDIT PROFILE PANEL
   ================================================================= */
.app-edit-panel {
    background: var(--app-bg); border: 2px solid var(--app-red-light);
    border-radius: var(--app-radius); padding: 24px 28px;
    margin-bottom: 26px; box-shadow: var(--app-shadow-lg); display: none;
}
.app-edit-panel.on { display: block; }
.app-edit-panel h2 { margin: 0 0 18px !important; font-size: 1.05rem !important; font-weight: 700 !important; color: var(--app-text) !important; }

.app-avatar-section { display: flex; align-items: center; gap: 16px; padding: 13px 15px; background: var(--app-bg-alt); border-radius: var(--app-radius-sm); margin-bottom: 18px; border: 1px solid var(--app-border); }
.app-avatar-section img { width: 68px !important; height: 68px !important; border-radius: 50%; object-fit: cover; border: 3px solid var(--app-red-light); display: block; }
.app-avatar-btns { display: flex; flex-direction: column; gap: 7px; }
.app-avatar-btns-row { display: flex; gap: 7px; flex-wrap: wrap; }
.app-upload-btn,.app-remove-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 12px; border-radius: 5px; font-size: .79rem; font-weight: 600;
    cursor: pointer; border: none; transition: var(--app-ease); font-family: inherit;
}
.app-upload-btn { background: var(--app-red); color: #fff; }
.app-upload-btn:hover { background: var(--app-red-dark); }
.app-remove-btn { background: var(--app-bg-alt); color: var(--app-muted); border: 1px solid var(--app-border); }
.app-remove-btn:hover { background: #fed7d7; color: #9b2c2c; border-color: #fc8181; }
.app-upload-btn svg,.app-remove-btn svg { width: 12px; height: 12px; }
.app-avatar-hint { font-size: .72rem; color: var(--app-muted); margin: 0; }

.app-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.app-form-full { grid-column: 1 / -1; }
.app-form-group { display: flex; flex-direction: column; gap: 4px; }
.app-form-group label { font-size: .79rem; font-weight: 600; color: var(--app-text); }
.app-form-group input,.app-form-group textarea {
    padding: 8px 11px; border: 1px solid var(--app-border);
    border-radius: var(--app-radius-sm);
    font-size: .86rem; font-family: inherit; color: var(--app-text);
    background: var(--app-bg); transition: var(--app-ease);
    width: 100%; box-sizing: border-box;
}
.app-form-group input:focus,.app-form-group textarea:focus { outline: none; border-color: var(--app-red); box-shadow: 0 0 0 3px var(--app-red-light); }
.app-form-group textarea { resize: vertical; min-height: 85px; }
.app-form-section-head { grid-column: 1/-1; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--app-muted); margin: 3px 0 0; padding-top: 11px; border-top: 1px solid var(--app-border); }
.app-form-actions { display: flex; gap: 9px; margin-top: 16px; flex-wrap: wrap; }
.app-save-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 21px; background: var(--app-red); color: #fff; border: none; border-radius: 50px; font-size: .86rem; font-weight: 600; cursor: pointer; transition: var(--app-ease); font-family: inherit; }
.app-save-btn:hover { background: var(--app-red-dark); }
.app-save-btn svg { width: 14px; height: 14px; }
.app-cancel-btn { padding: 9px 21px; background: transparent; color: var(--app-muted); border: 1px solid var(--app-border); border-radius: 50px; font-size: .86rem; cursor: pointer; transition: var(--app-ease); font-family: inherit; }
.app-cancel-btn:hover { background: var(--app-bg-alt); }
.app-form-msg { margin-top: 10px; padding: 9px 13px; border-radius: var(--app-radius-sm); font-size: .84rem; display: none; }
.app-form-msg.ok  { background: #c6f6d5; color: #276749; }
.app-form-msg.err { background: #fed7d7; color: #9b2c2c; }

/* =================================================================
   AUTHOR PAGE BODY & POSTS
   ================================================================= */
.app-page-body { display: flex; flex-direction: column; gap: 32px; }
.app-section-title { font-size: 1.12rem !important; font-weight: 700 !important; margin: 0 0 15px !important; padding-bottom: 9px; border-bottom: 2px solid var(--app-red-light); color: var(--app-text) !important; }
.app-bio-content { line-height: 1.8; color: var(--app-text); font-size: .94rem; }

.app-posts-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(275px,1fr)); gap: 18px; }
.app-post-card { background: var(--app-bg); border: 1px solid var(--app-border); border-radius: var(--app-radius); overflow: hidden; transition: var(--app-ease); box-shadow: var(--app-shadow); }
.app-post-card:hover { transform: translateY(-3px); box-shadow: var(--app-shadow-lg); }
.app-post-thumb { overflow: hidden; aspect-ratio: 16/9; background: var(--app-bg-alt); }
.app-post-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; display: block; }
.app-post-card:hover .app-post-thumb img { transform: scale(1.04); }
.app-post-body { padding: 12px 14px 14px; }
.app-post-cat { display: inline-block; background: var(--app-red-light); color: var(--app-red-dark); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; padding: 2px 7px; border-radius: 3px; margin-bottom: 6px; }
.app-post-title { font-size: .92rem !important; font-weight: 700 !important; margin: 0 0 5px !important; line-height: 1.4 !important; }
.app-post-title a { color: var(--app-text) !important; text-decoration: none !important; }
.app-post-title a:hover { color: var(--app-red) !important; }
.app-post-meta { font-size: .75rem; color: var(--app-muted); margin-bottom: 7px; }
.app-post-excerpt { font-size: .82rem; color: var(--app-muted); line-height: 1.6; margin: 0 0 9px !important; }
.app-read-more { font-size: .8rem; font-weight: 600; color: var(--app-red) !important; text-decoration: none !important; }
.app-read-more:hover { text-decoration: underline !important; }

.app-pagination { display: flex; justify-content: center; gap: 6px; margin-top: 24px; flex-wrap: wrap; }
.app-pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 6px; border: 1px solid var(--app-border); font-size: .84rem; color: var(--app-text); text-decoration: none; transition: var(--app-ease); }
.app-pagination .page-numbers.current { background: var(--app-red); color: #fff; border-color: var(--app-red); }
.app-pagination .page-numbers:hover   { background: var(--app-bg-alt); }
.app-no-posts { color: var(--app-muted); font-style: italic; }

/* =================================================================
   INTEGRATIONS
   ================================================================= */
/* myCred */
.app-mycred-block { background: linear-gradient(135deg,#fffbeb,#fef3c7); border: 1px solid #f6e05e; border-radius: var(--app-radius); padding: 16px 20px; display: flex; align-items: center; gap: 14px; }
.app-mycred-icon { font-size: 2rem; flex-shrink: 0; }
.app-mycred-details { flex: 1; }
.app-mycred-label { font-size: .71rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #92400e; opacity: .75; margin-bottom: 1px; }
.app-mycred-value { font-size: 1.45rem; font-weight: 800; color: #92400e; line-height: 1; }
.app-mycred-type  { font-size: .78rem; color: #92400e; opacity: .7; margin-top: 2px; }

/* Multiple point types row */
.app-mycred-row   { display: flex; gap: 12px; flex-wrap: wrap; }
.app-mycred-row .app-mycred-block { flex: 1; min-width: 160px; }

/* Directorist */
.app-listings-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(250px,1fr)); gap: 16px; }
.app-listing-card { background: var(--app-bg); border: 1px solid var(--app-border); border-radius: var(--app-radius); overflow: hidden; transition: var(--app-ease); box-shadow: var(--app-shadow); text-decoration: none !important; display: block; color: var(--app-text) !important; }
.app-listing-card:hover { transform: translateY(-2px); box-shadow: var(--app-shadow-lg); }
.app-listing-thumb { aspect-ratio: 16/9; background: var(--app-bg-alt); overflow: hidden; }
.app-listing-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.app-listing-body { padding: 11px 13px 13px; }
.app-listing-cat  { font-size: .68rem; font-weight: 700; text-transform: uppercase; color: var(--app-red); margin-bottom: 3px; }
.app-listing-name { font-size: .89rem; font-weight: 700; margin: 0 0 5px; line-height: 1.35; }
.app-listing-loc  { font-size: .75rem; color: var(--app-muted); display: flex; align-items: center; gap: 3px; }
.app-listing-loc svg { width: 11px; height: 11px; }
.app-listing-rating { font-size: .75rem; color: #d97706; font-weight: 600; display: flex; align-items: center; gap: 3px; margin-top: 3px; }
.app-listing-rating svg { width: 12px; height: 12px; fill: #d97706; }

/* =================================================================
   TOP AUTHORS WIDGET
   ================================================================= */
.app-top-authors-list { list-style: none; margin: 0; padding: 0; }
.app-tw-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--app-border); }
.app-tw-item:last-child { border-bottom: none; }

.app-tw-rank { width: 20px; text-align: center; font-size: .78rem; font-weight: 700; color: var(--app-muted); flex-shrink: 0; }
.app-tw-item:nth-child(1) .app-tw-rank { color: #d97706; }
.app-tw-item:nth-child(2) .app-tw-rank { color: #6b7280; }
.app-tw-item:nth-child(3) .app-tw-rank { color: #92400e; }

.app-tw-avatar-link { flex-shrink: 0; }
.app-tw-avatar-link img,.app-tw-avatar {
    width: 40px !important; height: 40px !important;
    border-radius: 50%; object-fit: cover; display: block;
    border: 2px solid var(--app-red-light);
}
.app-tw-info  { flex: 1; min-width: 0; }
.app-tw-name  { font-size: .85rem; font-weight: 700; color: var(--app-text) !important; text-decoration: none !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.app-tw-name:hover { color: var(--app-red) !important; }
.app-tw-job   { font-size: .72rem; color: var(--app-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.app-tw-count { font-size: .72rem; color: var(--app-muted); display: flex; align-items: center; gap: 3px; margin-top: 2px; }
.app-tw-count svg { width: 11px; height: 11px; color: var(--app-red); }

/* =================================================================
   RESPONSIVE
   ================================================================= */
@media (max-width: 900px) { .app-posts-grid,.app-listings-grid { grid-template-columns: repeat(2,1fr); } }

@media (max-width: 768px) {
    .app-author-box { padding: 13px 15px; }
    .app-author-box-inner { flex-direction: column; gap: 11px; }
    .app-box-avatar-wrap img { width: 62px !important; height: 62px !important; }
    .app-box-header { flex-direction: column; gap: 5px; }
    .app-author-hero { padding: 20px 16px; border-radius: 8px; }
    .app-author-hero-inner { flex-direction: column; gap: 14px; align-items: center; text-align: center; }
    .app-hero-avatar-block img { width: 86px !important; height: 86px !important; }
    .app-hero-name { font-size: 1.35rem !important; }
    .app-hero-stats,.app-hero-actions { justify-content: center; }
    .app-hero-socials { justify-content: center; }
    .app-form-grid { grid-template-columns: 1fr; }
    .app-edit-panel { padding: 16px 14px; }
    .app-avatar-section { flex-direction: column; align-items: flex-start; }
    .app-posts-grid,.app-listings-grid { grid-template-columns: 1fr; }
    .app-mycred-row { flex-direction: column; }
}

@media (max-width: 480px) {
    .app-author-page { padding: 0 10px 40px; }
    .app-author-hero { border-radius: 0; margin-left: -10px; margin-right: -10px; }
}

/* =================================================================
   DARK MODE SUPPORT
   ================================================================= */
@media (prefers-color-scheme: dark) {
    :root {
        --app-text:   #f7fafc;
        --app-muted:  #a0aec0;
        --app-bg:     #1a202c;
        --app-bg-alt: #2d3748;
        --app-border: #4a5568;
    }
    .app-bell-badge { box-shadow: 0 0 0 2px #1a202c; }
    .app-bell-panel::before { background: #1a202c; }
    .app-bell-btn.app-bell-inactive svg { stroke: #6b7280; }
    .app-bell-btn.app-bell-active svg   { stroke: #e2e8f0; }
    #app-bell-float .app-bell-btn { background: #2d3748; border-color: #4a5568; }
}
