:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-2: #eef3fa;
    --text: #172033;
    --muted: #66758f;
    --border: rgba(23, 32, 51, .1);
    --accent: #5b45ff;
    --accent-2: #1aa37a;
    --danger: #c84040;
    --shadow: 0 22px 60px rgba(27, 40, 66, .10);
    --radius: 24px;
    --radius-sm: 14px;
    --max: 1240px;
    --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at 10% 0%, rgba(91,69,255,.08), transparent 34rem), var(--bg);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.55;
}
a { color: inherit; }
img { max-width: 100%; height: auto; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
pre { overflow-x: auto; padding: 1rem; border-radius: var(--radius-sm); background: #111b2c; color: #e8f2ff; }
button, input, textarea, select { font: inherit; }
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(18px);
    background: rgba(245, 247, 251, .84);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    max-width: var(--max);
    margin: 0 auto;
    min-height: 78px;
    padding: .75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: space-between;
}
.brand {
    display: flex;
    align-items: center;
    gap: .85rem;
    text-decoration: none;
    min-width: 230px;
}
.brand img { width: 44px; height: 44px; object-fit: contain; }
.brand strong { display: block; font-size: 1.05rem; }
.brand small { display: block; max-width: 360px; color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main-nav { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
.main-nav a {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .62rem .82rem;
    border-radius: 999px;
    text-decoration: none;
    color: var(--muted);
    font-weight: 700;
    font-size: .92rem;
}
.main-nav a:hover, .main-nav a.active { color: var(--text); background: var(--surface); box-shadow: 0 8px 22px rgba(23,32,51,.08); }
.nav-toggle { display: none; border: 0; background: var(--surface); border-radius: 12px; padding: .55rem .7rem; box-shadow: var(--shadow); }
.page-shell { width: min(var(--max), calc(100% - 2rem)); margin: 1.25rem auto 4rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.hero { padding: clamp(1.25rem, 3vw, 2.4rem); display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; margin-bottom: 1rem; }
.hero h1 { margin: .2rem 0 .6rem; line-height: 1.08; font-size: clamp(2rem, 4vw, 4.25rem); letter-spacing: -.05em; }
.hero p { color: var(--muted); max-width: 760px; margin: 0; }
.eyebrow { margin: 0 0 .35rem; color: var(--accent); text-transform: uppercase; letter-spacing: .14em; font-weight: 900; font-size: .75rem; }
.hero-actions, .admin-actions-top, .publisher-actions { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.button {
    border: 0;
    border-radius: 999px;
    padding: .78rem 1.05rem;
    background: var(--accent);
    color: white;
    text-decoration: none;
    cursor: pointer;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    box-shadow: 0 12px 28px rgba(91,69,255,.23);
}
.button.secondary { background: var(--surface-2); color: var(--text); box-shadow: none; }
.button.ghost { background: transparent; color: var(--muted); box-shadow: none; border: 1px solid var(--border); }
.button.danger { background: var(--danger); box-shadow: none; }
.category-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.category-card { padding: 1.2rem; text-decoration: none; display: grid; gap: .45rem; transition: transform .2s ease, box-shadow .2s ease; }
.category-card:hover { transform: translateY(-3px); }
.category-card .cat-icon { font-size: 2rem; }
.category-card strong { font-size: 1.05rem; }
.category-card small { color: var(--muted); }
.toolbar { padding: .85rem; display: flex; gap: .75rem; align-items: center; margin-bottom: 1rem; }
.toolbar input, .toolbar select { border: 1px solid var(--border); border-radius: 999px; padding: .78rem 1rem; background: var(--surface-2); outline: none; }
.toolbar input { flex: 1; min-width: 220px; }
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.post-card { overflow: hidden; display: flex; flex-direction: column; min-height: 100%; position: relative; }
.post-card-image { display: block; aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; }
.post-card-image img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.post-card:hover .post-card-image img { transform: scale(1.035); }
.post-card-body { padding: 1rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.post-meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; color: var(--muted); font-size: .84rem; }
.post-meta a { color: var(--accent); text-decoration: none; font-weight: 800; }
.post-card h2 { margin: 0; font-size: 1.12rem; line-height: 1.18; }
.post-card h2 a { text-decoration: none; }
.post-card p { margin: 0; color: var(--muted); }
.post-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: auto; }
.tag { display: inline-flex; border-radius: 999px; background: var(--surface-2); color: var(--muted); padding: .25rem .5rem; font-size: .78rem; text-decoration: none; }
.quick-admin { display: flex; gap: .4rem; flex-wrap: wrap; padding: 0 1rem 1rem; }
.quick-admin button { border: 1px solid var(--border); border-radius: 999px; background: #fff; cursor: pointer; padding: .35rem .55rem; color: var(--muted); font-size: .78rem; }
.feed-status { text-align: center; color: var(--muted); padding: 1.5rem; }
.loading-state { padding: 1.5rem; color: var(--muted); }
.reader-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1rem; align-items: start; }
.post-reader { padding: clamp(1.2rem, 3vw, 2.5rem); overflow: hidden; }
.reader-sidebar { display: grid; gap: 1rem; position: sticky; top: 96px; }
.compact-card { padding: 1rem; }
.compact-card h3 { margin-top: 0; }
.post-title-main { font-size: clamp(2rem, 4vw, 4.1rem); line-height: 1.04; letter-spacing: -.045em; margin: .4rem 0 1rem; }
.post-cover { margin: -1rem -1rem 1.4rem; border-radius: 20px; overflow: hidden; background: var(--surface-2); }
.post-cover img { width: 100%; max-height: 560px; object-fit: cover; display: block; }
.markdown-body { font-size: 1.05rem; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { line-height: 1.15; margin-top: 1.6em; }
.markdown-body p { margin: 1em 0; }
.markdown-body img { display: block; margin: 1.2rem auto; border-radius: 18px; max-height: 900px; object-fit: contain; }
.markdown-body table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.markdown-body th, .markdown-body td { border: 1px solid var(--border); padding: .6rem; }
.markdown-body blockquote { border-left: 4px solid var(--accent); padding-left: 1rem; color: var(--muted); margin-left: 0; }
.embed-frame { aspect-ratio: 16 / 9; width: 100%; border: 0; border-radius: 18px; overflow: hidden; background: #101828; margin: 1.1rem 0; }
.embed-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem; background: var(--surface-2); border-radius: 18px; margin: 1rem 0; }
.reader-nav a { display: block; padding: .55rem 0; text-decoration: none; border-bottom: 1px solid var(--border); color: var(--muted); }
.reader-nav a:hover { color: var(--accent); }
.comments { margin-top: 1rem; padding: 1rem; }
.comment { border-top: 1px solid var(--border); padding: 1rem 0; }
.comment:first-child { border-top: 0; }
.comment .markdown-body { font-size: .95rem; }
.publish-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 1rem; align-items: start; }
.publisher, .preview { padding: 1.2rem; }
.form-grid, .grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
label { display: grid; gap: .35rem; color: var(--muted); font-weight: 800; font-size: .9rem; }
label.full, .full { grid-column: 1 / -1; }
input, textarea, select { border: 1px solid var(--border); border-radius: 14px; padding: .75rem .85rem; background: #fff; color: var(--text); outline: none; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: rgba(91,69,255,.55); box-shadow: 0 0 0 4px rgba(91,69,255,.08); }
.upload-box { border: 1px dashed var(--border); border-radius: 18px; padding: 1rem; background: var(--surface-2); }
.result-box { margin-top: 1rem; color: var(--muted); }
.result-box.success { color: var(--accent-2); }
.result-box.error { color: var(--danger); }
.muted-preview { color: var(--muted); }
.admin-shell { display: grid; gap: 1rem; }
.admin-hero { padding: 1.4rem; display: flex; justify-content: space-between; gap: 1rem; }
.admin-tabs { display: flex; gap: .5rem; flex-wrap: wrap; }
.admin-tabs a { text-decoration: none; padding: .7rem 1rem; border-radius: 999px; background: var(--surface); color: var(--muted); border: 1px solid var(--border); }
.admin-tabs a.active { background: var(--accent); color: white; }
.admin-panel { padding: 1.2rem; }
.admin-panel.wide { overflow: hidden; }
.admin-form { display: grid; gap: 1rem; }
.admin-form.compact { max-width: 520px; }
.checkbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.checkbox-grid label, label.inline { display: flex; align-items: center; gap: .45rem; font-weight: 700; }
.category-editor { display: grid; gap: 1rem; }
.category-row { display: grid; grid-template-columns: 1fr 1.3fr .55fr .7fr .7fr; gap: .75rem; padding: 1rem; background: var(--surface-2); border-radius: 18px; border: 1px solid var(--border); }
.row-head { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 1rem; }
.notice { padding: .85rem 1rem; border-radius: 16px; background: rgba(26,163,122,.12); color: #0c7657; border: 1px solid rgba(26,163,122,.2); }
.notice.error { background: rgba(200,64,64,.12); color: var(--danger); border-color: rgba(200,64,64,.2); }
.readable { max-width: 880px; }

.network-dropdown-panel {
    width: min(460px, calc(100vw - 2rem));
    grid-template-columns: 1fr;
}
.network-dropdown-panel .network-link {
    align-items: flex-start;
    gap: .65rem;
}
.network-dropdown-panel .network-link strong {
    display: block;
    line-height: 1.15;
}
.network-dropdown-panel .network-link small {
    display: block;
    color: var(--muted);
    font-size: .76rem;
    line-height: 1.35;
    margin-top: .18rem;
}
.network-dropdown-panel .network-link.highlight {
    background: linear-gradient(135deg, rgba(91,69,255,.12), rgba(28,184,138,.12));
    color: var(--text);
    border: 1px solid rgba(91,69,255,.16);
}
.footer-network-links {
    margin-top: .75rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .45rem .7rem;
    align-items: center;
}
.footer-network-links span {
    font-weight: 800;
    color: var(--text);
}
.footer-network-links a {
    color: var(--muted);
    text-decoration: none;
    padding: .34rem .62rem;
    border-radius: 999px;
    background: rgba(255,255,255,.55);
    border: 1px solid var(--border);
}
.footer-network-links a:hover,
.footer-network-links a.highlight {
    color: var(--accent);
    background: rgba(91,69,255,.08);
}

.site-footer { width: min(var(--max), calc(100% - 2rem)); margin: 2rem auto; color: var(--muted); text-align: center; }
.hidden { display: none !important; }
@media (max-width: 1040px) {
    .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .category-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .reader-layout, .publish-layout { grid-template-columns: 1fr; }
    .reader-sidebar { position: static; }
}
@media (max-width: 760px) {
    .header-inner { align-items: flex-start; }
    .nav-toggle { display: inline-flex; }
    .main-nav { display: none; width: 100%; position: absolute; left: 1rem; right: 1rem; top: 72px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: .7rem; justify-content: flex-start; }
    .main-nav.open { display: flex; }
    .brand small { display: none; }
    .hero, .admin-hero { flex-direction: column; align-items: flex-start; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .post-grid, .category-cards, .form-grid, .grid-form, .checkbox-grid { grid-template-columns: 1fr; }
    .category-row { grid-template-columns: 1fr; }
    .post-title-main { font-size: 2rem; }
    .page-shell { width: min(100% - 1rem, var(--max)); }
}

.portal-switcher select {
    border-radius: 999px;
    padding: .58rem .75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 800;
}
.wallet-button {
    border: 1px solid rgba(91,69,255,.28);
    border-radius: 999px;
    padding: .62rem .85rem;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font-weight: 900;
    box-shadow: 0 10px 22px rgba(91,69,255,.2);
}
.login-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 1rem;
}
.login-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 18, 32, .58);
    backdrop-filter: blur(8px);
}
.login-card {
    position: relative;
    width: min(520px, 100%);
    padding: 1.4rem;
    display: grid;
    gap: .9rem;
}
.login-card h2 { margin: 0; }
.login-card p { margin: 0; color: var(--muted); }
.login-close {
    position: absolute;
    top: .75rem;
    right: .75rem;
    border: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--surface-2);
    cursor: pointer;
    font-size: 1.35rem;
    line-height: 1;
}
.wallet-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .7rem;
}
.admin-login { padding: 1.25rem; }
.admin-login-box { display: grid; gap: .85rem; max-width: 620px; }
.site-editor { display: grid; gap: 1rem; }
.site-row {
    display: grid;
    grid-template-columns: .75fr 1.4fr .8fr 1fr;
    gap: .75rem;
    padding: 1rem;
    background: var(--surface-2);
    border-radius: 18px;
    border: 1px solid var(--border);
}
@media (max-width: 760px) {
    .wallet-grid { grid-template-columns: 1fr; }
    .site-row { grid-template-columns: 1fr; }
    .wallet-button, .portal-switcher, .portal-switcher select { width: 100%; }
}

/* Social layer: rewards, votes, comments */
.post-stats {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    align-items: center;
    margin: .7rem 0;
    color: var(--muted);
}
.post-stats span {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: .35rem .6rem;
    font-size: .84rem;
    font-weight: 800;
}
.post-stats small {
    flex-basis: 100%;
    color: var(--muted);
    font-size: .84rem;
}
.post-stats.compact {
    margin: .35rem 0;
    gap: .35rem;
}
.post-stats.compact span {
    padding: .25rem .48rem;
    font-size: .76rem;
}
.social-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    align-items: center;
    margin-top: .65rem;
}
.social-actions.card {
    margin-top: auto;
}
.mini-action {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    border-radius: 999px;
    padding: .42rem .65rem;
    text-decoration: none;
    cursor: pointer;
    font-weight: 900;
    font-size: .82rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
}
.mini-action.vote {
    background: rgba(91,69,255,.08);
    color: var(--accent);
    border-color: rgba(91,69,255,.22);
}
.mini-action.reply {
    background: rgba(26,163,122,.08);
    color: #0c7657;
    border-color: rgba(26,163,122,.22);
}
.vote-weight {
    width: auto;
    border-radius: 999px;
    padding: .38rem .55rem;
    background: var(--surface-2);
    font-size: .82rem;
    font-weight: 800;
}
.action-status {
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
}
.action-status.success,
.form-status.success { color: var(--accent-2); }
.action-status.error,
.form-status.error { color: var(--danger); }
.action-status.loading,
.form-status.loading { color: var(--accent); }
.votes-summary {
    display: grid;
    gap: .35rem;
    margin: 1rem 0;
    padding: .85rem 1rem;
    border-radius: 18px;
    background: var(--surface-2);
    color: var(--muted);
}
.votes-summary strong { color: var(--text); }
.votes-summary span {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .6rem;
}
.votes-summary a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 800;
}
.comments-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: .8rem;
}
.comments-head h2 { margin: 0; }
.comments-head p { margin: 0; color: var(--muted); }
.comment-form,
.comment-login {
    display: grid;
    gap: .75rem;
    padding: 1rem;
    margin: .8rem 0 1rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface-2);
}
.comment-form.compact,
.comment-login.compact {
    margin: .75rem 0;
    background: rgba(238,243,250,.72);
}
.comment-form-head,
.comment-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
}
.comment-form-head span { color: var(--muted); font-size: .9rem; }
.comment-form textarea {
    width: 100%;
    background: #fff;
}
.comment-login p { margin: 0; color: var(--muted); }
.comments-list { display: grid; gap: 0; }
.comment {
    border-top: 1px solid var(--border);
    padding: 1rem 0;
}
.comment:first-child { border-top: 0; }
.comment.depth-1,
.comment.depth-2,
.comment.depth-3 {
    padding-left: 1rem;
    border-left: 3px solid rgba(91,69,255,.14);
}
.comment-children {
    margin-left: .75rem;
    padding-left: .75rem;
    border-left: 1px dashed var(--border);
}
.reply-slot { margin-left: .35rem; }

.author-category-nav {
    padding: .85rem 1rem;
    display: flex;
    gap: .45rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1rem;
}
.author-category-nav strong { margin-right: .25rem; }
.author-category-nav .tag.active {
    background: var(--accent);
    color: #fff;
}

.load-more-wrap {
    display: flex;
    justify-content: center;
    padding: .5rem 0 2rem;
}
.load-more-wrap .button[hidden] { display: none; }
.author-category-nav .tag-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    margin-left: .25rem;
    padding: .08rem .35rem;
    border-radius: 999px;
    background: rgba(98, 73, 239, .12);
    font-size: .76rem;
    font-weight: 800;
}
.muted-inline { color: var(--muted); font-size: .9rem; }

/* v7 visual polish: compact headers, modern menu, calmer typography */
:root {
    --shadow: 0 14px 34px rgba(27, 40, 66, .075);
    --shadow-soft: 0 8px 22px rgba(27, 40, 66, .055);
    --radius: 20px;
    --radius-sm: 12px;
    --max: 1320px;
}
body {
    background:
        radial-gradient(circle at 12% 0%, rgba(91, 69, 255, .07), transparent 28rem),
        radial-gradient(circle at 90% 10%, rgba(26, 163, 122, .06), transparent 24rem),
        var(--bg);
}
.site-header {
    background: rgba(247, 249, 253, .88);
    backdrop-filter: blur(20px) saturate(1.3);
}
.header-inner {
    min-height: 66px;
    padding: .5rem 1rem;
    gap: .8rem;
}
.brand {
    min-width: 205px;
    gap: .65rem;
}
.brand img {
    width: 36px;
    height: 36px;
}
.brand strong {
    font-size: .98rem;
    letter-spacing: -.015em;
}
.brand small {
    font-size: .72rem;
    max-width: 280px;
}
.main-nav {
    flex-wrap: nowrap;
    gap: .3rem;
}
.main-nav > a,
.category-dropdown summary,
.portal-switcher select,
.wallet-button {
    min-height: 38px;
}
.main-nav a {
    padding: .52rem .72rem;
    font-size: .86rem;
    white-space: nowrap;
}
.main-nav a:hover,
.main-nav a.active,
.category-dropdown summary:hover,
.category-dropdown summary.active {
    background: rgba(255,255,255,.9);
    box-shadow: var(--shadow-soft);
}
.category-dropdown {
    position: relative;
}
.category-dropdown summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    border-radius: 999px;
    padding: .52rem .78rem;
    color: var(--muted);
    font-weight: 800;
    font-size: .86rem;
    cursor: pointer;
    user-select: none;
}
.category-dropdown summary::-webkit-details-marker {
    display: none;
}
.category-dropdown summary::after {
    content: "⌄";
    font-size: .75rem;
    opacity: .75;
    transform: translateY(-1px);
}
.category-dropdown[open] summary::after {
    transform: rotate(180deg) translateY(1px);
}
.category-dropdown-panel {
    position: absolute;
    right: 0;
    top: calc(100% + .6rem);
    width: min(520px, calc(100vw - 2rem));
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .35rem;
    padding: .65rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 22px 65px rgba(23,32,51,.16);
    backdrop-filter: blur(16px);
    z-index: 100;
}
.category-dropdown-panel a {
    justify-content: flex-start;
    border-radius: 14px;
    padding: .65rem .7rem;
    background: transparent;
    color: var(--text);
    box-shadow: none;
}
.category-dropdown-panel a.active {
    background: rgba(91,69,255,.09);
    color: var(--accent);
}
.cat-dot {
    width: 1.35rem;
    text-align: center;
    flex: 0 0 auto;
}
.portal-switcher select {
    padding: .48rem 2rem .48rem .8rem;
    font-size: .86rem;
    max-width: 190px;
}
.wallet-button {
    padding: .5rem .78rem;
    font-size: .86rem;
    box-shadow: 0 8px 18px rgba(91,69,255,.18);
}
.page-shell {
    margin-top: 1rem;
}
.card {
    border-color: rgba(23, 32, 51, .085);
}
.hero {
    padding: clamp(1.1rem, 2vw, 1.75rem);
    border-radius: 22px;
    overflow: hidden;
    position: relative;
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(110deg, rgba(91,69,255,.055), transparent 42%, rgba(26,163,122,.05));
}
.hero > * {
    position: relative;
}
.hero h1 {
    font-size: clamp(1.55rem, 2.65vw, 2.85rem);
    letter-spacing: -.035em;
    line-height: 1.08;
    margin: .12rem 0 .45rem;
}
.author-hero h1 {
    font-size: clamp(2rem, 4.2vw, 3.25rem);
    letter-spacing: -.045em;
}
.hero p {
    font-size: .96rem;
    max-width: 760px;
}
.eyebrow {
    font-size: .68rem;
    letter-spacing: .13em;
}
.button {
    padding: .68rem .95rem;
    box-shadow: 0 10px 24px rgba(91,69,255,.18);
}
.category-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .85rem;
}
.category-card {
    padding: 1rem;
    border-radius: 20px;
    min-height: 144px;
}
.category-card .cat-icon {
    font-size: 1.55rem;
}
.category-card strong {
    font-size: .98rem;
}
.category-card small {
    font-size: .86rem;
    line-height: 1.45;
}
.toolbar {
    padding: .65rem;
    border-radius: 18px;
}
.toolbar input,
.toolbar select {
    padding: .65rem .85rem;
    font-size: .92rem;
}
.post-grid {
    gap: .85rem;
}
.post-card {
    border-radius: 18px;
}
.post-card-body {
    padding: .9rem;
    gap: .48rem;
}
.post-card h2 {
    font-size: 1.02rem;
    letter-spacing: -.015em;
}
.post-meta,
.post-card p {
    font-size: .84rem;
}
.post-title-main {
    font-size: clamp(1.75rem, 3.4vw, 3rem);
    letter-spacing: -.035em;
    line-height: 1.08;
}
.markdown-body {
    font-size: 1rem;
}
.markdown-body h1 {
    font-size: clamp(1.55rem, 2.6vw, 2.35rem);
}
.markdown-body h2 {
    font-size: clamp(1.35rem, 2.15vw, 1.95rem);
}
.markdown-body h3 {
    font-size: clamp(1.15rem, 1.75vw, 1.55rem);
}
.author-category-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .45rem;
    padding: .65rem .8rem;
    border-radius: 18px;
}
.author-category-nav .tag {
    padding: .32rem .58rem;
    font-size: .79rem;
}
.tag.active {
    background: var(--accent);
    color: white;
}
.tag-count {
    opacity: .8;
    font-weight: 900;
    margin-left: .25rem;
}
.load-more-wrap {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}
.site-footer {
    font-size: .88rem;
}
@media (min-width: 1260px) {
    .post-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1120px) {
    .brand { min-width: 170px; }
    .brand small { display: none; }
    .portal-switcher select { max-width: 150px; }
}
@media (max-width: 900px) {
    .main-nav { flex-wrap: wrap; }
    .category-dropdown-panel { left: 0; right: auto; }
}
@media (max-width: 760px) {
    .header-inner {
        min-height: 62px;
        align-items: center;
    }
    .main-nav {
        top: 64px;
        left: .75rem;
        right: .75rem;
        max-height: calc(100vh - 84px);
        overflow-y: auto;
        border: 1px solid var(--border);
    }
    .category-dropdown,
    .category-dropdown summary,
    .category-dropdown-panel {
        width: 100%;
    }
    .category-dropdown-panel {
        position: static;
        grid-template-columns: 1fr;
        margin-top: .45rem;
        box-shadow: none;
        background: var(--surface-2);
    }
    .hero h1 {
        font-size: clamp(1.45rem, 8vw, 2.15rem);
    }
    .author-hero h1 {
        font-size: clamp(1.95rem, 11vw, 2.7rem);
    }
    .category-cards {
        grid-template-columns: 1fr;
    }
    .post-title-main {
        font-size: clamp(1.55rem, 8vw, 2.25rem);
    }
}

/* v8: language filter */
.toolbar-select {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    color: var(--muted);
    font-weight: 800;
    font-size: .86rem;
    white-space: nowrap;
}
.toolbar-select span {
    opacity: .8;
}
.language-filter-label select {
    min-width: 150px;
    cursor: pointer;
}
.language-badge {
    display: inline-flex;
    align-items: center;
    gap: .22rem;
    padding: .18rem .45rem;
    border-radius: 999px;
    background: rgba(91, 69, 255, .09);
    color: var(--accent);
    font-size: .76rem;
    font-weight: 900;
    line-height: 1.2;
}
.language-badge.unknown {
    background: var(--surface-2);
    color: var(--muted);
}
.login-card select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: .85rem 1rem;
    background: var(--surface-2);
    outline: none;
}
.login-card label small {
    display: block;
    margin-top: .35rem;
    color: var(--muted);
    font-size: .8rem;
    line-height: 1.35;
}
@media (max-width: 760px) {
    .toolbar-select {
        width: 100%;
        justify-content: space-between;
    }
    .language-filter-label select {
        min-width: 0;
        flex: 1;
    }
}

/* v11: UI language switcher */
.ui-language-switcher {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .15rem .2rem .15rem .55rem;
    border-radius: 999px;
    background: rgba(255,255,255,.74);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: .76rem;
    font-weight: 900;
    white-space: nowrap;
}
.ui-language-switcher select {
    border: 0;
    border-left: 1px solid var(--border);
    background: transparent;
    padding: .42rem .45rem;
    color: var(--text);
    font-weight: 900;
    outline: none;
    max-width: 130px;
}
.ui-language-switcher span { opacity: .82; }
@media (max-width: 760px) {
    .ui-language-switcher,
    .ui-language-switcher select {
        width: 100%;
        max-width: none;
    }
    .ui-language-switcher { justify-content: space-between; }
}

/* v14: subcategories, lightbox, optimistic comments */
.subcategory-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .45rem;
    padding: .75rem .85rem;
    margin-bottom: 1rem;
    border-radius: 18px;
}
.subcategory-nav strong { margin-right: .25rem; }
.subcategory-nav .tag,
.author-category-nav .tag.subtag {
    border: 1px solid rgba(91,69,255,.10);
}
.author-category-nav .tag.subtag {
    background: rgba(91,69,255,.07);
}
.author-category-nav .tag.subtag.active,
.subcategory-nav .tag.active {
    background: var(--accent);
    color: #fff;
}
.markdown-body img.lightbox-enabled,
.post-cover img.lightbox-enabled {
    cursor: zoom-in;
}
.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: grid;
    place-items: center;
    padding: 2rem;
    background: rgba(7, 12, 22, .86);
    backdrop-filter: blur(10px);
}
.image-lightbox img {
    max-width: min(96vw, 1600px);
    max-height: 88vh;
    object-fit: contain;
    border-radius: 18px;
    box-shadow: 0 24px 90px rgba(0,0,0,.45);
    background: #0f1728;
}
.image-lightbox p {
    margin: .75rem 0 0;
    max-width: min(96vw, 1100px);
    color: rgba(255,255,255,.86);
    text-align: center;
}
.lightbox-close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}
body.lightbox-open { overflow: hidden; }
.pending-comment {
    border: 1px dashed rgba(91,69,255,.38);
    border-radius: 18px;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(91,69,255,.07), rgba(26,163,122,.05));
}
.pending-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: .18rem .45rem;
    background: rgba(91,69,255,.12);
    color: var(--accent);
    font-weight: 900;
    font-size: .74rem;
}
@media (max-width: 760px) {
    .image-lightbox { padding: .75rem; }
    .image-lightbox img { max-width: 96vw; max-height: 82vh; }
}

/* v16 SEO snapshot rendered by PHP before JavaScript hydrates the reader. */
.seo-post-snapshot {
    display: block;
}
.seo-post-snapshot .post-main-image {
    width: 100%;
    max-height: 520px;
    object-fit: cover;
    border-radius: 24px;
    margin: 18px 0;
}
.seo-plain-body p {
    margin: 0 0 1rem;
}

/* v17: większe logo, foto-layout i ulepszony lightbox z galerią */
.header-inner .brand img {
    width: 52px;
    height: 52px;
}
.header-inner .brand {
    min-width: 240px;
}
.header-inner .brand strong {
    font-size: 1.06rem;
}
@media (max-width: 760px) {
    .header-inner .brand img { width: 44px; height: 44px; }
    .header-inner .brand { min-width: 0; }
}

.image-lightbox {
    padding: 2.5rem 4.75rem;
    background: rgba(3, 7, 18, .92);
}
.lightbox-content {
    width: calc(100vw - 9.5rem);
    height: calc(100vh - 5rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .75rem;
}
.image-lightbox img,
.image-lightbox .lightbox-image {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: calc(100vh - 8.5rem);
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 26px 100px rgba(0,0,0,.55);
    background: #020617;
}
.lightbox-footer {
    min-height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: rgba(255,255,255,.88);
}
.image-lightbox p,
.image-lightbox .lightbox-caption {
    margin: 0;
    max-width: min(90vw, 1100px);
    color: rgba(255,255,255,.88);
    text-align: center;
}
.lightbox-counter {
    color: rgba(255,255,255,.66);
    font-weight: 800;
    white-space: nowrap;
}
.lightbox-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 54px;
    height: 74px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 999px;
    background: rgba(255,255,255,.10);
    color: #fff;
    font-size: 3.2rem;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background .18s ease, transform .18s ease;
}
.lightbox-arrow:hover {
    background: rgba(255,255,255,.2);
}
.lightbox-prev { left: 1.35rem; }
.lightbox-next { right: 1.35rem; }
@media (max-width: 760px) {
    .image-lightbox { padding: 1rem; }
    .lightbox-content { width: 100%; height: calc(100vh - 2rem); }
    .image-lightbox img,
    .image-lightbox .lightbox-image { max-height: calc(100vh - 6rem); border-radius: 12px; }
    .lightbox-arrow { width: 42px; height: 58px; font-size: 2.3rem; background: rgba(0,0,0,.25); }
    .lightbox-prev { left: .5rem; }
    .lightbox-next { right: .5rem; }
}

body[data-category="fotografia"] {
    background:
        radial-gradient(circle at 8% 0%, rgba(91, 69, 255, .08), transparent 30rem),
        radial-gradient(circle at 92% 18%, rgba(10, 25, 47, .10), transparent 28rem),
        linear-gradient(180deg, #f7f8fb 0%, #eef2f7 100%);
}
body[data-category="fotografia"] .hero {
    background:
        linear-gradient(135deg, rgba(2,6,23,.88), rgba(30,41,59,.78)),
        radial-gradient(circle at 85% 20%, rgba(91,69,255,.42), transparent 18rem);
    color: #fff;
    border-color: rgba(255,255,255,.16);
}
body[data-category="fotografia"] .hero p,
body[data-category="fotografia"] .hero .eyebrow {
    color: rgba(255,255,255,.78);
}
body[data-category="fotografia"] .post-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
}
body[data-category="fotografia"] .post-card.photo-card {
    background: #fff;
    border-radius: 22px;
    overflow: hidden;
}
body[data-category="fotografia"] .post-card.photo-card .post-card-image {
    aspect-ratio: 4 / 5;
}
body[data-category="fotografia"] .post-card.photo-card .post-card-image img {
    transform-origin: center;
}
body[data-category="fotografia"] .post-card.photo-card .post-card-body {
    padding: .85rem .9rem .95rem;
}
body[data-category="fotografia"] .post-card.photo-card h2 {
    font-size: .98rem;
    line-height: 1.18;
}
body[data-category="fotografia"] .post-card.photo-card p {
    font-size: .8rem;
    line-height: 1.42;
}
body[data-category="fotografia"] .post-card.photo-featured {
    grid-column: span 2;
    grid-row: span 2;
}
body[data-category="fotografia"] .post-card.photo-featured .post-card-image {
    aspect-ratio: 16 / 10;
}
body[data-category="fotografia"] .post-card.photo-featured h2 {
    font-size: clamp(1.35rem, 2vw, 2rem);
}
body[data-category="fotografia"] .post-tags .tag {
    background: rgba(15,23,42,.06);
}
@media (max-width: 1180px) {
    body[data-category="fotografia"] .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    body[data-category="fotografia"] .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body[data-category="fotografia"] .post-card.photo-featured { grid-column: span 2; }
}
@media (max-width: 560px) {
    body[data-category="fotografia"] .post-grid { grid-template-columns: 1fr; }
    body[data-category="fotografia"] .post-card.photo-featured { grid-column: auto; grid-row: auto; }
}

/* v18: richer media embeds and thematic reader navigation */
.embed-native {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 18px;
    background: #101828;
    margin: 1.1rem 0;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .10);
}
.embed-video { aspect-ratio: 16 / 9; max-height: 72vh; }
.embed-audio { min-height: 54px; padding: .35rem; }
.media-service-card {
    align-items: center;
    border: 1px solid rgba(91, 69, 255, .12);
    background: linear-gradient(135deg, rgba(91,69,255,.07), rgba(26,163,122,.05));
}
.media-service-card p {
    margin: .22rem 0 0;
    color: var(--muted);
    font-size: .92rem;
}
.reader-nav {
    display: grid;
    gap: 1rem;
}
.reader-nav-group {
    display: grid;
    gap: .45rem;
}
.reader-nav-group h4 {
    margin: 0 0 .15rem;
    font-size: .86rem;
    letter-spacing: .02em;
    color: var(--muted);
    text-transform: uppercase;
}
.reader-nav a.reader-nav-item {
    display: grid;
    gap: .15rem;
    padding: .7rem .75rem;
    text-decoration: none;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 16px;
    background: rgba(255,255,255,.72);
    color: var(--text);
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.reader-nav a.reader-nav-item:hover {
    color: var(--text);
    border-color: rgba(91,69,255,.30);
    box-shadow: 0 10px 28px rgba(91,69,255,.10);
    transform: translateY(-1px);
}
.reader-nav-item span {
    color: var(--accent);
    font-weight: 900;
    font-size: .78rem;
}
.reader-nav-item strong {
    font-size: .94rem;
    line-height: 1.25;
}
.reader-nav-item em {
    color: var(--muted);
    font-size: .78rem;
    font-style: normal;
}
.reader-nav-empty,
.reader-nav-loading {
    margin: 0;
    padding: .75rem;
    border-radius: 14px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: .9rem;
}
.reader-related-list .reader-nav-item:nth-child(n+7) {
    display: none;
}
@media (max-width: 900px) {
    .reader-related-list .reader-nav-item:nth-child(n+7) { display: grid; }
}

/* v25: tryb wyświetlania obrazka wyróżniającego na stronie wpisu.
   Domyślnie można wyłączyć dodatkowe zdjęcie, żeby treść zaczynała się od razu po tytule. */
.post-cover[data-featured-mode="cover"] {
    margin: 1.1rem 0 1.4rem;
    border-radius: 22px;
    overflow: hidden;
    background: var(--surface-2);
}
.post-cover[data-featured-mode="cover"] img {
    width: 100%;
    max-height: 520px;
    object-fit: cover;
    display: block;
}
.post-hero-banner {
    position: relative;
    min-height: clamp(220px, 27vw, 340px);
    margin: -0.35rem -0.35rem 1.25rem;
    border-radius: 26px;
    overflow: hidden;
    isolation: isolate;
    background: var(--surface-2);
    box-shadow: 0 22px 52px rgba(15, 23, 42, .13);
}
.post-hero-banner img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.01);
}
.post-hero-shade {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(90deg, rgba(7, 12, 22, .78), rgba(7, 12, 22, .35) 55%, rgba(7, 12, 22, .12)),
        linear-gradient(0deg, rgba(7, 12, 22, .58), rgba(7, 12, 22, .05));
}
.post-hero-content {
    position: relative;
    z-index: 2;
    min-height: inherit;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: .65rem;
    padding: clamp(1.15rem, 3vw, 2.1rem);
    color: #fff;
}
.post-hero-content .post-meta,
.post-hero-content .post-meta a,
.post-hero-content .post-meta span,
.post-hero-content .language-badge {
    color: rgba(255,255,255,.92);
}
.post-title-on-cover {
    color: #fff;
    text-shadow: 0 6px 22px rgba(0, 0, 0, .35);
    max-width: 980px;
    margin: 0;
    font-size: clamp(2rem, 4.7vw, 4rem);
}
.seo-post-snapshot .post-main-image[data-featured-mode="cover"] {
    width: 100%;
    max-height: 520px;
    object-fit: cover;
    border-radius: 24px;
    margin: 18px 0;
}
.seo-post-snapshot .post-hero-banner {
    margin-bottom: 1.2rem;
}
@media (max-width: 760px) {
    .post-hero-banner {
        min-height: 220px;
        margin-left: 0;
        margin-right: 0;
        border-radius: 20px;
    }
    .post-hero-content {
        padding: 1rem;
    }
    .post-title-on-cover {
        font-size: clamp(1.65rem, 10vw, 2.35rem);
    }
}

/* v26: szersze logo i stabilniejsze osadzanie YouTube/Suno */
.header-inner .brand {
    min-width: 390px;
    gap: .9rem;
}
.header-inner .brand img {
    width: 200px;
    height: 52px;
    max-width: 40vw;
    object-fit: contain;
    object-position: left center;
    flex: 0 0 auto;
}
.header-inner .brand strong {
    font-size: 1.05rem;
    line-height: 1.1;
}
.header-inner .brand small {
    max-width: 260px;
}
.youtube-lite {
    position: relative;
    display: grid;
    place-items: center;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    box-shadow: 0 16px 38px rgba(15, 23, 42, .14);
}
.youtube-lite::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at center, rgba(255,255,255,.08), transparent 28%), linear-gradient(rgba(0,0,0,.06), rgba(0,0,0,.48));
    pointer-events: none;
}
.youtube-lite-play {
    position: relative;
    z-index: 2;
    width: 76px;
    height: 54px;
    border: 0;
    border-radius: 18px;
    background: #ff0033;
    color: #fff;
    font-size: 1.85rem;
    line-height: 1;
    box-shadow: 0 16px 35px rgba(0, 0, 0, .32);
    cursor: pointer;
}
.youtube-lite-caption {
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 2;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .55rem;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,.42);
}
.youtube-lite-caption a {
    color: #fff;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}
iframe[title="Suno"], .embed-frame[title="Suno"] {
    min-height: 240px;
    aspect-ratio: 16 / 5;
}
@media (max-width: 980px) {
    .header-inner .brand { min-width: 220px; }
    .header-inner .brand img { width: 150px; height: 42px; max-width: 36vw; }
    .header-inner .brand small { display: none; }
}
@media (max-width: 640px) {
    .header-inner .brand { min-width: 0; }
    .header-inner .brand img { width: 118px; height: 34px; max-width: 48vw; }
    .header-inner .brand strong { font-size: .95rem; }
}

/* v27 account menu, notifications and user settings */
.account-nav {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
}
.account-menu-wrap { position: relative; display: inline-flex; }
.notification-button {
    position: relative;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    width: 42px;
    height: 42px;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(23,32,51,.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.notification-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--danger);
    color: white;
    font-size: .68rem;
    line-height: 18px;
    font-weight: 900;
}
.account-dropdown,
.notifications-panel {
    position: absolute;
    right: 0;
    top: calc(100% + .65rem);
    width: min(360px, calc(100vw - 2rem));
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow);
    z-index: 90;
    padding: .65rem;
}
.account-dropdown::before,
.notifications-panel::before {
    content: "";
    position: absolute;
    top: -8px;
    right: 24px;
    width: 14px;
    height: 14px;
    transform: rotate(45deg);
    background: var(--surface);
    border-left: 1px solid var(--border);
    border-top: 1px solid var(--border);
}
.account-dropdown-head {
    padding: .75rem .8rem .65rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: .35rem;
}
.account-dropdown-head small {
    display: block;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 800;
}
.account-dropdown-head strong { font-size: 1.08rem; }
.account-dropdown a,
.account-dropdown button {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    border-radius: 14px;
    padding: .72rem .78rem;
    display: flex;
    align-items: center;
    gap: .65rem;
    font-weight: 800;
    text-align: left;
}
.account-dropdown a:hover,
.account-dropdown button:hover { background: var(--surface-2); }
.account-dropdown .danger-link { color: var(--danger); }
.notifications-panel {
    right: 0;
    width: min(440px, calc(100vw - 2rem));
    max-height: min(72vh, 680px);
    overflow: auto;
}
.notifications-panel header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .35rem .45rem .6rem;
    border-bottom: 1px solid var(--border);
}
.notifications-panel header button {
    border: 0;
    background: var(--surface-2);
    border-radius: 999px;
    width: 34px;
    height: 34px;
    cursor: pointer;
    font-weight: 900;
}
.notifications-toolbar { padding: .65rem .35rem .35rem; }
.activity-section { padding: .55rem .35rem .25rem; }
.activity-section h4 {
    margin: .35rem 0 .45rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .76rem;
}
.activity-item {
    display: grid;
    gap: .2rem;
    padding: .65rem .7rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    text-decoration: none;
    margin-bottom: .45rem;
    background: rgba(255,255,255,.65);
}
.activity-item:hover { border-color: rgba(91,69,255,.35); background: var(--surface-2); }
.activity-item strong { font-size: .92rem; line-height: 1.25; }
.activity-item small { color: var(--muted); }
.hidden { display: none !important; }

@media (max-width: 860px) {
    .account-nav { width: 100%; justify-content: flex-start; }
    .account-menu-wrap { flex: 1; }
    .account-menu-wrap .wallet-button { width: 100%; }
    .account-dropdown, .notifications-panel {
        right: auto;
        left: 0;
        width: min(100%, calc(100vw - 2rem));
    }
    .account-dropdown::before, .notifications-panel::before { right: auto; left: 24px; }
}


/* v28: cleaner header, network menu wrapping, avatar account button */
.main-nav > a[data-i18n="nav.start"] { display: none !important; }
.network-dropdown-panel {
    width: min(420px, calc(100vw - 1.4rem));
    max-width: calc(100vw - 1.4rem);
}
.network-dropdown-panel .network-link {
    white-space: normal !important;
    min-width: 0;
    align-items: flex-start;
    padding: .72rem .78rem;
}
.network-dropdown-panel .network-link > span:last-child {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: normal;
}
.network-dropdown-panel .network-link strong,
.network-dropdown-panel .network-link small {
    white-space: normal !important;
    overflow-wrap: anywhere;
    hyphens: auto;
}
.network-dropdown-panel .network-link small {
    max-width: 100%;
}
.wallet-button.avatar-button {
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    border-radius: 999px;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,.86);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 10px 24px rgba(91,69,255,.22);
}
.account-avatar {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    color: #fff;
    font-weight: 950;
    letter-spacing: -.03em;
}
.account-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.account-avatar-fallback {
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.account-avatar.avatar-broken img { display: none; }
.account-avatar.avatar-broken .account-avatar-fallback { display: inline-flex; }
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
@media (max-width: 860px) {
    .account-menu-wrap { flex: 0 0 auto; }
    .account-menu-wrap .wallet-button.avatar-button { width: 44px; min-width: 44px; }
    .network-dropdown-panel { width: min(100%, calc(100vw - 2rem)); }
}

/* v29: notification preview, account activity tabs and modern post layouts */
.notifications-toolbar {
    display: flex;
    align-items: center;
    gap: .55rem;
    justify-content: space-between;
}
.notifications-toolbar .button { padding: .55rem .8rem; }
.activity-panel-footer {
    padding: .4rem .35rem .15rem;
    display: flex;
    justify-content: flex-end;
}
.activity-page .hero { margin-bottom: 1rem; }
.activity-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    padding: .7rem;
    margin-bottom: 1rem;
}
.activity-tabs a {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    text-decoration: none;
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 999px;
    padding: .65rem .95rem;
    font-weight: 900;
    color: var(--muted);
}
.activity-tabs a.active,
.activity-tabs a:hover {
    color: var(--accent);
    border-color: rgba(91,69,255,.32);
    background: rgba(91,69,255,.08);
}
.activity-page-card { padding: 1rem; }
.activity-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: .85rem;
    margin-bottom: .85rem;
}
.activity-page-head h2 { margin: 0; font-size: clamp(1.35rem, 2vw, 1.85rem); }
.activity-page-content .activity-section { padding: .35rem 0 1rem; }
.activity-item-large {
    grid-template-columns: 1fr;
    padding: .9rem 1rem;
    border-radius: 18px;
}
.activity-item-large span { color: var(--muted); line-height: 1.55; }

.post-grid.layout-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .85rem;
}
.post-grid.layout-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: .8rem;
}
.post-grid.layout-list .post-card {
    display: grid;
    grid-template-columns: minmax(220px, 31%) 1fr;
    min-height: 0;
}
.post-grid.layout-list .post-card-image {
    height: 100%;
    min-height: 190px;
    aspect-ratio: auto;
}
.post-grid.layout-list .post-card-body {
    padding: 1rem 1.1rem;
}
.post-grid.layout-list .post-card h2 { font-size: clamp(1.15rem, 1.8vw, 1.55rem); }
.post-grid.layout-compact {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
}
.post-grid.layout-compact .post-card-image { display: none; }
.post-grid.layout-compact .post-card-body { padding: .85rem; }
.post-grid.layout-compact .post-card h2 { font-size: 1rem; }
.post-grid.layout-compact .post-tags { display: none; }
.post-grid.layout-compact .post-card p { font-size: .82rem; }
.post-grid.layout-magazine {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .9rem;
}
.post-grid.layout-magazine .post-card:first-child {
    grid-column: span 2;
    grid-row: span 2;
}
.post-grid.layout-magazine .post-card:first-child .post-card-image { aspect-ratio: 16 / 10; }
.post-grid.layout-magazine .post-card:first-child h2 { font-size: clamp(1.45rem, 2.4vw, 2.15rem); }
.post-grid.layout-magazine .post-card:first-child p { font-size: .98rem; }
.view-mode-label select { min-width: 135px; }
@media (max-width: 1100px) {
    .post-grid.layout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .post-grid.layout-magazine { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .post-grid.layout-grid,
    .post-grid.layout-compact,
    .post-grid.layout-magazine { grid-template-columns: 1fr; }
    .post-grid.layout-list .post-card { grid-template-columns: 1fr; }
    .post-grid.layout-list .post-card-image { min-height: 180px; aspect-ratio: 16 / 9; }
    .post-grid.layout-magazine .post-card:first-child { grid-column: auto; grid-row: auto; }
    .activity-page-head { align-items: flex-start; flex-direction: column; }
}
.author-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    padding: .7rem;
    margin-bottom: 1rem;
}
.author-tabs a {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    text-decoration: none;
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 999px;
    padding: .65rem .95rem;
    font-weight: 900;
    color: var(--muted);
}
.author-tabs a.active,
.author-tabs a:hover {
    color: var(--accent);
    border-color: rgba(91,69,255,.32);
    background: rgba(91,69,255,.08);
}

/* v30: dopracowanie bloku logo + nazwa portalu */
.header-inner .brand {
    gap: 0;
    min-width: 0;
    flex: 0 1 auto;
    align-items: center;
}
.header-inner .brand > span {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 52px;
    max-width: 200px;
    padding-left: 0;
    margin-left: 0;
    overflow-wrap: anywhere;
    word-break: normal;
}
.header-inner .brand strong {
    max-width: 200px;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.12;
}
.header-inner .brand small {
    max-width: 200px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.25;
}
@media (max-width: 760px) {
    .header-inner .brand > span {
        min-height: 38px;
        max-width: 120px;
    }
    .header-inner .brand strong,
    .header-inner .brand small {
        max-width: 120px;
    }
}

/* v31: stabilne miniatury wpisów i czystsze kafelki
   Karty/listy mają zawsze proporcje 16:9, a dłuższe zdjęcia są kadrowane przez cover. */
.post-card .post-card-image,
body[data-category="fotografia"] .post-card.photo-card .post-card-image,
body[data-category="fotografia"] .post-card.photo-featured .post-card-image,
.post-grid.layout-magazine .post-card:first-child .post-card-image {
    aspect-ratio: 16 / 9 !important;
    height: auto !important;
    min-height: 0 !important;
    background: var(--surface-2);
}
.post-card .post-card-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center;
}
.post-card .post-tags {
    display: none !important;
}
.post-grid.layout-list .post-card {
    grid-template-columns: minmax(220px, 320px) minmax(0, 1fr) !important;
    align-items: start;
}
.post-grid.layout-list .post-card-image {
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    align-self: start;
}
body[data-category="fotografia"] .post-card.photo-featured {
    grid-column: span 2;
    grid-row: auto;
}
body[data-category="fotografia"] .post-card.photo-card .post-card-body {
    min-height: 0;
}
@media (max-width: 760px) {
    .post-grid.layout-list .post-card {
        grid-template-columns: 1fr !important;
    }
    .post-grid.layout-list .post-card-image {
        aspect-ratio: 16 / 9 !important;
    }
    body[data-category="fotografia"] .post-card.photo-featured {
        grid-column: auto;
    }
}

/* v32: widok fotograficzny, większe menu sieci, cookies */
.category-dropdown.network-dropdown { position: relative; }
.network-dropdown-panel {
    width: min(620px, calc(100vw - 2rem));
    max-height: min(72vh, 720px);
    overflow: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .6rem;
    padding: .85rem;
}
.network-dropdown-panel .network-link {
    align-items: flex-start;
    min-width: 0;
    white-space: normal;
    line-height: 1.25;
}
.network-dropdown-panel .network-link > span:last-child { min-width: 0; max-width: 100%; }
.network-dropdown-panel .network-link strong,
.network-dropdown-panel .network-link small {
    display: block;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
}
.network-dropdown-panel .network-link small { margin-top: .16rem; opacity: .72; font-size: .76rem; }

.post-grid.layout-photo {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}
.photo-gallery-card {
    position: relative;
    overflow: hidden;
    padding: 0;
    min-height: 0;
    background: #111827;
}
.photo-gallery-open {
    appearance: none;
    border: 0;
    padding: 0;
    margin: 0;
    width: 100%;
    aspect-ratio: 4 / 5;
    display: block;
    position: relative;
    cursor: zoom-in;
    background: #0f172a;
    color: #fff;
    text-align: left;
    overflow: hidden;
}
.photo-gallery-open img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .28s ease, filter .28s ease;
}
.photo-gallery-card:hover .photo-gallery-open img { transform: scale(1.045); filter: saturate(1.04); }
.photo-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15,23,42,.06) 0%, rgba(15,23,42,.25) 45%, rgba(15,23,42,.88) 100%);
    pointer-events: none;
}
.photo-badge {
    position: absolute;
    top: .8rem;
    right: .8rem;
    border-radius: 999px;
    padding: .3rem .55rem;
    background: rgba(255,255,255,.9);
    color: #172033;
    font-size: .78rem;
    font-weight: 800;
    box-shadow: 0 8px 24px rgba(0,0,0,.16);
}
.photo-card-text {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1rem;
    color: #fff;
    display: grid;
    gap: .35rem;
    z-index: 2;
}
.photo-card-text .post-meta { color: rgba(255,255,255,.86); margin: 0; }
.photo-card-text strong { font-size: clamp(1.05rem, 1.55vw, 1.45rem); line-height: 1.1; text-shadow: 0 2px 10px rgba(0,0,0,.35); }
.photo-card-actions {
    position: absolute;
    z-index: 3;
    left: .75rem;
    right: .75rem;
    bottom: .75rem;
    display: flex;
    gap: .45rem;
    justify-content: space-between;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease;
}
.photo-gallery-card:hover .photo-card-actions,
.photo-gallery-card:focus-within .photo-card-actions { opacity: 1; transform: translateY(0); }
.photo-card-actions .button { min-height: 34px; padding: .45rem .75rem; background: rgba(255,255,255,.92); }

.post-grid.layout-list .post-card { grid-template-columns: minmax(180px, 320px) minmax(0, 1fr); align-items: stretch; }
.post-grid.layout-list .post-card-image { aspect-ratio: 16 / 9; min-height: 0; height: auto; }
.post-grid.layout-list .post-card-image img { object-fit: cover; }

.markdown-body table img { max-width: 100%; height: auto; border-radius: .75rem; }
.markdown-body table td { vertical-align: top; }
.markdown-body table { display: block; max-width: 100%; overflow-x: auto; }

.cookie-panel {
    position: fixed;
    z-index: 99999;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    max-width: 760px;
    margin: 0 auto;
    background: rgba(255,255,255,.98);
    border: 1px solid rgba(60,75,110,.14);
    border-radius: 1.2rem;
    box-shadow: 0 20px 70px rgba(15,23,42,.22);
    padding: 1rem;
    display: grid;
    gap: .7rem;
}
.cookie-panel.hidden { display: none; }
.cookie-panel h2 { margin: 0; font-size: 1rem; }
.cookie-panel p { margin: 0; color: var(--muted); font-size: .9rem; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.privacy-content { max-width: 900px; }
.privacy-content h1 { font-size: clamp(1.8rem, 3vw, 2.5rem); }
.privacy-content h2 { margin-top: 1.6rem; }

@media (max-width: 900px) {
    .network-dropdown-panel { grid-template-columns: 1fr; }
    .post-grid.layout-photo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
    .post-grid.layout-photo { grid-template-columns: 1fr; }
    .post-grid.layout-list .post-card { grid-template-columns: 1fr; }
    .photo-gallery-open { aspect-ratio: 16 / 11; }
    .photo-card-actions { position: static; opacity: 1; transform: none; padding: .65rem; background: #fff; }
}


/* v34: poprawki moderacji z listy i stabilny tryb listy dla portalu Fotografia */
.quick-admin button[disabled] {
    opacity: .65;
    cursor: wait;
}
.post-card.admin-action-done {
    outline: 2px solid rgba(16, 185, 129, .45);
    outline-offset: 2px;
}
body[data-category="fotografia"] .post-grid.layout-list {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: .85rem !important;
}
body[data-category="fotografia"] .post-grid.layout-list .post-card {
    display: grid !important;
    grid-template-columns: minmax(190px, 320px) minmax(0, 1fr) !important;
    align-items: stretch !important;
    min-height: 0 !important;
    overflow: hidden !important;
}
body[data-category="fotografia"] .post-grid.layout-list .post-card-image {
    width: 100% !important;
    aspect-ratio: 16 / 9 !important;
    height: auto !important;
    min-height: 0 !important;
    align-self: start !important;
}
body[data-category="fotografia"] .post-grid.layout-list .post-card-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}
body[data-category="fotografia"] .post-grid.layout-list .post-card-body {
    min-width: 0 !important;
    padding: 1rem 1.1rem !important;
}
body[data-category="fotografia"] .post-grid.layout-list .post-card h2 {
    font-size: clamp(1.15rem, 1.7vw, 1.55rem) !important;
    line-height: 1.16 !important;
}
body[data-category="fotografia"] .post-grid.layout-list .post-card p {
    font-size: .9rem !important;
    line-height: 1.55 !important;
}
body[data-category="fotografia"] .post-grid.layout-list .post-card.photo-featured {
    grid-column: auto !important;
    grid-row: auto !important;
}
body[data-category="fotografia"] .post-grid.layout-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}
body[data-category="fotografia"] .post-grid.layout-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
body[data-category="fotografia"] .post-grid.layout-magazine {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}
body[data-category="fotografia"] .post-grid.layout-photo {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}
@media (max-width: 900px) {
    body[data-category="fotografia"] .post-grid.layout-list .post-card {
        grid-template-columns: 1fr !important;
    }
    body[data-category="fotografia"] .post-grid.layout-grid,
    body[data-category="fotografia"] .post-grid.layout-compact,
    body[data-category="fotografia"] .post-grid.layout-magazine,
    body[data-category="fotografia"] .post-grid.layout-photo {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}
@media (max-width: 620px) {
    body[data-category="fotografia"] .post-grid.layout-grid,
    body[data-category="fotografia"] .post-grid.layout-compact,
    body[data-category="fotografia"] .post-grid.layout-magazine,
    body[data-category="fotografia"] .post-grid.layout-photo {
        grid-template-columns: 1fr !important;
    }
}

/* v37: jasny/ciemny motyw całej instalacji */
html[data-color-scheme="dark"] {
    --bg: #0e1522;
    --surface: #151f2e;
    --surface-2: #202b3d;
    --text: #edf4ff;
    --muted: #9baeca;
    --border: rgba(255,255,255,.12);
    --shadow: 0 22px 60px rgba(0,0,0,.34);
}
html[data-color-scheme="dark"] body {
    background: radial-gradient(circle at 12% 0%, rgba(91,69,255,.18), transparent 34rem), radial-gradient(circle at 90% 10%, rgba(26,163,122,.12), transparent 28rem), var(--bg);
}
html[data-color-scheme="dark"] .site-header {
    background: rgba(14,21,34,.86);
}
html[data-color-scheme="dark"] input,
html[data-color-scheme="dark"] textarea,
html[data-color-scheme="dark"] select {
    color: var(--text);
}
html[data-color-scheme="dark"] .post-card,
html[data-color-scheme="dark"] .card,
html[data-color-scheme="dark"] .toolbar,
html[data-color-scheme="dark"] .category-dropdown-panel,
html[data-color-scheme="dark"] .account-menu,
html[data-color-scheme="dark"] .notifications-panel {
    background-color: var(--surface);
}
html[data-color-scheme="dark"] .tag,
html[data-color-scheme="dark"] .pill,
html[data-color-scheme="dark"] .post-stat {
    background: var(--surface-2);
}
.theme-switcher {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: .25rem .35rem .25rem .7rem;
    color: var(--muted);
    font-weight: 800;
    white-space: nowrap;
}
.theme-switcher select {
    border: 0;
    background: transparent;
    color: var(--text);
    font-weight: 900;
    outline: none;
    max-width: 116px;
}
.publish-main-heading,
.publish-settings-heading {
    margin: .15rem 0 .25rem;
    color: var(--muted);
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.publish-body-first textarea {
    min-height: 340px;
}
.publish-settings-separator {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    margin-top: .25rem;
}
@media (max-width: 860px) {
    .theme-switcher span { display: none; }
    .theme-switcher select { max-width: 92px; }
}

/* v38: czytelniejsze powiadomienia i stan przeczytania */
.activity-item { position: relative; }
.activity-item.is-read { opacity: .72; }
.activity-item.is-unread { border-color: rgba(91,69,255,.22); background: rgba(91,69,255,.045); }
.activity-unread-dot {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #ef4444;
    box-shadow: 0 0 0 3px rgba(239,68,68,.13);
}
.activity-panel-footer,
.activity-bulk-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    margin-top: 10px;
}
.notifications-toolbar {
    flex-wrap: wrap;
}
.notifications-content .activity-section + .activity-section { margin-top: 12px; }
[data-color-scheme="dark"] .activity-item.is-unread {
    background: rgba(139,123,255,.12);
    border-color: rgba(139,123,255,.28);
}

/* v41: saved library and reblurt actions */
.social-actions .mini-action.save.saved {
    background: rgba(99, 102, 241, .14);
    border-color: rgba(99, 102, 241, .35);
    color: var(--accent);
    font-weight: 800;
}
.social-actions .mini-action.reblurt {
    color: var(--ink);
}
.library-page .library-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px) auto;
    gap: 12px;
    align-items: center;
}
.library-list {
    margin-top: 16px;
}
.library-item .library-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}
.library-actions {
    margin-top: 10px;
}
.author-tabs a.active {
    box-shadow: inset 0 -2px 0 var(--accent);
}
@media (max-width: 760px) {
    .library-page .library-toolbar {
        grid-template-columns: 1fr;
    }
}

/* v43 login: tylko Blurt Keychain w formularzu logowania */
.wallet-grid-single { grid-template-columns: 1fr; }
.wallet-grid-single .button { width: 100%; justify-content: center; }

.login-register-hint {
    margin: 10px 0 0;
    font-size: 0.92rem;
    color: var(--muted);
    text-align: center;
}
.login-register-hint a {
    color: var(--accent);
    font-weight: 800;
    text-decoration: none;
}
.login-register-hint a:hover { text-decoration: underline; }
