/* =============================================================================
   app.css
   Main stylesheet for the PWA feed application.
   Sections:
     1. Base & Typography
     2. Buttons
     3. Icons
     4. Modals
     5. Layout / Wrapper
     6. Skeleton Loader
     7. Header
     8. Post Feed & Cards
     9. Image Grid
    10. Reaction Badges & Emoji Picker
    11. Social Items
    12. Share Row
    13. Shield Items
    14. Footer
    15. Sidebar & Menu
    16. New Posts Alert
    17. Lightbox
   ============================================================================= */


/* =============================================================================
   1. Base & Typography
   ============================================================================= */

:root {
    --app-bg-position: center center;
    --app-bg-size: 960px auto;
    --app-bg-repeat: repeat;
    --app-bg-bleed-top: 96px;
    --app-bg-bleed-bottom: 320px;
    --app-edge-fade-top: max(36px, calc(env(safe-area-inset-top, 0px) + 2px));
    --app-edge-fade-bottom: clamp(118px, calc(96px + env(safe-area-inset-bottom, 0px)), 150px);
}

@media (max-width: 768px) {
    :root {
        --app-bg-size: 440px auto;
    }
}

html[data-feed-background="custom"] {
    --app-bg-size: cover;
    --app-bg-repeat: no-repeat;
}

html {
    height: 100%;
    min-height: 100%;
    min-height: -webkit-fill-available;
    min-height: 100svh;
    min-height: 100dvh;
    overscroll-behavior-x: none;
    background-color: rgb(var(--app-edge-rgb));
    background-image: none;
}

body {
    font-family: 'Onest', sans-serif;
    color: #1f2528;
    position: relative;
    isolation: isolate;
    min-height: 100%;
    min-height: -webkit-fill-available;
    min-height: 100svh;
    min-height: 100dvh;
    overflow-x: hidden;
    overscroll-behavior-x: none;
    background-color: var(--app-bg-base);
    background-image: none;
}

body.is-booting {
    background-image:
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, .46), rgba(255, 255, 255, 0) 42%),
        linear-gradient(180deg, rgba(var(--app-edge-rgb), .98), rgba(var(--app-edge-rgb), .94));
}

#pwa-bg-layer {
    position: fixed;
    top: calc(0px - var(--app-bg-bleed-top) - env(safe-area-inset-top));
    right: calc(0px - env(safe-area-inset-right));
    bottom: calc(0px - var(--app-bg-bleed-bottom) - env(safe-area-inset-bottom));
    left: calc(0px - env(safe-area-inset-left));
    z-index: 0;
    pointer-events: none;
    background-color: var(--app-bg-base);
    background-image:
        radial-gradient(ellipse at 3% 100%, var(--app-wash-corner), transparent 62%),
        linear-gradient(135deg, var(--app-wash-top), var(--app-wash-middle) 45%, var(--app-wash-bottom)),
        var(--app-bg-image);
    background-position: center top, center top, var(--app-bg-position);
    background-size: 100% 100%, 100% 100%, var(--app-bg-size);
    background-repeat: no-repeat, no-repeat, var(--app-bg-repeat);
    transform: translateZ(0);
}

:root[data-feed-background="summer"] #pwa-bg-layer::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--app-bg-image);
    background-position: var(--app-bg-position);
    background-size: var(--app-bg-size);
    background-repeat: var(--app-bg-repeat);
    mix-blend-mode: multiply;
}

:root[data-feed-background="summer"] #pwa-bg-layer::before {
    opacity: .34;
}

body.is-booting #pwa-bg-layer::before { display: none; }

body.is-booting #pwa-bg-layer {
    background-image:
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 42%),
        linear-gradient(180deg, rgba(var(--app-edge-rgb), .98), rgba(var(--app-edge-rgb), .94));
    background-size: 100% 100%, 100% 100%;
    background-position: center top, center top;
}

body.is-booting #pwa-edge-fades {
    opacity: 0;
}

body::before,
body::after {
    content: none;
    display: none;
}

#pwa-edge-fades {
    position: fixed;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    transform: translateZ(0);
}

#pwa-edge-fades::before,
#pwa-edge-fades::after {
    content: "";
    position: absolute;
    right: 0;
    left: 0;
    pointer-events: none;
    backdrop-filter: blur(9px) saturate(1.04);
    -webkit-backdrop-filter: blur(9px) saturate(1.04);
}

#pwa-edge-fades::before {
    top: 0;
    height: var(--app-edge-fade-top);
    backdrop-filter: blur(5px) saturate(1.03);
    -webkit-backdrop-filter: blur(5px) saturate(1.03);
    background: none;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .72) 52%, rgba(0, 0, 0, 0) 100%);
    mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .72) 52%, rgba(0, 0, 0, 0) 100%);
}

#pwa-edge-fades::after {
    bottom: 0;
    height: var(--app-edge-fade-bottom);
    background:
        linear-gradient(0deg,
            rgba(var(--app-edge-rgb), .44) 0%,
            rgba(var(--app-edge-rgb), .18) 48%,
            rgba(var(--app-edge-rgb), .05) 76%,
            rgba(var(--app-edge-rgb), 0) 100%);
    -webkit-mask-image: linear-gradient(0deg, #000 0%, rgba(0, 0, 0, .74) 52%, rgba(0, 0, 0, 0) 100%);
    mask-image: linear-gradient(0deg, #000 0%, rgba(0, 0, 0, .74) 52%, rgba(0, 0, 0, 0) 100%);
}

.app-boot-screen {
    --app-boot-bottom-bleed: 160px;
    position: fixed;
    inset: 0;
    bottom: calc(-1 * var(--app-boot-bottom-bleed));
    box-sizing: border-box;
    z-index: 4;
    overflow: hidden;
    padding: calc(112px + env(safe-area-inset-top)) 12px calc(104px + env(safe-area-inset-bottom));
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, .42), rgba(255, 255, 255, 0) 44%),
        linear-gradient(180deg, rgba(var(--app-edge-rgb), .98), rgba(var(--app-edge-rgb), .94));
    opacity: 1;
    transition: opacity .28s ease, transform .28s ease;
}

@media (display-mode: standalone) {
    html,
    body.is-booting { min-height: 100vh; }

    .app-boot-screen {
        bottom: auto;
        height: calc(100vh + var(--app-boot-bottom-bleed));
    }
}

.app-boot-screen.is-dismissing,
body.is-app-ready .app-boot-screen {
    opacity: 0;
    transform: translateY(-8px);
}

.app-boot-feed {
    width: min(560px, 100%);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    z-index: 1;
    transform: translate3d(0, calc(-150px - env(safe-area-inset-top, 0px)), 0);
}

.app-boot-card {
    width: 100%;
    min-height: 318px;
    overflow: hidden;
    border-radius: 24px 24px 24px 10px;
    background: rgba(255, 255, 255, .92);
    border: 1px solid rgba(255, 255, 255, .76);
    box-shadow: 0 16px 42px rgba(31, 65, 42, .1);
}

.app-boot-card--compact {
    min-height: clamp(380px, 45dvh, 410px);
    opacity: .92;
}

body.is-booting #footer {
    visibility: hidden;
}

.app-boot-body {
    padding: 26px 28px 24px;
}

.app-boot-card--compact .app-boot-body {
    padding-bottom: 20px;
}

.app-boot-line,
.app-boot-pill,
.app-boot-dot {
    position: relative;
    overflow: hidden;
    background: rgba(220, 233, 226, .9);
}

.app-boot-line::after,
.app-boot-pill::after,
.app-boot-dot::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .55), rgba(255, 255, 255, 0));
    animation: appBootShimmer 1.35s ease-in-out infinite;
}

.app-boot-line {
    height: 15px;
    margin-bottom: 14px;
    border-radius: 999px;
}

.app-boot-line.is-long {
    width: 100%;
}

.app-boot-line.is-mid {
    width: 86%;
}

.app-boot-line.is-short {
    width: 72%;
    margin-bottom: 26px;
}

.app-boot-line.is-gap {
    margin-top: 28px;
}

.app-boot-card--compact .app-boot-line.is-short {
    margin-bottom: 20px;
}

.app-boot-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}

.app-boot-card--compact .app-boot-actions {
    margin-top: 22px;
}

.app-boot-pill {
    width: 74px;
    height: 34px;
    border-radius: 999px;
}

.app-boot-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 17px 28px 18px;
    border-top: 1px solid rgba(25, 135, 84, .16);
}

.app-boot-footer-left {
    display: flex;
    gap: 12px;
}

.app-boot-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
}

.app-boot-date {
    width: 116px;
    height: 14px;
    margin-bottom: 0;
    border-radius: 999px;
}

@keyframes appBootShimmer {
    100% {
        transform: translateX(100%);
    }
}

body,
.btn {
    font-size: 15px;
}

a {
    text-decoration: none;
    color: #198754;
}

.pointer {
    cursor: pointer;
}


/* =============================================================================
   2. Buttons
   ============================================================================= */

.btn {
    border-radius: 30px;
    padding: 10px;
    font-weight: 500;
}

.btn-close:focus {
    box-shadow: none;
}

.btn-circle {
    border-radius: 50%;
    width: 44.5px;
    height: 44.5px;
    padding: 0;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Compact circle button variant for small screens */
@media (max-width: 412px) {
    .btn-circle-xsm {
        border-radius: 50%;
        width: 38px;
        height: 38px;
        padding: 6px !important;
        font-size: 16px;
    }

    .btn-circle-xsm .btn-text {
        display: none;
    }
}

/* Style for blockquote */
blockquote {
    border-left: 5px solid #b11116;
    /* Left border */
    padding: 0.5rem 1rem;
    /* Padding inside blockquote */
    margin: 1rem 0;
    /* Margin around blockquote */
    font-style: italic;
    /* Italicize text */
    background-color: #f8f9fa;
    /* Light background color */
    border-radius: 0.25rem;
    /* Rounded corners */
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

blockquote p:last-of-type {
    margin-bottom: 0;
}

/* Style for citation inside blockquote */
blockquote footer {
    display: block;
    font-size: 0.875rem;
    /* Smaller font size for citation */
    margin-top: 0.5rem;
    /* Space above citation */
    color: #6c757d;
    /* Muted color */
}

/* Style for preformatted text */
pre {
    background-color: #f8f9fa;
    /* Light background color */
    padding: 1rem;
    /* Padding inside pre block */
    border-radius: 0.25rem;
    /* Rounded corners */
    border: 1px solid #e9ecef;
    /* Light border */
    margin-bottom: 1rem;
    /* Margin below pre block */
    overflow-x: auto;
    /* Enable horizontal scrolling */
    white-space: pre-wrap;
    /* Wrap lines */
}

figure.table {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Table Styling */
figure.table table {
    margin-bottom: 0;
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

figure.table th,
figure.table td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid #dee2e6;
    white-space: nowrap;
}

figure.table thead {
    background-color: #f8f9fa;
    font-weight: bold;
}

/* Scrollbar Styling */
figure.table::-webkit-scrollbar {
    -webkit-appearance: none;
}

figure.table::-webkit-scrollbar:vertical {
    width: 12px;
}

figure.table::-webkit-scrollbar:horizontal {
    height: 12px;
}

figure.table::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 16px;
    border: 2px solid #ffffff;
}

figure.table::-webkit-scrollbar-track {
    border-radius: 16px;
    background-color: #ffffff;
}


/* =============================================================================
   3. Icons
   Bootstrap Icons and Font Awesome brand icons vertical alignment fix.
   ============================================================================= */

.bi,
.fa-brands {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.fa-brands,
.bi::before,
[class^="bi-"]::before,
[class*=" bi-"]::before {
    line-height: unset !important;
}


/* =============================================================================
   4. Modals
   ============================================================================= */

/* Match the QR panel's dark, softened background treatment. */
.modal-backdrop {
    background: rgba(8, 17, 11, .72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
}

.modal-backdrop.show { opacity: 1; }
.rounded,
.modal-content,
.alert {
    border-radius: 18px !important;
}

.alert-warning {
    border: 0;
    background-color: #ff6a1f !important;
    border-color: #ff6a1f;
    color: #fff !important;
}

/* Drag handle shown at top of bottom sheet modals */
.modal-handle {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: #d0e5d2;
    margin: 16px auto 0;
}

.modal-header {
    padding: 13px 18px 11px;
}

.btn-close-modal {
    background: #fff;
    border: none;
    color: #198754;
    font-size: 18px;
}

#modal-shield .help-panel :is(h2, h3, h4, h5, h6),
#modal-shield .help-panel :is(h2, h3, h4, h5, h6) span[style] {
    color: rgb(var(--app-accent-rgb)) !important;
}

#modal-shield .modal-dialog {
    width: calc(100% - 32px);
    max-width: 620px;
}

#modal-shield .modal-content {
    height: min(520px, calc(100dvh - 56px));
    max-height: calc(100dvh - 56px);
    overflow: hidden;
    border: 1px solid rgba(36, 64, 70, .13);
    background: #fff;
    box-shadow: 0 22px 64px rgba(8, 23, 18, .22);
}

#modal-shield .modal-handle {
    background: rgba(var(--app-accent-rgb), .24);
}

#modal-shield .modal-header {
    flex: 0 0 auto;
    padding: 18px 24px 12px;
    border: 0;
}

#modal-shield .modal-title {
    color: #253039;
    font-size: 20px !important;
    line-height: 1.25;
}

#modal-shield .btn-close-modal {
    color: rgb(var(--app-accent-rgb));
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: transparent;
    transition: background .18s ease, transform .18s ease;
}

#modal-shield .btn-close-modal:hover,
#modal-shield .btn-close-modal:focus-visible {
    background: rgba(var(--app-accent-rgb), .08);
}

#modal-shield .btn-close-modal:active {
    transform: scale(.94);
}

#modal-shield .help-tabs {
    display: flex;
    gap: 0;
    flex: 0 0 auto;
    margin: 0 24px;
    padding: 2px 6px;
    border-radius: 12px;
    border: 1px solid rgba(71, 111, 106, .14);
    background: rgba(247, 250, 249, .6);
    box-shadow: inset 0 1px rgba(255, 255, 255, .9), 0 3px 12px rgba(26, 47, 42, .04);
    backdrop-filter: blur(12px) saturate(1.12);
    -webkit-backdrop-filter: blur(12px) saturate(1.12);
}

#modal-shield .help-tab {
    flex: 1 1 0;
    min-width: 0;
    min-height: 40px;
    padding: 8px 5px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #68747a;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    transition: color .18s ease;
}

#modal-shield .help-tab.is-active {
    color: #253039;
    font-weight: 700;
}

#modal-shield .help-tab:focus-visible { outline: 2px solid rgb(var(--app-accent-rgb)); outline-offset: 2px; }
#modal-shield .help-panel[hidden], #modal-shield .install-check[hidden] { display: none !important; }

#modal-shield .help-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 28px 24px 24px;
    color: #39464d;
    font-size: 15px;
    line-height: 1.6;
}

#modal-shield .help-panel > :first-child { margin-top: 0; }
#modal-shield .help-panel p { margin-bottom: 14px; }
#modal-shield .help-panel p:last-child { margin-bottom: 0; }
#modal-shield .help-panel :is(h2, h3, h4, h5, h6) { margin: 18px 0 8px; font-size: 17px; line-height: 1.35; }

#modal-shield .install-check {
    flex: 0 0 auto;
    padding: 14px 24px 20px;
    border-top: 1px solid rgba(36, 64, 70, .14);
    background: #fff;
    text-align: center;
}

#modal-shield .install-check__button {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 9px 14px;
    border: 1px solid rgba(71, 111, 106, .22);
    border-radius: 10px;
    background: rgba(247, 250, 249, .7);
    color: #253039;
    box-shadow: inset 0 1px rgba(255, 255, 255, .86);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font: inherit;
    font-weight: 600;
    line-height: 1.25;
    text-align: left;
    justify-content: center;
    max-width: 100%;
    transition: background .18s ease, border-color .18s ease;
}

#modal-shield .install-check__button[hidden] { display: none !important; }

#modal-shield .install-check__button:hover,
#modal-shield .install-check__button:focus-visible {
    background: rgba(235, 243, 240, .88);
    border-color: rgba(71, 111, 106, .34);
}

#modal-shield .install-check__button:disabled {
    cursor: wait;
    opacity: .75;
}

#modal-shield .install-check__button.is-checking i {
    animation: installCheckSpin .8s linear infinite;
}

#modal-shield .install-check__status {
    margin: 10px 0 0;
    color: #647179;
    font-size: .9em;
    line-height: 1.4;
}

#modal-shield .install-check__status:empty {
    display: none;
}

#modal-shield .install-check__button[hidden] + .install-check__status {
    margin-top: 0;
}

@keyframes installCheckSpin {
    to { transform: rotate(360deg); }
}

.modal-body {
    padding: 16px 18px 22px;
}

.app-toast-container {
    left: 0 !important;
    right: 0;
    bottom: 0 !important;
    transform: none !important;
    width: 100%;
    max-width: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0 14px calc(92px + max(12px, env(safe-area-inset-bottom))) !important;
    pointer-events: none;
}

.toast-pwa {
    width: min(460px, calc(100vw - 32px));
    max-width: none;
    margin: 0;
    border: 0;
    border-radius: 24px;
    background: transparent;
    box-shadow: none;
    color: #fff;
    pointer-events: auto;
    overflow: visible;
}

.toast-pwa__inner {
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 15px 9px 11px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 24px;
    background: rgba(31, 37, 40, .88);
    box-shadow: 0 14px 38px rgba(8, 16, 12, .24);
    backdrop-filter: blur(18px) saturate(1.08);
    -webkit-backdrop-filter: blur(18px) saturate(1.08);
}

.toast-pwa.is-actionable {
    cursor: pointer;
}

.toast-pwa.is-actionable .toast-pwa__inner {
    transition: background .18s ease, transform .18s ease;
}

.toast-pwa.is-actionable:hover .toast-pwa__inner,
.toast-pwa.is-actionable:focus-visible .toast-pwa__inner {
    background: rgba(38, 45, 48, .92);
}

.toast-pwa.is-actionable:active .toast-pwa__inner {
    transform: scale(.985);
}

.toast-pwa__icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 20px;
}

.toast-pwa__icon i {
    color: #fff;
}

.toast-pwa__text {
    min-width: 0;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.25;
}

.toast-pwa--success .toast-pwa__icon,
.toast-pwa--warning .toast-pwa__icon,
.toast-pwa--info .toast-pwa__icon,
.toast-pwa--danger .toast-pwa__icon {
    color: #fff;
    background: rgba(255, 255, 255, .12);
}

.toast-pwa--language .toast-pwa__icon {
    width: 42px;
    flex-basis: 42px;
    border-radius: 14px;
    perspective: 260px;
    overflow: hidden;
}

.toast-pwa--language.showing .toast-pwa__icon,
.toast-pwa--language.show .toast-pwa__icon {
    animation: none;
}

.toast-lang-flip {
    position: relative;
    width: 34px;
    height: 24px;
    display: block;
    transform-style: preserve-3d;
    animation: toastLangFlip .74s cubic-bezier(.2, .82, .18, 1) both;
}

.toast-lang-flip__side {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 12px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: .02em;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.toast-lang-flip__side.is-to {
    transform: rotateY(180deg);
}

.toast-pwa.showing,
.toast-pwa.show {
    animation: toastPwaEnter .2s cubic-bezier(.18, .86, .25, 1) both;
}

.toast-pwa.showing .toast-pwa__icon,
.toast-pwa.show .toast-pwa__icon {
    animation: toastIconFlip .34s cubic-bezier(.18, .86, .25, 1) .03s both;
}

.toast-pwa.hide {
    animation: toastPwaLeave .16s ease both;
}

.sw-update-banner {
    position: fixed;
    right: 14px;
    bottom: calc(92px + max(12px, env(safe-area-inset-bottom)));
    left: 14px;
    z-index: 100030;
    display: flex;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transform: translateY(12px) scale(.96);
    transition: opacity .2s ease, transform .24s cubic-bezier(.18, .86, .25, 1);
}

body.modal-open .sw-update-banner {
    visibility: hidden;
    pointer-events: none;
}

.sw-update-banner.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.sw-update-banner.is-hiding {
    opacity: 0;
    transform: translateY(10px) scale(.94);
}

.sw-update-banner__inner {
    width: min(460px, 100%);
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 11px 12px;
    align-items: center;
    padding: 11px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(31, 37, 40, .9);
    box-shadow: 0 14px 38px rgba(8, 16, 12, .24);
    color: #fff;
    pointer-events: auto;
    backdrop-filter: blur(18px) saturate(1.08);
    -webkit-backdrop-filter: blur(18px) saturate(1.08);
}

.sw-update-banner__icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 20px;
}

.sw-update-banner__title {
    margin: 0;
    color: #fff;
    font-size: 15px;
    font-weight: 750;
    line-height: 1.18;
}

.sw-update-banner__text {
    margin: 2px 0 0;
    color: rgba(255, 255, 255, .72);
    font-size: 13px;
    line-height: 1.25;
}

.sw-update-banner__actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1.35fr;
    gap: 8px;
    margin-top: 2px;
}

.sw-update-banner__btn {
    min-height: 38px;
    border: 0;
    border-radius: 16px;
    padding: 8px 13px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.sw-update-banner__btn.is-later {
    background: rgba(255, 255, 255, .1);
    color: rgba(255, 255, 255, .82);
}

.sw-update-banner__btn.is-update {
    background: rgba(247, 255, 244, .94);
    color: #1f2528;
}

@keyframes toastPwaEnter {
    from {
        opacity: 0;
        transform: translateY(14px) scaleX(.58) scaleY(.9);
        filter: blur(2px);
    }
    64% {
        opacity: 1;
        transform: translateY(-1px) scaleX(1.025) scaleY(1);
        filter: blur(0);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes toastPwaLeave {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(8px) scaleX(.72) scaleY(.92);
    }
}

@keyframes toastIconFlip {
    from {
        opacity: .5;
        transform: rotateY(-92deg) scale(.72);
    }
    58% {
        opacity: 1;
        transform: rotateY(12deg) scale(1.08);
    }
    to {
        opacity: 1;
        transform: rotateY(0) scale(1);
    }
}

@keyframes toastLangFlip {
    from {
        transform: rotateY(0deg) scale(.92);
    }
    62% {
        transform: rotateY(188deg) scale(1.04);
    }
    to {
        transform: rotateY(180deg) scale(1);
    }
}

@media (max-width: 420px) {
    .app-toast-container {
        padding-inline: 12px !important;
    }

    .toast-pwa {
        width: calc(100vw - 40px);
    }

    .toast-pwa__inner {
        min-height: 50px;
        gap: 10px;
        padding: 8px 14px 8px 10px;
        border-radius: 23px;
    }

    .toast-pwa__icon {
        width: 33px;
        height: 33px;
        flex-basis: 33px;
        border-radius: 11px;
        font-size: 19px;
    }

    .toast-pwa__text {
        font-size: 14px;
    }

    .sw-update-banner {
        right: 12px;
        left: 12px;
    }

    .sw-update-banner__inner {
        border-radius: 23px;
    }
}


/* =============================================================================
   5. Layout / Wrapper
   Centered content column, collapses to full-width on mobile.
   ============================================================================= */

.wrapper {
    margin: auto;
    width: 620px;
    position: relative;
}

#main-app {
    position: relative;
    z-index: 2;
}

#main-app > .pt-4 {
    padding-bottom: calc(116px + env(safe-area-inset-bottom));
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .wrapper {
        width: 100%;
        padding: 0 12px;
    }
}


/* =============================================================================
   7. Header
   Sticky top bar over the app background.
   ============================================================================= */

#header {
    position: sticky;
    top: 0;
    z-index: 9;

    padding:
        calc(8px + env(safe-area-inset-top))
        max(12px, env(safe-area-inset-right))
        12px
        max(12px, env(safe-area-inset-left));
    background: transparent;
    box-shadow: none;
}

#header::before {
    content: "";
    display: none;
}

#header {
    isolation: isolate;
}

#header .header-shell {
    position: relative;
    z-index: 1;
    width: min(620px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    min-height: 56px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

#header .meta {
    position: relative;
    width: fit-content;
    min-width: 0;
    max-width: min(100%, 520px);
    padding: 6px 16px 6px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .52);
    border: 1px solid rgba(55, 65, 61, .14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .58), 0 10px 26px rgba(20, 28, 25, .08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

#header .meta::before,
#footer .lang-switcher::before,
#footer .btn-notify::before,
#footer .footer-inner > .btn-footer::before,
.scroll-latest-btn::before {
    content: none;
}

#header .meta > div:first-child {
    flex: 0 0 auto;
}

#header .meta > div:last-child {
    flex: 0 1 auto;
    min-width: 0;
}

#header .meta > div:last-child > div:first-child {
    min-width: 0;
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: visible;
}

#header .meta .fw-bold {
    display: inline-block;
    flex: 0 0 auto;
    max-width: none;
    overflow: visible;
    color: #111820;
    font-size: 16px;
    line-height: 1.08;
    font-weight: 760;
    text-overflow: clip;
    white-space: nowrap;
    vertical-align: middle;
}

#header .meta .text-primary {
    flex: 0 0 auto;
    color: #2b87ee !important;
    font-size: 16px;
    margin-left: 2px;
    vertical-align: middle;
}

#header .header-actions {
    position: absolute;
    top: 50%;
    right: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    transform: translateY(-50%);
}

#header.has-install-action .meta {
    max-width: min(calc(100% - 96px), 520px);
}

#header.has-social-action .meta {
    max-width: min(calc(100% - 96px), 520px);
}

#header.has-install-action.has-social-action .meta {
    max-width: min(calc(100% - 144px), 520px);
}

.header-install-btn {
    position: relative;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 50%;
    color: #1f282a;
    background: rgba(var(--app-chrome-rgb), .8);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, .72),
        0 12px 28px rgba(var(--app-shadow-rgb), .12);
    backdrop-filter: blur(18px) saturate(1.08);
    -webkit-backdrop-filter: blur(18px) saturate(1.08);
    opacity: 0;
    transform: translateY(2px) scale(.88);
    overflow: hidden;
    transition:
        opacity .2s ease,
        transform .24s cubic-bezier(.2, .82, .18, 1),
        background .18s ease,
        border-color .18s ease,
        color .18s ease;
}

.header-install-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        linear-gradient(110deg, rgba(255, 255, 255, 0) 18%, rgba(255, 255, 255, .34) 48%, rgba(255, 255, 255, 0) 76%);
    opacity: 0;
    transform: translateX(-110%);
}

.header-install-btn::after {
    content: "";
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .95);
    box-shadow:
        -9px 0 0 rgba(255, 255, 255, .58),
        9px 0 0 rgba(255, 255, 255, .58);
    opacity: 0;
    transform: scale(.72);
    transition: opacity .16s ease, transform .2s cubic-bezier(.2, .82, .18, 1);
}

.header-install-btn[hidden] {
    display: none !important;
}

.header-install-btn.is-ready {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.header-install-btn:hover,
.header-install-btn:focus-visible {
    color: #111820;
    background: rgba(255, 255, 255, .9);
    outline: none;
}

.header-install-btn:active {
    transform: translateY(0) scale(.94);
}

.header-install-btn.is-installing {
    color: #fff;
    border-color: rgba(255, 255, 255, .4);
    background: rgba(34, 43, 45, .82);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, .16),
        0 14px 30px rgba(17, 27, 29, .18);
    transform: translateY(0) scale(.98);
}

.header-install-btn.is-installing::before {
    opacity: 1;
    animation: installButtonSweep 1.05s ease-in-out infinite;
}

.header-install-btn.is-installing::after {
    opacity: 1;
    transform: scale(1);
    animation: installButtonDots 1.05s ease-in-out infinite;
}

.header-install-btn i {
    position: relative;
    z-index: 1;
    font-size: 20px;
    line-height: 1;
    transition: opacity .14s ease, transform .18s cubic-bezier(.2, .82, .18, 1);
}

.header-install-btn.is-installing i {
    opacity: 0;
    transform: translateY(2px) scale(.78);
}

@keyframes installButtonSweep {
    0% {
        transform: translateX(-112%);
    }
    58%,
    100% {
        transform: translateX(112%);
    }
}

@keyframes installButtonDots {
    0%,
    100% {
        box-shadow:
            -9px 0 0 rgba(255, 255, 255, .42),
            9px 0 0 rgba(255, 255, 255, .42);
        transform: scale(.82);
    }
    44% {
        box-shadow:
            -9px 0 0 rgba(255, 255, 255, .78),
            9px 0 0 rgba(255, 255, 255, .78);
        transform: scale(1);
    }
}

#header .meta img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .9);
    box-shadow: 0 6px 16px rgba(17, 45, 24, .12);
}

#header .meta .caption {
    color: rgba(31, 37, 40, .72);
    font-size: 12.5px;
    line-height: 1.1;
    margin-top: 1px;
}

@media (max-width: 420px) {
    #header {
        padding-bottom: 10px;
    }

    #header::before {
        display: none;
    }

    #header .header-shell {
        width: min(620px, calc(100vw - 24px));
        max-width: calc(100vw - 24px);
        min-height: 52px;
    }

    #header .meta {
        max-width: 100%;
        padding: 5px 12px 5px 6px;
    }

    #header.has-install-action .meta {
        max-width: calc(100% - 82px);
    }

    #header.has-social-action .meta {
        max-width: calc(100% - 82px);
    }

    #header.has-install-action.has-social-action .meta {
        max-width: calc(100% - 126px);
    }

    #header .meta img {
        width: 42px;
        height: 42px;
    }

    #header .meta .fw-bold {
        font-size: 15px;
    }

    #header .meta .text-primary {
        font-size: 15px;
    }

    #header .meta .caption {
        font-size: 12px;
    }
}


/* =============================================================================
   8. Post Feed & Cards
   ============================================================================= */

.posts {
    padding: 22px 0 calc(98px + env(safe-area-inset-bottom)) 0;
}

.posts > .post-message:last-child {
    margin-bottom: 0;
}

.post-message {
    position: relative;
    box-sizing: border-box;
    --quick-card-lift: 0px;
    width: min(100%, 560px);
    margin: 0 auto 16px;
    padding-right: 32px;
}

.post-message.is-quick-open {
    z-index: 99974;
}

.post-card {
    border: 1px solid rgba(255, 255, 255, .88);
    border-radius: 22px 22px 22px 10px;
    background: rgba(var(--app-card-rgb), .95);
    margin-bottom: 0;
    min-width: 0;
    overflow: hidden;
    position: relative;
    box-shadow: 0 12px 28px rgba(var(--app-shadow-rgb), .08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    transition: transform .34s cubic-bezier(.2, .82, .18, 1), box-shadow .36s ease, border-color .3s ease, filter .34s ease;
}

.post-card.is-context-active {
    border-color: rgba(255, 255, 255, .96);
    z-index: 99975;
    transform: translate3d(0, calc(var(--quick-card-lift, 0px) * -1), 0) scale(1.004);
    box-shadow: 0 24px 58px rgba(15, 25, 18, .18);
}

/*
 * Direct-child selector ensures this max-height only applies to single
 * standalone images, not to images inside .post-images-grid.
 */
.post-card>img {
    display: block;
    width: 100%;
    object-fit: cover;
    max-height: 280px;
}

.post-image-single {
    position: relative;
    height: clamp(300px, 58vw, 520px);
    overflow: hidden;
    background: #ddecda;
}

.post-image-single .post-image-backdrop {
    position: absolute;
    inset: -22px;
    width: calc(100% + 44px);
    height: calc(100% + 44px);
    object-fit: cover;
    filter: blur(24px) saturate(1.08) brightness(1.03);
    opacity: .72;
    transform: scale(1.06);
}

.post-image-single .post-image-foreground {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: block;
    min-width: 100%;
    min-height: 100%;
    object-fit: cover !important;
    object-position: center center;
}

/*
 * Grid images bleed to the card edges (no inner border-radius on the grid).
 * The card's overflow:hidden + border-radius clips the corners correctly.
 */
.post-card .post-images-grid {
    border-radius: 0;
}

/* Round only the top-left corner of the first grid image to match card radius */
.post-card .post-images-grid .img-clickable:first-child {
    border-top-left-radius: 21px;
}

/* Round the top-right corner for 3-image and 2-image grids */
.post-card .post-images-grid .img-clickable:nth-child(2):not(:last-child),
.post-card .post-images-grid.count-2 .img-clickable:nth-child(2) {
    border-top-right-radius: 21px;
}

.post-card .post-body {
    min-width: 0;
    padding: 16px 18px 4px;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.post-card .post-body * {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.post-card .post-body p {
    margin-bottom: 0;
}

/* Reaction badge pill */
.post-card .post-body .badge-reaction {
    padding: 4px 10px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 0;
    background: #f3f6f7;
    color: #53646e;
}

@media (pointer: coarse) {
    .post-card .post-body .badge-reaction {
        touch-action: manipulation;
    }
}

.post-card .post-body .badge-reaction span {
    font-size: 12px;
    font-weight: 700;
}

.badge-reaction .badge-reaction__emoji,
.post-card .post-body .badge-reaction .badge-reaction__emoji {
    display: inline-block;
    font-size: 17px;
    font-weight: 400;
    line-height: 1;
    transform-origin: center;
}

.post-card .reaction-summary-wrapper,
#reaction-summary-wrapper {
    -webkit-touch-callout: none;
    user-select: none;
}

.post-card .post-footer {
    display: flex;
    justify-content: flex-end;
    padding: 0 18px 14px;
    border-top: 0;
    margin-top: 2px;
    -webkit-touch-callout: none;
    user-select: none;
}

.post-card .post-footer .date {
    font-size: 11px;
    line-height: 1;
    color: rgba(31, 95, 67, .68);
    font-weight: 650;
    letter-spacing: 0;
}

.post-share-float {
    position: absolute;
    right: -7px;
    bottom: 27px;
    z-index: 3;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    padding: 0;
    background: transparent;
    color: rgba(37, 48, 57, .72);
    box-shadow: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform .16s ease, color .16s ease;
}

.post-share-float i {
    font-size: 24px;
    line-height: 1;
    transform: scaleX(-1) translateX(-1px);
}

.post-share-float:active {
    transform: scale(.94);
}

.post-share-float:hover,
.post-share-float:focus-visible {
    color: rgba(37, 48, 57, .88);
}

.post-share-float:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -3px;
}

@media (max-width: 768px) {
    body {
        background-color: var(--app-bg-base);
        background-image: none;
    }

    .post-message {
        width: min(100%, 548px);
        padding-right: 30px;
    }

    .post-image-single {
        height: clamp(260px, 78vw, 460px);
    }

    .post-image-single .post-image-foreground {
        object-fit: cover !important;
    }

}

.post-quick-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99970;
    background:
        radial-gradient(circle at 50% 42%, rgba(255, 255, 255, .08), rgba(255, 255, 255, 0) 34%),
        rgba(8, 24, 12, .28);
    backdrop-filter: blur(9px) saturate(.94);
    -webkit-backdrop-filter: blur(9px) saturate(.94);
    opacity: 0;
    pointer-events: auto;
    transition: opacity .42s cubic-bezier(.18, .86, .22, 1);
    will-change: opacity;
}

.post-quick-backdrop.is-mounted {
    opacity: 1;
}

.post-quick-backdrop.is-leaving {
    opacity: 0;
}

body.post-quick-open {
    -webkit-tap-highlight-color: transparent;
}

body.post-quick-open,
body.post-quick-open *:not(input):not(textarea),
body.share-sheet-open,
body.share-sheet-open *:not(input):not(textarea) {
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
}

.post-quick-actions {
    position: fixed;
    top: var(--quick-actions-top, 50%);
    left: var(--quick-actions-left, 50%);
    z-index: 99976;
    width: var(--quick-actions-width, min(560px, calc(100vw - 24px)));
    max-width: calc(100vw - 24px);
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    opacity: 0;
    transform: translate3d(0, 18px, 0) scale(.94);
    transform-origin: center center;
    filter: blur(2px);
    transition: opacity .34s ease, transform .44s cubic-bezier(.18, .86, .22, 1), filter .34s ease;
    will-change: opacity, transform, filter;
}

.post-quick-actions.is-mounted {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
}

.post-quick-actions.is-ready {
    pointer-events: auto;
}

.post-quick-actions.is-leaving {
    opacity: 0;
    transform: translate3d(0, 12px, 0) scale(.972);
    filter: blur(1.5px);
    transition-duration: .24s, .3s, .22s;
    transition-timing-function: ease, cubic-bezier(.4, 0, .22, 1), ease;
}

.post-quick-backdrop,
.post-quick-actions,
.post-quick-actions *,
.picker-reaction,
.picker-reaction *,
.share-sheet-layer,
.share-sheet-layer * {
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
}

.post-quick-actions__emojis {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    justify-items: center;
    gap: 6px 2px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, .74);
    border-radius: 24px;
    background: rgba(255, 255, 255, .78);
    box-shadow: 0 16px 36px rgba(22, 29, 34, .14);
    backdrop-filter: blur(18px) saturate(1.1);
    -webkit-backdrop-filter: blur(18px) saturate(1.1);
    opacity: 0;
    transform: translate3d(0, 12px, 0) scale(.975);
    transition: opacity .36s ease, transform .44s cubic-bezier(.18, .86, .22, 1);
    transition-delay: .04s;
    will-change: opacity, transform;
}

.post-quick-emoji,
.post-quick-row {
    border: 0;
    appearance: none;
    -webkit-appearance: none;
    touch-action: manipulation;
    transition: transform .18s cubic-bezier(.2, .8, .2, 1), background .18s ease, color .18s ease;
}

.post-quick-emoji {
    width: min(100%, 38px);
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
    font-size: 23px;
    line-height: 1;
}

.post-quick-emoji.active {
    background: rgba(31, 95, 67, .1);
}

@media (max-width: 360px) {
    .post-quick-actions__emojis { gap: 6px 2px; padding: 10px 8px; }
    .post-quick-emoji { height: 34px; font-size: 21px; }
}

.post-quick-sheet {
    width: 100%;
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 23px;
    background: rgba(255, 255, 255, .78);
    box-shadow: 0 22px 48px rgba(22, 29, 34, .18);
    backdrop-filter: blur(20px) saturate(1.12);
    -webkit-backdrop-filter: blur(20px) saturate(1.12);
    opacity: 0;
    transform: translate3d(0, 14px, 0) scale(.976);
    transition: opacity .36s ease, transform .46s cubic-bezier(.18, .86, .22, 1);
    transition-delay: .1s;
    will-change: opacity, transform;
}

.post-quick-actions.is-mounted .post-quick-actions__emojis,
.post-quick-actions.is-mounted .post-quick-sheet {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
}

.post-quick-actions.is-leaving .post-quick-actions__emojis,
.post-quick-actions.is-leaving .post-quick-sheet {
    opacity: 0;
    transform: translate3d(0, 8px, 0) scale(.982);
    transition-duration: .22s;
    transition-delay: 0s;
}

.post-quick-row {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 14px;
    border-radius: 16px;
    background: transparent;
    color: #1f2528;
    font-size: 15px;
    font-weight: 650;
    text-align: left;
}

.post-quick-row i {
    width: 22px;
    color: #1f5f43;
    font-size: 20px;
    text-align: center;
}

.post-quick-row + .post-quick-row {
    margin-top: 2px;
}

.post-quick-row:hover,
.post-quick-row:focus-visible {
    background: rgba(31, 95, 67, .08);
}

.post-quick-row.is-copied {
    background: rgba(31, 143, 77, .12);
    color: #1f8f4d;
}

.post-quick-row.is-copied i {
    color: #1f8f4d;
}

.post-quick-emoji:active,
.post-quick-row:active {
    transform: scale(.96);
}

@keyframes postQuickIn {
    from {
        opacity: 0;
        transform: translate3d(0, 10px, 0) scale(.965);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

@keyframes postQuickOut {
    from {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
    to {
        opacity: 0;
        transform: translate3d(0, 7px, 0) scale(.975);
    }
}

.reaction-feedback-burst {
    position: fixed;
    z-index: 100002;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin: -23px 0 0 -23px;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--reaction-accent), white 65%);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 9px 25px rgba(18, 32, 38, .16);
    color: #132017;
    line-height: 1;
    pointer-events: none;
    animation: reactionFeedbackShell .9s ease-out forwards;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.reaction-feedback-main {
    position: relative;
    z-index: 1;
    font-size: 27px;
    animation: reactionFeedbackPop .76s cubic-bezier(.18, .86, .22, 1) both;
}

.reaction-feedback-particle {
    position: absolute;
    left: 50%;
    top: 50%;
    pointer-events: none;
    color: var(--reaction-accent);
    font-size: 14px;
    opacity: 0;
    animation: reactionFeedbackParticle .72s ease-out var(--spark-delay) forwards;
}

.reaction-feedback-burst[data-motion="pulse"] .reaction-feedback-main { animation-name: reactionFeedbackPulse; }
.reaction-feedback-burst[data-motion="drop"] .reaction-feedback-main { animation-name: reactionFeedbackDrop; }
.reaction-feedback-burst[data-motion="shake"] .reaction-feedback-main { animation-name: reactionFeedbackShake; }
.reaction-feedback-burst[data-motion="tilt"] .reaction-feedback-main { animation-name: reactionFeedbackTilt; }
.reaction-feedback-burst[data-motion="flash"] .reaction-feedback-main { animation-name: reactionFeedbackFlash; }
.reaction-feedback-burst[data-motion="rise"] .reaction-feedback-main { animation-name: reactionFeedbackRise; }
.reaction-feedback-burst[data-motion="burst"] .reaction-feedback-main { animation-name: reactionFeedbackBurst; }
.reaction-feedback-burst[data-motion="squeeze"] .reaction-feedback-main { animation-name: reactionFeedbackSqueeze; }
.reaction-feedback-burst[data-motion="glide"] .reaction-feedback-main { animation-name: reactionFeedbackGlide; }
.reaction-feedback-burst[data-motion="bloom"] .reaction-feedback-main { animation-name: reactionFeedbackBloom; }

@keyframes reactionFeedbackShell {
    0% { opacity: 0; transform: translateY(10px) scale(.86); }
    18% { opacity: 1; transform: translateY(-3px) scale(1); }
    75% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-25px) scale(.96); }
}

@keyframes reactionFeedbackParticle {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(.5); }
    20% { opacity: 1; }
    100% { opacity: 0; transform: translate(calc(-50% + var(--spark-x)), calc(-50% + var(--spark-y))) scale(.85); }
}

@keyframes reactionFeedbackPop { 0% { transform: scale(.55); } 42% { transform: scale(1.22); } 100% { transform: scale(1); } }
@keyframes reactionFeedbackPulse { 0% { transform: scale(.55); } 35% { transform: scale(1.28); } 62% { transform: scale(.9); } 100% { transform: scale(1); } }
@keyframes reactionFeedbackDrop { 0% { transform: translateY(-15px) scale(.7); } 55% { transform: translateY(5px) scale(1.08); } 100% { transform: translateY(0); } }
@keyframes reactionFeedbackShake { 0% { transform: scale(.7); } 28% { transform: translateX(-5px) rotate(-8deg); } 52% { transform: translateX(5px) rotate(8deg); } 78% { transform: translateX(-2px); } 100% { transform: none; } }
@keyframes reactionFeedbackTilt { 0% { transform: rotate(-18deg) scale(.65); } 55% { transform: rotate(12deg) scale(1.12); } 100% { transform: none; } }
@keyframes reactionFeedbackFlash { 0% { opacity: 0; transform: scale(.65); } 20%, 48% { opacity: 1; transform: scale(1.22); } 35% { opacity: .36; } 100% { opacity: 1; transform: scale(1); } }
@keyframes reactionFeedbackRise { 0% { transform: translateY(14px) scale(.65); } 55% { transform: translateY(-9px) scale(1.12); } 100% { transform: none; } }
@keyframes reactionFeedbackBurst { 0% { transform: rotate(-18deg) scale(.45); } 40% { transform: rotate(10deg) scale(1.35); } 100% { transform: none; } }
@keyframes reactionFeedbackSqueeze { 0% { transform: scale(.68); } 40% { transform: scaleX(.82) scaleY(1.15); } 75% { transform: scaleX(1.16) scaleY(.88); } 100% { transform: none; } }
@keyframes reactionFeedbackGlide { 0% { transform: translate(-12px, 12px) rotate(-14deg) scale(.68); } 65% { transform: translate(5px, -5px) rotate(8deg) scale(1.1); } 100% { transform: none; } }
@keyframes reactionFeedbackBloom { 0% { transform: scale(.35); } 55% { transform: scale(1.25); } 100% { transform: none; } }
}

@media (max-width: 420px) {
    .post-quick-actions {
        gap: 7px;
        align-items: center;
    }

    .post-quick-emoji {
        width: min(34px, 100%);
        height: auto;
        aspect-ratio: 1;
        font-size: 20px;
    }

    .post-quick-sheet {
        border-radius: 21px;
    }

    .post-quick-row {
        min-height: 46px;
        font-size: 14px;
    }
}


/* =============================================================================
   9. Image Grid
   Supports 2, 3, and 4-image layouts.
   Images are capped at 4; extras are silently dropped in JS.
   ============================================================================= */

.post-images-grid {
    display: grid;
    gap: 3px;
    overflow: hidden;
    margin-bottom: 0;
}

/* 2 images â€” equal side-by-side columns */
.post-images-grid.count-2 {
    grid-template-columns: 1fr 1fr;
}

.post-images-grid.count-2 .img-clickable {
    height: 280px;
}

/*
 * 3 images â€” large hero on the left spanning both rows,
 * two smaller images stacked on the right.
 * Hero height = row1 + gap + row2 = 160 + 3 + 160 = 323px
 */
.post-images-grid.count-3 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 160px 160px;
    align-items: stretch;
}

.post-images-grid.count-3 .img-clickable:first-child {
    grid-row: 1 / 3;
    height: 323px;
}

.post-images-grid.count-3 .img-clickable:not(:first-child) {
    height: 160px;
}

/* 4 images â€” uniform 2Ã—2 grid */
.post-images-grid.count-4 {
    grid-template-columns: 1fr 1fr;
}

.post-images-grid.count-4 .img-clickable {
    height: 180px;
}

/* Shared styles for all grid images */
.post-images-grid .img-clickable {
    width: 100%;
    object-fit: cover;
    cursor: pointer;
    display: block;
}

.posts .img-clickable {
    transition: opacity 0.2s;
}

.posts .img-clickable:hover {
    opacity: 0.9;
}


/* =============================================================================
   10. Reaction Badges & Emoji Picker
   ============================================================================= */

/* Hide empty reaction wrapper so it takes no space */
.reaction-summary-wrapper:empty,
#reaction-summary-wrapper:empty {
    display: none;
}

/* Floating emoji picker popover */
.picker-reaction {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 4px 2px;
    width: min(354px, calc(100% - 16px));
    padding: 8px;
    background: #fff;
    border: 1px solid #d0e5d2;
    border-radius: 18px;
    position: absolute;
    bottom: 48px;
    left: 8px;
    z-index: 8;
    animation: picker-in .14s ease;
}

@media (max-width: 576px) {
    .picker-reaction {
        width: min(354px, calc(100% - 16px));
    }
}

@keyframes picker-in {
    from {
        opacity: 0;
        transform: scale(.82) translateY(6px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.picker-emoji {
    font-size: 24px;
    width: 100%;
    min-width: 0;
    aspect-ratio: 1;
    padding: 2px;
    border-radius: 50%;
    line-height: 1;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 100ms ease, background 100ms;
    position: relative;
}

.picker-emoji:hover {
    transform: scale(1.35);
    background: #f0f5f0;
}

/* Active dot indicator below an already-selected emoji */
.picker-emoji.active::after {
    content: '';
    position: absolute;
    bottom: 1px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #198754;
}

/* Clickable reaction badge */
.badge-reaction {
    cursor: pointer;
    transition: transform .18s cubic-bezier(.2, .8, .2, 1), background .18s ease, color .18s ease, box-shadow .18s ease;
    -webkit-user-select: none;
    /* Safari / iOS */
    user-select: none;
}

.badge-reaction:hover {
    opacity: 0.85;
}

.badge-reaction:active {
    transform: scale(0.95);
}

/* Keep the emoji's own color visible while marking the reader's choice. */
.post-card .post-body .badge-reaction.active,
.badge-reaction.active {
    border: 0;
    color: #24465b;
    background: #eaf3f8;
    box-shadow: 0 1px 4px rgba(31, 67, 85, .1);
}

.post-card .post-body .badge-reaction[data-emoji-id="trophy"] {
    --trophy-sparkle: #e1a317;
    position: relative;
    overflow: visible;
    color: #815513;
    background: rgba(255, 221, 139, .3);
    box-shadow: none;
}

.post-card .post-body .badge-reaction[data-emoji-id="trophy"].active {
    color: #63400d;
    background: rgba(255, 211, 101, .43);
}

:root[data-color-mode="night"] .post-card .post-body .badge-reaction[data-emoji-id="trophy"] {
    --trophy-sparkle: #f4cb64;
}

.post-card .post-body .badge-reaction .badge-reaction__sparkles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.post-card .post-body .badge-reaction .badge-reaction__sparkles i {
    position: absolute;
    z-index: 1;
    display: block;
    width: 0;
    height: 0;
    color: var(--trophy-sparkle);
    font-size: var(--sparkle-size);
    font-style: normal;
    line-height: 1;
    opacity: 0;
    animation: trophyTwinkle var(--sparkle-duration) ease-in-out var(--sparkle-delay) infinite;
}

.post-card[data-view-observed]:not(.trophy-sparkles-visible) .badge-reaction__sparkles i {
    animation-play-state: paused;
}

.post-card .post-body .badge-reaction .badge-reaction__sparkles i::before {
    content: "\2726";
    text-shadow: 0 0 3px rgba(236, 177, 56, .28);
}

.post-card .post-body .badge-reaction .badge-reaction__sparkles i:nth-child(even)::before {
    content: "\2727";
}

.post-card .post-body .badge-reaction .badge-reaction__sparkles i:nth-child(1) { left: -7px; top: -8px; --sparkle-size: 12px; --sparkle-duration: 3.7s; --sparkle-delay: -1.9s; }
.post-card .post-body .badge-reaction .badge-reaction__sparkles i:nth-child(2) { left: 12px; top: -15px; --sparkle-size: 7px; --sparkle-duration: 4.1s; --sparkle-delay: -3.1s; }
.post-card .post-body .badge-reaction .badge-reaction__sparkles i:nth-child(3) { left: 32px; top: -10px; --sparkle-size: 9px; --sparkle-duration: 3.3s; --sparkle-delay: -1.1s; }
.post-card .post-body .badge-reaction .badge-reaction__sparkles i:nth-child(4) { right: 8px; top: -16px; --sparkle-size: 6px; --sparkle-duration: 4.4s; --sparkle-delay: -2.7s; }
.post-card .post-body .badge-reaction .badge-reaction__sparkles i:nth-child(5) { right: 1px; bottom: -11px; --sparkle-size: 10px; --sparkle-duration: 3.8s; --sparkle-delay: -3.4s; }
.post-card .post-body .badge-reaction .badge-reaction__sparkles i:nth-child(6) { right: 16px; bottom: -8px; --sparkle-size: 7px; --sparkle-duration: 4.2s; --sparkle-delay: -1.4s; }
.post-card .post-body .badge-reaction .badge-reaction__sparkles i:nth-child(7) { left: 25px; bottom: -12px; --sparkle-size: 9px; --sparkle-duration: 3.5s; --sparkle-delay: -2.5s; }
.post-card .post-body .badge-reaction .badge-reaction__sparkles i:nth-child(8) { left: -10px; bottom: 1px; --sparkle-size: 6px; --sparkle-duration: 4.6s; --sparkle-delay: -.6s; }

@keyframes trophyTwinkle {
    0%, 100% { opacity: 0; transform: translate3d(0, 4px, 0) scale(.45) rotate(-12deg); }
    18% { opacity: .8; transform: translate3d(0, 0, 0) scale(.85) rotate(0deg); }
    35% { opacity: 1; transform: translate3d(1px, -3px, 0) scale(1.1) rotate(9deg); }
    52% { opacity: .7; transform: translate3d(2px, -6px, 0) scale(.9) rotate(17deg); }
    70% { opacity: 0; transform: translate3d(3px, -9px, 0) scale(.55) rotate(22deg); }
}

@media (prefers-reduced-motion: reduce) {
    .post-card .post-body .badge-reaction .badge-reaction__sparkles i {
        animation: none;
        opacity: 0;
    }

    .post-card .post-body .badge-reaction .badge-reaction__sparkles i:nth-child(1),
    .post-card .post-body .badge-reaction .badge-reaction__sparkles i:nth-child(5) {
        opacity: .65;
    }
}


/* =============================================================================
   11. Social Items
   Icon + label grid used in sidebar and share sheet.
   ============================================================================= */

.social-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: opacity .2s;
}

.social-item a {
    text-decoration: none;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.social-item a:hover {
    opacity: 0.75;
}

.social-item .icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border: 1px solid #bdd8bf;
    /* background: #f1f9f1; */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: border-color .2s;
}

/* Per-platform brand colors */
.social-item .icon .telegram {
    color: #29b6f6;
}

.social-item .icon .youtube {
    color: #FF0000;
}

.social-item .icon .instagram {
    color: #E4405F;
}

.social-item .icon .whatsapp {
    color: #25D366;
}

.social-item .icon .vk {
    color: #0077FF;
}

.social-item .icon .x {
    color: #000000;
}

.social-item:hover .social-item .icon {
    border-color: #9ec2a1;
}

.social-item .label {
    font-size: 13.125px;
    color: #198754;
    text-align: center;
}


/* =============================================================================
   12. Share Row
   Link copy input + button inside the share modal.
   ============================================================================= */

.social-share-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.row-copy {
    background: #f5faf5;
    border: 1px solid #d0e5d2;
    border-radius: 14px;
    padding: 5px 8px;
}

.row-copy .link-text {
    border: 0;
    flex: 1;
    font-size: 13.125;
    background: transparent;
    color: #198754;
    padding: 0;
}

.row-copy .link-text:focus {
    background: #f5faf5;
    box-shadow: none;
}

.row-copy .btn-copy-link {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #198754;
    border: none;
    color: #fff;
    transition: all .15s;
}

.row-copy .btn-copy-link:hover {
    background: #157347;
}

.share-sheet-layer {
    position: fixed;
    inset: 0;
    z-index: 100000;
    pointer-events: none;
}

body.share-sheet-open {
    overflow: hidden;
}

.share-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 22, 11, .48);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: auto;
    transition: opacity .28s ease;
    will-change: opacity;
}

.share-sheet-stack {
    position: fixed;
    left: 50%;
    bottom: max(12px, env(safe-area-inset-bottom));
    width: min(520px, calc(100vw - 24px));
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    pointer-events: auto;
    transform: translate(-50%, 26px) scale(.98);
    transform-origin: bottom center;
    transition: opacity .28s ease, transform .36s cubic-bezier(.18, .86, .22, 1);
    will-change: opacity, transform;
}

.share-sheet-panel,
.share-sheet-cancel {
    border: 1px solid rgba(255, 255, 255, .86);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 24px 68px rgba(5, 21, 12, .24);
}

.share-sheet-panel {
    overflow: hidden;
    border-radius: 27px;
}

.share-sheet-header {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 8px;
    padding: 20px 22px 16px;
}

.share-sheet-spacer {
    width: 44px;
    height: 44px;
}

.share-sheet-title {
    min-width: 0;
    text-align: center;
}

.share-sheet-title strong {
    display: block;
    color: #151b1e;
    font-size: 24px;
    line-height: 1.05;
    font-weight: 760;
    letter-spacing: 0;
}

.share-sheet-title span {
    display: block;
    margin-top: 4px;
    color: rgba(31, 37, 40, .48);
    font-size: 13px;
    line-height: 1.2;
    font-weight: 560;
}

.share-sheet-native {
    appearance: none;
    -webkit-appearance: none;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    font-family: inherit;
    color: #2f91bb;
    background: transparent;
    font-size: 27px;
    transition: transform .16s ease, background .16s ease;
}

.share-sheet-native:active {
    transform: scale(.94);
}

.share-sheet-native:hover,
.share-sheet-native:focus-visible {
    background: rgba(47, 145, 187, .09);
}

.share-sheet-layer.is-mounted .share-sheet-backdrop {
    opacity: 1;
}

.share-sheet-layer.is-mounted .share-sheet-stack {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

.share-sheet-layer.is-leaving .share-sheet-backdrop {
    opacity: 0;
}

.share-sheet-layer.is-leaving .share-sheet-stack {
    opacity: 0;
    transform: translate(-50%, 22px) scale(.985);
}

.share-sheet-socials {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 2px 12px 22px;
    overflow: hidden;
}

.share-sheet-socials::-webkit-scrollbar {
    display: none;
}

.share-sheet-social {
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: #1f2528;
    text-decoration: none;
    font-size: 11.5px;
    line-height: 1.1;
    font-weight: 560;
    text-align: center;
    touch-action: manipulation;
    transition: transform .18s cubic-bezier(.2, .8, .2, 1);
}

.share-sheet-social > span:last-child {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.share-sheet-social-icon {
    width: clamp(44px, 10.8vw, 54px);
    height: clamp(44px, 10.8vw, 54px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    font-size: clamp(20px, 5vw, 24px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24);
}

@media (max-width: 390px) {
    .share-sheet-panel {
        border-radius: 24px;
    }

    .share-sheet-header {
        padding: 18px 18px 14px;
    }

    .share-sheet-socials {
        padding-inline: 9px;
    }

    .share-sheet-social {
        font-size: 10.5px;
    }

    .share-sheet-social-icon {
        width: 42px;
        height: 42px;
        font-size: 19px;
    }
}

.share-sheet-social--telegram .share-sheet-social-icon { background: linear-gradient(145deg, #35b9f0, #1d93d1); }
.share-sheet-social--whatsapp .share-sheet-social-icon { background: linear-gradient(145deg, #35d77f, #17a75b); }
.share-sheet-social--vk .share-sheet-social-icon { background: linear-gradient(145deg, #3f9bff, #1976e8); }
.share-sheet-social--x .share-sheet-social-icon { background: linear-gradient(145deg, #3a3f43, #111820); }
.share-sheet-social--mail .share-sheet-social-icon { background: linear-gradient(145deg, #7f8a91, #424b51); }

.share-sheet-social:active,
.share-sheet-copy:active,
.share-sheet-cancel:active {
    transform: scale(.97);
}

.share-sheet-copy {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    min-height: 68px;
    display: grid;
    place-items: center;
    padding: 0 18px;
    border: 0;
    border-top: 1px solid rgba(31, 37, 40, .08);
    background: transparent;
    color: #2f91bb;
    font-size: 20px;
    font-weight: 650;
    font-family: inherit;
    text-align: center;
    letter-spacing: 0;
    touch-action: manipulation;
}

.share-sheet-cancel {
    appearance: none;
    -webkit-appearance: none;
    min-height: 66px;
    display: grid;
    place-items: center;
    border-radius: 22px;
    color: #2f91bb;
    font-size: 22px;
    font-weight: 650;
    font-family: inherit;
    letter-spacing: 0;
    touch-action: manipulation;
}

@media (max-width: 420px) {
    .share-sheet-stack {
        width: calc(100vw - 24px);
        gap: 8px;
    }

    .share-sheet-panel {
        border-radius: 24px;
    }

    .share-sheet-header {
        padding: 18px 16px 14px;
        grid-template-columns: 38px minmax(0, 1fr) 38px;
    }

    .share-sheet-spacer,
    .share-sheet-native {
        width: 38px;
        height: 38px;
    }

    .share-sheet-native {
        font-size: 25px;
    }

    .share-sheet-title strong {
        font-size: 22px;
    }

    .share-sheet-socials {
        gap: 5px;
        padding: 0 10px 22px;
    }

    .share-sheet-social {
        font-size: 10.5px;
    }

    .share-sheet-social-icon {
        width: clamp(43px, 12.2vw, 50px);
        height: clamp(43px, 12.2vw, 50px);
        font-size: clamp(20px, 5.8vw, 23px);
    }

    .share-sheet-copy {
        min-height: 64px;
        font-size: 19px;
    }

    .share-sheet-cancel {
        min-height: 62px;
        border-radius: 20px;
        font-size: 21px;
    }
}

@media (max-width: 360px) {
    .share-sheet-socials {
        gap: 5px;
        padding-inline: 8px;
    }

    .share-sheet-social {
        font-size: 10px;
    }

    .share-sheet-social-icon {
        width: 43px;
        height: 43px;
        font-size: 20px;
    }
}


/* =============================================================================
   13. Shield Items
   Trust/security info rows shown in modals or settings.
   ============================================================================= */

.shield-item {
    gap: 10px;
}

.shield-item .icon {
    font-size: 18px;
    color: #198754;
    min-width: 20px;
}

.shield-item strong {
    display: block;
    font-size: 13.125px;
    margin-bottom: 2.08px;
}

.shield-item p {
    font-size: 12px;
    color: #5c7a65;
    line-height: 1.5;
    margin: 0;
}

.shield-item .link {
    color: #198754;
    font-weight: 600;
    text-decoration: none;
}


/* =============================================================================
   14. Footer
   Fixed bottom action bar with gradient fade above it.
   ============================================================================= */

#footer {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 560px;
    padding: 10px 0 max(16px, env(safe-area-inset-bottom));
    background: transparent;
    z-index: 8;
    gap: 8px;
    pointer-events: none;
    transition: bottom .38s cubic-bezier(.22, 1, .36, 1);
}

#footer::before {
    content: "";
    display: none;
}

@media (max-width: 768px) {
    #footer {
        width: 100%;
        padding: 10px 12px max(16px, env(safe-area-inset-bottom));
    }

    #footer::before {
        display: none;
    }
}

#footer .btn-notify {
    flex: 1;
    min-width: 0;
    min-height: 48px;
    padding: 0 12px;
    border-radius: 999px;
    position: relative;
    background: rgba(255, 255, 255, .42) !important;
    border: 1px solid rgba(55, 65, 61, .14) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .58), 0 8px 24px rgba(20, 28, 25, .08) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    pointer-events: auto;
}

.footer-inner {
    position: relative;
    margin: auto;
    width: calc(100% - 2px);
    gap: 8px;
    pointer-events: none;
}

#footer .lang-switcher,
#footer .footer-inner > .btn-footer {
    position: relative;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .42);
    border: 1px solid rgba(55, 65, 61, .14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .58), 0 8px 24px rgba(20, 28, 25, .08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    pointer-events: auto;
}

#footer .btn-notify:hover,
#footer .lang-switcher:hover,
#footer .footer-inner > .btn-footer:hover {
    background: rgba(255, 255, 255, .54) !important;
}

#footer .btn-notify:focus-visible,
#footer .footer-inner > .btn-footer:focus-visible {
    outline: 2px solid rgba(var(--app-accent-rgb), .55);
    outline-offset: 3px;
}

#footer .lang-switcher:focus-within { outline: none; }
#footer .lang-switcher .btn-footer:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px rgba(var(--app-accent-rgb), .36);
}

#footer .btn-notify span {
    min-width: 0;
    line-height: 1.2;
    text-wrap: balance;
}

#footer .btn-notify:not(.declined) i {
    color: rgb(var(--app-accent-rgb));
}

@media (max-width: 360px) {
    #footer .btn-notify {
        font-size: 12px;
        padding: 0 7px;
    }

    #footer .btn-notify span {
        white-space: normal;
    }
}

@media (prefers-reduced-transparency: reduce) {
    #header .meta,
    #footer .btn-notify,
    #footer .lang-switcher,
    #footer .footer-inner > .btn-footer {
        background: rgba(255, 255, 255, .94) !important;
        border-color: rgba(55, 65, 61, .2) !important;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

.scroll-latest-btn {
    position: absolute;
    right: 15px;
    bottom: calc(100% + 10px);
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(55, 65, 61, .14);
    border-radius: 50%;
    background: rgba(255, 255, 255, .42);
    color: rgb(var(--app-accent-rgb));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .58), 0 8px 24px rgba(20, 28, 25, .08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px) scale(.92);
    transition: opacity .18s ease, transform .2s cubic-bezier(.2, .82, .24, 1), background .16s ease, border-color .16s ease;
}

.scroll-latest-btn i {
    color: inherit;
    font-size: 18px;
    line-height: 1;
}

.scroll-latest-btn.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.scroll-latest-btn:active {
    transform: translateY(1px) scale(.94);
}

.scroll-latest-btn:hover,
.scroll-latest-btn:focus-visible {
    background: rgba(255, 255, 255, .54);
}

.scroll-latest-btn:focus-visible {
    outline: 2px solid rgba(var(--app-accent-rgb), .55);
    outline-offset: 3px;
}

@media (prefers-reduced-transparency: reduce) {
    .scroll-latest-btn {
        background: rgba(255, 255, 255, .94);
        border-color: rgba(55, 65, 61, .2);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

body.is-feed-pulling #main-app {
    transform: translate3d(0, calc(0px - var(--feed-pull-lift, 0px)), 0);
    transition: none;
    will-change: transform;
}

body.is-feed-pull-releasing #main-app {
    transform: translate3d(0, 0, 0);
    transition: transform .46s cubic-bezier(.18, .88, .14, 1);
    will-change: transform;
}

.feed-pull-refresh {
    --feed-pull-progress: 0;
    --feed-pull-visual-progress: 0;
    position: fixed;
    left: 50%;
    bottom: calc(74px + max(10px, env(safe-area-inset-bottom)));
    z-index: 100018;
    display: grid;
    justify-items: center;
    gap: 6px;
    color: #fff;
    pointer-events: none;
    opacity: 0;
    transform: translate3d(-50%, 16px, 0) scale(.9);
    transition:
        opacity .38s ease,
        transform .68s cubic-bezier(.18, .88, .14, 1);
    will-change: opacity, transform;
}

.feed-pull-refresh.is-active {
    opacity: calc(.64 + var(--feed-pull-visual-progress) * .36);
    transform: translate3d(-50%, 0, 0) scale(calc(.9 + var(--feed-pull-visual-progress) * .1));
}

body.is-feed-pulling .feed-pull-refresh,
body.is-feed-pulling .feed-pull-refresh__orb,
body.is-feed-pulling .feed-pull-refresh__orb i {
    transition: none;
}

.feed-pull-refresh.is-hiding {
    opacity: 0;
    transform: translate3d(-50%, 14px, 0) scale(.93);
    transition:
        opacity .34s ease,
        transform .52s cubic-bezier(.22, .72, .18, 1);
}

.feed-pull-refresh__orb {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: rgba(31, 37, 40, .64);
    border: 1px solid rgba(255, 255, 255, .16);
    box-shadow: 0 18px 38px rgba(8, 16, 12, .22);
    backdrop-filter: blur(18px) saturate(1.08);
    -webkit-backdrop-filter: blur(18px) saturate(1.08);
    transform: translate3d(0, var(--feed-pull-orb-y, 0px), 0)
        scaleX(var(--feed-pull-orb-scale-x, 1))
        scaleY(var(--feed-pull-orb-scale-y, 1));
    transform-origin: center bottom;
    transition:
        width .48s cubic-bezier(.18, .88, .14, 1),
        height .48s cubic-bezier(.18, .88, .14, 1),
        opacity .3s ease,
        border-radius .48s cubic-bezier(.18, .88, .14, 1),
        background .32s ease,
        border-color .28s ease,
        transform .96s cubic-bezier(.16, .9, .14, 1);
}

.feed-pull-refresh.is-ready .feed-pull-refresh__orb,
.feed-pull-refresh.is-checking .feed-pull-refresh__orb,
.feed-pull-refresh.is-done .feed-pull-refresh__orb,
.feed-pull-refresh.is-offline .feed-pull-refresh__orb,
.feed-pull-refresh.is-error .feed-pull-refresh__orb {
    border-radius: 999px;
    background: rgba(31, 37, 40, .74);
}

.feed-pull-refresh.is-checking .feed-pull-refresh__orb {
    transform: translate3d(0, 0, 0) scale(1);
    animation: feedPullOrbBreathe 1.24s ease-in-out infinite;
}

.feed-pull-refresh__orb i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 27px;
    line-height: 1;
    transform-origin: 50% 50%;
    transform: translate3d(0, var(--feed-pull-icon-y, 0px), 0);
    transition: transform .42s cubic-bezier(.18, .88, .14, 1), opacity .24s ease;
}

.feed-pull-refresh.is-checking .feed-pull-refresh__orb i {
    transform: translate3d(0, 0, 0);
    animation: feedPullSpin .92s linear infinite;
    will-change: transform;
}

.feed-pull-refresh__label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    max-width: calc(100vw - 42px);
    min-height: 28px;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(31, 37, 40, .55);
    box-shadow: 0 10px 24px rgba(8, 16, 12, .16);
    color: rgba(255, 255, 255, .92);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
    backdrop-filter: blur(16px) saturate(1.08);
    -webkit-backdrop-filter: blur(16px) saturate(1.08);
    transition:
        background .28s ease,
        box-shadow .34s ease,
        transform .34s cubic-bezier(.19, .9, .16, 1),
        opacity .28s ease;
}

.feed-pull-refresh.is-done,
.feed-pull-refresh.is-offline,
.feed-pull-refresh.is-error {
    gap: 6px;
}

.feed-pull-refresh.is-done .feed-pull-refresh__orb,
.feed-pull-refresh.is-offline .feed-pull-refresh__orb,
.feed-pull-refresh.is-error .feed-pull-refresh__orb {
    transform: translate3d(0, 0, 0) scale(1);
    animation: feedPullOrbSettle .62s cubic-bezier(.18, .88, .14, 1) both;
}

.feed-pull-refresh.is-done .feed-pull-refresh__label,
.feed-pull-refresh.is-offline .feed-pull-refresh__label,
.feed-pull-refresh.is-error .feed-pull-refresh__label {
    min-width: min(192px, calc(100vw - 42px));
    background: rgba(31, 37, 40, .68);
    box-shadow: 0 14px 30px rgba(8, 16, 12, .18);
    animation: feedPullResult .42s ease both;
}

.feed-pull-refresh.is-done .feed-pull-refresh__orb i,
.feed-pull-refresh.is-offline .feed-pull-refresh__orb i,
.feed-pull-refresh.is-error .feed-pull-refresh__orb i {
    animation: feedPullIconSettle .48s cubic-bezier(.18, .88, .14, 1) both;
}

@keyframes feedPullSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes feedPullOrbBreathe {
    0%, 100% {
        box-shadow: 0 18px 38px rgba(8, 16, 12, .2);
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        box-shadow: 0 20px 44px rgba(8, 16, 12, .25);
        transform: translate3d(0, -1px, 0) scale(1.025);
    }
}

@keyframes feedPullOrbSettle {
    0% {
        transform: translate3d(0, 1px, 0) scale(.985);
    }
    70% {
        transform: translate3d(0, 0, 0) scale(1.012);
    }
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
}

@keyframes feedPullIconSettle {
    from {
        opacity: .72;
        transform: translate3d(0, 0, 0) scale(.92);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

@keyframes feedPullResult {
    from {
        opacity: .72;
    }
    to {
        opacity: 1;
    }
}

.btn-liquid {
    flex: 1;
    border: none !important;
    background: transparent !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    box-shadow: none !important;
    transition: .3s ease;
}

.btn-liquid.enabled {
    /* color: #179258 !important; */
}

.btn-liquid.declined {
    color: #dc3545 !important;
}

.btn-liquid:hover {
    transform: translateY(-1px);
}

.btn-liquid i {
    font-size: 17px;
}

@media(max-width:576px) {
    .btn-liquid {
        font-size: .85rem;
        gap: .5rem;
    }
}



/* =============================================================================
   15. Telegram-style full-screen profile menu
   ============================================================================= */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(8, 17, 11, .72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .46s cubic-bezier(.18, .86, .22, 1);
    will-change: opacity;
}

.sidebar-overlay.is-dragging {
    transition: none;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.sidebar {
    --sidebar-green: #198754;
    position: fixed;
    inset: -1px auto 0 0;
    z-index: 1001;
    width: 100vw;
    max-width: none;
    height: calc(100dvh + 1px);
    overflow: hidden;
    background: #edf1ed;
    opacity: 0;
    pointer-events: none;
    transform: translate3d(var(--sidebar-drag-x, -100%), 0, 0);
    transition:
        transform .68s cubic-bezier(.16, 1, .22, 1),
        opacity .34s ease;
    will-change: transform, opacity;
    contain: paint;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.sidebar.is-dragging {
    opacity: var(--sidebar-drag-opacity, .2);
    pointer-events: none;
    transform: translate3d(var(--sidebar-drag-x, -100%), 0, 0);
    transition: none;
    box-shadow: 0 26px 80px rgba(6, 20, 10, .18);
}

.sidebar.is-releasing {
    opacity: var(--sidebar-drag-opacity, 0);
    pointer-events: none;
    transform: translate3d(var(--sidebar-drag-x, -100%), 0, 0);
    transition:
        transform .54s cubic-bezier(.18, .88, .18, 1),
        opacity .34s ease;
}

.sidebar.is-opening-from-swipe {
    transition:
        transform .56s cubic-bezier(.16, 1, .22, 1),
        opacity .28s ease;
}

.sidebar.active {
    opacity: 1;
    pointer-events: auto;
    transform: translate3d(0, 0, 0);
    box-shadow: 0 26px 80px rgba(6, 20, 10, .24);
}

.sidebar.active.is-dragging {
    opacity: var(--sidebar-drag-opacity, 1);
    pointer-events: auto;
    transform: translate3d(var(--sidebar-drag-x, 0%), 0, 0);
    transition: none;
}

.sidebar.active.is-releasing {
    opacity: var(--sidebar-drag-opacity, 1);
    pointer-events: none;
    transform: translate3d(var(--sidebar-drag-x, 0%), 0, 0);
    transition:
        transform .54s cubic-bezier(.18, .88, .18, 1),
        opacity .34s ease;
}

.sidebar-scroll {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    opacity: .96;
    transform: translateX(-10px);
    transition: opacity .44s ease, transform .54s cubic-bezier(.18, .86, .22, 1);
    will-change: opacity, transform;
}

.sidebar.active .sidebar-scroll {
    opacity: 1;
    transform: translateX(0);
}

.sidebar.active.is-releasing .sidebar-scroll {
    opacity: 1;
    transform: translateX(0);
}

.sidebar-banner {
    position: relative;
    min-height: clamp(285px, 42vh, 390px);
    flex: 0 0 auto;
    overflow: hidden;
    isolation: isolate;
    background: linear-gradient(145deg, #5f9b6b, #1f4b30);
}

.sidebar-banner::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: var(--app-edge-fade-top);
    z-index: 3;
    background: none;
    backdrop-filter: blur(5px) saturate(1.03);
    -webkit-backdrop-filter: blur(5px) saturate(1.03);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 25%, rgba(0, 0, 0, .55) 58%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 0%, #000 25%, rgba(0, 0, 0, .55) 58%, transparent 100%);
    pointer-events: none;
}

.sidebar-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    background:
        linear-gradient(180deg, rgba(4, 12, 6, 0) 38%, rgba(4, 12, 6, .52) 78%, rgba(4, 12, 6, .84) 100%),
        linear-gradient(90deg, rgba(4, 12, 6, .18), rgba(4, 12, 6, 0) 32%, rgba(4, 12, 6, 0) 68%, rgba(4, 12, 6, .18));
    pointer-events: none;
}

.cover-backdrop {
    display: block;
    position: absolute;
    z-index: 0;
    inset: -32px;
    width: calc(100% + 64px);
    height: calc(100% + 64px);
    object-fit: cover;
    object-position: center 34%;
    filter: blur(24px) brightness(.76) saturate(.95);
    opacity: .94;
    transform: scale(1.05);
}

.sidebar-banner .cover {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    z-index: 1;
    object-fit: cover;
    object-position: center 34%;
    filter: saturate(.98);
}

.btn-close-sidebar,
.qr-back,
.qr-close {
    display: grid;
    place-items: center;
    border: 0;
    color: #fff;
    background: rgba(14, 22, 16, .42);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-close-sidebar {
    position: absolute;
    z-index: 10;
    top: max(16px, env(safe-area-inset-top));
    left: 16px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 22px;
}

.sidebar-avatar-wrapper {
    position: absolute;
    z-index: 4;
    left: 22px;
    bottom: 82px;
}

.sidebar-avatar {
    width: 74px;
    height: 74px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, .85);
    border-radius: 50%;
    box-shadow: 0 5px 18px rgba(0, 0, 0, .2);
}

.sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; }

.sidebar-identity {
    position: absolute;
    z-index: 4;
    left: 22px;
    right: 22px;
    bottom: 25px;
    color: rgba(255, 255, 255, .82);
    font-size: 13px;
}

.sidebar-name {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
    color: #fff;
    font-size: 20px;
    font-weight: 750;
    text-transform: uppercase;
}

.sidebar-name i { color: #2aabee; font-size: 17px; }

.sidebar-info {
    padding: 0 12px max(8px, env(safe-area-inset-bottom));
    border: 0;
    min-height: calc(100dvh - clamp(285px, 42vh, 390px));
    display: flex;
    flex-direction: column;
}

.sidebar-actions {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    margin: 12px 0 10px;
    padding: 6px;
    overflow: hidden;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(28, 66, 39, .07);
}

.sidebar-action {
    position: relative;
    min-width: 0;
    min-height: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 5px;
    border: 0;
    border-radius: 13px;
    color: #198754;
    background: transparent;
    box-shadow: none;
    text-decoration: none;
    font-size: 11px;
    line-height: 1.2;
    text-align: center;
    transition: color .16s ease, background .16s ease, transform .16s ease;
}

.sidebar-action + .sidebar-action::before {
    content: '';
    position: absolute;
    top: 15px;
    bottom: 15px;
    left: -1px;
    width: 1px;
    background: #e3ebe5;
}

.sidebar-action i { display: block; font-size: 23px; line-height: 1; }
.sidebar-action span { color: #233229; font-weight: 600; letter-spacing: 0; }
.sidebar-action:active { background: #eaf5ee; transform: scale(.98); }
.sidebar-action:focus-visible { outline: 2px solid rgba(25, 135, 84, .32); outline-offset: -2px; }

@media (hover: hover) {
    .sidebar-action:hover { color: #157347; background: #eff8f2; }
    .sidebar-action:hover span { color: #157347; }
}
.sidebar-card {
    margin: 9px 0;
    overflow: hidden;
    border: 1px solid rgba(36, 84, 50, .08);
    border-radius: 17px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 2px 8px rgba(26, 61, 35, .04);
}

.sidebar-about-card { padding: 17px; }
.sidebar-card-label {
    margin-bottom: 7px;
    color: #718078;
    font-size: 11px;
    font-weight: 600;
}

.sidebar-bio { margin: 0; color: #18201a; font-size: 14px; line-height: 1.45; }
.sidebar-menu-card { padding-top: 14px; }
.sidebar-menu-card > .sidebar-card-label { padding: 0 18px; margin-bottom: 7px; }
.menu { margin: 0; padding: 0 10px 10px; border: 0; border-radius: 0; overflow: visible; background: transparent; }

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    margin: 1px 0 !important;
    padding: 9px 12px;
    border: 0;
    border-radius: 12px;
    color: #151a16;
    text-decoration: none;
    transition: transform .18s ease, background .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.menu-item:last-child { border-bottom: 0; }
.menu-item:active { background: rgba(49, 95, 58, .08); transform: scale(.992); }
.menu-item:focus-visible { outline: 2px solid rgba(49, 95, 58, .28); outline-offset: -2px; }
@media (hover: hover) {
    .menu-item:hover {
        background: rgba(49, 95, 58, .055);
        box-shadow: inset 0 0 0 1px rgba(49, 95, 58, .06);
        transform: translateX(2px);
    }
}
.menu-item > i:first-child { width: 23px; color: var(--sidebar-green); font-size: 18px; text-align: center; }
.menu-item p { flex: 1; margin: 0; color: inherit; font-size: 14px; font-weight: 540; text-transform: none; line-height: 1.25; }
.menu-item .menu-item-arrow { width: auto; color: #9aa49d; font-size: 13px; }

.sidebar-signature {
    margin: auto 0 max(26px, calc(env(safe-area-inset-bottom, 0px) + 18px));
    padding-top: 34px;
    color: rgba(89, 104, 94, .68);
    font-size: 11px;
    font-weight: 400;
    line-height: 1.35;
    letter-spacing: .01em;
    text-align: center;
}

.header-telegram-link,
.header-social-link {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    color: #fff;
    background: #198754;
    box-shadow: none;
    text-decoration: none;
    font-size: 21px;
}
.header-telegram-link,
.header-social-telegram {
    background: #2aabee;
}
.header-social-instagram {
    background: #e4405f;
}
.header-social-youtube {
    background: #ff0033;
}
.header-social-vk {
    background: #0077ff;
}
.header-telegram-link:hover,
.header-social-link:hover { color: #fff; filter: brightness(.94); }
.header-social-link i { line-height: 1; }

.sidebar-qr-view {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
    background: rgba(8, 17, 11, .72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .28s ease;
    will-change: opacity;
}
.sidebar-qr-view.active { opacity: 1; pointer-events: auto; }

.qr-sheet {
    width: min(100%, 360px);
    max-height: 100%;
    overflow-y: auto;
    padding: 20px;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 22px 60px rgba(0, 0, 0, .28);
    text-align: center;
    opacity: 0;
    transform: translateY(18px) scale(.965);
    transition: opacity .28s ease, transform .34s cubic-bezier(.18, .86, .22, 1);
    will-change: opacity, transform;
}
.sidebar-qr-view.active .qr-sheet {
    opacity: 1;
    transform: none;
}
.qr-sheet-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.qr-sheet-header strong { font-size: 17px; font-weight: 600; }
.qr-close { width: 36px; height: 36px; border: 0; border-radius: 50%; color: #26342a; background: #f0f3f0; }
.qr-switch {
    display: grid;
    grid-template-columns: repeat(var(--qr-option-count, 3), minmax(0, 1fr));
    gap: 4px;
    margin: 0 0 12px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(238, 243, 239, .92);
}
.qr-switch__btn {
    min-width: 0;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 8px;
    border: 0;
    border-radius: 999px;
    color: #66756b;
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    transition: color .18s ease, background .18s ease;
}
.qr-switch__btn i { font-size: 15px; line-height: 1; }
.qr-switch__btn span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.qr-switch__btn.is-active {
    color: var(--sidebar-green);
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(31, 88, 50, .06);
}
.qr-switch__btn:focus-visible { outline: 2px solid rgba(25, 135, 84, .26); outline-offset: 2px; }
.qr-code-frame {
    width: min(100%, 300px);
    aspect-ratio: 1;
    box-sizing: border-box;
    display: grid;
    place-items: center;
    margin: 0 auto 12px;
    padding: 0;
    background: #fff;
}
.telegram-qr {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    transition: opacity .18s ease, transform .18s ease, filter .18s ease;
}
.qr-sheet.is-switching .telegram-qr {
    opacity: .4;
    transform: scale(.985);
    filter: blur(.5px);
}
.qr-actions { display: block; }
.qr-primary-action { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; color: #26342a; background: #f2f4f3; font-size: 14px; font-weight: 500; }
.qr-primary-action:hover { background: #e9eeeb; }
.qr-primary-action:focus-visible,
.qr-close:focus-visible { outline: 2px solid rgba(var(--app-qr-rgb), .42); outline-offset: 2px; }
.qr-primary-action [data-copy-icon] { color: #222b2f; transition: transform .18s ease; }
.qr-primary-action.is-copied [data-copy-icon] { transform: scale(1.12); }
@media (max-width: 359px) {
    .qr-switch__btn { gap: 2px; padding: 0 2px; font-size: 11px; }
}


/* The menu is always full-screen; its content density adapts to the device. */
@media (min-width: 600px) {
    .sidebar-banner {
        min-height: clamp(340px, 48svh, 520px);
        background: #18251c;
    }
	
    .cover-backdrop {
        inset: -28px;
        width: calc(100% + 56px);
        height: calc(100% + 56px);
        filter: blur(24px) brightness(.62) saturate(.8);
        transform: scale(1.04);
    }
	
    .sidebar-banner .cover {
        left: 0;
        width: 100%;
        transform: none;
        object-fit: cover;
        object-position: center 36%;
        box-shadow: none;
    }
	
    .sidebar-banner::before,
    .sidebar-banner::after {
        left: 0;
        width: 100%;
        transform: none;
    }

    .btn-close-sidebar {
        left: max(24px, calc(50% - 386px));
    }

    .sidebar-identity,
    .sidebar-avatar-wrapper {
        left: max(30px, calc(50% - 380px));
    }

    .sidebar-info {
        width: min(100%, 820px);
        margin-inline: auto;
        padding-inline: 18px;
        min-height: calc(100dvh - clamp(340px, 48svh, 520px));
    }

    .sidebar-actions { margin-top: 14px; padding: 7px; }
    .sidebar-action { min-height: 80px; }

    .sidebar-card { margin-block: 12px; }
}

@media (min-width: 1100px) and (min-height: 700px) {
    .sidebar-banner { min-height: min(52svh, 540px); }
    .sidebar-info { padding-top: 4px; }
    .sidebar-about-card { padding: 20px; }
    .menu-item { min-height: 46px; }
}
@media (max-width: 370px) {
    .sidebar-action span { font-size: 10px; }
}
/* =============================================================================
   16. Graphite Status Banners & New Posts Alert
   Fixed floating pills and in-feed status messages.
   ============================================================================= */

.feed-status-banner {
    width: min(560px, calc(100% - 24px));
    margin: 16px auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px 14px;
    border-radius: 999px;
    color: #fff;
    background: rgba(31, 37, 40, .78);
    border: 1px solid rgba(255, 255, 255, .16);
    box-shadow: 0 14px 34px rgba(8, 16, 12, .18);
    backdrop-filter: blur(18px) saturate(1.08);
    -webkit-backdrop-filter: blur(18px) saturate(1.08);
}

.feed-status-banner i {
    color: #fff;
    font-size: 17px;
    line-height: 1;
}

.feed-status-banner span {
    color: rgba(255, 255, 255, .92);
    font-size: 13px;
    line-height: 1.25;
    font-weight: 600;
    text-align: left;
}

.feed-status-banner strong {
    color: #fff;
    font-weight: 800;
}

.post-status-banner {
    margin-top: 18px;
}

.feed-load-more-wrap {
    display: flex;
    justify-content: center;
    padding: 18px 16px 2px;
}

.feed-load-more-wrap[hidden] { display: none; }

.post-context-skeleton {
    box-sizing: border-box;
    width: min(calc(100% - 32px), 528px);
    min-height: 150px;
    margin: 0 auto 16px;
    padding: 28px;
    border-radius: 22px 22px 22px 10px;
    background: rgba(var(--app-card-rgb), .72);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.post-context-skeleton span {
    display: block;
    height: 14px;
    border-radius: 7px;
    background: currentColor;
    opacity: .1;
    animation: postContextSkeletonPulse 1.3s ease-in-out infinite alternate;
}

.post-context-skeleton span:nth-child(1) { width: 76%; }
.post-context-skeleton span:nth-child(2) { width: 94%; }
.post-context-skeleton span:nth-child(3) { width: 57%; }

@keyframes postContextSkeletonPulse {
    to { opacity: .18; }
}

@media (prefers-reduced-motion: reduce) {
    .post-context-skeleton span { animation: none; }
}

.post-context-load-more--newer {
    padding-top: 2px;
    padding-bottom: 18px;
}

.post-context-load-more--older {
    padding-top: 20px;
    padding-bottom: 18px;
}

.feed-load-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 42px;
    max-width: min(420px, calc(100vw - 32px));
    padding: 9px 18px 9px 12px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px;
    background: rgba(31, 37, 40, .88);
    color: rgba(255, 255, 255, .94);
    box-shadow: 0 14px 34px rgba(8, 16, 12, .18);
    backdrop-filter: blur(18px) saturate(1.08);
    -webkit-backdrop-filter: blur(18px) saturate(1.08);
    font-size: 13px;
    font-weight: 750;
    line-height: 1.1;
    white-space: nowrap;
    cursor: pointer;
    transition:
        background .22s ease,
        transform .28s cubic-bezier(.18, .86, .22, 1),
        box-shadow .28s ease,
        opacity .22s ease;
}

.feed-load-more:hover {
    background: rgba(42, 49, 52, .92);
}

.feed-load-more:active {
    transform: scale(.975);
    background: rgba(24, 29, 31, .94);
}

.feed-load-more:disabled {
    cursor: default;
    opacity: .92;
}

.feed-load-more__icon {
    width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    flex: 0 0 auto;
}

.feed-load-more__icon i {
    font-size: 15px;
    line-height: 1;
}

.feed-load-more__spinner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .28);
    border-top-color: #fff;
    animation: feedLoadMoreSpin .78s linear infinite;
    flex: 0 0 auto;
}

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

.new-posts-alert {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 84px);
    left: 50%;
    width: min(430px, calc(100% - 24px));
    z-index: 100040;
    pointer-events: none;
    opacity: 0;
    transform: translate3d(-50%, -8px, 0);
    transition: opacity .18s ease, transform .22s cubic-bezier(.2, .82, .18, 1);
}

.new-posts-alert--visible {
    opacity: 1;
    transform: translate3d(-50%, 0, 0);
    pointer-events: auto;
}

.new-posts-alert__inner {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 6px 6px 14px;
    box-sizing: border-box;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 20px;
    background: rgba(28, 34, 36, .94);
    box-shadow: 0 8px 24px rgba(10, 20, 15, .18);
    backdrop-filter: blur(20px) saturate(1.06);
    -webkit-backdrop-filter: blur(20px) saturate(1.06);
}

.new-posts-alert__left {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    flex: 1;
}

.new-posts-alert__dot {
    width: 6px;
    height: 6px;
    min-width: 6px;
    border-radius: 50%;
    background: #82d69a;
}

.new-posts-alert__text {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    color: rgba(255, 255, 255, .95);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.new-posts-alert__sub {
    margin-left: 3px;
    color: rgba(255, 255, 255, .62);
    font-weight: 400;
}

.new-posts-alert__actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.new-posts-alert__btn-refresh {
    min-height: 40px;
    background: rgba(247, 255, 244, .94);
    color: #1f2528;
    border: 0;
    padding: 0 12px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: background .15s ease, transform .15s ease;
}

.new-posts-alert__btn-refresh i {
    font-size: 15px;
    line-height: 1;
}

.new-posts-alert__btn-refresh:hover {
    background: #fff;
}

.new-posts-alert__btn-refresh:active {
    transform: scale(.96);
}

.new-posts-alert__btn-dismiss {
    background: transparent;
    color: rgba(255, 255, 255, .72);
    border: 0;
    width: 40px;
    height: 40px;
    border-radius: 15px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .15s ease, color .15s ease;
}

.new-posts-alert__btn-dismiss:hover {
    background: rgba(255, 255, 255, .16);
    color: #fff;
}

@media (max-width: 480px) {
    .new-posts-alert {
        top: calc(env(safe-area-inset-top, 0px) + 84px);
    }

    .new-posts-alert__sub {
        display: none;
    }

    .new-posts-alert__btn-refresh {
        padding-inline: 11px;
    }
}

@media (max-width: 360px) {
    .new-posts-alert__btn-refresh {
        width: 40px;
        padding: 0;
        justify-content: center;
    }

    .new-posts-alert__btn-label {
        display: none;
    }
}


/* =============================================================================
   17. Lightbox
   Full-screen image viewer with blurred backdrop.
   Supports prev/next navigation when a post has multiple images.
   ============================================================================= */

/* All .img-clickable elements are tappable to open the lightbox */
.img-clickable {
    cursor: pointer;
}

/* The feed is a reading surface, while editable fields remain selectable. */
body, body * {
    -webkit-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

input, textarea, [contenteditable], [contenteditable] * {
    -webkit-user-select: text !important;
    user-select: text !important;
    -webkit-touch-callout: default;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.lightbox--visible {
    opacity: 1;
    pointer-events: auto;
    touch-action: none;
    /* prevent iOS Safari from stealing swipe events */
    user-select: none;
    /* prevent text/image selection highlight during mouse drag */
    -webkit-user-select: none;
}

/* Blurred dark backdrop â€” clicking it closes the lightbox */
.lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

@media (max-width: 768px) {
    .lightbox__backdrop {
        background: #111;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

.lightbox__img-wrap {
    position: relative;
    z-index: 1;
    width: min(1000px, calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right) - 48px));
    height: calc(100vh - 88px);
    height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 88px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    touch-action: none;
}

.lightbox__img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 18px;
    object-fit: contain;
    box-shadow: 0 8px 48px rgba(0, 0, 0, 0.6);
    transform: scale(0.92);
    transition: transform 0.25s ease, filter 0.25s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    cursor: grab;
    will-change: transform;
}

.lightbox__img.is-zoomed {
    cursor: grabbing;
}
.lightbox.has-multiple .lightbox__img:not(.is-zoomed) { cursor: pointer; }

.lightbox__img--incoming {
    position: absolute;
    z-index: 1;
    pointer-events: none;
}

.lightbox__actions {
    position: absolute;
    z-index: 4;
    top: max(calc(env(safe-area-inset-top) + 12px), var(--lightbox-actions-top, 20px));
    right: max(calc(env(safe-area-inset-right) + 12px), var(--lightbox-actions-right, 20px));
}
.lightbox__actions[hidden], .lightbox__menu[hidden] { display: none; }

.lightbox__menu-toggle {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .26);
    border-radius: 50%;
    background: rgba(31, 42, 46, .76);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background .16s ease, border-color .16s ease;
}
.lightbox__menu-toggle:active,
.lightbox__menu-toggle[aria-expanded="true"] {
    background: rgba(53, 69, 74, .92);
    border-color: rgba(255, 255, 255, .4);
}

.lightbox__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 186px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 8px;
    background: rgba(30, 41, 45, .94);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .24);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.lightbox__save {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 42px;
    padding: 8px 10px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}
.lightbox__save:active { background: rgba(255, 255, 255, .12); }

.lightbox__status {
    position: absolute;
    z-index: 3;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: calc(100vw - 48px);
    padding: 12px 18px;
    border-radius: 14px;
    color: #fff;
    background: rgba(31, 43, 47, .9);
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

.lightbox__status.is-visible { opacity: 1; }

/* Image scales up to full size when lightbox is open */
.lightbox--visible .lightbox__img {
    transform: scale(1);
}

/* Lock body scroll while lightbox is open */
body.lightbox--open {
    overflow: hidden;
}

/* "1 / 3" counter shown when navigating multiple images */
.lightbox__counter {
    position: absolute;
    bottom: calc(env(safe-area-inset-bottom) + 20px);
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 500;
    z-index: 2;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 12px;
    border-radius: 20px;
}

@media (max-width: 640px) {
    .lightbox__img-wrap {
        width: calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right) - 20px);
        height: calc(100vh - 92px);
        height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 92px);
    }

    .lightbox__img {
        max-height: 100%;
        border-radius: 14px;
    }
}

.editor-content>p:last-of-type {
    margin-bottom: 0;
}

.editor-content,
.editor-content p,
.editor-content li {
    overflow-wrap: break-word;
}

.editor-content a:not(.btn-boxed) {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.post-body > *,
.editor-content > * {
    max-width: 100%;
}

.editor-content iframe {
    width: 100%;
    margin-bottom: 11px;
}

.editor-content li {
    margin-bottom: 4px;
}

.editor-content img {
    max-width: 100%;
    max-height: 500px;
    display: block;
    margin: auto;
    margin-bottom: 16px;
    object-fit: cover;
}

.editor-content blockquote a:hover {
    text-decoration: underline;
}

.editor-content pre {
    background-color: #1a1a18;
    padding: 16px 20px;
    color: #fff;
}

@media screen and (max-width: 1199px) {
    .editor-content iframe {
        height: 324px;
    }
}

@media screen and (max-width: 767px) {
    .editor-content iframe {
        height: 236px;
    }
}

@media screen and (max-width: 576px) {
    #modal-shield.modal.show {
        display: flex !important;
        align-items: flex-end;
    }

    #modal-shield .modal-dialog {
        width: 100%;
        max-width: none;
        min-height: 0;
        height: auto;
        margin: 0;
    }

    #modal-shield .modal-content {
        min-height: 0;
        height: min(640px, calc(100dvh - env(safe-area-inset-top) - 16px));
        max-height: calc(100dvh - env(safe-area-inset-top) - 16px);
        border-radius: 20px 20px 0 0 !important;
        border-bottom: 0;
        overflow: hidden;
    }

    #modal-shield .modal-handle {
        margin-top: 9px;
    }

    #modal-shield .modal-header {
        min-height: 56px;
        padding: 10px 20px 12px;
        background: #fff;
    }

    #modal-shield .btn-close-modal {
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
    }

    #modal-shield .help-tabs { margin: 0 20px; }
    #modal-shield .help-tab { font-size: 13px; }
    #modal-shield .help-body { padding: 26px 20px 20px; }
    #modal-shield .install-check {
        padding: 12px 20px max(18px, env(safe-area-inset-bottom));
    }
}

.lightbox__img-wrap {
    overflow: unset !important;
}

.modal-title {
    font-weight: 700;
}

/* =============================================================================
   Language Switcher — liquid glass variant (footer)
   ============================================================================= */

.footer-inner .btn-footer {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;

    background: transparent;
    border: none;
    color: rgb(var(--app-accent-rgb));

    box-shadow: none;
    transition: background .15s ease, transform .15s ease;
}

.footer-inner .btn-footer .bi {
    font-size: 18px;
}

.lang-switcher .dropdown-toggle .chevron {
    display: none;
    /* redundant on a circular icon-only button */
}

.footer-inner .btn-footer:hover,
.footer-inner .btn-footer:focus {
    background: rgba(25, 135, 84, .08);
    border-color: transparent;
    outline: none;
    box-shadow: none;
}

.footer-inner .btn-footer:active {
    transform: scale(.93);
    background: rgba(25, 135, 84, .14);
}

.lang-switcher .dropdown-toggle::after {
    display: none;
}

/* Dropdown panel stays crisp/opaque so menu text stays readable over content below */
.lang-switcher .dropdown-menu {
    min-width: 168px;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 18px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, .12);
    padding: 4px;
    margin-top: 4px !important;
    background: #fff;
}

.lang-switcher .dropdown-item {
    font-size: 14px;
    padding: 9px 12px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #1a1a1a;
    transition: background .12s;
}

.lang-switcher .dropdown-item:hover,
.lang-switcher .dropdown-item:focus {
    background: #f1f9f1;
    color: #198754;
}

.lang-switcher .dropdown-item.active {
    background: #e3f4ea;
    color: #198754;
    font-weight: 500;
}

#footer .lang-switcher .dropup {
    width: 100%;
    height: 100%;
}

#footer .lang-switcher .btn-footer {
    width: 100%;
    height: 100%;
}

.lang-switcher .dropdown-item.is-switching {
    opacity: .72;
    pointer-events: none;
}

body.is-offline .lang-switcher {
    display: none !important;
}

/* Keep the menu itself neutral; the selected season colors its controls. */
.sidebar {
    --sidebar-green: rgb(var(--app-accent-rgb, 24, 126, 88));
    background-color: #f7f8fa;
    background-image: none;
}

.sidebar-banner { background-color: #26312b; }

.sidebar-actions,
.sidebar-card {
    background: #fff;
    box-shadow: 0 6px 22px rgba(29, 41, 51, .045);
}
.sidebar-card { border: 0; }
.sidebar-action { color: var(--sidebar-green); }
.sidebar-action + .sidebar-action::before { background: rgba(var(--app-shadow-rgb), .14); }
.sidebar-action:active,
.menu-item:active { background: rgba(var(--app-accent-rgb, 24, 126, 88), .1); }
.sidebar-action:focus-visible,
.menu-item:focus-visible { outline-color: rgba(var(--app-accent-rgb, 24, 126, 88), .36); }
.menu-item > i:first-child { color: var(--sidebar-green); }

.qr-sheet {
    background: rgba(255, 255, 255, .97);
    border: 1px solid rgba(34, 58, 63, .13);
    box-shadow: 0 24px 64px rgba(15, 23, 22, .25);
}
.qr-close,
.qr-switch { background: #f2f4f3; }
.qr-sheet-header strong { color: #222b2f; }
.qr-switch__btn.is-active { color: #222b2f; background: #fff; }
.qr-switch__btn:focus-visible { outline-color: rgba(var(--app-qr-rgb), .42); }
.qr-code-frame { background: #fff; }
.qr-close i,
.qr-switch__btn.is-active i,
.qr-primary-action.is-copied { color: #222b2f; }

@media (hover: hover) {
    .sidebar-action:hover,
    .menu-item:hover { background: rgba(var(--app-accent-rgb, 24, 126, 88), .07); }
    .sidebar-action:hover,
    .sidebar-action:hover span { color: var(--sidebar-green); }
    .menu-item:hover { box-shadow: inset 0 0 0 1px rgba(var(--app-accent-rgb, 24, 126, 88), .07); }
}

.btn-boxed {
    display: inline-block;
    border: 1px solid #ccc;
    background: #fff;
    color: #000;
    padding: 8px 16px;
    border-radius: 8px;
}
/* In-app web and support sheet */
:root {
    --mini-surface: rgba(255, 255, 255, .97);
    --mini-text: #222b2f;
    --mini-muted: #65737a;
    --mini-line: rgba(34, 58, 63, .13);
    --mini-control: rgba(43, 77, 80, .07);
    --mini-backdrop: rgba(8, 20, 18, .48);
    --mini-action: #25383c;
    --mini-action-text: #fff;
}

:root[data-color-mode="night"] {
    --mini-surface: rgba(27, 42, 48, .97);
    --mini-text: #eaf1f0;
    --mini-muted: #adbec1;
    --mini-line: rgba(211, 234, 233, .16);
    --mini-control: rgba(220, 238, 239, .08);
    --mini-backdrop: rgba(3, 12, 14, .64);
    --mini-action: #dce8e6;
    --mini-action-text: #1b2a30;
}

body.is-mini-app-open { overflow: hidden !important; }
body.is-mini-app-minimized #footer {
    bottom: calc(46px + env(safe-area-inset-bottom));
    padding-bottom: 10px;
}
body.is-mini-app-minimized .app-toast-container { padding-bottom: calc(150px + env(safe-area-inset-bottom)) !important; }
body.is-mini-app-minimized .posts { padding-bottom: calc(126px + env(safe-area-inset-bottom)); }
body.is-mini-app-minimized #main-app > .pt-4 { padding-bottom: calc(190px + env(safe-area-inset-bottom)); }
.mini-app-layer[hidden], .mini-app-content > [hidden], .mini-app-recovery[hidden] { display: none !important; }
.mini-app-layer { position: fixed; inset: 0; z-index: 12000; color: var(--mini-text); pointer-events: none; --mini-collapsed-height: calc(46px + env(safe-area-inset-bottom)); }
.mini-app-backdrop {
    position: absolute;
    inset: 0;
    background: var(--mini-backdrop);
    opacity: 0;
    transition: opacity .28s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    pointer-events: auto;
}
.mini-app-layer.is-visible .mini-app-backdrop { opacity: 1; }
.mini-app-layer.is-minimized .mini-app-backdrop { opacity: 0; pointer-events: none; }
.mini-app-panel {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: min(760px, 100%);
    height: min(78dvh, 790px);
    max-height: calc(100dvh - env(safe-area-inset-top) - 32px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--mini-line);
    border-radius: 20px 20px 0 0;
    background: var(--mini-surface);
    box-shadow: 0 22px 70px rgba(0, 0, 0, .23);
    backdrop-filter: blur(22px) saturate(1.08);
    -webkit-backdrop-filter: blur(22px) saturate(1.08);
    transform: translate3d(-50%, calc(100% + 44px), 0);
    transition: transform .36s cubic-bezier(.22, 1, .36, 1), height .42s cubic-bezier(.22, 1, .36, 1), width .42s cubic-bezier(.22, 1, .36, 1), border-radius .42s cubic-bezier(.22, 1, .36, 1);
    outline: 0;
    pointer-events: auto;
}
.mini-app-layer.is-visible .mini-app-panel { transform: translate3d(-50%, 0, 0); }
.mini-app-layer.is-minimized .mini-app-panel { width: min(680px, 100%); height: var(--mini-collapsed-height); max-height: none; border-color: transparent; border-radius: 22px 22px 0 0; box-shadow: 0 -6px 24px rgba(0, 0, 0, .12); animation: mini-tab-settle .42s ease-out both; }
.mini-app-layer.is-dragging .mini-app-panel { transition: width .2s ease, border-radius .2s ease; max-height: none; animation: none; }
.mini-app-layer.is-expanded .mini-app-panel { height: 100dvh; max-height: none; bottom: 0; border-radius: 0; padding-top: env(safe-area-inset-top); }
@keyframes mini-tab-settle { 0%, 78%, 100% { transform: translate3d(-50%, 0, 0); } 88% { transform: translate3d(-50%, 2px, 0); } }
.mini-app-grip, .mini-app-header, .mini-app-content { transition: opacity .16s ease; }
.mini-app-layer.is-compact .mini-app-grip, .mini-app-layer.is-compact .mini-app-header, .mini-app-layer.is-compact .mini-app-content { opacity: 0; pointer-events: none; }
.mini-app-grip {
    flex: 0 0 auto;
    align-self: center;
    width: 38px;
    height: 4px;
    margin: 11px 0 3px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: var(--mini-line);
    touch-action: none;
    cursor: grab;
}
.mini-app-header {
    flex: 0 0 auto;
    min-height: 64px;
    padding: 9px 16px 12px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid var(--mini-line);
    touch-action: none;
}
.mini-app-heading { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.mini-app-heading h2 { margin: 0; color: var(--mini-text); font-size: 18px; line-height: 1.3; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-app-controls { flex: 0 0 auto; display: flex; align-items: center; gap: 2px; }
.mini-app-controls button, .mini-app-collapsed > button[data-mini-close] {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: var(--mini-text);
    background: transparent;
    font-size: 17px;
}
.mini-app-controls button:hover, .mini-app-collapsed > button[data-mini-close]:hover { background: var(--mini-control); }
.mini-app-controls button[hidden] { display: none; }
.mini-app-content { flex: 1 1 auto; min-height: 0; overflow: hidden; }
.mini-app-web { position: relative; height: 100%; background: var(--mini-surface); }
.mini-app-web iframe { width: 100%; height: 100%; display: block; border: 0; background: #fff; }
.mini-app-loading { position: absolute; z-index: 1; inset: 0; display: flex; flex-direction: column; gap: 15px; padding: 22px 24px; background: var(--mini-surface); }
.mini-app-loading[hidden] { display: none; }
.mini-app-loading__top { display: flex; justify-content: space-between; align-items: center; }
.mini-app-loading__top span:first-child { width: 120px; height: 16px; }
.mini-app-loading__top span:last-child { width: 28px; height: 28px; }
.mini-app-loading__image { width: 100%; height: min(38vh, 260px); margin-top: 6px; }
.mini-app-loading__line { width: 84%; height: 14px; }
.mini-app-loading__line.is-short { width: 58%; }
.mini-app-loading__top span, .mini-app-loading__image, .mini-app-loading__line { border-radius: 5px; background: var(--mini-control); animation: mini-pulse 1.65s ease-in-out infinite alternate; }
.mini-app-loading__image { animation-delay: .12s; }
.mini-app-loading__line { animation-delay: .22s; }
.mini-app-loading p { margin: 9px 0 0; color: var(--mini-muted); text-align: center; font-size: 13px; }
@keyframes mini-pulse { from { opacity: .56; } to { opacity: 1; } }
.mini-app-recovery { margin: 12px auto; }
.mini-app-recovery button { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 12px; border: 1px solid var(--mini-line); border-radius: 7px; color: var(--mini-text); background: var(--mini-control); font: inherit; font-size: 13px; }
.mini-app-support { height: 100%; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.mini-app-region { position: sticky; top: 0; z-index: 2; display: flex; gap: 20px; padding: 0 24px; background: var(--mini-surface); }
.mini-app-region button { min-height: 49px; padding: 0 2px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--mini-muted); font: inherit; font-size: 14px; font-weight: 600; }
.mini-app-region button[aria-pressed="true"] { color: var(--mini-text); border-bottom-color: currentColor; }
.mini-app-support-list { padding: 12px 24px 28px; }
.mini-app-category { width: 100%; display: grid; grid-template-columns: 26px minmax(0, 1fr) 18px; align-items: center; gap: 14px; min-height: 78px; padding: 14px 2px; border: 0; border-bottom: 1px solid var(--mini-line); color: var(--mini-text); background: transparent; font: inherit; text-align: left; }
@media (hover: hover) and (pointer: fine) {
    .mini-app-category:hover > i:last-child { transform: translateX(3px); }
}
.mini-app-category:focus { background: transparent; }
.mini-app-category > i:first-child { font-size: 20px; }
.mini-app-category > i:last-child { color: var(--mini-muted); font-size: 14px; transition: transform .16s ease; }
.mini-app-category__copy { display: block; min-width: 0; }
.mini-app-category__copy strong { display: block; font-size: 15px; line-height: 1.35; }
.mini-app-category__copy small { display: -webkit-box; margin-top: 3px; color: var(--mini-muted); font-size: 12px; line-height: 1.4; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-app-detail__back { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 6px 0; border: 0; color: var(--mini-muted); background: transparent; font: inherit; font-size: 13px; }
.mini-app-detail__title { margin: 18px 0 7px; color: var(--mini-text); font-size: 22px; line-height: 1.25; }
.mini-app-detail__description { margin: 0 0 22px; color: var(--mini-muted); font-size: 14px; line-height: 1.55; }
.mini-app-method { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 18px 0; }
.mini-app-method + .mini-app-method { border-top: 1px solid var(--mini-line); }
.mini-app-method-details { flex: 1 1 100%; min-width: 0; }
.mini-app-method-details strong { display: block; margin-bottom: 3px; color: var(--mini-text); font-size: 14px; line-height: 1.35; }
.mini-app-method-details p { margin: 0; color: var(--mini-muted); font-size: 12px; line-height: 1.4; }
.mini-app-wallet { flex: 1 1 100%; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 112px; align-items: center; gap: 10px; padding: 9px 10px 9px 12px; border: 1px solid var(--mini-line); border-radius: 8px; background: var(--mini-control); }
.mini-app-wallet code { flex: 1 1 auto; min-width: 0; color: var(--mini-text); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; user-select: all; }
.mini-app-wallet button { width: 112px; min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 6px; border: 0; border-radius: 6px; color: var(--mini-text); background: transparent; font: inherit; font-size: 11px; font-weight: 650; white-space: nowrap; }
.mini-app-wallet button i { font-size: 15px; }
.mini-app-wallet button:hover { background: var(--mini-line); }
.mini-app-method-action { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 11px 18px; border: 1px solid var(--mini-action); border-radius: 8px; color: var(--mini-action-text); background: var(--mini-action); font: inherit; font-size: 15px; font-weight: 700; transition: filter .18s ease, transform .18s ease; }
.mini-app-method-action i { font-size: 18px; }
.mini-app-method-action:hover { filter: brightness(1.08); }
.mini-app-method-action:active { transform: scale(.99); }
.mini-app-support-status { padding: 28px 0; color: var(--mini-muted); font-size: 14px; }
.mini-app-collapsed { position: absolute; inset: 0; z-index: 2; display: grid; grid-template-columns: 42px minmax(0, 1fr) 42px; align-items: start; padding: 2px 8px env(safe-area-inset-bottom); color: var(--mini-text); background: var(--mini-surface); opacity: 0; visibility: hidden; pointer-events: none; touch-action: none; transition: opacity .16s ease, visibility 0s linear .16s; }
.mini-app-layer.is-compact .mini-app-collapsed { opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s; }
.mini-app-collapsed > button[data-mini-restore] { grid-column: 2; grid-row: 1; min-width: 0; display: flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 2px; border: 0; color: var(--mini-text); background: transparent; font: inherit; }
.mini-app-collapsed > button[data-mini-restore] span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 700; }
.mini-app-collapsed > button[data-mini-restore] i { display: none; }
.mini-app-collapsed > button[data-mini-close] { grid-column: 1; grid-row: 1; width: 42px; height: 42px; }
.mini-app-layer button, .mini-app-collapsed button, .telegram-confirm button { -webkit-tap-highlight-color: transparent; }
.mini-app-layer button:focus-visible, .mini-app-collapsed button:focus-visible { outline: 2px solid rgb(var(--app-accent-rgb)); outline-offset: 2px; }
.telegram-confirm { position: fixed; z-index: 13000; width: min(360px, calc(100% - 32px)); max-width: none; margin: auto; padding: 24px; border: 1px solid var(--mini-line); border-radius: 12px; color: var(--mini-text); background: var(--mini-surface); box-shadow: 0 22px 70px rgba(0, 0, 0, .25); text-align: center; }
.telegram-confirm::backdrop { background: var(--mini-backdrop); backdrop-filter: blur(4px); }
.telegram-confirm > i { display: block; margin-bottom: 12px; color: var(--mini-text); font-size: 27px; }
.telegram-confirm h2 { margin: 0 0 8px; font-size: 18px; }
.telegram-confirm h2:focus { outline: none; }
.telegram-confirm p { margin: 0 0 20px; color: var(--mini-muted); font-size: 14px; line-height: 1.5; }
.telegram-confirm__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.telegram-confirm__actions button { min-height: 42px; border: 1px solid var(--mini-line); border-radius: 7px; color: var(--mini-text); background: transparent; font: inherit; font-size: 13px; font-weight: 650; }
.telegram-confirm__actions button:last-child { background: var(--mini-control); }
.telegram-confirm__actions button:focus-visible { outline: 2px solid rgb(var(--app-accent-rgb)); outline-offset: 2px; }

@media (max-width: 600px) {
    .mini-app-panel { width: 100%; bottom: 0; height: min(76dvh, 760px); max-height: calc(100dvh - env(safe-area-inset-top) - 20px); border-radius: 20px 20px 0 0; border-bottom: 0; }
    .mini-app-layer.is-minimized .mini-app-panel { width: 100%; }
    .mini-app-layer.is-expanded .mini-app-panel { width: 100%; height: 100dvh; bottom: 0; border-radius: 0; padding-top: env(safe-area-inset-top); }
    .mini-app-header { padding: 8px 8px 10px 16px; }
    .mini-app-controls button { width: 35px; height: 35px; font-size: 16px; }
    .mini-app-heading h2 { font-size: 16px; }
    .mini-app-region { padding: 0 18px; }
    .mini-app-support-list { padding: 5px 18px calc(25px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
    .mini-app-panel, .mini-app-backdrop, .mini-app-grip, .mini-app-header, .mini-app-content, .mini-app-collapsed, #footer { transition-duration: .01ms; }
    .mini-app-layer.is-minimized .mini-app-panel { animation: none; }
    .mini-app-loading__top span, .mini-app-loading__image, .mini-app-loading__line { animation: none; }
}

/* Editorial quotes share the site's reading style. */
.editor-content blockquote {
    position: relative;
    margin: 1.5rem 0;
    padding: 1.1rem 3.2rem 1.1rem 1.3rem;
    border: 1px solid #d4e3e9;
    border-left: 3px solid #287b96;
    border-radius: 6px;
    background: #f2f7f9;
    color: #243942;
    font-style: normal;
    line-height: 1.65;
    box-shadow: none;
    overflow-wrap: anywhere;
}

.editor-content blockquote::after {
    position: absolute;
    top: 0.45rem;
    right: 0.9rem;
    color: #287b96;
    content: "\201C";
    font: 700 32px/1 Georgia, serif;
    pointer-events: none;
}

.editor-content blockquote p { margin-bottom: 0.7em; }
.editor-content blockquote p:last-child { margin-bottom: 0; }
.editor-content blockquote footer { margin-top: 0.75rem; color: #536b75; }

@media (max-width: 640px) {
    .editor-content blockquote { margin: 1.25rem 0; padding: 0.9rem 2.7rem 0.9rem 1rem; }
}
