:root {
    --bg: #faf9f7;
    --bg-soft: #f5f3f0;
    --surface: #ffffff;
    --surface-2: #f8f6f3;
    --line: #e8e5e0;
    --line-soft: #ddd9d3;
    --text: #1c1917;
    --text-soft: #78716c;
    --accent: #b45309;
    --accent-hover: #92400e;
    --accent-text: #ffffff;
    --accent-ground: #059669;
    --accent-freight: #dc2626;
    --accent-office: #0d9488;
    --font-size-title: clamp(1.25rem, 1.2vw + 1rem, 1.6rem);
    --font-size-subtitle: 1.05rem;
    --font-size-body: 0.95rem;
    --font-size-meta: 0.8rem;
    --header-offset: 66px;
    --font-heading: "Source Serif 4", Georgia, "Times New Roman", serif;
    --font-display: "Instrument Serif", "Source Serif 4", Georgia, serif;
    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 28px rgba(0,0,0,0.08);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: 
        radial-gradient(ellipse 100% 60% at 50% -15%, rgba(180, 83, 9, 0.12), transparent 50%),
        radial-gradient(ellipse 70% 50% at 0% 30%, rgba(180, 83, 9, 0.05), transparent 50%),
        radial-gradient(ellipse 70% 50% at 100% 70%, rgba(180, 83, 9, 0.04), transparent 50%),
        linear-gradient(180deg, #fcfbf9 0%, #faf9f7 30%, #f5f3f0 70%, #f0ede8 100%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

body.no-scroll {
    overflow: hidden;
}

a {
    color: var(--text);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
    #feed-list .blog-post-card {
        animation: none;
    }
}

header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: background 0.3s ease;
}
header:hover {
    background: rgba(255, 255, 255, 0.85);
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.25rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 700;
    font-size: 1.08rem;
    letter-spacing: -0.01em;
}
.brand:hover {
    text-decoration: none;
}

.brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(145deg, var(--accent), #92400e);
    color: var(--accent-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(180, 83, 9, 0.25);
}

.brand-logo-image {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    font-size: 0.88rem;
}

.nav-user {
    color: var(--text-soft);
}

.nav-link {
    color: var(--text-soft);
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
    padding: 0.35rem 0;
}
.nav-link::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s var(--ease-out-expo);
}
.nav-link:hover {
    color: var(--text);
    text-decoration: none;
}
.nav-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}
.nav-link.is-active,
.nav-links a[aria-current="page"] {
    color: var(--accent);
    font-weight: 600;
}
.nav-link.is-active::after,
.nav-links a[aria-current="page"]::after {
    transform: scaleX(1);
}

.nav-avatar {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid var(--line-soft);
}

.nav-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.74rem;
    font-weight: 700;
    background: var(--surface-2);
    color: var(--text);
}

.nav-pill {
    background: linear-gradient(145deg, var(--accent), #92400e);
    color: var(--accent-text);
    border-radius: 10px;
    padding: 0.4rem 1rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(180, 83, 9, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-pill:hover {
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(180, 83, 9, 0.3);
}

.nav-links form button {
    background: var(--surface-2);
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    padding: 0.3rem 0.85rem;
    color: var(--text);
    cursor: pointer;
}

.nav-links form button:hover {
    background: var(--surface);
}

.main-public,
.main-private {
    max-width: 1320px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 1.2fr);
    gap: 1.5rem;
    padding: 1rem;
}

.main-private {
    grid-template-columns: minmax(0, 1fr);
}

.feed {
    border: none;
    background: transparent;
    border-radius: 0;
    overflow: visible;
    min-height: 60vh;
}
.app-shell.blog-shell {
    display: block;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem 4rem;
    grid-template-columns: unset;
    gap: unset;
}
#feed-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.75rem;
}
#feed-list .blog-post-card {
    animation: cardFadeIn 0.6s ease backwards;
}
#feed-list .blog-post-card:nth-child(1) { animation-delay: 0.05s; }
#feed-list .blog-post-card:nth-child(2) { animation-delay: 0.1s; }
#feed-list .blog-post-card:nth-child(3) { animation-delay: 0.15s; }
#feed-list .blog-post-card:nth-child(4) { animation-delay: 0.2s; }
#feed-list .blog-post-card:nth-child(5) { animation-delay: 0.25s; }
#feed-list .blog-post-card:nth-child(6) { animation-delay: 0.3s; }
#feed-list .blog-post-card:nth-child(n+7) { animation-delay: 0.35s; }
@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
@media (max-width: 640px) {
    #feed-list {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    .blog-hero .blog-search-hint {
        display: none;
    }
    .blog-hero {
        padding: 3rem 0 2.5rem;
    }
    .blog-tabs {
        gap: 0.35rem;
    }
    .blog-tab {
        padding: 0.45rem 0.9rem;
        font-size: 0.85rem;
    }
}
.blog-hero {
    text-align: center;
    padding: 4.5rem 0 3.5rem;
    position: relative;
}
.blog-hero .blog-search-hint {
    font-size: 0.75rem;
    color: var(--text-soft);
    opacity: 0.7;
    margin-top: 0.5rem;
}
.blog-hero .blog-search-hint kbd {
    display: inline-block;
    padding: 0.12rem 0.4rem;
    font-size: 0.7rem;
    font-family: inherit;
    background: rgba(0,0,0,0.06);
    border-radius: 6px;
    border: 1px solid rgba(0,0,0,0.08);
}
.blog-hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 56px;
    background: linear-gradient(180deg, var(--accent), transparent);
    opacity: 0.5;
    border-radius: 3px;
}
.blog-hero::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(180, 83, 9, 0.2), transparent);
    opacity: 0.8;
}
.blog-hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    font-weight: 400;
    font-style: italic;
    color: var(--text);
    letter-spacing: -0.03em;
    margin: 0 0 0.6rem;
    line-height: 1.15;
}
.blog-hero-tagline {
    font-size: 1.05rem;
    color: var(--text-soft);
    margin: 0 0 2rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.blog-search {
    display: flex;
    max-width: 420px;
    margin: 0 auto 1.5rem;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: box-shadow 0.3s ease;
}
.blog-search:focus-within {
    box-shadow: 0 8px 32px rgba(180, 83, 9, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.blog-search input {
    flex: 1;
    border: none;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    background: transparent;
    transition: color 0.2s ease;
}
.blog-search input::placeholder {
    color: var(--text-soft);
    opacity: 0.85;
}
.blog-search input:focus {
    outline: none;
}
.blog-search:focus-within input::placeholder {
    opacity: 0.6;
}
.blog-search button {
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-soft);
    transition: color 0.25s ease, transform 0.25s var(--ease-spring);
}
.blog-search button:hover {
    color: var(--accent);
    transform: scale(1.08);
}
.blog-search button:active {
    transform: scale(0.96);
}
.blog-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}
.blog-tab {
    padding: 0.5rem 1.15rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-soft);
    border-radius: 10px;
    transition: all 0.2s ease;
}
.blog-tab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.5);
    text-decoration: none;
}
.blog-tab.active {
    color: var(--accent);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}
.blog-admin-btn {
    display: block;
    margin: 1rem auto 0;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    color: var(--text-soft);
}
.blog-post-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 0;
    transition: transform 0.4s var(--ease-spring), box-shadow 0.4s var(--ease-out-expo), border-color 0.3s ease;
}
.blog-post-card:hover {
    transform: translateY(-6px);
}
.blog-post-card:active {
    transform: translateY(-2px);
}
.blog-card-glass {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04), 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}
.blog-card-glass:hover {
    border-color: rgba(180, 83, 9, 0.15);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(180, 83, 9, 0.06), 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}
.blog-post-thumb {
    aspect-ratio: 1200 / 630;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-soft) 0%, #e8e4df 100%);
    position: relative;
}
.blog-post-thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.12) 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.blog-post-card:hover .blog-post-thumb::after {
    opacity: 1;
}
.blog-post-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.blog-post-card:hover .blog-post-thumb img {
    transform: scale(1.06);
}
.blog-post-body {
    padding: 1.25rem 1.5rem;
}
.blog-post-link {
    text-decoration: none;
    color: inherit;
    display: block;
}
.blog-post-link:hover {
    text-decoration: none;
}
.blog-post-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-lg);
}
.blog-post-body .blog-post-date {
    display: block;
    font-size: 0.8rem;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}
.blog-post-body .blog-post-title {
    font-family: var(--font-heading);
    font-size: 1.22rem;
    font-weight: 600;
    line-height: 1.35;
    margin: 0 0 0.5rem;
    color: var(--text);
    transition: color 0.25s ease;
}
.blog-post-link:hover .blog-post-title {
    color: var(--accent);
}
.blog-post-body .blog-post-excerpt {
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text-soft);
    margin: 0 0 0.6rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-post-body .blog-post-cta {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: gap 0.25s ease;
}
.blog-post-link:hover .blog-post-cta {
    text-decoration: none;
    gap: 0.4rem;
}
.blog-post-meta {
    margin: 0;
    padding: 0.75rem 1.5rem 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 0.78rem;
    color: var(--text-soft);
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
}
.blog-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.like-icon,
.chip-icon-lightning,
.blog-meta-icon-lightning {
    font-size: 1em;
}

.blog-meta-icon-lightning {
    width: auto;
    height: auto;
    font-size: 0.95em;
    opacity: 0.9;
}
.blog-meta-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.75;
}
.blog-post-card .admin-actions-menu {
    margin: 0;
    padding: 0.75rem 1.5rem 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.blog-feed .card.alert {
    margin-bottom: 1.5rem;
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: alertSlideIn 0.4s var(--ease-out-expo);
}
@keyframes alertSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.blog-feed .feed-empty {
    padding: 4rem 1.5rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(12px);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.6);
}
.blog-feed .feed-empty-actions {
    margin-top: 1.25rem;
    gap: 0.75rem;
}
.blog-feed .feed-empty-actions .btn-primary {
    background: linear-gradient(145deg, var(--accent), var(--accent-hover));
    box-shadow: 0 2px 12px rgba(180, 83, 9, 0.25);
}
.blog-feed .feed-empty-actions .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(180, 83, 9, 0.3);
}
.blog-feed .feed-inline-error {
    border-radius: var(--radius-lg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.blog-feed .skeleton-wrap {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.75rem;
    padding: 1rem 0;
}
.blog-feed .skeleton-wrap .skeleton-item {
    height: 280px;
    border-radius: var(--radius-lg);
    margin: 0;
    background: linear-gradient(110deg, rgba(245, 243, 240, 0.8) 18%, rgba(255, 255, 255, 0.9) 40%, rgba(245, 243, 240, 0.8) 58%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.4s ease-in-out infinite;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}
@keyframes skeletonShimmer {
    0%, 100% { background-position: 200% 0; }
    50% { background-position: -200% 0; }
}
.blog-feed .pagination {
    justify-content: center;
    align-items: center;
    gap: 1.25rem;
    padding: 2.5rem 0 3rem;
    border: none;
    background: transparent;
    flex-wrap: wrap;
}
.blog-feed .pagination span {
    font-size: 0.9rem;
    color: var(--text-soft);
    font-weight: 500;
}
.blog-feed .pagination a {
    padding: 0.55rem 1.2rem;
    border-radius: 12px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.25s var(--ease-out-expo);
}
.blog-feed .pagination a:hover {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    text-decoration: none;
    transform: translateY(-1px);
}
.blog-feed .pagination a:active {
    transform: translateY(0);
}
.blog-article .blog-article-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 400;
    font-style: italic;
    line-height: 1.25;
}
.blog-article .blog-article-meta {
    font-size: 0.85rem;
    color: var(--text-soft);
}
.blog-article .rich-content {
    font-size: 1.05rem;
    line-height: 1.75;
}
.blog-article .rich-content p {
    margin-bottom: 1rem;
}

/* Blog contribute section - konu sayfası katkı formu */
.blog-contribute-card {
    padding: 1.75rem 1.5rem;
    border-radius: var(--radius-lg);
}
.blog-contribute-head {
    margin-bottom: 1.5rem;
}
.blog-contribute-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, transparent), color-mix(in srgb, var(--accent) 8%, transparent));
    color: var(--accent);
    margin-bottom: 0.85rem;
}
.blog-contribute-icon svg {
    width: 20px;
    height: 20px;
}
.blog-contribute-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 0.4rem;
}
.blog-contribute-desc {
    font-size: 0.95rem;
    color: var(--text-soft);
    margin: 0;
    line-height: 1.5;
}
.blog-contribute-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.blog-contribute-form .form-group input,
.blog-contribute-form .form-group textarea {
    border-radius: 12px;
    padding: 0.75rem 1rem;
    border-color: rgba(0, 0, 0, 0.08);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.blog-contribute-form .form-group input:focus,
.blog-contribute-form .form-group textarea:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
.blog-contribute-form textarea {
    min-height: 120px;
}
.blog-contribute-hint {
    font-size: 0.82rem;
    color: var(--text-soft);
    margin: 0;
}
.blog-contribute-btn {
    align-self: flex-start;
    padding: 0.65rem 1.4rem;
    font-size: 0.95rem;
    border-radius: 12px;
    transition: transform 0.2s var(--ease-spring), box-shadow 0.2s ease;
}
.blog-contribute-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 25%, transparent);
}

/* Blog section styling - konu sayfası bölümleri */
body[data-page-kind="question"] .blog-section {
    padding: 1.5rem 1.5rem;
    border-radius: var(--radius-lg);
}
body[data-page-kind="question"] .blog-section-head {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
}
body[data-page-kind="question"] .question-answer-card {
    border-radius: 12px;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
}
body[data-page-kind="question"] .question-answer-card.is-featured {
    border-color: color-mix(in srgb, var(--accent-ground) 35%, var(--line));
    background: rgba(255, 255, 255, 0.7);
}
body[data-page-kind="question"] .question-answer-list .question-answer-card {
    margin-bottom: 0.85rem;
}
body[data-page-kind="question"] .question-answer-list .question-answer-card:last-child {
    margin-bottom: 0;
}
body[data-page-kind="question"] .topic-link {
    border-radius: 10px;
    padding: 0.6rem 0.85rem;
    transition: background 0.2s ease;
}
body[data-page-kind="question"] .topic-link:hover {
    background: rgba(255, 255, 255, 0.6);
}
body[data-page-kind="question"] .question-main-card {
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.5rem;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}
body[data-page-kind="question"] .featured-banner {
    border-radius: var(--radius-lg);
    overflow: hidden;
}

@media (max-width: 640px) {
    .blog-contribute-card {
        padding: 1.25rem 1rem;
    }
    .blog-contribute-icon {
        width: 36px;
        height: 36px;
    }
    .blog-contribute-icon svg {
        width: 18px;
        height: 18px;
    }
    .blog-contribute-title {
        font-size: 1.2rem;
    }
    .blog-contribute-btn {
        align-self: stretch;
    }
}

.feed-header {
    padding: 1rem;
    border-bottom: 1px solid var(--line);
}

.site-banner {
    border: 1px dashed var(--line-soft);
    border-radius: 12px;
    background: var(--surface);
    padding: 0.75rem;
}

.site-banner iframe,
.site-banner img {
    max-width: 100%;
}

.site-banner-top {
    max-width: 1320px;
    margin: 0.8rem auto 0;
}

.site-banner-inline {
    margin-top: 0.8rem;
}

.profile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
}

.profile-head h1 {
    margin: 0;
    font-size: 1.2rem;
}

.profile-summary {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.profile-avatar {
    width: 62px;
    height: 62px;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid var(--line-soft);
    flex: 0 0 auto;
}

.profile-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    font-weight: 700;
    background: var(--surface-2);
    color: var(--text);
}

.profile-avatar-edit {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.feed-header-stacked {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.page-wrap {
    padding: 1rem;
}

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.page-title {
    font-size: var(--font-size-title);
    font-weight: 700;
    line-height: 1.25;
}

.search-form {
    display: flex;
    gap: 0.55rem;
}

.search-form input {
    flex: 1;
    border-radius: 999px;
    border: 1px solid var(--line-soft);
    background: var(--surface);
    color: var(--text);
    padding: 0.5rem 0.85rem;
    min-width: 0;
    transition: width 220ms ease, padding 220ms ease, border-radius 220ms ease;
}

.search-form button {
    border-radius: 999px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: var(--accent-text);
    padding: 0.42rem 0.95rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    transition: min-width 220ms ease, padding 220ms ease, transform 220ms ease, border-radius 220ms ease;
}

.search-btn-icon {
    width: 14px;
    height: 14px;
    fill: currentColor;
    flex: 0 0 auto;
}

@media (hover: hover) and (pointer: fine) {
    .search-form button:hover .search-btn-icon {
        animation: searchIconPulse 520ms ease-out;
    }

    .nav-pill:hover {
        box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 28%, transparent);
        transform: translateY(-1px);
    }

    .engagement-chip:hover {
        transform: translateY(-1px);
    }
}

@keyframes searchIconPulse {
    0% {
        transform: scale(1);
    }
    45% {
        transform: scale(1.14);
    }
    100% {
        transform: scale(1);
    }
}

.feed-item {
    padding: 1rem;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 0.75rem;
}

.feed-hover {
    transition: background-color 0.2s ease;
}

.feed-hover:hover {
    background: rgba(255, 255, 255, 0.03);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 25%, #ffffff), color-mix(in srgb, var(--accent-office) 24%, var(--surface-2)));
    flex: 0 0 auto;
}

.avatar-img {
    object-fit: cover;
    border: 1px solid var(--line-pro-soft);
}

.avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-text);
    font-size: 0.82rem;
    font-weight: 700;
    background: linear-gradient(145deg, var(--accent), color-mix(in srgb, var(--accent) 30%, var(--accent-office)));
    border: 1px solid var(--line-pro-soft);
}

.feed-content {
    flex: 1;
}

.feed-author {
    color: var(--text-pro-soft);
    font-size: var(--font-size-meta);
    font-weight: 600;
    margin-bottom: 0.18rem;
    letter-spacing: 0.01em;
}

.feed-title {
    font-size: var(--font-size-subtitle);
    font-weight: 600;
    margin-bottom: 0.35rem;
    line-height: 1.35;
}

.feed-meta {
    font-size: var(--font-size-meta);
    color: var(--text-soft);
    line-height: 1.35;
}

.meta-row {
    margin-top: 0.55rem;
}

.feed-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-soft);
}

.feed-empty-actions {
    margin-top: 0.75rem;
    display: inline-flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1rem;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.015);
}

.pagination a {
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
}

.feed-inline-error {
    margin: 0.9rem 1rem;
    padding: 0.7rem 0.8rem;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--accent-freight) 35%, var(--line));
    background: color-mix(in srgb, var(--accent-freight) 9%, var(--surface));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
}

.feed-inline-error p {
    margin: 0;
    font-size: 0.86rem;
    color: var(--text);
}

.sidebar {
    display: none;
}

@media (min-width: 900px) {
    .sidebar {
        display: block;
    }

    .main-public,
    .main-private {
        padding-top: 1.5rem;
    }
}

.card {
    background: var(--surface);
    border-radius: 1rem;
    border: 1px solid var(--line);
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
}

.card h2,
.card h3 {
    margin-bottom: 0.5rem;
}

.trend-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.trend-chip {
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.8rem;
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
}

.trend-chip span,
.muted {
    color: var(--text-soft);
    font-size: 0.84rem;
}

.answers-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.answer-item {
    padding-left: 0.75rem;
    border-left: 2px solid var(--line-soft);
}

.reply-form textarea,
.form-group input,
.form-group textarea,
.form-group select,
.auth-card form input,
.auth-card form select {
    width: 100%;
    background: var(--surface);
    border-radius: 0.75rem;
    border: 1px solid var(--line);
    padding: 0.62rem 0.75rem;
    color: var(--text);
}

.form-group input::placeholder,
.form-group textarea::placeholder,
.reply-form textarea::placeholder {
    color: var(--text-soft);
}

.profile-avatar-edit input[type="file"] {
    background: transparent;
    color: var(--text);
}

.reply-form textarea,
.form-group textarea {
    resize: vertical;
}

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

.reply-submit {
    border-radius: 12px !important;
    padding: 0.56rem 1rem !important;
    min-width: 180px;
    letter-spacing: 0.01em;
}

.form-card {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.form-group label {
    color: var(--text-soft);
    font-size: 0.9rem;
    font-weight: 600;
}

.toggle-row {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 600;
}

.snippet-preview {
    border: 1px dashed var(--line-soft);
    border-radius: 10px;
    background: var(--surface);
    padding: 0.55rem;
    min-height: 46px;
}

.snippet-preview.code {
    white-space: pre-wrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.75rem;
    line-height: 1.35;
}

.snippet-preview.is-disabled,
.form-group textarea.is-disabled {
    opacity: 0.58;
}

.form-divider {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 0.25rem 0 0.15rem;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 0.48rem 0.82rem;
    border: 1px solid var(--line-soft);
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    background: var(--surface-2);
    font-size: 0.86rem;
    transition: all 0.2s ease;
}

.btn:hover {
    text-decoration: none;
    filter: brightness(0.97);
}

.btn:disabled {
    opacity: 0.72;
    cursor: not-allowed;
}

.btn.is-loading {
    position: relative;
    padding-right: 1.55rem;
}

.btn.is-loading::after {
    content: "";
    position: absolute;
    right: 0.55rem;
    top: 50%;
    width: 11px;
    height: 11px;
    margin-top: -5.5px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn-primary,
.reply-form button {
    background: var(--accent);
    color: var(--accent-text);
    border: 1px solid var(--accent);
    font-weight: 700;
}

.btn-primary:hover,
.reply-form button:hover {
    filter: brightness(0.92);
}

.btn-muted {
    background: var(--surface);
    color: var(--text-soft);
}

.btn-success {
    background: var(--accent-ground);
    border-color: var(--accent-ground);
    color: #ffffff;
    font-weight: 700;
}

.btn-danger {
    background: var(--accent-freight);
    border-color: var(--accent-freight);
    color: #ffffff;
}

.btn-success:hover,
.btn-danger:hover {
    filter: brightness(0.92);
}

.btn-sm {
    padding: 0.34rem 0.62rem;
    font-size: 0.78rem;
}

.like-button {
    background: var(--surface);
    border-radius: 999px;
    border: 1px solid var(--line-soft);
    color: var(--text);
    padding: 0.38rem 0.95rem;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.like-button:hover {
    background: var(--surface-2);
    border-color: var(--line-soft);
}

.like-button.liked {
    background: var(--accent);
    color: var(--accent-text);
    border-color: var(--accent);
}

.action-row {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.admin-inline-actions {
    margin-top: 0.65rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
    padding: 0.45rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-2);
}

.admin-actions-menu {
    margin-top: 0.65rem;
}

.admin-actions-menu > summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.34rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.26rem 0.66rem;
    background: var(--surface);
    color: var(--text-soft);
    font-size: 0.76rem;
    font-weight: 700;
}

.admin-actions-menu > summary::-webkit-details-marker {
    display: none;
}

.admin-actions-menu[open] > summary {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.admin-inline-actions form {
    margin: 0;
}

.inline-action {
    margin-top: 0.5rem;
}

.table-card {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.data-table th,
.data-table td {
    padding: 0.7rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    background: var(--surface);
    color: var(--text);
}

.data-table th {
    background: var(--surface-2);
    color: var(--text-soft);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.cell-wrap {
    min-width: 240px;
    max-width: 420px;
}

.status-pill {
    display: inline-block;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-size: 0.74rem;
    border: 1px solid var(--line-soft);
    text-transform: capitalize;
}

.status-published {
    background: var(--surface);
    color: var(--accent-ground);
    border-color: var(--accent-ground);
}

.status-draft {
    background: var(--surface);
    color: var(--accent-office);
    border-color: var(--accent-office);
}

.status-archived {
    background: var(--surface);
    color: var(--accent-freight);
    border-color: var(--accent-freight);
}

.auth-shell {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 1.2rem 0;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    margin: 1.2rem auto;
    padding: 1.1rem;
}

.auth-head {
    margin-bottom: 0.55rem;
}

.auth-head h2 {
    margin: 0 0 0.35rem 0;
}

.auth-form {
    margin-top: 0.5rem;
}

.auth-form .form-group {
    gap: 0.38rem;
}

.auth-form .form-group label {
    color: var(--text);
}

.auth-submit {
    width: 100%;
    margin-top: 0.2rem;
    border-radius: 12px;
    min-height: 42px;
}

.auth-switch {
    margin: 0.7rem 0 0;
    text-align: center;
}

.auth-switch a {
    color: var(--accent);
    font-weight: 700;
}

.errors {
    list-style: none;
    margin-bottom: 0.75rem;
    padding: 0.65rem 0.8rem;
    border-radius: 0.75rem;
    background: color-mix(in srgb, var(--accent-freight) 10%, #ffffff);
    border: 1px solid var(--accent-freight);
    color: var(--text);
    font-size: 0.85rem;
}

.alert {
    padding: 0.8rem 0.95rem;
    font-size: 0.9rem;
}

.alert-success {
    border-color: var(--accent-ground);
    background: color-mix(in srgb, var(--accent-ground) 10%, #ffffff);
    color: var(--text);
}

.alert-error {
    border-color: var(--accent-freight);
    background: color-mix(in srgb, var(--accent-freight) 10%, #ffffff);
    color: var(--text);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
    margin-bottom: 0.85rem;
}

.stat-card h3 {
    margin: 0;
    font-size: 1.06rem;
}

footer {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem;
    font-size: 0.85rem;
    color: var(--text-soft);
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}
footer p {
    margin: 0;
    font-weight: 500;
}
body[data-page-kind="feed"] footer {
    padding: 2rem 1.25rem 2.5rem;
}

/* Monochrome pro refinements */
:root {
    --bg-pro: var(--bg);
    --bg-pro-soft: var(--bg-soft);
    --surface-pro: var(--surface);
    --line-pro: var(--line);
    --line-pro-soft: var(--line-soft);
    --text-pro: var(--text);
    --text-pro-soft: var(--text-soft);
}

body {
    background: radial-gradient(circle at 18% 0%, var(--surface-2) 0, var(--bg-soft) 34%, var(--bg-pro) 100%);
    color: var(--text-pro);
}

header {
    background: var(--surface-pro);
    border-bottom-color: var(--line-pro);
}

a {
    color: var(--text-pro);
}

.nav-user,
.muted,
.feed-meta,
.trend-chip span {
    color: var(--text-pro-soft);
}

.nav-pill {
    background: var(--accent);
    color: var(--accent-text);
}

.nav-links form button {
    background: var(--surface-2);
    border-color: var(--line-pro-soft);
    color: var(--text-pro);
}

.app-shell {
    max-width: 1460px;
    margin: 0 auto;
    padding: 1.1rem 1rem;
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) 360px;
    gap: 1.35rem;
}

.left-rail {
    display: none;
}

@media (min-width: 1024px) {
    .left-rail {
        display: flex;
        flex-direction: column;
        gap: 0.8rem;
        position: sticky;
        top: 86px;
        align-self: start;
    }
}

.rail-card {
    position: static;
    background: var(--surface-pro);
    border: 1px solid var(--line-pro);
    border-radius: 14px;
    padding: 0.55rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.compose-card {
    margin-top: 0;
}

.compose-card h4 {
    margin: 0.2rem 0.2rem 0.55rem;
    font-size: 0.85rem;
    color: var(--text-pro-soft);
}

.rail-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.62rem 0.72rem;
    border-radius: 10px;
    font-weight: 600;
    color: var(--text-pro);
}

.rail-icon {
    width: 1.05rem;
    display: inline-flex;
    justify-content: center;
    color: var(--accent);
    font-weight: 700;
}

.rail-icon svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.rail-link:hover {
    text-decoration: none;
    background: var(--surface-2);
}

.rail-link.is-active {
    background: color-mix(in srgb, var(--accent) 14%, var(--surface));
    color: var(--text);
    border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
}

.feed {
    border-color: var(--line-pro);
    background: var(--surface-pro);
}

.feed-content {
    min-width: 0;
}

.sidebar .card,
.feed .card,
.rail-card {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
}

.feed-item {
    border-bottom-color: var(--line-pro);
}

.feed-hover:hover {
    background: rgba(255, 255, 255, 0.025);
}

.avatar {
    background: linear-gradient(145deg, var(--accent), var(--line-pro-soft));
}

.search-form input {
    border-color: var(--line-pro-soft);
    background: var(--surface-pro);
    color: var(--text-pro);
}

.search-form button,
.btn-primary,
.reply-form button {
    background: var(--accent);
    color: var(--accent-text);
    border-color: var(--accent);
}

.search-form button:hover,
.btn-primary:hover,
.reply-form button:hover {
    filter: brightness(0.94);
}

.engagement-row {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-top: 0.6rem;
}

.engagement-chip {
    border: 1px solid var(--line-pro-soft);
    background: var(--surface-2);
    border-radius: 999px;
    padding: 0.28rem 0.7rem;
    font-size: 0.76rem;
    color: var(--text-pro);
}

.engagement-chip:hover {
    text-decoration: none;
    filter: brightness(0.97);
}

.engagement-chip:focus-visible,
.btn:focus-visible,
.like-button:focus-visible,
.search-form button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.muted-chip {
    color: var(--text-pro-soft);
}

.compact-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.24rem 0.58rem;
    font-size: 0.72rem;
}

.chip-icon {
    color: var(--accent);
    font-size: 0.82rem;
    line-height: 1;
}

.chip-icon-svg {
    width: 14px;
    height: 14px;
    display: inline-block;
    fill: currentColor;
    color: var(--accent);
    flex: 0 0 auto;
}

.like-button {
    background: var(--surface-2);
    border-color: var(--line-pro-soft);
    color: var(--text-pro);
}

.like-button .like-icon {
    margin-right: 0.35rem;
}

.like-button:hover {
    filter: brightness(0.97);
}

.like-button.liked {
    background: var(--accent);
    color: var(--accent-text);
    border-color: var(--accent);
}

.card {
    background: var(--surface-pro);
    border-color: var(--line-pro);
}

.data-table th,
.data-table td {
    border-bottom-color: var(--line-pro);
}

.status-published {
    background: var(--surface-pro);
    border-color: var(--accent-ground);
    color: var(--accent-ground);
}

.status-draft {
    background: var(--surface-pro);
    border-color: var(--accent-office);
    color: var(--accent-office);
}

.status-archived {
    background: var(--surface-pro);
    border-color: var(--accent-freight);
    color: var(--accent-freight);
}

@media (max-width: 1019px) {
    .app-shell {
        grid-template-columns: minmax(0, 1fr);
        max-width: 980px;
    }

    .sidebar {
        display: block;
    }
}

@media (min-width: 1020px) and (max-width: 1320px) {
    .app-shell {
        max-width: 1260px;
        grid-template-columns: 210px minmax(0, 1fr) 300px;
        gap: 1rem;
    }
}

.toast-root {
    position: fixed;
    right: 16px;
    bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    z-index: 120;
    pointer-events: none;
}

.toast-item {
    min-width: 240px;
    max-width: 340px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: var(--text);
    padding: 0.7rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(12px) scale(0.96);
    transition: opacity 0.35s var(--ease-out-expo), transform 0.35s var(--ease-out-expo);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.toast-item.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast-item.info {
    border-color: rgba(180, 83, 9, 0.2);
    box-shadow: 0 12px 40px rgba(180, 83, 9, 0.1);
}

.toast-item.success {
    border-color: rgba(5, 150, 105, 0.3);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 12px 40px rgba(5, 150, 105, 0.15);
}

.toast-item.error {
    border-color: rgba(220, 38, 38, 0.25);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 12px 40px rgba(220, 38, 38, 0.1);
}

.hidden {
    display: none !important;
}

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

.skip-link {
    position: absolute;
    left: 12px;
    top: -44px;
    z-index: 500;
    background: var(--surface);
    color: var(--text);
    padding: 0.4rem 0.65rem;
    border-radius: 8px;
    border: 1px solid var(--line);
    font-weight: 700;
}

.skip-link:focus {
    top: 12px;
}

.skeleton-wrap {
    padding: 0.8rem 1rem;
    border-top: 1px solid var(--line-pro);
}

.skeleton-item {
    height: 78px;
    border-radius: 12px;
    margin-bottom: 0.6rem;
    background: linear-gradient(110deg, var(--surface-2) 8%, #ffffff 18%, var(--surface-2) 33%);
    background-size: 200% 100%;
    animation: shimmer 1.2s linear infinite;
}

.feed-sentinel {
    height: 1px;
}

@keyframes shimmer {
    to {
        background-position-x: -200%;
    }
}

.rich-content {
    line-height: 1.62;
    color: var(--text-pro);
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
    overflow-x: hidden;
}

.rich-content h1,
.rich-content h2,
.rich-content h3 {
    margin: 1rem 0 0.55rem;
    letter-spacing: 0.01em;
}

.rich-content h1 {
    font-size: 1.18rem;
}

.rich-content h2 {
    font-size: 1.06rem;
}

.rich-content h3 {
    font-size: 0.98rem;
}

.rich-content p {
    margin: 0.5rem 0;
}

.rich-image {
    margin: 0.7rem 0;
    border: 1px solid var(--line-pro);
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface);
    max-width: 100%;
}

.rich-image img {
    display: block;
    max-width: 100%;
    width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: contain;
    vertical-align: middle;
}

body[data-page-kind="question"] .question-main-card .rich-image img {
    max-height: 70vh;
}

.rich-content ul,
.rich-content ol {
    margin: 0.55rem 0 0.75rem 1.15rem;
}

.rich-content li {
    margin: 0.24rem 0;
}

.rich-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line-pro);
    border-radius: 12px;
    margin: 0.7rem 0;
    background: var(--surface);
}

.rich-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.rich-table th,
.rich-table td {
    padding: 0.5rem 0.65rem;
    border-bottom: 1px solid var(--line);
    white-space: normal;
    word-break: break-word;
    color: var(--text);
    background: var(--surface);
}

.rich-table th {
    color: var(--text);
    background: var(--surface-2);
    text-align: left;
}

@media (max-width: 720px) {
    .feed-item {
        padding: 0.85rem 0.75rem;
        gap: 0.55rem;
    }

    .avatar {
        width: 34px;
        height: 34px;
    }

    .feed-title {
        font-size: 0.95rem;
    }

    .meta-row {
        font-size: 0.73rem;
    }

    .rich-table {
        font-size: 0.8rem;
    }

    .rich-table th,
    .rich-table td {
        padding: 0.42rem 0.5rem;
    }
}

.featured-banner {
    position: relative;
    z-index: 1;
    border: 1px solid var(--line-pro);
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 1200 / 630;
    margin: 0.85rem;
    background: radial-gradient(circle at 20% 10%, #282833 0, #17171d 35%, #0d0d10 100%);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    cursor: zoom-in;
}

.featured-banner img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: brightness(0.56) saturate(1.05);
    cursor: zoom-in;
}

.featured-banner.generated-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 80% 18%, rgba(255, 255, 255, 0.15) 0, rgba(255, 255, 255, 0) 34%),
        linear-gradient(135deg, #23232d 0%, #15151a 52%, #0c0c0f 100%);
}

.featured-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(6, 6, 8, 0.86), rgba(6, 6, 8, 0.18));
    pointer-events: none;
}

.featured-content {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 2;
    padding: 1.2rem 1.2rem 1.05rem;
    pointer-events: none;
}

.featured-content p {
    margin: 0 0 0.35rem;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #c8c8d0;
}

.featured-content h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(1.05rem, 2.2vw, 1.6rem);
    line-height: 1.2;
    text-wrap: balance;
}

.question-main-card {
    border-bottom: none;
    margin-bottom: 0.7rem;
    position: relative;
    z-index: 2;
    background: var(--surface);
}

.question-main-card .feed-content {
    position: relative;
    z-index: 3;
}

.question-main-card .rich-content,
.question-main-card .rich-content * {
    color: var(--text);
}

.question-section {
    margin-bottom: 0.72rem;
}

.question-section:last-of-type {
    margin-bottom: 0.2rem;
}

.publish-loading {
    position: fixed;
    inset: 0;
    z-index: 210;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--text) 22%, transparent);
    backdrop-filter: blur(3px);
}

.publish-loading-card {
    min-width: 250px;
    max-width: 90vw;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.72rem;
    color: var(--text);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.45);
}

.publish-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--line);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    flex: 0 0 auto;
}

#publish-loading-text {
    font-size: 0.88rem;
    color: var(--text);
}

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

.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 260;
    background: color-mix(in srgb, var(--text) 30%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
}

.image-lightbox img {
    max-width: min(94vw, 1600px);
    max-height: 90vh;
    border-radius: 10px;
    border: 1px solid var(--line);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
    object-fit: contain;
}

.image-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    color: var(--text);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s var(--ease-spring);
}
.image-lightbox-close:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.05);
}

.admin-drawer {
    position: fixed;
    inset: 0;
    z-index: 220;
    background: rgba(77, 20, 140, 0.16);
    display: flex;
    justify-content: flex-end;
}

.admin-drawer-panel {
    width: min(640px, 100vw);
    height: 100%;
    overflow-y: auto;
    background: var(--surface-pro);
    border-left: 1px solid var(--line-pro);
    padding: 0.9rem;
}

.admin-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
    position: sticky;
    top: 0;
    z-index: 4;
    background: color-mix(in srgb, var(--surface) 90%, #ffffff);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.62rem 0.66rem;
    backdrop-filter: blur(6px);
}

body[data-page-kind="feed"] .admin-drawer-head,
body[data-page-kind="question"] .admin-drawer-head,
body[data-page-kind="profile"] .admin-drawer-head {
    top: calc(var(--header-offset) + 6px);
}

.admin-drawer-section h4 {
    margin-bottom: 0.32rem;
    font-size: 0.94rem;
}

.admin-drawer-section > .muted {
    margin-bottom: 0.62rem;
}

.admin-drawer .card.admin-drawer-section {
    border-radius: 14px;
    border: 1px solid var(--line);
    box-shadow: 0 10px 24px rgba(77, 20, 140, 0.08);
}

.admin-quick-summary {
    padding: 0.72rem;
}

.admin-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 0.55rem;
}

.admin-summary-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.46rem 0.52rem;
    background: var(--surface);
}

.admin-summary-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-soft);
}

.admin-summary-value {
    display: block;
    margin-top: 0.1rem;
    font-size: 1.02rem;
    line-height: 1.1;
}

.admin-shortcuts {
    margin-top: 0.55rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.content-fetcher-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.content-fetcher-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.content-fetcher-head h3 {
    margin: 0;
}

.content-fetcher-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
}

.content-fetcher-log-wrap h4 {
    margin-bottom: 0.5rem;
}

.content-fetcher-log {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 340px;
    overflow-y: auto;
}

.content-fetcher-log li {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.45rem 0.55rem;
    background: var(--surface-2);
    font-size: 0.82rem;
}

.admin-section-collapse > summary,
.admin-settings-group > summary {
    list-style: none;
    cursor: pointer;
}

.admin-section-collapse > summary::-webkit-details-marker,
.admin-settings-group > summary::-webkit-details-marker {
    display: none;
}

.admin-section-collapse > summary {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    padding: 0.1rem 0.1rem 0.55rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: 0.6rem;
}

.admin-section-collapse > summary > span {
    font-size: 0.94rem;
    font-weight: 700;
}

.admin-section-collapse > summary > small {
    font-size: 0.74rem;
    color: var(--text-soft);
}

.admin-settings-group {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.4rem 0.5rem;
    background: var(--surface);
    margin-bottom: 0.52rem;
}

.admin-settings-group > summary {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.45rem;
}

.admin-drawer .form-group input,
.admin-drawer .form-group textarea,
.admin-drawer .form-group select {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--line);
}

.admin-drawer .form-group input::placeholder,
.admin-drawer .form-group textarea::placeholder {
    color: var(--text-soft);
}

.admin-drawer .form-group input[type="color"] {
    padding: 0.2rem;
    min-height: 2.35rem;
    background: transparent;
}

.admin-drawer .form-actions-sticky {
    position: sticky;
    bottom: 0;
    margin-top: 0.35rem;
    padding: 0.52rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface) 92%, #ffffff);
    backdrop-filter: blur(6px);
}

.admin-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.admin-list-item {
    border: 1px solid var(--line-pro);
    border-radius: 10px;
    padding: 0.6rem;
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    background: var(--surface);
}

.admin-bulk-controls {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.45rem;
    flex-wrap: wrap;
}

.bulk-check-label {
    display: inline-flex;
    align-items: center;
    margin-right: 0.4rem;
}

.bulk-check {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

@media (max-width: 760px) {
    .admin-list-item {
        flex-direction: column;
        align-items: stretch;
    }
    .admin-list-item .action-row {
        width: 100%;
    }
    .admin-summary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .admin-drawer-head {
        position: static;
    }
}

/* Flarum-inspired professional feed */
.feed-header {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
}

.feed-tabs {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.feed-tab {
    border: 1px solid var(--line-pro-soft);
    border-radius: 999px;
    font-size: 0.78rem;
    padding: 0.28rem 0.7rem;
    color: var(--text-pro-soft);
    background: var(--surface-2);
}

.feed-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-text);
    font-weight: 700;
}

.feed-tab:hover {
    text-decoration: none;
    filter: brightness(0.97);
}

.discussion-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: flex-start;
    gap: 0.95rem;
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    border-left: 2px solid transparent;
}

.discussion-card:hover {
    transform: translateY(-1px);
    border-left-color: var(--accent);
}

.discussion-main {
    grid-column: 2 / 3;
    min-width: 0;
}

.discussion-sep {
    opacity: 0.5;
    margin: 0 0.35rem;
}

.discussion-stats {
    grid-column: 3 / 4;
    margin-left: auto;
    display: flex;
    gap: 0.55rem;
    align-items: stretch;
}

.discussion-stat {
    min-width: 84px;
    border: 1px solid var(--accent);
    border-radius: 10px;
    padding: 0.45rem 0.5rem;
    text-align: center;
    background: var(--surface-pro);
}

.discussion-stat strong {
    display: block;
    font-size: 0.95rem;
    line-height: 1.05;
    color: var(--accent);
}

.discussion-stat span {
    font-size: 0.68rem;
    color: var(--text-pro-soft);
}

.feed-title a {
    text-underline-offset: 3px;
}

@media (max-width: 920px) {
    .discussion-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .discussion-main {
        grid-column: 2 / 3;
    }

    .discussion-stats {
        grid-column: 2 / 3;
        margin-left: 0;
        width: 100%;
        margin-top: 0.35rem;
        justify-content: flex-start;
    }

    .discussion-stat {
        min-width: 74px;
    }
}

@media (max-width: 760px) {
    .feed-header-stacked {
        gap: 0.75rem;
    }

    .search-form {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 0.42rem;
    }

    .search-form input {
        width: 100%;
        padding: 0.46rem 0.72rem;
    }

    .search-form button {
        width: auto;
        min-width: 64px;
        padding: 0.4rem 0.72rem;
        transform: translateX(0);
    }

    .feed-tabs {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 0.2rem;
        flex-wrap: nowrap;
    }

    .feed-tab {
        flex: 0 0 auto;
    }

    .discussion-card {
        grid-template-columns: 36px minmax(0, 1fr);
        gap: 0.6rem;
    }

    .discussion-stats {
        gap: 0.4rem;
        flex-wrap: wrap;
    }

    .discussion-stat {
        min-width: 68px;
        padding: 0.4rem 0.45rem;
    }

    .admin-inline-actions .btn {
        width: 100%;
    }
}

/* Mobile-first polish pack */
@media (max-width: 640px) {
    header {
        backdrop-filter: blur(8px);
    }

    .nav-container {
        padding: 0.58rem 0.72rem;
        gap: 0.5rem;
    }

    .brand {
        min-width: 0;
        gap: 0.45rem;
        font-size: 0.92rem;
    }

    #brand-text {
        display: inline-block;
        max-width: 44vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .brand-icon {
        width: 24px;
        height: 24px;
        border-width: 1.5px;
        font-size: 0.7rem;
    }

    .nav-links {
        gap: 0.4rem;
        font-size: 0.8rem;
        max-width: 52vw;
        overflow-x: auto;
        white-space: nowrap;
        flex-wrap: nowrap;
        padding-bottom: 0.08rem;
    }

    .nav-user {
        display: none;
    }

    .nav-avatar {
        width: 22px;
        height: 22px;
    }

    .nav-pill {
        padding: 0.25rem 0.6rem;
    }

    .app-shell,
    .main-private {
        padding: 0.72rem 0.55rem;
    }

    .feed {
        border-radius: 12px;
        min-height: 70vh;
    }

    .feed-header {
        padding: 0.78rem;
    }

    .search-form {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.36rem;
    }

    .search-form input {
        padding: 0.42rem 0.62rem;
        border-radius: 11px;
    }

    .search-form button {
        min-width: 56px;
        padding: 0.38rem 0.62rem;
        border-radius: 11px;
    }

    .page-title {
        font-size: 1.08rem;
    }

    .muted {
        font-size: 0.8rem;
    }

    .feed-item {
        padding: 0.78rem 0.65rem;
    }

    .feed-title {
        font-size: 0.92rem;
        line-height: 1.3;
    }

    .feed-author {
        font-size: 0.74rem;
    }

    .feed-meta {
        font-size: 0.72rem;
    }

    .engagement-row {
        gap: 0.38rem;
    }

    .engagement-chip,
    .btn.btn-sm {
        min-height: 36px;
        padding: 0.4rem 0.62rem;
        font-size: 0.74rem;
    }

    .discussion-stat strong {
        font-size: 0.88rem;
    }

    .discussion-stat span {
        font-size: 0.66rem;
    }

    .featured-banner {
        margin: 0.62rem;
        border-radius: 12px;
    }

    .featured-content {
        padding: 0.9rem 0.9rem 0.8rem;
    }

    .featured-content h2 {
        font-size: clamp(0.95rem, 4.5vw, 1.2rem);
    }

    .card {
        padding: 0.82rem 0.85rem;
        border-radius: 12px;
    }

    .reply-submit {
        width: 100%;
        min-width: 0;
        min-height: 40px;
    }

    .admin-drawer-panel {
        width: 100vw;
        padding: 0.78rem;
    }

    .admin-drawer-head {
        margin-bottom: 0.62rem;
    }

    .admin-drawer-section h4 {
        font-size: 0.92rem;
    }
}

@media (max-width: 375px) {
    .nav-container {
        padding: 0.5rem 0.5rem;
    }

    #brand-text {
        max-width: 36vw;
        font-size: 0.84rem;
    }

    .nav-links {
        max-width: 58vw;
        font-size: 0.76rem;
    }

    .feed-header {
        padding: 0.68rem;
    }

    .search-form {
        gap: 0.3rem;
    }

    .search-form input {
        padding: 0.36rem 0.54rem;
        border-radius: 10px;
    }

    .search-form button {
        min-width: 48px;
        padding: 0.33rem 0.5rem;
        border-radius: 10px;
        font-size: 0.72rem;
        gap: 0;
    }

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

    .search-form .search-btn-icon {
        width: 15px;
        height: 15px;
    }

    .page-title {
        font-size: 1rem;
    }

    .feed-item {
        padding: 0.68rem 0.55rem;
        gap: 0.48rem;
    }

    .avatar {
        width: 30px;
        height: 30px;
    }

    .feed-title {
        font-size: 0.88rem;
    }

    .discussion-stats {
        gap: 0.32rem;
    }

    .discussion-stat {
        min-width: 62px;
        padding: 0.34rem 0.35rem;
        border-radius: 8px;
    }

    .engagement-chip,
    .btn.btn-sm {
        min-height: 34px;
        font-size: 0.71rem;
        padding: 0.33rem 0.5rem;
    }

    .card {
        padding: 0.72rem 0.72rem;
    }
}

@media (max-width: 320px) {
    #brand-text {
        max-width: 31vw;
        font-size: 0.8rem;
    }

    .brand-icon {
        width: 22px;
        height: 22px;
        font-size: 0.64rem;
    }

    .nav-links {
        gap: 0.3rem;
        max-width: 61vw;
    }

    .feed-header {
        padding: 0.58rem;
    }

    .search-form {
        gap: 0.26rem;
    }

    .search-form input {
        padding: 0.32rem 0.48rem;
        font-size: 0.76rem;
    }

    .search-form button {
        min-width: 44px;
        padding: 0.3rem 0.42rem;
        font-size: 0.69rem;
        gap: 0;
    }

    .search-form .search-btn-icon {
        width: 14px;
        height: 14px;
    }

    .feed-tabs {
        gap: 0.28rem;
    }

    .feed-tab {
        font-size: 0.7rem;
        padding: 0.22rem 0.52rem;
    }

    .discussion-card {
        grid-template-columns: 30px minmax(0, 1fr);
    }

    .discussion-stat {
        min-width: 56px;
    }

    .discussion-stat strong {
        font-size: 0.8rem;
    }

    .discussion-stat span {
        font-size: 0.62rem;
    }

    .admin-drawer-panel {
        padding: 0.62rem;
    }
}

/* Final consistency overrides */
.nav-pill:hover {
    filter: brightness(0.92);
}

.profile-avatar-fallback {
    background: var(--surface-2);
    color: var(--text);
}

.feed,
.sidebar .card,
.feed .card,
.rail-card {
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

/* UI polish pass */
body {
    letter-spacing: 0.01em;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.feed {
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(77, 20, 140, 0.08);
}

.feed-header {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(243, 238, 251, 0.75) 100%);
}

.feed-item {
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.feed-hover:hover {
    background: #fffaf6;
    transform: translateY(-1px);
}

.search-form input {
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.search-form input::placeholder {
    color: var(--text-soft);
}

.avatar,
.avatar-img {
    border: 1px solid var(--line-soft);
    box-shadow: 0 2px 8px rgba(77, 20, 140, 0.12);
}

.avatar-fallback {
    background: linear-gradient(145deg, #4d148c, #ff6200);
    color: #fff;
    border: 1px solid rgba(77, 20, 140, 0.25);
}

.feed-title a {
    text-decoration: none;
}

.feed-title a:hover {
    color: #4d148c;
    text-decoration: none;
}

.card,
.rail-card {
    border-radius: 14px;
    box-shadow: 0 8px 22px rgba(77, 20, 140, 0.08);
}

.btn {
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.btn-primary,
.search-form button {
    box-shadow: 0 8px 18px rgba(255, 98, 0, 0.22);
}

.engagement-chip {
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.engagement-chip:hover {
    background: #fff7f1;
    border-color: #ffcfad;
}

.muted-chip {
    background: #faf7ff;
}

/* Sidebar topic cards */
.sidebar-section {
    padding: 0.9rem;
}

.sidebar-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.sidebar-section-head h3 {
    margin: 0;
}

.sidebar-section-badge {
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text-soft);
    border-radius: 999px;
    font-size: 0.7rem;
    padding: 0.18rem 0.5rem;
    white-space: nowrap;
}

.topic-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.topic-link {
    display: grid;
    grid-template-columns: 1.55rem minmax(0, 1fr);
    gap: 0.55rem;
    align-items: start;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.46rem 0.56rem;
    background: var(--surface);
    text-decoration: none;
}

.topic-link:hover {
    text-decoration: none;
    background: #fff7f1;
    border-color: #ffd2b3;
}

.topic-rank {
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--text-soft);
    font-size: 0.74rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.topic-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.14rem;
}

.topic-title {
    font-size: 0.84rem;
    font-weight: 650;
    line-height: 1.3;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.topic-meta {
    font-size: 0.74rem;
    color: var(--text-soft);
}

/* Profile improvements */
.profile-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
}

.profile-main h2 {
    margin: 0 0 0.18rem;
}

.profile-tags {
    margin-top: 0.42rem;
    display: flex;
    gap: 0.42rem;
    flex-wrap: wrap;
}

.profile-tag {
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text-soft);
    border-radius: 999px;
    font-size: 0.72rem;
    padding: 0.18rem 0.54rem;
}

.profile-hero-actions {
    flex: 0 0 auto;
}

.profile-section h3 {
    margin-bottom: 0.55rem;
}

.profile-list {
    gap: 0.55rem;
}

.profile-list-item {
    border-left: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.58rem 0.66rem;
    background: var(--surface);
}

.profile-list-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.24rem;
}

.profile-metric {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.1rem 0.48rem;
    font-size: 0.72rem;
    color: var(--text-soft);
    background: var(--surface-2);
}

.profile-answer-excerpt {
    margin-top: 0.36rem;
    color: var(--text-soft);
    font-size: 0.86rem;
    line-height: 1.45;
}

@media (max-width: 860px) {
    .profile-hero {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Admin modern list layout */
.admin-collection {
    display: flex;
    flex-direction: column;
    gap: 0.72rem;
}

.admin-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.9rem;
    padding: 0.85rem;
}

.admin-row-main {
    min-width: 0;
    flex: 1;
}

.admin-row-head {
    display: flex;
    align-items: center;
    gap: 0.42rem;
    margin-bottom: 0.34rem;
    flex-wrap: wrap;
}

.admin-id {
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text-soft);
    border-radius: 999px;
    font-size: 0.7rem;
    padding: 0.12rem 0.46rem;
}

.admin-row-user {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text-soft);
    border-radius: 999px;
    font-size: 0.72rem;
    padding: 0.12rem 0.48rem;
}

.admin-row-title {
    font-size: 0.96rem;
    font-weight: 650;
    line-height: 1.35;
    color: var(--text);
    text-decoration: none;
}

.admin-row-title:hover {
    text-decoration: none;
    color: #4d148c;
}

.admin-row-meta {
    margin-top: 0.3rem;
    color: var(--text-soft);
    font-size: 0.77rem;
}

.admin-row-body {
    margin-top: 0.48rem;
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--text-soft);
    border: 1px solid var(--line);
    background: var(--surface-2);
    border-radius: 10px;
    padding: 0.5rem 0.58rem;
    max-height: 9.2rem;
    overflow: auto;
}

.admin-row-actions {
    display: flex;
    align-items: center;
    gap: 0.42rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex: 0 0 auto;
}

.admin-row-actions form {
    margin: 0;
}

@media (max-width: 900px) {
    .admin-row {
        flex-direction: column;
    }

    .admin-row-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Advanced motion + micro-interactions */
.reveal-init {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
    filter: blur(2px);
    transition:
        opacity 420ms ease var(--reveal-delay, 0ms),
        transform 420ms cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0ms),
        filter 360ms ease var(--reveal-delay, 0ms);
}

.reveal-show {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.feed-item,
.card,
.topic-link,
.admin-row,
.engagement-chip {
    transition:
        transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 220ms ease,
        border-color 220ms ease,
        background-color 220ms ease,
        color 220ms ease;
}

.card:hover,
.admin-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(77, 20, 140, 0.12);
}

.feed-item:hover {
    transform: none;
}

.topic-link:hover {
    transform: translateX(2px);
}

.btn:active,
.engagement-chip:active,
.nav-pill:active {
    transform: translateY(0) scale(0.98);
}

.skeleton-item {
    background: linear-gradient(100deg, #f2eafb 12%, #ffffff 32%, #f2eafb 52%);
    background-size: 220% 100%;
    animation: skeletonShift 1.1s linear infinite;
}

@keyframes skeletonShift {
    from {
        background-position: 180% 0;
    }
    to {
        background-position: -40% 0;
    }
}

.toast-item {
    transform: translateY(10px) scale(0.97);
    transition: opacity 220ms ease, transform 220ms ease;
}

.toast-item.visible {
    transform: translateY(0) scale(1);
}

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

    .reveal-init,
    .reveal-show {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }
}

/* Advanced layout hierarchy */
.app-shell {
    gap: 1.5rem;
}

.feed-header {
    position: static;
    z-index: 8;
    border-bottom: 1px solid var(--line);
}

.feed-header-stacked {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "title search"
        "tabs actions";
    align-items: center;
    gap: 0.75rem 0.85rem;
}

.feed-header-stacked > div:first-child {
    grid-area: title;
}

.feed-header-stacked .search-form {
    grid-area: search;
    min-width: min(460px, 100%);
}

.feed-header-stacked .feed-tabs {
    grid-area: tabs;
}

.feed-header-stacked .admin-drawer-toggle {
    grid-area: actions;
    justify-self: end;
}

.left-rail {
    top: calc(var(--header-offset) + 18px);
}

.sidebar {
    position: sticky;
    top: calc(var(--header-offset) + 18px);
    align-self: start;
    height: fit-content;
}

@media (max-width: 1100px) {
    .feed-header-stacked {
        grid-template-columns: 1fr;
        grid-template-areas:
            "title"
            "search"
            "tabs"
            "actions";
    }

    .feed-header-stacked .search-form {
        min-width: 0;
    }

    .feed-header-stacked .admin-drawer-toggle {
        justify-self: start;
    }

    .sidebar {
        position: static;
    }
}

/* Route transitions */
body.page-enter {
    opacity: 0.01;
    transform: translateY(4px);
}

body.page-enter.page-enter-active {
    opacity: 1;
    transform: none;
    transition: opacity 260ms ease, transform 260ms ease;
}

body.page-leaving {
    opacity: 0.02;
    transform: translateY(6px);
    transition: opacity 150ms ease, transform 150ms ease;
}

/* Ripple effects */
.btn,
.engagement-chip,
.topic-link,
.rail-link,
.nav-pill {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.ui-ripple {
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
    background: radial-gradient(circle, color-mix(in srgb, var(--accent) 32%, #ffffff) 0%, rgba(255, 255, 255, 0) 70%);
    transform: scale(0.2);
    opacity: 0.65;
    animation: uiRipple 540ms ease-out forwards;
    z-index: 0;
}

@keyframes uiRipple {
    to {
        transform: scale(1.35);
        opacity: 0;
    }
}

/* Spring-like admin drawer */
.admin-drawer {
    opacity: 0;
    pointer-events: none;
    transition: opacity 260ms ease;
}

.admin-drawer.is-open,
.admin-drawer.is-closing {
    opacity: 1;
    pointer-events: auto;
}

.admin-drawer-panel {
    transform: translateX(105%);
    transition: transform 280ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.admin-drawer.is-open .admin-drawer-panel {
    transform: translateX(0);
}

.admin-drawer.is-closing .admin-drawer-panel {
    transform: translateX(105%);
}

/* Contextual hover depth by page type */
body[data-page-kind="feed"] .feed-item:hover {
    transform: translateY(-2px);
}

body[data-page-kind="feed"] .topic-link:hover {
    transform: translateX(3px) translateY(-1px);
}

body[data-page-kind="question"] .card:hover,
body[data-page-kind="profile"] .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 30px rgba(77, 20, 140, 0.14);
}


body[data-page-kind="admin"] .admin-row:hover,
body[data-page-kind="admin"] .admin-list-item:hover {
    transform: translateY(-1px) scale(1.002);
    box-shadow: 0 10px 24px rgba(77, 20, 140, 0.12);
}

body[data-page-kind="auth"] .card:hover {
    transform: none;
    box-shadow: 0 10px 24px rgba(77, 20, 140, 0.1);
}

/* Counter emphasis */
.stat-value {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
}

.stats-grid .card {
    margin-bottom: 0;
}

.stat-card {
    padding: 0.6rem 0.68rem;
    border-radius: 12px;
    min-height: 74px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.18rem;
    border: 1px solid var(--line);
    background: var(--surface);
}

.stat-compact-card {
    position: relative;
    overflow: hidden;
}

.stat-compact-card::before {
    content: "";
    position: absolute;
    left: 0.6rem;
    top: 0.56rem;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 78%, #ffffff);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, #ffffff);
}

.stat-card .stat-value {
    line-height: 1.1;
    font-size: 1.04rem;
}

.stat-label {
    color: var(--text-soft);
    font-size: 0.72rem;
    line-height: 1.2;
    margin: 0;
    padding-left: 0.9rem;
}

.stat-compact-card .stat-value {
    padding-left: 0.9rem;
}

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

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

/* Question answer cards polish */
.question-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.55rem;
}

.question-section-badge {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-soft);
    font-size: 0.74rem;
    padding: 0.16rem 0.56rem;
    white-space: nowrap;
}

.question-answer-list {
    margin-top: 0.45rem;
}

.question-answer-card {
    border-left: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.68rem 0.74rem;
    background: var(--surface);
    box-shadow: 0 2px 10px rgba(77, 20, 140, 0.06);
}

.question-answer-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.45rem;
}

.question-answer-meta form {
    margin: 0;
}

.answer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.55rem;
    padding: 0.5rem 0.55rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-2);
}

.answer-filter-group {
    display: inline-flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.answer-filter.is-active {
    background: var(--accent);
    color: var(--accent-text);
    border-color: var(--accent);
}

.answer-sort-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    font-size: 0.8rem;
    color: var(--text-soft);
}

.answer-sort-wrap select {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    padding: 0.2rem 0.58rem;
}

.question-answer-author {
    display: flex;
    align-items: center;
    gap: 0.52rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.answer-author-avatar {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid var(--line);
    background: var(--surface-2);
    flex: 0 0 auto;
}

.answer-author-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(145deg, #4d148c, #ff6200);
}

.answer-author-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.answer-author-main strong {
    font-size: 0.86rem;
    line-height: 1.2;
    color: var(--text);
}

.answer-author-main span {
    font-size: 0.72rem;
    color: var(--text-soft);
}

.answer-author-badge {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.24rem;
    border: 1px solid color-mix(in srgb, var(--accent-ground) 45%, #ffffff);
    color: var(--accent-ground);
    background: color-mix(in srgb, var(--accent-ground) 12%, #ffffff);
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.14rem 0.5rem;
}

.answer-author-badge svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

.answer-author-badge.pending {
    border-color: color-mix(in srgb, var(--accent-office) 45%, #ffffff);
    color: var(--accent-office);
    background: color-mix(in srgb, var(--accent-office) 12%, #ffffff);
}

.question-answer-card.is-featured {
    border-color: color-mix(in srgb, var(--accent-ground) 40%, var(--line));
    box-shadow: 0 8px 20px color-mix(in srgb, var(--accent-ground) 18%, transparent);
}

.featured-metric {
    border-color: color-mix(in srgb, var(--accent-ground) 42%, #ffffff);
    color: var(--accent-ground);
    background: color-mix(in srgb, var(--accent-ground) 12%, #ffffff);
}

.answer-helpful-toggle {
    gap: 0.28rem;
}

.answer-helpful-toggle .answer-helpful-count {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.05rem 0.36rem;
    font-size: 0.72rem;
    background: var(--surface-2);
    color: var(--text-soft);
}

.answer-helpful-toggle.is-active {
    border-color: color-mix(in srgb, var(--accent-ground) 42%, #ffffff);
    color: var(--accent-ground);
    background: color-mix(in srgb, var(--accent-ground) 12%, #ffffff);
}

