/*
 * DIY Solar Forum v0.5.0 Beta 2
 * Professional UI layer
 */

:root {
    --ui-bg: #f3f6f4;
    --ui-surface: #ffffff;
    --ui-surface-soft: #f8faf9;
    --ui-surface-strong: #edf3ef;
    --ui-text: #14211a;
    --ui-muted: #64716a;
    --ui-border: #dde6e0;
    --ui-primary: var(--solar-green, #0f5132);
    --ui-primary-dark: color-mix(in srgb, var(--ui-primary) 80%, #000 20%);
    --ui-accent: #f4b400;
    --ui-success-soft: #e9f7ef;
    --ui-warning-soft: #fff7dc;
    --ui-danger-soft: #fff0f1;
    --ui-radius-sm: .7rem;
    --ui-radius: 1rem;
    --ui-radius-lg: 1.4rem;
    --ui-shadow-sm: 0 1px 2px rgba(17, 39, 27, .04), 0 8px 24px rgba(17, 39, 27, .055);
    --ui-shadow-md: 0 12px 34px rgba(17, 39, 27, .09);
    --ui-shadow-lg: 0 22px 60px rgba(6, 31, 18, .18);
    --ui-nav-height: 72px;
}

[data-bs-theme="dark"] {
    --ui-bg: #0d1511;
    --ui-surface: #131e18;
    --ui-surface-soft: #17241c;
    --ui-surface-strong: #1d2c23;
    --ui-text: #edf4ef;
    --ui-muted: #9eaaa3;
    --ui-border: #2b3d32;
    --ui-primary-dark: color-mix(in srgb, var(--ui-primary) 76%, #000 24%);
    --ui-success-soft: #143322;
    --ui-warning-soft: #332c14;
    --ui-danger-soft: #351a1d;
    --ui-shadow-sm: 0 1px 2px rgba(0, 0, 0, .14), 0 8px 26px rgba(0, 0, 0, .16);
    --ui-shadow-md: 0 14px 36px rgba(0, 0, 0, .24);
    --ui-shadow-lg: 0 24px 64px rgba(0, 0, 0, .35);
}

html { scroll-padding-top: calc(var(--ui-nav-height) + 1rem); }
body {
    background:
        radial-gradient(circle at 8% -10%, color-mix(in srgb, var(--ui-primary) 8%, transparent), transparent 26rem),
        var(--ui-bg);
    color: var(--ui-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: .96rem;
    letter-spacing: -.005em;
}

a { text-underline-offset: .18em; }

.app-shell { min-height: calc(100vh - 250px); }
.app-container { max-width: 1360px; }

/* Navigation */
.solar-navbar {
    min-height: var(--ui-nav-height);
    background: rgba(8, 45, 28, .96);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 8px 30px rgba(4, 24, 14, .16) !important;
    backdrop-filter: blur(18px);
    z-index: 1045;
}

.navbar-brand { min-width: max-content; }
.brand-mark-pro {
    width: 2.55rem;
    height: 2.55rem;
    display: grid;
    place-items: center;
    border-radius: .82rem;
    background: linear-gradient(145deg, #ffd35c, #f4a900);
    color: #163a26;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65), 0 8px 20px rgba(244, 180, 0, .22);
    font-size: 1.25rem;
}

.brand-logo-pro {
    display: block;
    width: auto;
    max-width: 13rem;
    height: 2.75rem;
    object-fit: contain;
    object-position: left center;
}

.branding-preview-box {
    min-height: 11rem;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(15, 81, 50, .08), rgba(244, 180, 0, .08));
    overflow: hidden;
}
.branding-preview-header { max-width: 100%; max-height: 5.5rem; object-fit: contain; }
.branding-preview-square { width: 8rem; height: 8rem; object-fit: contain; border-radius: 1.25rem; }
.branding-preview-social { width: 100%; max-width: 24rem; aspect-ratio: 1200 / 630; object-fit: contain; border-radius: .8rem; }
.branding-preview-email { max-width: 12rem; max-height: 6rem; object-fit: contain; }

.brand-copy { line-height: 1.05; }
.brand-copy strong { display: block; font-size: .98rem; letter-spacing: -.015em; }
.brand-copy small { display: block; margin-top: .2rem; color: rgba(255, 255, 255, .62); font-size: .68rem; font-weight: 500; }

.primary-nav { gap: .15rem; }
.primary-nav .nav-link {
    display: flex;
    align-items: center;
    gap: .42rem;
    padding: .62rem .78rem !important;
    border-radius: .72rem;
    color: rgba(255, 255, 255, .72);
    font-size: .88rem;
    font-weight: 650;
    transition: color .18s ease, background-color .18s ease, transform .18s ease;
}
.primary-nav .nav-link:hover,
.primary-nav .nav-link:focus,
.primary-nav .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, .11);
}
.primary-nav .nav-link.active { box-shadow: inset 0 -2px 0 #f4b400; }

.nav-search-pro { width: clamp(190px, 20vw, 300px); }
.nav-search-pro .input-group {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: .78rem;
    background: rgba(255, 255, 255, .08);
}
.nav-search-pro .input-group-text,
.nav-search-pro .form-control {
    border: 0;
    background: transparent;
    color: #fff;
}
.nav-search-pro .form-control { box-shadow: none; }
.nav-search-pro .form-control::placeholder { color: rgba(255, 255, 255, .52); }

.nav-icon-button {
    position: relative;
    width: 2.45rem;
    height: 2.45rem;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: .75rem;
    color: rgba(255, 255, 255, .82);
    background: rgba(255, 255, 255, .07);
    text-decoration: none;
    transition: background-color .18s ease, color .18s ease, transform .18s ease;
}
.nav-icon-button:hover { color: #fff; background: rgba(255, 255, 255, .13); transform: translateY(-1px); }
.nav-icon-badge {
    position: absolute;
    top: -.33rem;
    right: -.33rem;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 .25rem;
    display: grid;
    place-items: center;
    border: 2px solid #0a321f;
    border-radius: 999px;
    background: #f4b400;
    color: #18251d;
    font-size: .61rem;
    font-weight: 800;
}

.user-menu-button {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .32rem .55rem .32rem .34rem;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: .8rem;
    color: #fff;
    background: rgba(255, 255, 255, .07);
}
.user-menu-button:hover,
.user-menu-button.show { color: #fff; background: rgba(255, 255, 255, .13); }
.nav-user-avatar {
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: .62rem;
    background: linear-gradient(145deg, #f8ca43, #f2a800);
    color: #153320;
    font-weight: 850;
}
.nav-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-dropdown { width: min(320px, 92vw); padding: .6rem; border: 1px solid var(--ui-border); border-radius: 1rem; box-shadow: var(--ui-shadow-lg); }
.user-dropdown .dropdown-item { padding: .65rem .75rem; border-radius: .62rem; }

/* Shared surfaces */
.card,
.forum-list,
.list-group-item,
.dropdown-menu,
.modal-content,
.offcanvas {
    --bs-card-bg: var(--ui-surface);
    --bs-list-group-bg: var(--ui-surface);
}
.card { border-color: var(--ui-border); }
.shadow-sm { box-shadow: var(--ui-shadow-sm) !important; }
.rounded-4 { border-radius: var(--ui-radius) !important; }

.pro-card {
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-shadow-sm);
}
.section-kicker {
    color: var(--ui-primary);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}
.section-title { letter-spacing: -.035em; }
.section-subtitle { color: var(--ui-muted); }

.btn {
    --bs-btn-border-radius: .72rem;
    font-weight: 650;
}
.btn-solar {
    --bs-btn-bg: var(--ui-primary);
    --bs-btn-border-color: var(--ui-primary);
    --bs-btn-hover-bg: var(--ui-primary-dark);
    --bs-btn-hover-border-color: var(--ui-primary-dark);
    --bs-btn-active-bg: var(--ui-primary-dark);
    box-shadow: 0 7px 18px color-mix(in srgb, var(--ui-primary) 22%, transparent);
}
.form-control,
.form-select,
.input-group-text {
    border-color: var(--ui-border);
    border-radius: .75rem;
}
.form-control:focus,
.form-select:focus {
    border-color: color-mix(in srgb, var(--ui-primary) 58%, #fff 42%);
    box-shadow: 0 0 0 .23rem color-mix(in srgb, var(--ui-primary) 15%, transparent);
}

.alert { border: 1px solid color-mix(in srgb, currentColor 18%, transparent); border-radius: .9rem; }
.breadcrumb-shell {
    display: inline-flex;
    max-width: 100%;
    padding: .38rem .68rem;
    border: 1px solid var(--ui-border);
    border-radius: 999px;
    background: color-mix(in srgb, var(--ui-surface) 90%, transparent);
    box-shadow: 0 4px 14px rgba(17, 39, 27, .035);
}
.breadcrumb { flex-wrap: nowrap; overflow: hidden; }
.breadcrumb-item { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumb-item a { color: var(--ui-muted); text-decoration: none; }

/* Homepage */
.hero-pro {
    position: relative;
    overflow: hidden;
    padding: clamp(1.7rem, 4vw, 4.4rem);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: var(--ui-radius-lg);
    color: #fff;
    background:
        radial-gradient(circle at 88% 14%, rgba(255, 211, 92, .28), transparent 23rem),
        radial-gradient(circle at 60% 120%, rgba(89, 190, 130, .22), transparent 25rem),
        linear-gradient(125deg, #07341f 0%, #0d5835 52%, #0b4229 100%);
    box-shadow: var(--ui-shadow-lg);
}
.hero-pro::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: .14;
    background-image:
        linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
    background-size: 38px 38px;
    mask-image: linear-gradient(90deg, #000, transparent 82%);
}
.hero-content { position: relative; z-index: 1; }
.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .48rem;
    padding: .42rem .72rem;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 999px;
    background: rgba(255,255,255,.09);
    color: rgba(255,255,255,.9);
    font-size: .76rem;
    font-weight: 750;
}
.hero-pro h1 { max-width: 780px; font-size: clamp(2.15rem, 5vw, 4.35rem); line-height: .99; letter-spacing: -.055em; }
.hero-pro .lead { max-width: 720px; color: rgba(255,255,255,.76); font-size: clamp(1rem, 1.6vw, 1.22rem); }
.hero-benefit { display: inline-flex; align-items: center; gap: .42rem; color: rgba(255,255,255,.72); font-size: .86rem; }
.hero-benefit i { color: #ffd35c; }
.hero-stat-panel {
    position: relative;
    z-index: 1;
    padding: 1.1rem;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 1.2rem;
    background: rgba(255,255,255,.09);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
    backdrop-filter: blur(14px);
}
.hero-stat-item { padding: 1rem; border-radius: .9rem; background: rgba(5, 32, 18, .24); }
.hero-stat-item strong { display: block; font-size: 1.65rem; letter-spacing: -.04em; }
.hero-stat-item span { color: rgba(255,255,255,.63); font-size: .76rem; }

.quick-action-card {
    display: flex;
    align-items: center;
    gap: .9rem;
    min-height: 86px;
    padding: 1rem 1.05rem;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    background: var(--ui-surface);
    color: inherit;
    text-decoration: none;
    box-shadow: var(--ui-shadow-sm);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.quick-action-card:hover { color: inherit; transform: translateY(-3px); border-color: color-mix(in srgb, var(--ui-primary) 30%, var(--ui-border)); box-shadow: var(--ui-shadow-md); }
.quick-action-icon {
    flex: 0 0 auto;
    width: 2.75rem;
    height: 2.75rem;
    display: grid;
    place-items: center;
    border-radius: .86rem;
    color: var(--ui-primary);
    background: color-mix(in srgb, var(--ui-primary) 10%, var(--ui-surface));
    font-size: 1.2rem;
}
.quick-action-card strong { display: block; }
.quick-action-card small { color: var(--ui-muted); }

.category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.category-card {
    position: relative;
    display: flex;
    gap: 1rem;
    min-height: 132px;
    padding: 1.2rem;
    overflow: hidden;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    background: var(--ui-surface);
    color: inherit;
    text-decoration: none;
    box-shadow: var(--ui-shadow-sm);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.category-card::after {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    right: -75px;
    bottom: -78px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--ui-primary) 7%, transparent);
}
.category-card:hover { color: inherit; transform: translateY(-3px); border-color: color-mix(in srgb, var(--ui-primary) 32%, var(--ui-border)); box-shadow: var(--ui-shadow-md); }
.category-card-icon {
    flex: 0 0 auto;
    width: 3.15rem;
    height: 3.15rem;
    display: grid;
    place-items: center;
    border-radius: .95rem;
    background: color-mix(in srgb, var(--ui-primary) 10%, var(--ui-surface));
    color: var(--ui-primary);
    font-size: 1.35rem;
}
.category-card h3 { letter-spacing: -.018em; }
.category-card p { color: var(--ui-muted); }
.category-card-meta { display: inline-flex; align-items: center; gap: .35rem; color: var(--ui-muted); font-size: .76rem; }
.category-card-arrow { position: absolute; right: 1rem; top: 1rem; color: var(--ui-muted); }

.recent-pro-card {
    top: calc(var(--ui-nav-height) + 1rem);
    z-index: 1;
}
.recent-topic-item {
    display: grid;
    grid-template-columns: 2.2rem minmax(0, 1fr);
    gap: .75rem;
    padding: .85rem 0;
    border-bottom: 1px solid var(--ui-border);
}
.recent-topic-item:last-child { border-bottom: 0; }
.recent-topic-index {
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    border-radius: .65rem;
    background: var(--ui-surface-soft);
    color: var(--ui-primary);
    font-size: .75rem;
    font-weight: 800;
}

/* Forum pages */
.page-hero {
    padding: clamp(1.2rem, 2.5vw, 2rem);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    background:
        radial-gradient(circle at 94% 0, color-mix(in srgb, var(--ui-primary) 10%, transparent), transparent 18rem),
        var(--ui-surface);
    box-shadow: var(--ui-shadow-sm);
}
.page-hero-icon {
    width: 3.4rem;
    height: 3.4rem;
    display: grid;
    place-items: center;
    border-radius: 1rem;
    background: color-mix(in srgb, var(--ui-primary) 11%, var(--ui-surface));
    color: var(--ui-primary);
    font-size: 1.45rem;
}

.topic-list-pro { overflow: hidden; border: 1px solid var(--ui-border); border-radius: var(--ui-radius); background: var(--ui-surface); box-shadow: var(--ui-shadow-sm); }
.topic-row-pro {
    display: grid;
    grid-template-columns: 3rem minmax(0, 1fr) 9.5rem;
    gap: 1rem;
    align-items: center;
    padding: 1.05rem 1.15rem;
    border-bottom: 1px solid var(--ui-border);
    color: inherit;
    text-decoration: none;
    transition: background-color .16s ease;
}
.topic-row-pro:last-child { border-bottom: 0; }
.topic-row-pro:hover { color: inherit; background: var(--ui-surface-soft); }
.topic-row-pro.is-unread { box-shadow: inset 3px 0 0 var(--ui-accent); }
.topic-state-pro {
    width: 2.65rem;
    height: 2.65rem;
    display: grid;
    place-items: center;
    border-radius: .82rem;
    background: var(--ui-surface-strong);
    color: var(--ui-primary);
    font-size: 1.05rem;
}
.topic-row-title { font-size: .98rem; font-weight: 760; letter-spacing: -.014em; }
.topic-row-meta { color: var(--ui-muted); font-size: .76rem; }
.topic-row-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; text-align: center; }
.topic-row-stat { padding: .48rem .35rem; border-radius: .65rem; background: var(--ui-surface-soft); }
.topic-row-stat strong { display: block; line-height: 1; }
.topic-row-stat small { color: var(--ui-muted); font-size: .65rem; }

.topic-header { border: 1px solid var(--ui-border) !important; background: var(--ui-surface); box-shadow: var(--ui-shadow-sm) !important; }
.topic-header h1 { letter-spacing: -.035em; }
.post-card { border: 1px solid var(--ui-border) !important; box-shadow: var(--ui-shadow-sm) !important; }
.post-card:hover { box-shadow: var(--ui-shadow-md) !important; }
.post-author { background: var(--ui-surface-soft) !important; border-color: var(--ui-border) !important; }
.post-meta { background: color-mix(in srgb, var(--ui-surface-soft) 74%, transparent); }
.post-body { padding-top: 1.4rem !important; padding-bottom: 1.5rem !important; font-size: .97rem; }
.post-actions { background: color-mix(in srgb, var(--ui-surface-soft) 72%, transparent); }
.post-actions .btn { font-size: .76rem; }

/* Auth */
.auth-shell { max-width: 620px; }
.auth-shell .card { border: 1px solid var(--ui-border) !important; box-shadow: var(--ui-shadow-md) !important; }
.auth-icon {
    width: 4.4rem;
    height: 4.4rem;
    border-radius: 1.2rem;
    background: linear-gradient(145deg, color-mix(in srgb, var(--ui-primary) 14%, var(--ui-surface)), var(--ui-surface));
    box-shadow: inset 0 0 0 1px var(--ui-border);
}

/* Admin */
.admin-action,
.settings-nav,
.health-score-ring,
.table-responsive {
    border-color: var(--ui-border);
}
.admin-action { border: 1px solid var(--ui-border) !important; box-shadow: var(--ui-shadow-sm) !important; }
.admin-action:hover { box-shadow: var(--ui-shadow-md) !important; }
.table { --bs-table-bg: transparent; }
.table thead th { color: var(--ui-muted); font-size: .7rem; letter-spacing: .055em; text-transform: uppercase; }

/* Footer */
.site-footer-pro {
    margin-top: 4.5rem;
    border-top: 1px solid rgba(255,255,255,.08);
    background: #071e13;
    color: rgba(255,255,255,.72);
}
.footer-brand-icon {
    width: 2.45rem;
    height: 2.45rem;
    display: grid;
    place-items: center;
    border-radius: .8rem;
    background: rgba(255,255,255,.08);
    color: #ffd35c;
}
.site-footer-pro a { color: rgba(255,255,255,.7); text-decoration: none; }
.site-footer-pro a:hover { color: #fff; }

/* Mobile app navigation */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    left: .65rem;
    right: .65rem;
    bottom: .65rem;
    z-index: 1035;
    grid-template-columns: repeat(4, 1fr);
    padding: .38rem;
    border: 1px solid var(--ui-border);
    border-radius: 1.05rem;
    background: color-mix(in srgb, var(--ui-surface) 94%, transparent);
    box-shadow: var(--ui-shadow-lg);
    backdrop-filter: blur(18px);
}
.mobile-bottom-nav a {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .12rem;
    padding: .42rem .25rem;
    border-radius: .72rem;
    color: var(--ui-muted);
    text-decoration: none;
    font-size: .65rem;
    font-weight: 700;
}
.mobile-bottom-nav a.active { color: var(--ui-primary); background: color-mix(in srgb, var(--ui-primary) 9%, transparent); }
.mobile-bottom-nav i { font-size: 1.08rem; }
.mobile-nav-badge { position: absolute; top: .18rem; right: calc(50% - 1.1rem); width: .46rem; height: .46rem; border-radius: 50%; background: #dc3545; }

@media (max-width: 1199.98px) {
    .primary-nav .nav-link { padding-inline: .6rem !important; }
    .nav-search-pro { width: 210px; }
}

@media (max-width: 991.98px) {
    :root { --ui-nav-height: 64px; }
    .desktop-nav-content { display: none !important; }
    .mobile-bottom-nav { display: grid; }
    body { padding-bottom: 5.4rem; }
    .mobile-reply-button { bottom: 5.65rem; }
    .app-container { padding-left: .8rem; padding-right: .8rem; }
    .category-grid { grid-template-columns: 1fr; }
    .recent-pro-card { position: static !important; }
}

@media (max-width: 767.98px) {
    body { font-size: .93rem; }
    .hero-pro { border-radius: 1.1rem; }
    .hero-pro h1 { font-size: clamp(2rem, 11vw, 3rem); }
    .hero-stat-panel { margin-top: .4rem; }
    .quick-actions-grid { display: grid !important; grid-template-columns: 1fr 1fr; }
    .quick-action-card { min-height: 104px; align-items: flex-start; flex-direction: column; gap: .55rem; }
    .category-card { min-height: 145px; }
    .topic-row-pro { grid-template-columns: 2.6rem minmax(0, 1fr); padding: .95rem .85rem; }
    .topic-row-stats { display: none; }
    .page-hero { border-radius: 1rem; }
    .post-card { border-radius: .9rem !important; }
    .post-body { font-size: .94rem; }
    .post-actions .btn { padding: .35rem .5rem; }
    .breadcrumb-shell { max-width: calc(100vw - 1.6rem); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

body.ui-width-standard .app-container { max-width: 1180px; }
body.ui-nav-compact { --ui-nav-height: 62px; }
body.ui-nav-compact .solar-navbar { min-height: 62px; }
body.ui-nav-compact .brand-mark-pro { width: 2.25rem; height: 2.25rem; }
body.ui-nav-compact .primary-nav .nav-link { padding-top: .48rem !important; padding-bottom: .48rem !important; }

/* Alpha 10 — Discovery, advanced search, PWA and activity center */
.advanced-search-panel > summary {
    list-style: none;
    cursor: pointer;
}
.advanced-search-panel > summary::-webkit-details-marker { display: none; }
.advanced-search-panel[open] > summary { background: color-mix(in srgb, var(--solar-green) 10%, transparent); border-color: color-mix(in srgb, var(--solar-green) 35%, transparent); }
.discovery-shortcut { transition: transform .18s ease, box-shadow .18s ease; }
.discovery-shortcut:hover { transform: translateY(-3px); box-shadow: 0 1rem 2rem rgba(22, 55, 38, .12) !important; }
.discovery-tabs { position: relative; }
.discovery-tabs .d-flex { scrollbar-width: thin; }
.topic-discovery-card { transition: border-color .18s ease, transform .18s ease; }
.topic-discovery-card:hover { transform: translateY(-2px); box-shadow: 0 .9rem 2rem rgba(22,55,38,.11) !important; }
.topic-metrics { min-width: 245px; }
.topic-metrics > div { min-width: 70px; }
.topic-metrics strong { display: block; font-size: 1.05rem; color: var(--bs-emphasis-color); }
.topic-metrics span { display: block; font-size: .7rem; color: var(--bs-secondary-color); text-transform: uppercase; letter-spacing: .03em; }
.activity-icon { width: 2.5rem; height: 2.5rem; border-radius: .85rem; display: grid; place-items: center; flex: 0 0 auto; color: var(--solar-green); background: color-mix(in srgb, var(--solar-green) 10%, var(--bs-body-bg)); border: 1px solid color-mix(in srgb, var(--solar-green) 18%, var(--bs-border-color)); }
.activity-icon-unread { color: #fff; background: var(--solar-green); border-color: var(--solar-green); }
.notification-entry { border-left: .3rem solid transparent !important; }
.notification-entry.notification-unread { border-left-color: var(--solar-yellow) !important; background: color-mix(in srgb, var(--solar-yellow) 10%, var(--bs-body-bg)); }
.notification-entry:hover .notification-view-button,
.notification-entry:focus-visible .notification-view-button { color: #fff; background: var(--solar-green); border-color: var(--solar-green); }
.notification-entry:focus-visible { position: relative; z-index: 1; outline: .2rem solid color-mix(in srgb, var(--solar-green) 35%, transparent); outline-offset: -.2rem; }
@media (max-width: 575.98px) { .notification-entry time { font-size: .72rem; } .notification-view-button { width: 100%; } }
.offline-page .solar-navbar, .offline-page .mobile-bottom-nav { display: none !important; }
.offline-state { margin-top: 10vh !important; }
[data-pwa-install] { color: rgba(255,255,255,.72) !important; text-decoration: none; }
[data-pwa-install]:hover { color: #fff !important; }

@media (max-width: 991.98px) {
    .topic-metrics { min-width: 0; border-top: 1px solid var(--bs-border-color); padding-top: .85rem; justify-content: space-around; }
    .topic-metrics > div { flex: 1; }
    .advanced-search-panel .card-body { padding: 1rem !important; }
}

@media (prefers-reduced-motion: reduce) {
    .discovery-shortcut, .topic-discovery-card { transition: none; }
    .discovery-shortcut:hover, .topic-discovery-card:hover { transform: none; }
}


/* Desktop navigation correction */
@media (min-width: 992px) {
    .solar-navbar > .container-fluid {
        flex-wrap: nowrap;
    }

    .desktop-nav-content {
        display: flex !important;
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
    }

    .primary-nav {
        display: flex;
        flex-direction: row !important;
        align-items: center;
        flex-wrap: nowrap;
    }

    .primary-nav .nav-item {
        flex: 0 0 auto;
    }

    .solar-navbar .navbar-toggler {
        display: none !important;
    }
}

/* Beta 2 Hotfix 1 — unified inline media editor */
.editor-media-hint {
    padding: .55rem .7rem;
    border: 1px dashed color-mix(in srgb, var(--ui-primary) 28%, var(--ui-border));
    border-radius: .7rem;
    background: color-mix(in srgb, var(--ui-primary) 5%, var(--ui-surface));
}

.editor-upload-preview {
    position: relative;
}

.editor-upload-preview::after {
    content: '✓';
    position: absolute;
    right: -.25rem;
    bottom: -.25rem;
    width: 1.15rem;
    height: 1.15rem;
    display: grid;
    place-items: center;
    border: 2px solid var(--ui-surface);
    border-radius: 50%;
    background: var(--ui-primary);
    color: #fff;
    font-size: .62rem;
    font-weight: 800;
}

@media (max-width: 575.98px) {
    .editor-toolbox .bbcode-toolbar {
        display: flex;
        width: 100%;
        gap: .25rem;
    }

    .editor-toolbox .bbcode-toolbar .btn {
        border-radius: .45rem !important;
    }
}

/* Beta 2 Hotfix 2 — post edit image management */
.editor-inline-image-manager {
    padding: 1rem;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    background: var(--ui-surface-soft);
}
.editor-inline-image-grid,
.edit-attachment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: .85rem;
}
.editor-inline-image-card,
.edit-attachment-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--ui-border);
    border-radius: .9rem;
    background: var(--ui-surface);
    box-shadow: 0 5px 18px rgba(17, 39, 27, .05);
}
.editor-inline-image-thumb,
.edit-attachment-thumb {
    display: block;
    width: 100%;
    height: 145px;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-bottom: 1px solid var(--ui-border);
    background: var(--ui-surface-strong);
}
.editor-inline-image-thumb img,
.edit-attachment-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .18s ease;
}
.editor-inline-image-thumb:hover img,
.edit-attachment-thumb:hover img { transform: scale(1.025); }
.editor-inline-image-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
    padding: .75rem;
}
.edit-attachment-card {
    display: block;
    padding-bottom: .8rem;
    cursor: pointer;
}
.edit-attachment-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: .7rem .8rem 0;
}
.edit-attachment-meta small { color: var(--ui-muted); }
.edit-attachment-card .form-check { margin: .25rem .8rem 0; }
.edit-attachment-card:has(.form-check-input:checked) {
    border-color: color-mix(in srgb, #dc3545 48%, var(--ui-border));
    background: color-mix(in srgb, #dc3545 5%, var(--ui-surface));
}
.edit-attachment-card:has(.form-check-input:checked) img { opacity: .55; filter: grayscale(.5); }

@media (max-width: 575.98px) {
    .editor-inline-image-grid,
    .edit-attachment-grid { grid-template-columns: 1fr 1fr; gap: .6rem; }
    .editor-inline-image-thumb,
    .edit-attachment-thumb { height: 120px; }
    .editor-inline-image-footer { align-items: stretch; flex-direction: column; }
    .editor-inline-image-footer .btn { width: 100%; }
}

/* v0.5.0.5 — compact legacy post rendering */
.post-content .post-body {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 1.62 !important;
}
.post-body > br:first-child,
.post-body > br:last-child { display: none; }
.post-body .guest-media-lock {
    margin-top: .9rem !important;
    margin-bottom: .9rem !important;
    padding: 1rem 1.25rem !important;
}
.post-body .forum-inline-image-link,
.post-body .forum-video-wrap {
    margin-top: .9rem !important;
    margin-bottom: .9rem !important;
}
.post-body .forum-list-bbcode {
    margin-top: .45rem;
    margin-bottom: .85rem;
}

/* v0.5.0.8 — πιστή και καθαρή εμφάνιση legacy HTML */
.post-body > p,
.post-body .p1,
.post-body .p2,
.post-body .p3,
.post-body .p4,
.post-body .p5 {
    margin: 0 0 .9rem;
    line-height: 1.68;
}
.post-body > h2 { margin: 1.65rem 0 .7rem; line-height: 1.25; }
.post-body > h3 { margin: 1.25rem 0 .5rem; line-height: 1.3; }
.post-body > hr { margin: .75rem 0; opacity: .18; }
.post-body > ul,
.post-body > ol { margin: .35rem 0 1rem; padding-left: 1.45rem; }
.post-body > ul li,
.post-body > ol li { margin-bottom: .3rem; line-height: 1.55; }
.post-body picture,
.post-body .forum-inline-image-link { display: block; margin: 1.1rem auto; text-align: center; }
.post-body .forum-inline-image { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: .65rem; }
.post-body .forum-video-wrap { margin: 1.1rem 0 !important; }
.post-body .text-center.my-3 { margin-top: 1.1rem !important; margin-bottom: 1.1rem !important; }
.post-body .guest-media-lock { margin-top: 1.1rem !important; margin-bottom: 1.1rem !important; }

/* v0.5.0.13 — marketplace αγγελιών */
.marketplace-hero { background: linear-gradient(135deg, #102f25 0%, #17623f 65%, #d6a400 150%); color: #fff; }
.classifieds-grid { align-items: stretch; }
.classified-listing-card { transition: transform .18s ease, box-shadow .18s ease; }
.classified-listing-card:hover { transform: translateY(-4px); box-shadow: 0 1rem 2rem rgba(16,47,37,.14)!important; }
.classified-card-media { position: relative; display: grid; place-items: center; aspect-ratio: 4/3; overflow: hidden; background: #edf3ef; color: #789487; text-decoration: none; }
.classified-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.classified-listing-card:hover .classified-card-media img { transform: scale(1.035); }
.classified-card-media > span:not(.badge) { font-size: 3rem; }
.classified-card-price, .classified-detail-price { color: #198754; font-weight: 800; }
.classified-card-price { font-size: 1.15rem; }
.classified-detail-price { font-size: clamp(1.75rem, 4vw, 2.6rem); }
.classified-detail-hero { background: linear-gradient(180deg, rgba(25,135,84,.06), transparent 55%); }
.classified-contact-panel { background: var(--bs-tertiary-bg); border: 1px solid var(--bs-border-color); border-radius: 1rem; padding: 1.25rem; }
.classified-specs > div { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--bs-border-color); }
.classified-specs > div:last-child { border-bottom: 0; }
.classified-specs dt { color: var(--bs-secondary-color); font-weight: 500; }
.classified-specs dd { margin: 0; font-weight: 700; text-align: right; }
.classified-description img { max-height: 720px; object-fit: contain; }
@media (max-width: 575.98px) { .classified-card-media { aspect-ratio: 16/10; } }

/* v0.5.0.19 — Solar tools */
.tools-hero{background:linear-gradient(135deg,#086f3d,#0b8f52);color:#fff;box-shadow:0 16px 40px rgba(8,111,61,.18)}
.tool-card{border:1px solid var(--bs-border-color);border-radius:1.25rem;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;overflow:hidden}
.tool-card:hover{transform:translateY(-4px);box-shadow:0 16px 35px rgba(0,0,0,.10);border-color:rgba(13,110,253,.28)}
.tool-icon{width:3.25rem;height:3.25rem;border-radius:1rem;display:flex;align-items:center;justify-content:center;font-size:1.45rem}
.tool-icon-lg{width:4rem;height:4rem;font-size:1.8rem;flex:0 0 auto}
.result-card .list-group-item{background:transparent}

/* Cookie Consent Center */
.cookie-consent-banner{position:fixed;left:0;right:0;bottom:0;z-index:1090;padding:1rem;background:linear-gradient(135deg,#062f22,#0f5132);color:#fff;box-shadow:0 -12px 35px rgba(0,0,0,.22)}
.cookie-consent-inner{max-width:1380px;margin:0 auto;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:1rem}
.cookie-consent-icon{width:3rem;height:3rem;border-radius:1rem;background:rgba(255,255,255,.12);display:grid;place-items:center;font-size:1.25rem}
.cookie-consent-copy p{color:rgba(255,255,255,.86);font-size:.94rem}.cookie-consent-copy a{color:#ffd451}
.cookie-consent-actions{display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;gap:.6rem}.cookie-consent-actions form{margin:0}
.cookie-category-card{border:1px solid var(--bs-border-color);border-radius:1rem;padding:1rem 1.1rem;background:var(--bs-body-bg)}
.footer-cookie-settings{color:inherit;text-decoration:none}.footer-cookie-settings:hover{text-decoration:underline;color:#fff}
.external-content-placeholder{border:1px dashed var(--bs-border-color);border-radius:1rem;padding:1.25rem;background:var(--bs-tertiary-bg);text-align:center}
@media (max-width:991.98px){.cookie-consent-inner{grid-template-columns:1fr}.cookie-consent-icon{display:none}.cookie-consent-actions{justify-content:stretch}.cookie-consent-actions>*{flex:1 1 auto}.cookie-consent-actions .btn{width:100%}}
@media (max-width:575.98px){.cookie-consent-banner{padding:.8rem}.cookie-consent-copy h2{font-size:1rem}.cookie-consent-actions{display:grid;grid-template-columns:1fr}.cookie-consent-actions>*{width:100%}}
