/* VOROPAEVO.online — neo-brutalist */

:root {
    --ink: #111111;
    --paper: #faf8ff;
    --card: #ffffff;
    --lime: #d9f99d;
    --pink: #fda4af;
    --sky: #7dd3fc;
    --violet: #c4b5fd;
    --ok: #22c55e;
    --err: #ef4444;
    --font: 'Space Grotesk', system-ui, sans-serif;
    --border: 2.5px solid var(--ink);
    --shadow: 5px 5px 0 var(--ink);
    --shadow-sm: 3px 3px 0 var(--ink);
    --radius: 14px;
    /* icon colors */
    --ico-news: #0284c7;
    --ico-news-bg: #bae6fd;
    --ico-home: #65a30d;
    --ico-home-bg: #d9f99d;
    --ico-messages: #7c3aed;
    --ico-messages-bg: #ddd6fe;
    --ico-groups: #0f766e;
    --ico-groups-bg: #ccfbf1;
    --ico-friends: #db2777;
    --ico-friends-bg: #fbcfe8;
    --ico-notifications: #d97706;
    --ico-notifications-bg: #fde68a;
    --ico-search: #2563eb;
    --ico-search-bg: #bfdbfe;
    --ico-useful: #0f766e;
    --ico-useful-bg: #99f6e4;
    --ico-profile: #9333ea;
    --ico-profile-bg: #e9d5ff;
    --ico-info: #0891b2;
    --ico-info-bg: #a5f3fc;
    --ico-admin: #475569;
    --ico-admin-bg: #e2e8f0;
    --ico-logout: #dc2626;
    --ico-logout-bg: #fecaca;
    --ico-like: #16a34a;
    --ico-like-bg: #bbf7d0;
    --ico-dislike: #dc2626;
    --ico-dislike-bg: #fecaca;
    --ico-neutral: #ca8a04;
    --ico-neutral-bg: #fef08a;
    --ico-inbox: #0ea5e9;
    --ico-inbox-bg: #e0f2fe;
    --ico-comment: #7c3aed;
    --ico-comment-bg: #ede9fe;
    --ico-edit: #2563eb;
    --ico-edit-bg: #dbeafe;
    --ico-trash: #dc2626;
    --ico-trash-bg: #fee2e2;
    --ico-menu: #111111;
    --ico-share: #2563eb;
    --ico-send: #2563eb;
    --ico-arrow-up: #65a30d;
    --ico-more-vertical: #64748b;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink);
    background-color: var(--paper);
    background-image:
        radial-gradient(circle at 0% 0%, rgba(196, 181, 253, 0.45) 0%, transparent 45%),
        radial-gradient(circle at 100% 20%, rgba(125, 211, 252, 0.4) 0%, transparent 40%),
        radial-gradient(circle at 80% 100%, rgba(253, 164, 175, 0.35) 0%, transparent 40%),
        repeating-linear-gradient(
            -12deg,
            transparent,
            transparent 28px,
            rgba(17, 17, 17, 0.025) 28px,
            rgba(17, 17, 17, 0.025) 29px
        );
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--pink); }

.container { width: min(620px, 100% - 1.25rem); margin-inline: auto; }

/* —— Header —— */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--ink);
    color: #fff;
    border-bottom: var(--border);
    box-shadow: var(--shadow);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 56px;
}

.is-guest .header-inner { justify-content: center; }

.logo {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.03em;
    color: #fff;
    text-decoration: none;
    flex-shrink: 0;
}

.logo:hover { color: var(--lime); text-decoration: none; }

.logo em {
    font-style: normal;
    display: inline-block;
    background: var(--lime);
    color: var(--ink);
    padding: 0.05em 0.2em;
    border-radius: 6px;
    border: 2px solid var(--ink);
    box-shadow: 2px 2px 0 var(--ink);
    transform: rotate(-4deg);
}

.logo span { color: var(--sky); font-weight: 500; }

.main-nav {
    display: flex;
    gap: 0.35rem;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
}

.main-nav::-webkit-scrollbar { display: none; }

.main-nav a {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: 999px;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.main-nav a:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
    transform: translateY(-1px);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.25rem;
    margin-left: 0.15rem;
    background: var(--pink);
    color: var(--ink);
    font-size: 0.65rem;
    font-weight: 800;
    border: 2px solid var(--ink);
    border-radius: 999px;
    vertical-align: middle;
    text-decoration: none;
}

.logout-form { margin-left: auto; }

/* —— Layout —— */
.main-content { padding: 1.35rem 0 2rem; flex: 1; }
.flash-wrap { padding-top: 0.65rem; }

.is-guest .main-content {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0 3rem;
}

.is-guest .main-content:has(.landing) {
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: 1.5rem;
}

.landing {
    width: min(920px, 100% - 1.25rem);
    margin-inline: auto;
}

.landing-hero { text-align: center; padding: 2rem 1.5rem; }

.landing-kicker {
    margin: 0 0 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.65;
}

.landing-title {
    margin: 0 0 0.35rem;
    font-size: clamp(1.6rem, 5vw, 2.35rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    word-break: break-word;
}

.landing-brand {
    margin: 0 0 0.85rem;
    font-size: clamp(1rem, 3vw, 1.35rem);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.landing-brand em {
    font-style: normal;
    background: var(--lime);
    padding: 0 0.15em;
    border: var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.landing-brand span { color: var(--sky); font-weight: 600; }

.landing-lead {
    margin: 0 auto 1.25rem;
    max-width: 42ch;
    font-size: 0.95rem;
    line-height: 1.45;
    opacity: 0.85;
}

.landing-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    margin-top: 1rem;
}

.landing-links a {
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.guest-top-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 0.9rem;
    align-items: center;
    justify-content: flex-end;
    font-size: 0.82rem;
    font-weight: 600;
}

.guest-top-nav a {
    color: inherit;
    text-decoration: none;
    opacity: 0.8;
}

.guest-top-nav a:hover { opacity: 1; text-decoration: underline; }

.header-inner--guest {
    justify-content: space-between;
    gap: 1rem;
    min-height: 52px;
    width: min(920px, 100% - 1.25rem);
    margin-inline: auto;
}

@media (max-width: 640px) {
    .header-inner--guest {
        flex-direction: column;
        justify-content: center;
        padding-block: 0.55rem;
    }

    .guest-top-nav {
        justify-content: center;
        font-size: 0.78rem;
    }

    .footer-line {
        white-space: normal;
        text-align: center;
    }
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem 0.9rem;
    margin-top: 0.35rem;
    font-size: 0.7rem;
    font-weight: 600;
}

.footer-nav a {
    color: #aaa;
    text-decoration: none;
}

.footer-nav a:hover { color: #fff; text-decoration: underline; }

.site-footer a { color: #bbb; }

.landing-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.landing-stat { display: flex; flex-direction: column; align-items: center; }

.landing-stat-num {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.landing-stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.landing-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    width: 100%;
    max-width: 380px;
    margin-inline: auto;
}

.landing-actions .btn {
    width: 100%;
    min-width: 0;
    padding: 0.7rem 0.65rem;
    font-size: 0.88rem;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    white-space: normal;
    hyphens: auto;
}

.btn-lg { padding: 0.7rem 1rem; font-size: 0.95rem; }

@media (max-width: 400px) {
    .landing-actions { grid-template-columns: 1fr; max-width: 260px; }
    .landing-hero { padding: 1.5rem 1rem; }
}

.landing-features {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.landing-feature { text-align: center; padding: 1.25rem 1rem; }

.landing-feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    margin: 0 auto 0.65rem;
    border: var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.landing-feature-icon:has(.icon--home) { background: var(--ico-home-bg); border-color: var(--ico-home); }
.landing-feature-icon:has(.icon--friends) { background: var(--ico-friends-bg); border-color: var(--ico-friends); }
.landing-feature-icon:has(.icon--messages) { background: var(--ico-messages-bg); border-color: var(--ico-messages); }
.landing-feature-icon:has(.icon--like) { background: var(--ico-like-bg); border-color: var(--ico-like); }

.landing-feature h2 {
    margin: 0 0 0.35rem;
    font-size: 1rem;
}

.landing-feature p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.75;
    line-height: 1.45;
}

.online-pulse::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--ok);
    border: 2px solid var(--ink);
    border-radius: 50%;
    margin-right: 0.35rem;
    vertical-align: middle;
    animation: blink 1.5s step-end infinite;
}

/* —— Footer (одна строка) —— */
.site-footer {
    padding: 0.45rem 0;
    background: var(--ink);
    color: #888;
    border-top: var(--border);
}

.footer-line {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 500;
    white-space: nowrap;
}

.footer-dot { color: #444; }

.online-indicator {
    color: var(--lime);
    font-weight: 700;
    text-decoration: none;
}

.online-indicator:hover { text-decoration: underline; }

.online-indicator::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--lime);
    border: 1.5px solid var(--ink);
    border-radius: 50%;
    margin-right: 0.25rem;
    vertical-align: middle;
    animation: blink 1.5s step-end infinite;
}

.footer-weather {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: rgba(255, 255, 255, 0.72);
}

.footer-weather::before {
    content: '';
    width: 0.65rem;
    height: 0.65rem;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    background: var(--sky);
    box-shadow: 0 0 0 2px rgba(125, 211, 252, 0.18);
}

.footer-weather-label {
    font-weight: 800;
    color: var(--sky);
}

.footer-weather-value {
    font-weight: 700;
}

.footer-weather-button {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    min-height: 1.35rem;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
    white-space: nowrap;
}

.footer-weather-button:disabled {
    cursor: wait;
    opacity: 0.8;
}

.footer-weather-button:focus-visible {
    outline: 2px solid var(--sky);
    outline-offset: 3px;
    border-radius: 999px;
}

.weather-popover[hidden] {
    display: none;
}

.weather-popover {
    position: absolute;
    z-index: 600;
    left: 50%;
    bottom: calc(100% + 0.7rem);
    display: block;
    width: min(360px, calc(100vw - 1rem));
    max-height: min(520px, 72vh);
    overflow: auto;
    transform: translateX(-50%);
    padding: 0.75rem;
    color: #111111;
    background: #ffffff;
    border: var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: left;
    white-space: normal;
}

.weather-popover::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -0.55rem;
    width: 0.85rem;
    height: 0.85rem;
    transform: translateX(-50%) rotate(45deg);
    background: #ffffff;
    border-right: 2.5px solid var(--ink);
    border-bottom: 2.5px solid var(--ink);
}

.weather-popover-head,
.weather-day-summary,
.weather-hour-card {
    display: block;
}

.weather-popover-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.45rem;
}

.weather-popover-head strong {
    font-size: 0.95rem;
    line-height: 1.15;
}

.weather-popover-head span {
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 700;
    opacity: 0.65;
}

.weather-day-summary {
    margin-bottom: 0.6rem;
    padding: 0.35rem 0.5rem;
    background: var(--lime);
    border: 2px solid var(--ink);
    border-radius: 8px;
    box-shadow: 2px 2px 0 var(--ink);
    font-weight: 800;
}

.weather-hourly {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
}

.weather-hour-card {
    min-width: 0;
    padding: 0.45rem;
    background: #f8fafc;
    border: 2px solid var(--ink);
    border-radius: 8px;
    box-shadow: 2px 2px 0 var(--ink);
}

.weather-hour-time,
.weather-hour-desc,
.weather-hour-meta {
    display: block;
}

.weather-hour-time {
    font-size: 0.68rem;
    font-weight: 800;
    opacity: 0.7;
}

.weather-hour-card strong {
    display: block;
    margin: 0.05rem 0;
    font-size: 1.05rem;
    line-height: 1;
}

.weather-hour-desc {
    overflow: hidden;
    font-size: 0.72rem;
    font-weight: 800;
    text-overflow: ellipsis;
}

.weather-hour-meta {
    margin-top: 0.18rem;
    font-size: 0.66rem;
    font-weight: 700;
    opacity: 0.72;
}

@keyframes blink {
    50% { opacity: 0.4; }
}

/* —— Cards —— */
.card {
    background: var(--card);
    border: var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 1.3rem;
    margin-bottom: 0.85rem;
    box-shadow: var(--shadow);
    transition: transform 0.15s, box-shadow 0.15s;
}

.card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0 var(--ink);
}

.page-title {
    margin: 0 0 1rem;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    text-transform: uppercase;
}

.page-hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1rem;
    padding: 1rem 1.1rem;
    border: var(--border);
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(217, 249, 157, 0.42)),
        var(--card);
    box-shadow: var(--shadow);
}

.page-hero .page-title {
    margin: 0;
    line-height: 1;
}

.page-hero p {
    margin: 0.3rem 0 0;
    max-width: 38rem;
    font-weight: 650;
}

.page-hero-kicker {
    color: rgba(17, 17, 17, 0.58);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.page-hero-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.1rem;
    height: 3.1rem;
    border: var(--border);
    border-radius: 14px;
    background: var(--lime);
    box-shadow: var(--shadow-sm);
}

.page-hero-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.4rem;
    padding: 0.32rem 0.7rem;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--card);
    box-shadow: var(--shadow-sm);
    font-size: 0.85rem;
    font-weight: 900;
}

.page-hero--news .page-hero-icon { background: var(--ico-news-bg); color: var(--ico-news); }
.page-hero--feed .page-hero-icon { background: var(--ico-home-bg); color: var(--ico-home); }
.page-hero--messages .page-hero-icon { background: var(--ico-messages-bg); color: var(--ico-messages); }
.page-hero--groups .page-hero-icon { background: var(--ico-groups-bg); color: var(--ico-groups); }
.page-hero--friends .page-hero-icon { background: var(--ico-friends-bg); color: var(--ico-friends); }
.page-hero--notifications .page-hero-icon { background: var(--ico-notifications-bg); color: var(--ico-notifications); }
.page-hero--search .page-hero-icon { background: var(--ico-search-bg); color: var(--ico-search); }
.page-hero--useful .page-hero-icon { background: var(--ico-useful-bg); color: var(--ico-useful); }
.page-hero--info .page-hero-icon { background: var(--ico-info-bg); color: var(--ico-info); }
.page-hero--online .page-hero-icon { background: var(--ico-friends-bg); color: var(--ico-friends); }

.page-section-card h2,
.info-block h2 {
    display: inline-flex;
    align-items: center;
    margin-top: 0;
    padding: 0.2rem 0.55rem;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--lime);
    box-shadow: 2px 2px 0 var(--ink);
    font-size: 1rem;
}

.page-card-accent {
    border-left: 7px solid var(--sky);
}

.page-empty {
    margin-top: 0;
}

.search-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 0.75rem;
    border-left: 7px solid var(--sky);
}

.search-panel label {
    margin: 0;
}

.page-list-card {
    border-left: 7px solid var(--lime);
}

.section-title {
    margin: 1.75rem 0 0.6rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.profile-wall {
    margin-top: 1.8rem;
    padding-top: 1rem;
    border-top: 2px dashed rgba(17, 17, 17, 0.18);
}

.profile-wall-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.85rem 1rem;
    border: var(--border);
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(217, 249, 157, 0.95), rgba(125, 211, 252, 0.28)),
        var(--card);
    box-shadow: var(--shadow);
}

.profile-wall-kicker {
    margin: 0 0 0.1rem;
    color: rgba(17, 17, 17, 0.58);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.profile-wall-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1;
}

.profile-wall-count {
    flex-shrink: 0;
    padding: 0.28rem 0.65rem;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--card);
    box-shadow: var(--shadow-sm);
    font-size: 0.78rem;
    font-weight: 900;
}

.profile-wall-list .post-card:last-child {
    margin-bottom: 0;
}

.profile-friends-back {
    margin: -0.35rem 0 0.75rem;
}

.profile-friend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.profile-friend-card {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 5rem;
    padding: 0.8rem;
    border: var(--border);
    border-radius: 14px;
    background: var(--card);
    box-shadow: var(--shadow);
    color: var(--ink);
    text-decoration: none;
}

.profile-friend-card:hover {
    transform: translate(-2px, -2px);
    text-decoration: none;
}

.profile-friend-card span {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.profile-friend-card strong,
.profile-friend-card small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-friend-card small {
    color: rgba(17, 17, 17, 0.62);
    font-weight: 700;
}

/* —— Buttons —— */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.1s, box-shadow 0.1s;
}

.btn:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

.btn-primary {
    background: var(--lime);
    color: var(--ink);
}

.btn-primary:hover {
    background: #bef264;
    color: var(--ink);
}

.btn-secondary {
    background: var(--violet);
    color: var(--ink);
}

.btn-secondary:hover { background: #a78bfa; color: var(--ink); }

.btn-ghost {
    background: var(--paper);
    color: var(--ink);
}

.btn-outline {
    background: transparent;
    color: #fff;
    border-color: #fff;
    box-shadow: none;
}

.btn-outline:hover {
    background: #fff;
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}

.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.78rem; }
.btn-block { width: 100%; }

/* —— Forms —— */
label {
    display: block;
    margin-bottom: 0.85rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="search"],
input[type="file"],
textarea {
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.6rem 0.8rem;
    border: var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    background: #fff;
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}

input:focus,
textarea:focus {
    outline: none;
    background: #fffef5;
    box-shadow: 4px 4px 0 var(--sky);
}

textarea { resize: vertical; min-height: 80px; }
.composer textarea { margin-bottom: 0; resize: vertical; min-height: 4rem; max-height: 16rem; }

.composer-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 2px dashed rgba(17, 17, 17, 0.15);
}

.composer-hint {
    flex: 1;
    min-width: 140px;
    font-size: 0.72rem;
    font-weight: 500;
    opacity: 0.55;
}

.composer-count {
    font-size: 0.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.composer-count.is-warn { color: var(--err); }

.composer-bar .btn-primary { margin-left: auto; }

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
    margin: 0.5rem 0 0.75rem;
    border: var(--border);
    border-radius: 12px;
    background: var(--paper);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: transform 0.12s, background 0.12s;
}

.sidebar-user:hover {
    transform: translate(-2px, -2px);
    background: var(--lime);
    text-decoration: none;
}

.sidebar-user-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

.sidebar-user-text strong {
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-text small {
    font-size: 0.72rem;
    opacity: 0.6;
}

.bottom-nav { position: relative; }

.bottom-badge {
    position: absolute;
    top: 2px;
    right: calc(50% - 18px);
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.2rem;
    font-size: 0.6rem;
    font-weight: 800;
    line-height: 1rem;
    text-align: center;
    background: var(--pink);
    color: var(--ink);
    border: 2px solid var(--ink);
    border-radius: 999px;
}

/* —— Colorful SVG icons —— */
.icon {
    display: block;
    flex-shrink: 0;
}

.icon--news { color: var(--ico-news); }
.icon--home { color: var(--ico-home); }
.icon--messages { color: var(--ico-messages); }
.icon--groups { color: var(--ico-groups); }
.icon--friends { color: var(--ico-friends); }
.icon--notifications { color: var(--ico-notifications); }
.icon--search { color: var(--ico-search); }
.icon--useful { color: var(--ico-useful); }
.icon--profile { color: var(--ico-profile); }
.icon--info { color: var(--ico-info); }
.icon--admin { color: var(--ico-admin); }
.icon--logout { color: var(--ico-logout); }
.icon--like { color: var(--ico-like); }
.icon--dislike { color: var(--ico-dislike); }
.icon--neutral { color: var(--ico-neutral); }
.icon--inbox { color: var(--ico-inbox); }
.icon--comment { color: var(--ico-comment); }
.icon--edit { color: var(--ico-edit); }
.icon--trash { color: var(--ico-trash); }
.icon--menu { color: var(--ico-menu); }
.icon--share { color: var(--ico-share); }
.icon--send { color: var(--ico-send); }
.icon--arrow-up { color: var(--ico-arrow-up); }
.icon--more-vertical { color: var(--ico-more-vertical); }

.icon--nav {
    width: 1.35rem;
    height: 1.35rem;
}

.icon--empty {
    width: 3rem;
    height: 3rem;
}

.icon--reaction {
    width: 1.1rem;
    height: 1.1rem;
}

.reaction-glyph {
    display: block;
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.icon--inline {
    display: inline-block;
    vertical-align: -0.2em;
    margin: 0 0.1rem;
}

.sidebar-icon .icon {
    width: 1.15rem;
    height: 1.15rem;
}

.sidebar-icon:has(.icon--news) { background: var(--ico-news-bg); border-color: var(--ico-news); }
.sidebar-icon:has(.icon--home) { background: var(--ico-home-bg); border-color: var(--ico-home); }
.sidebar-icon:has(.icon--messages) { background: var(--ico-messages-bg); border-color: var(--ico-messages); }
.sidebar-icon:has(.icon--groups) { background: var(--ico-groups-bg); border-color: var(--ico-groups); }
.sidebar-icon:has(.icon--poll) { background: #fef3c7; border-color: #ca8a04; }
.sidebar-icon:has(.icon--calendar) { background: #dbeafe; border-color: #2563eb; }
.sidebar-icon:has(.icon--friends) { background: var(--ico-friends-bg); border-color: var(--ico-friends); }
.sidebar-icon:has(.icon--notifications) { background: var(--ico-notifications-bg); border-color: var(--ico-notifications); }
.sidebar-icon:has(.icon--search) { background: var(--ico-search-bg); border-color: var(--ico-search); }
.sidebar-icon:has(.icon--useful) { background: var(--ico-useful-bg); border-color: var(--ico-useful); }
.sidebar-icon:has(.icon--profile) { background: var(--ico-profile-bg); border-color: var(--ico-profile); }
.sidebar-icon:has(.icon--info) { background: var(--ico-info-bg); border-color: var(--ico-info); }
.sidebar-icon:has(.icon--admin) { background: var(--ico-admin-bg); border-color: var(--ico-admin); }
.sidebar-icon:has(.icon--logout) { background: var(--ico-logout-bg); border-color: var(--ico-logout); }

.sidebar-link:hover .sidebar-icon,
.sidebar-link.is-active .sidebar-icon {
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 var(--ink);
}

.bottom-nav .icon--news { color: #38bdf8; }
.bottom-nav .icon--home { color: #a3e635; }
.bottom-nav .icon--messages { color: #c4b5fd; }
.bottom-nav .icon--useful { color: #5eead4; }
.bottom-nav .icon--info { color: #67e8f9; }
.bottom-nav .icon--profile { color: #e879f9; }

.bottom-nav a.is-active .icon--news { color: #7dd3fc; filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.65)); }
.bottom-nav a.is-active .icon--home { color: #d9f99d; filter: drop-shadow(0 0 6px rgba(163, 230, 53, 0.55)); }
.bottom-nav a.is-active .icon--messages { color: #ddd6fe; filter: drop-shadow(0 0 6px rgba(196, 181, 253, 0.55)); }
.bottom-nav a.is-active .icon--useful { color: #99f6e4; filter: drop-shadow(0 0 6px rgba(45, 212, 191, 0.55)); }
.bottom-nav a.is-active .icon--info { color: #a5f3fc; filter: drop-shadow(0 0 6px rgba(103, 232, 249, 0.55)); }
.bottom-nav a.is-active .icon--profile { color: #f0abfc; filter: drop-shadow(0 0 6px rgba(232, 121, 249, 0.55)); }

.page-hero--polls .page-hero-icon { background: #fef3c7; color: #ca8a04; }
.page-hero--events .page-hero-icon { background: #dbeafe; color: #2563eb; }

.reaction-btn--fire.active { background: #fee2b8; border-color: #f97316; }
.reaction-btn--funny.active { background: #fde68a; border-color: #eab308; }
.reaction-btn--support.active { background: #bbf7d0; border-color: #22c55e; }
.reaction-btn--wow.active { background: #dbeafe; border-color: #3b82f6; }
.reaction-btn--sad.active { background: #ddd6fe; border-color: #8b5cf6; }

.post-body,
.news-card-body,
.comment-list span,
.chat-msg {
    font-family: var(--font), "Segoe UI Emoji", "Segoe UI Symbol", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
}

.emoji-char {
    font-family: "Segoe UI Emoji", "Segoe UI Symbol", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
    font-size: 1.15em;
    line-height: 1;
    vertical-align: -0.08em;
}

.btn-icon:has(.icon--edit) { color: var(--ico-edit); }
.btn-icon:has(.icon--trash) { color: var(--ico-trash); }

.comment-count .icon--like { color: var(--ico-like); }
.comment-count .icon--comment { color: var(--ico-comment); }

.empty-icon .icon { filter: drop-shadow(2px 2px 0 rgba(17, 17, 17, 0.12)); }

.comment-count {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.82rem;
    font-weight: 600;
    opacity: 0.75;
}

.comment-count--total {
    padding: 0.24rem 0.55rem;
    border: 2px solid rgba(17, 17, 17, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.64);
    font-weight: 850;
    opacity: 1;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.45rem;
    min-width: 2rem;
}

.scroll-top {
    display: none !important;
    align-items: center;
    justify-content: center;
    position: fixed;
    right: 1rem;
    bottom: 5rem;
    z-index: 90;
    width: 2.75rem;
    height: 2.75rem;
    border: var(--border);
    border-radius: 12px;
    background: var(--lime);
    color: var(--ink);
    font-weight: 800;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: opacity 0.2s, transform 0.15s;
}

.scroll-top:not([hidden]) { display: none !important; }

.scroll-top:hover { transform: translate(-2px, -2px); }

.is-auth .scroll-top { bottom: 5.5rem; }

@media (max-width: 720px) {
    .card:hover { transform: none; box-shadow: var(--shadow); }
    .composer-hint { display: none; }
}

/* —— Alerts —— */
.alert {
    padding: 0.7rem 0.9rem;
    border: var(--border);
    border-radius: 10px;
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: var(--shadow-sm);
}

.alert-error { background: var(--pink); color: var(--ink); }
.alert-success { background: var(--lime); color: var(--ink); }
.alert-info { background: var(--sky); color: var(--ink); margin-bottom: 0.75rem; padding: 0.7rem 0.9rem; border: var(--border); border-radius: 10px; box-shadow: var(--shadow-sm); font-weight: 600; font-size: 0.875rem; }

/* —— Auth —— */
.auth-card { max-width: 400px; width: 100%; margin: 0 auto; }
.auth-card h1 { margin: 0 0 1rem; font-size: 1.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: -0.03em; }
.auth-note { margin: 0 0 1rem; color: var(--muted); font-weight: 650; }
.auth-resend-form { margin-top: 0.7rem; }
.auth-footer { text-align: center; margin-top: 1rem; font-size: 0.875rem; font-weight: 500; }
.auth-footer a { font-weight: 700; }

/* Games */
.page-hero--games .page-hero-icon {
    background: #fef3c7;
    color: #ca8a04;
}

.sidebar-icon:has(.icon--games) {
    background: #fef3c7;
    border-color: #ca8a04;
}

.games-grid {
    display: grid;
    gap: 1rem;
}

.game-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
    border-left: 8px solid #facc15;
}

.game-card-icon {
    width: 4.2rem;
    height: 4.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--ink);
    border-radius: 18px;
    background: #fef3c7;
    color: #ca8a04;
    box-shadow: 6px 6px 0 var(--ink);
}

.game-card h2,
.quiz-head h2,
.quiz-leaders h2 {
    margin: 0;
    font-size: clamp(1.35rem, 2.6vw, 1.9rem);
    line-height: 1.08;
    text-transform: uppercase;
}

.game-card p {
    margin: 0.45rem 0 0;
    color: var(--muted);
    font-weight: 650;
}

.game-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0.85rem 0 1rem;
}

.game-card-meta span,
.quiz-pill {
    display: inline-flex;
    align-items: center;
    min-height: 2.1rem;
    padding: 0.25rem 0.75rem;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: #fff;
    box-shadow: 3px 3px 0 var(--ink);
    font-weight: 850;
}

.quiz-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: start;
}

.quiz-card {
    display: grid;
    gap: 1rem;
    min-width: 0;
    overflow: hidden;
    border-left: 8px solid #facc15;
}

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

.quiz-head > div,
.quiz-options,
.quiz-result,
.quiz-timer,
.quiz-leaders {
    min-width: 0;
}

.quiz-head h2 {
    font-size: clamp(1.25rem, 1.9vw, 1.75rem);
    overflow-wrap: anywhere;
}

.quiz-pill {
    flex: 0 0 auto;
}

.quiz-options {
    display: grid;
    gap: 0.65rem;
}

.quiz-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.7rem;
    align-items: center;
    min-height: 3.2rem;
    padding: 0.7rem 0.85rem;
    border: 3px solid var(--ink);
    border-radius: var(--radius-sm);
    background: #fff;
    box-shadow: 4px 4px 0 var(--ink);
    font-weight: 850;
    cursor: pointer;
}

.quiz-option span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.quiz-option input {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: #84cc16;
}

.quiz-option:has(input:checked) {
    background: #ecffb9;
}

.quiz-option.is-correct {
    border-color: #4d7c0f;
    background: #d9f99d;
}

.quiz-option.is-wrong {
    border-color: #dc2626;
    background: #fee2e2;
}

.quiz-result {
    padding: 0.8rem 1rem;
    border: 3px solid var(--ink);
    border-radius: var(--radius-sm);
    box-shadow: 4px 4px 0 var(--ink);
    font-weight: 900;
}

.quiz-result.is-correct {
    background: #d9f99d;
}

.quiz-result.is-wrong {
    background: #fee2e2;
}

.quiz-timer {
    color: var(--muted);
    font-weight: 750;
    text-align: center;
}

.quiz-timer strong {
    color: var(--ink);
}

.quiz-lead {
    margin: 0.45rem 0 0;
    color: var(--muted);
    font-weight: 650;
}

.quiz-head-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: flex-end;
}

.quiz-pill--score {
    background: #ecfccb;
}

.quiz-progress {
    height: 0.85rem;
    border: 2.5px solid var(--ink);
    border-radius: 999px;
    background: #fff;
    overflow: hidden;
    box-shadow: 2px 2px 0 var(--ink);
}

.quiz-progress > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #facc15, #84cc16);
    border-right: 2px solid var(--ink);
}

.quiz-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.quiz-option-mark {
    width: 1.25rem;
    text-align: center;
    font-weight: 900;
}

.quiz-leaders {
    display: grid;
    gap: 0.8rem;
}

.quiz-leaders .useful-section-head {
    align-items: center;
}

.quiz-leader-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 0.55rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.quiz-leader-list li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.6rem;
    align-items: center;
    padding: 0.45rem;
    border: 2px solid var(--ink);
    border-radius: var(--radius-sm);
    background: #fff;
}

.quiz-leader-list span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 850;
}

.quiz-leader-list strong {
    min-width: 2.2rem;
    text-align: center;
    font-size: 1.2rem;
}

@media (min-width: 901px) {
    body:has(.quiz-layout) .app-main,
    body:has(.games-grid) .app-main {
        max-width: 820px;
    }
}

@media (max-width: 1180px) {
    .quiz-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .game-card,
    .quiz-head {
        grid-template-columns: 1fr;
    }

    .game-card {
        display: grid;
    }

    .quiz-head {
        display: grid;
    }
}

.form-card h1 { margin: 0 0 0.85rem; font-size: 1.35rem; text-transform: uppercase; }
.breadcrumb { margin: 0 0 0.75rem; font-size: 0.8rem; font-weight: 600; }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.form-divider { border: none; border-top: var(--border); margin: 1rem 0; }

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-weight: 600;
    text-transform: none;
    cursor: pointer;
}

.checkbox-label input { width: auto; margin-top: 0.2rem; accent-color: var(--ink); }

/* —— Avatars —— */
.avatar {
    border-radius: 50%;
    object-fit: cover;
    background: var(--violet);
    border: var(--border);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.avatar-sm { width: 34px; height: 34px; }
.avatar-md { width: 46px; height: 46px; }
.avatar-lg { width: 76px; height: 76px; }
.avatar-xl { width: 100px; height: 100px; }
.avatar-preview { margin-bottom: 0.75rem; }

/* —— Posts —— */
.post-card {
    background: var(--card);
    border: var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 1.3rem;
    margin-bottom: 0.85rem;
    box-shadow: var(--shadow);
    border-left: 6px solid var(--lime);
    transition: transform 0.15s, box-shadow 0.15s;
}

.post-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0 var(--ink);
}

.post-card:nth-child(3n+2) { border-left-color: var(--sky); }
.post-card:nth-child(3n) { border-left-color: var(--pink); }

.post-header {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    margin-bottom: 0.65rem;
}

.post-author {
    font-weight: 700;
    font-size: 0.95rem;
    display: block;
    text-decoration: none;
}

.post-author:hover { text-decoration: underline; }

.post-time { font-size: 0.75rem; font-weight: 500; opacity: 0.55; }

.post-body {
    margin-bottom: 0.65rem;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.95rem;
}

.post-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-top: 0.65rem;
    border-top: 2px dashed rgba(17, 17, 17, 0.15);
}

.post-open-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--paper);
    color: var(--ink);
    box-shadow: 2px 2px 0 var(--ink);
    font-size: 0.82rem;
    font-weight: 800;
    text-decoration: none;
}

.post-open-link:hover {
    background: var(--sky);
    text-decoration: none;
}

.btn-like {
    background: var(--paper);
    border: 2px solid var(--ink);
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ink);
    cursor: pointer;
    box-shadow: 2px 2px 0 var(--ink);
    transition: transform 0.1s, background 0.1s;
}

.btn-like:hover,
.btn-like.active {
    background: var(--pink);
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 var(--ink);
}

.comment-list { list-style: none; padding: 0; margin: 0.65rem 0 0; }

.comment-list li {
    display: flex;
    gap: 0.5rem;
    padding: 0.55rem;
    margin-bottom: 0.4rem;
    background: var(--paper);
    border: 2px solid var(--ink);
    border-radius: 10px;
    font-size: 0.85rem;
}

.comment-list strong { display: block; font-size: 0.78rem; margin-bottom: 0.1rem; }
.comment-list time { display: block; font-size: 0.7rem; opacity: 0.5; margin-top: 0.15rem; }

.post-more-comments {
    margin: 0.55rem 0 0;
    font-size: 0.84rem;
    font-weight: 800;
}

.post-more-comments a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.32rem 0.62rem;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--violet);
    color: var(--ink);
    text-decoration: none;
    box-shadow: 2px 2px 0 var(--ink);
}

.post-more-comments a:hover {
    background: var(--lime);
}

.comment-form { display: flex; gap: 0.4rem; margin-top: 0.65rem; }
.comment-form input { flex: 1; margin: 0; font-size: 0.85rem; }

.inline-form { display: inline; }

/* —— Profile —— */
.profile-hero {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.85rem 1rem;
    background: linear-gradient(135deg, var(--lime) 0%, var(--sky) 100%);
    border: var(--border);
    box-shadow: var(--shadow);
}

.profile-hero .avatar-xl {
    border-width: 3px;
    background: #fff;
}

.profile-info h1 {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.profile-info .username { margin: 0.1rem 0 0.35rem; font-weight: 600; font-size: 0.85rem; }
.profile-info .bio { margin: 0 0 0.35rem; font-size: 0.9rem; }

.profile-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

@media (min-width: 500px) {
    .profile-hero {
        grid-template-columns: auto 1fr auto;
        align-items: start;
    }

    .profile-actions {
        grid-column: 3;
        grid-row: 1 / 4;
        flex-direction: column;
    }
}

@media (max-width: 499px) {
    .profile-hero { text-align: center; grid-template-columns: 1fr; }
    .profile-hero .avatar-xl { margin: 0 auto; }
    .profile-actions { justify-content: center; }
}

/* —— Lists —— */
.user-list, .notification-list { list-style: none; padding: 0; margin: 0; }

.user-list li, .notification-list li {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 0;
    border-bottom: 2px dashed rgba(17, 17, 17, 0.12);
}

.user-list li:last-child, .notification-list li:last-child { border-bottom: none; }

.notification-list li.unread {
    background: var(--lime);
    margin: 0 -1.3rem;
    padding: 0.7rem 1.3rem;
    border-left: 4px solid var(--ink);
}

.notifications-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.8rem;
    padding: 0.75rem 0.9rem;
}

.notifications-actions span {
    color: rgba(17, 17, 17, 0.68);
    font-size: 0.86rem;
    font-weight: 750;
}

.notifications-actions form {
    flex: 0 0 auto;
}

.notification-main {
    min-width: 0;
}

.notification-main p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    line-height: 1.25;
}

.notification-main time {
    display: block;
    margin-top: 0.18rem;
    color: rgba(17, 17, 17, 0.58);
    font-size: 0.78rem;
    font-weight: 750;
}

.add-friend-form { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.add-friend-form input { flex: 1; min-width: 120px; margin: 0; }

.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    font-weight: 600;
    font-size: 0.95rem;
    opacity: 0.6;
}

.pagination {
    display: flex;
    justify-content: space-between;
    margin-top: 0.75rem;
    font-weight: 600;
    font-size: 0.85rem;
}

.badge-muted { opacity: 0.55; font-size: 0.85rem; font-weight: 600; }
.badge-success { color: var(--ok); font-weight: 700; }
.meta { font-size: 0.85rem; font-weight: 500; opacity: 0.65; }
.text-center { text-align: center; }

.breadcrumb--icon {
    margin: 0 0 0.75rem;
}

.breadcrumb--icon a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--lime);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
    font-size: 0.85rem;
    font-weight: 800;
    text-decoration: none;
}

.breadcrumb--icon a:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

@media (max-width: 380px) {
    .footer-line { font-size: 0.65rem; }
}

/* —— New features UI —— */
.header-search { flex: 1; max-width: 200px; margin: 0 0.25rem; }
.header-search input {
    width: 100%; margin: 0; padding: 0.35rem 0.6rem; font-size: 0.8rem;
    border: 2px solid rgba(255,255,255,0.35); background: rgba(0,0,0,0.2); color: #fff;
    box-shadow: none;
}
.header-search input::placeholder { color: rgba(255,255,255,0.55); }

.nav-toggle {
    display: none; background: var(--lime); border: 2px solid var(--ink);
    border-radius: 8px; padding: 0.35rem 0.55rem; font-size: 1rem; cursor: pointer;
}

.main-nav a.is-active { background: var(--lime); color: var(--ink); border-color: var(--ink); }

.bottom-nav {
    display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
    background: var(--ink); border-top: var(--border); padding: 0.35rem 0.5rem;
    justify-content: space-around; box-shadow: 0 -4px 0 var(--ink);
}
.bottom-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
    border-radius: 10px;
    transition: color 0.15s, background 0.15s;
}
.bottom-nav a.is-active {
    color: var(--lime);
    background: rgba(255, 255, 255, 0.08);
}

.toast-root { position: fixed; top: 70px; right: 1rem; z-index: 200; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
    padding: 0.65rem 1rem; border: var(--border); border-radius: 10px;
    box-shadow: var(--shadow); font-weight: 600; font-size: 0.85rem;
    transform: translateX(120%); transition: transform 0.3s;
    max-width: 280px;
}
.toast.show, .toast.is-visible { transform: translateX(0); }
.toast-success, .toast--notify { background: var(--lime); color: var(--ink); }
.toast-error { background: var(--pink); color: var(--ink); }
.toast--message { background: var(--sky); color: var(--ink); }
.toast--sound {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: var(--violet);
    color: var(--ink);
}
.toast--sound button {
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: var(--card);
    color: var(--ink);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 0.28rem 0.5rem;
    cursor: pointer;
}

.feed-tabs { display: flex; gap: 0.35rem; margin-bottom: 0.85rem; }
.feed-tab {
    padding: 0.4rem 0.85rem; border: var(--border); border-radius: 999px;
    font-weight: 700; font-size: 0.85rem; text-decoration: none; color: var(--ink);
    box-shadow: var(--shadow-sm);
}
.feed-tab.active, .feed-tab:hover { background: var(--lime); }

.reaction-bar { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--paper); border: 2px solid var(--ink); border-radius: 999px;
    padding: 0.25rem 0.6rem; font-size: 0.78rem; font-weight: 700; cursor: pointer;
    box-shadow: 2px 2px 0 var(--ink); font-family: inherit;
    color: var(--ink);
}
.reaction-btn.pop { animation: pop 0.25s ease; }
@keyframes pop { 50% { transform: scale(1.15); } }

.photo-picker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.25rem;
    max-width: 11rem;
    padding: 0.28rem 0.7rem;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--paper);
    box-shadow: 2px 2px 0 var(--ink);
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 900;
    cursor: pointer;
}

.photo-picker [data-photo-label],
.chat-photo [data-photo-label] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    gap: 0.35rem;
}

.photo-picker .icon,
.chat-photo .icon {
    flex: 0 0 auto;
}

.photo-picker [data-photo-name] {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.photo-picker input,
.chat-photo input {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    opacity: 0;
    pointer-events: none;
}

.photo-picker.is-selected,
.chat-photo.is-selected {
    background: var(--lime);
}

.post-photo,
.chat-photo-link {
    display: block;
    overflow: hidden;
    border: 3px solid var(--ink);
    background: var(--paper);
    box-shadow: var(--shadow-sm);
}

.post-photo {
    margin-top: 0.75rem;
    border-radius: 10px;
}

.post-photo img {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: contain;
}

.chat-photo-link {
    margin-top: 0.35rem;
    border-radius: 9px;
}

.chat-photo-link img {
    display: block;
    max-width: min(260px, 62vw);
    max-height: 340px;
    object-fit: contain;
}

.reaction-glyph--emoji {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1rem;
    min-width: 1.1rem;
    font-family: "Segoe UI Emoji", "Segoe UI Symbol", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
    font-size: 1rem;
    line-height: 1;
}

.post-header { flex-wrap: wrap; }
.post-manage { margin-left: auto; display: flex; gap: 0.25rem; }

.profile-hero.has-cover { padding: 0; overflow: hidden; display: block; }
.profile-cover {
    height: 120px; background-size: cover; background-position: center;
    border-bottom: var(--border);
}
.profile-hero-body {
    display: grid; grid-template-columns: auto 1fr; gap: 0.85rem 1rem;
    padding: 1rem 1.2rem; align-items: start;
}
.profile-hero.has-cover .profile-hero-body {
    margin-top: -40px;
}
.profile-hero.has-cover .avatar-xl { position: relative; z-index: 1; }

.profile-mini-status {
    display: inline-flex;
    width: max-content;
    max-width: 100%;
    margin: 0.25rem 0 0;
    padding: 0.18rem 0.55rem;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--lime);
    box-shadow: 2px 2px 0 var(--ink);
    font-size: 0.82rem;
    font-weight: 900;
}

.profile-details {
    display: grid;
    gap: 0.35rem;
    margin: 0.65rem 0 0;
    padding: 0.65rem 0.75rem;
    background: var(--paper);
    border: 2px solid var(--ink);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
}

.profile-details-row {
    display: grid;
    grid-template-columns: 5.5rem 1fr;
    gap: 0.5rem;
    align-items: baseline;
    font-size: 0.88rem;
}

.profile-details dt {
    margin: 0;
    font-weight: 700;
    opacity: 0.65;
}

.profile-details dd {
    margin: 0;
    font-weight: 600;
}

.profile-about {
    margin-top: 0.65rem;
}

.profile-about-title {
    margin: 0 0 0.25rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.55;
}

.profile-info .bio {
    margin: 0;
    line-height: 1.5;
}

.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.65rem;
}
.stat-box {
    border: var(--border); border-radius: 12px; padding: 0.85rem; text-align: center;
    box-shadow: var(--shadow-sm); background: var(--paper);
}
.stat-num { display: block; font-size: 1.75rem; font-weight: 800; }
.stat-label { font-size: 0.75rem; font-weight: 600; opacity: 0.65; }

.admin-health { margin-top: 1rem; }
.admin-checklist { margin: 0.5rem 0 0; padding-left: 1.25rem; font-size: 0.9rem; }
.admin-checklist li { margin-bottom: 0.35rem; }
.admin-health .hint { margin: 0.75rem 0 0; font-size: 0.85rem; opacity: 0.8; }

.theme-picker { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.65rem; }
.theme-option {
    border: var(--border); padding: 0.45rem 0.75rem; border-radius: 8px;
    font-weight: 600; cursor: pointer; box-shadow: var(--shadow-sm);
}
.theme-option:has(input:checked) { background: var(--lime); }

/* v20260526-17: stable profile header */
.profile-hero,
.profile-hero.has-cover {
    display: block;
    padding: 0;
    overflow: hidden;
    border: var(--border);
    border-radius: 14px;
    background: var(--card);
    box-shadow: var(--shadow);
}

.profile-cover {
    position: relative;
    min-height: 138px;
    height: 138px;
    border-bottom: var(--border);
    background:
        linear-gradient(135deg, rgba(217, 249, 157, 0.92), rgba(125, 211, 252, 0.88) 48%, rgba(253, 164, 175, 0.82)),
        repeating-linear-gradient(-12deg, rgba(17, 17, 17, 0.08) 0 2px, transparent 2px 18px);
    background-size: cover;
    background-position: center;
}

.profile-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to bottom, transparent 42%, rgba(255, 255, 255, 0.5)),
        radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.38), transparent 34%);
}

.profile-hero-body,
.profile-hero.has-cover .profile-hero-body {
    display: grid;
    grid-template-columns: 136px minmax(0, 1fr);
    grid-template-areas:
        "avatar info"
        "actions info";
    gap: 0.55rem 1rem;
    align-items: start;
    margin-top: 0;
    padding: 0 1.1rem 0.85rem;
    position: relative;
    z-index: 1;
}

.profile-avatar-wrap {
    grid-area: avatar;
    display: grid;
    place-items: center;
    padding: 0.25rem;
    width: 126px;
    height: 126px;
    margin-top: -42px;
    border: var(--border);
    border-radius: 22px;
    background: var(--card);
    box-shadow: var(--shadow-sm);
}

.profile-hero .avatar-xl,
.profile-hero.has-cover .avatar-xl {
    width: 104px;
    height: 104px;
    margin: 0;
    border-width: 2.5px;
    box-shadow: none;
    position: static;
}

.profile-info {
    grid-area: info;
    min-width: 0;
    padding: 0.9rem 0 0;
}

.profile-kicker {
    display: inline-flex;
    max-width: 100%;
    margin: 0 0 0.2rem;
    padding: 0.12rem 0.5rem;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--lime);
    box-shadow: 2px 2px 0 var(--ink);
    font-size: 0.78rem;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-info h1 {
    margin: 0;
    font-size: 1.85rem;
    line-height: 1.08;
    text-transform: none;
    overflow-wrap: anywhere;
    letter-spacing: 0;
}

.profile-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.45rem;
}

.profile-stats span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.55rem;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--paper);
    font-size: 0.8rem;
    font-weight: 700;
}

.profile-stats a {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.55rem;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--paper);
    color: var(--ink);
    font-size: 0.8rem;
    font-weight: 800;
    text-decoration: none;
}

.profile-stats a:hover {
    background: var(--lime);
    transform: translateY(-1px);
    text-decoration: none;
}

.profile-actions {
    grid-area: actions;
    display: flex;
    width: 126px;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    padding-bottom: 0;
}

.profile-actions .btn,
.profile-actions .inline-form,
.profile-actions .inline-form .btn {
    width: 100%;
}

.profile-actions .btn {
    justify-content: center;
}

.profile-content {
    display: grid;
    gap: 0.75rem;
    padding: 0 1.1rem 1rem;
}

.profile-content .profile-details {
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 0.55rem;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.profile-content .profile-details-row {
    display: block;
    min-width: 0;
    padding: 0.52rem 0.62rem;
    border: 2px solid var(--ink);
    border-radius: 10px;
    background: var(--paper);
    box-shadow: var(--shadow-sm);
}

.profile-content .profile-details dt {
    margin: 0 0 0.15rem;
    font-size: 0.72rem;
    text-transform: uppercase;
}

.profile-content .profile-details dd {
    overflow-wrap: anywhere;
}

.profile-content .profile-about {
    margin: 0;
    padding: 0.75rem;
    border: 2px solid var(--ink);
    border-radius: 10px;
    background: var(--card);
    box-shadow: var(--shadow-sm);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

/* v20260526-18: profile settings media controls */
.settings-card {
    padding-top: 1.05rem;
}

.settings-head {
    display: grid;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.settings-head h1 {
    margin: 0;
}

.settings-back {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--lime);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
    font-size: 0.85rem;
    font-weight: 800;
    text-decoration: none;
}

.settings-back:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.settings-media {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.settings-avatar-preview {
    display: grid;
    place-items: center;
    position: relative;
    width: 94px;
    height: 94px;
    border: var(--border);
    border-radius: 20px;
    background: var(--paper);
    box-shadow: var(--shadow-sm);
}

.settings-avatar-preview .avatar {
    box-shadow: none;
}

.file-pick {
    display: grid;
    gap: 0.35rem;
    margin: 0;
    flex: 1;
}

.file-pick input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.file-pick span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.55rem 0.85rem;
    border: var(--border);
    border-radius: 12px;
    background: var(--violet);
    box-shadow: var(--shadow-sm);
    font-weight: 800;
}

.file-pick:hover span {
    background: var(--lime);
}

.file-pick.is-selected span {
    background: var(--lime);
}

.file-pick small {
    color: rgba(17, 17, 17, 0.62);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: none;
}

.avatar-remove-btn {
    position: absolute;
    right: -0.45rem;
    top: -0.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 2px solid var(--ink);
    border-radius: 10px;
    background: var(--pink);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.avatar-remove-btn:hover {
    transform: translate(-1px, -1px);
}

.cover-picker {
    margin: 0 0 1rem;
    padding: 0;
    border: 0;
}

.cover-picker legend {
    margin-bottom: 0.45rem;
    font-weight: 800;
    text-transform: uppercase;
}

.cover-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
}

.cover-option {
    display: grid;
    gap: 0.35rem;
    margin: 0;
    cursor: pointer;
}

.cover-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.cover-option-preview {
    display: block;
    aspect-ratio: 3 / 1;
    border: 2px solid var(--ink);
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    box-shadow: var(--shadow-sm);
}

.cover-option-name {
    display: inline-flex;
    justify-content: center;
    padding: 0.28rem 0.45rem;
    border: 2px solid transparent;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
}

.cover-option input:checked + .cover-option-preview {
    outline: 4px solid var(--lime);
    transform: translateY(-1px);
}

.cover-option input:checked + .cover-option-preview + .cover-option-name {
    border-color: var(--ink);
    background: var(--lime);
}

@media (max-width: 680px) {
    .profile-wall-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .profile-cover { height: 124px; min-height: 124px; }
    .profile-hero-body,
    .profile-hero.has-cover .profile-hero-body {
        grid-template-columns: 1fr;
        grid-template-areas:
            "avatar"
            "info"
            "actions";
        justify-items: center;
        text-align: center;
        gap: 0.55rem;
        padding-top: 0;
    }
    .profile-avatar-wrap {
        margin-top: -44px;
    }
    .profile-info {
        padding-top: 0;
    }
    .profile-info h1 {
        font-size: 1.45rem;
    }
    .profile-actions {
        width: min(100%, 12rem);
        justify-content: center;
    }
    .profile-stats {
        justify-content: center;
    }
    .settings-grid {
        grid-template-columns: 1fr;
    }
    .settings-media {
        align-items: stretch;
    }
    .cover-options {
        grid-template-columns: 1fr;
    }
}

.chat-box { min-height: 280px; display: flex; flex-direction: column; }
.chat-messages {
    list-style: none; padding: 0; margin: 0 0 0.75rem; flex: 1;
    max-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow-y: auto;
    overflow-anchor: none;
    gap: 0.5rem;
}
.chat-scroll-anchor {
    height: 0; margin: 0; padding: 0; border: 0; overflow: hidden;
    list-style: none; visibility: hidden;
}

/* Страница диалога: лента на весь экран, прокрутка только внутри чата */
.page-chat .main-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding-bottom: 0.5rem;
}
.page-chat .breadcrumb { flex-shrink: 0; }
.page-chat .chat-box {
    flex: 1;
    min-height: 0;
    max-height: calc(100dvh - 7.5rem);
}
.page-chat .chat-messages {
    max-height: none;
    min-height: 12rem;
}
.page-chat .comment-form { flex-shrink: 0; }
.chat-msg {
    margin: 0; flex-shrink: 0; padding: 0.5rem 0.65rem; border: 2px solid var(--ink);
    border-radius: 10px; background: var(--paper); max-width: 85%;
}
.chat-msg.mine { margin-left: auto; background: var(--lime); }
.chat-msg time { display: block; font-size: 0.7rem; opacity: 0.55; margin-top: 0.2rem; }
.chat-error {
    margin: 0 0 0.5rem;
    padding: 0.4rem 0.55rem;
    font-size: 0.85rem;
    color: #b00020;
    border: 2px solid #b00020;
    border-radius: 8px;
    background: #fff5f5;
}
.chat-error[hidden] { display: none; }

.empty-icon {
    display: flex;
    justify-content: center;
    margin: 0 0 0.5rem;
    color: var(--ink);
}
.empty-actions { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }
.conv-preview { flex: 1; min-width: 0; }
.conv-last { margin: 0.15rem 0 0; font-size: 0.8rem; opacity: 0.7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.is-auth { padding-bottom: 4rem; }

@media (max-width: 720px) {
    .nav-toggle { display: block; }
    .main-nav {
        display: none; position: absolute; top: 100%; left: 0; right: 0;
        background: var(--ink); flex-direction: column; padding: 0.75rem;
        border-bottom: var(--border); box-shadow: var(--shadow);
    }
    .main-nav.is-open { display: flex; }
    .main-nav a { color: #fff; }
    .header-search { max-width: none; order: 3; flex-basis: 100%; }
    .logout-form { display: none; }
    .bottom-nav { display: flex; }
    .site-header { position: relative; }
}

@media (min-width: 721px) {
    .bottom-nav { display: none !important; }
    .is-auth { padding-bottom: 0; }
}

/* —— VK-style sidebar layout (logged in) —— */
.is-auth {
    padding-bottom: 0;
}

.is-auth .site-header,
.is-auth .header-search,
.is-auth .main-nav,
.is-auth .logout-form,
.is-auth .nav-toggle {
    display: none !important;
}

.app-shell {
    display: flex;
    min-height: 100vh;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--card);
    border-right: var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 120;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    padding: 1rem 1rem 0.75rem;
    text-decoration: none;
    color: var(--ink);
    font-size: 0.95rem;
}

.sidebar-logo:hover { color: var(--ink); text-decoration: none; }
.sidebar-logo em { transform: rotate(-4deg); margin-right: 0.15rem; }
.sidebar-logo span { color: var(--sky); }

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0 0.5rem;
    flex: 1;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.65rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--ink);
    text-decoration: none;
    border: 2px solid transparent;
    position: relative;
}

.sidebar-link:hover {
    background: var(--paper);
    text-decoration: none;
}

.sidebar-link.is-active {
    background: var(--lime);
    border-color: var(--ink);
    box-shadow: var(--shadow-sm);
}

.sidebar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    border: 2px solid var(--ink);
    border-radius: 8px;
    box-shadow: 2px 2px 0 var(--ink);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.sidebar-badge--msg {
    background: var(--sky);
}

.sidebar-badge {
    margin-left: auto;
    background: var(--pink);
    color: var(--ink);
    font-size: 0.65rem;
    font-weight: 800;
    min-width: 1.1rem;
    height: 1.1rem;
    line-height: 1.1rem;
    text-align: center;
    border-radius: 999px;
    border: 2px solid var(--ink);
    padding: 0 0.25rem;
}

.sidebar-player {
    margin: 0.45rem 0.5rem 0.5rem;
    padding: 0.55rem;
    border: 2px solid var(--ink);
    border-radius: 10px;
    background:
        linear-gradient(135deg, rgba(217, 249, 157, 0.85), rgba(196, 181, 253, 0.5)),
        var(--card);
    box-shadow: var(--shadow-sm);
}

.player-head {
    display: grid;
    grid-template-columns: 1.65rem minmax(0, 1fr);
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.45rem;
}

.player-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: var(--sky);
    box-shadow: 2px 2px 0 var(--ink);
}

.player-title {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-size: 0.76rem;
    font-weight: 900;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-controls {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.3rem;
}

.player-btn {
    display: inline-grid;
    place-items: center;
    min-width: 0;
    height: 2rem;
    padding: 0;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: var(--card);
    color: var(--ink);
    box-shadow: 2px 2px 0 var(--ink);
    cursor: pointer;
}

.player-btn:hover,
.player-btn:focus-visible {
    background: var(--lime);
}

.player-btn:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 var(--ink);
}

.player-btn--play {
    background: var(--lime);
}

.sidebar-player.is-playing .player-icon,
.sidebar-player.is-playing .player-btn--play {
    background: var(--pink);
}

.player-progress {
    height: 0.45rem;
    margin-top: 0.45rem;
    overflow: hidden;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
}

.player-progress span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--ink);
}

.sidebar-foot {
    padding: 0.5rem;
    border-top: 2px dashed rgba(17, 17, 17, 0.12);
    border-bottom: 2px dashed rgba(17, 17, 17, 0.12);
}

.sidebar-link--btn {
    width: 100%;
    background: none;
    border: 2px solid transparent;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
}

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    max-width: 640px;
}

.mobile-top {
    display: none;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.75rem;
    background: var(--ink);
    color: #fff;
    border-bottom: var(--border);
}

.mobile-title {
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-open {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lime);
    border: 2px solid var(--ink);
    border-radius: 8px;
    padding: 0.4rem;
    width: 2.25rem;
    height: 2.25rem;
    color: var(--ink);
    cursor: pointer;
    font-family: inherit;
}

.is-auth .main-content {
    padding: 1rem 1rem 1.25rem;
    flex: 1;
    width: 100%;
    max-width: none;
    margin: 0;
}

.is-auth .flash-wrap {
    padding: 0.65rem 1rem 0;
}

.is-auth .site-footer {
    margin-top: auto;
    padding: 0.75rem 1rem 1rem;
    background: transparent;
    border-top: none;
}

.is-auth .footer-line {
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
    padding: 0.22rem 0.5rem;
    border: 2px solid transparent;
    border-radius: 999px;
    color: var(--ink);
    opacity: 1;
}

.is-auth .footer-dot {
    opacity: 0.45;
}

.is-auth .online-indicator {
    color: #15803d;
    font-weight: 800;
    background: var(--card);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    border: 2px solid var(--ink);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}

.is-auth .online-indicator:hover {
    background: var(--lime);
    text-decoration: none;
}

.is-auth .online-indicator::before {
    background: #22c55e;
    border-color: var(--ink);
}

.is-auth .footer-weather {
    color: var(--ink);
    opacity: 1;
    background: var(--card);
    padding: 0.15rem 0.55rem;
    border: 2px solid var(--ink);
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
}

.is-auth .footer-weather::before {
    background: var(--sky);
    color: var(--ink);
    box-shadow: none;
}

.is-auth .footer-weather-label {
    color: var(--ink);
}

.is-auth .page-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.page-title--sm { font-size: 1.1rem; }

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

.online-page-subtitle {
    margin: -0.25rem 0 0;
    font-size: 0.9rem;
    opacity: 0.7;
}

.online-page-count {
    display: inline-grid;
    place-items: center;
    min-width: 2.3rem;
    height: 2.3rem;
    padding: 0 0.55rem;
    border: var(--border);
    border-radius: 999px;
    background: var(--lime);
    box-shadow: var(--shadow-sm);
    font-weight: 900;
}

.online-user-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.55rem;
}

.online-user-card {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem;
    border: var(--border);
    border-radius: 12px;
    background: var(--card);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}

.online-user-card:hover {
    transform: translate(-1px, -1px);
    box-shadow: var(--shadow);
    text-decoration: none;
}

.online-user-main {
    min-width: 0;
}

.online-user-main strong,
.online-user-main small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.online-user-main small,
.online-user-card time {
    font-size: 0.78rem;
    opacity: 0.62;
}

.online-user-card time {
    white-space: nowrap;
}

.card--compact {
    padding: 0.85rem 1rem;
    margin-bottom: 0.65rem;
}

.is-auth .card {
    padding: 1rem 1.1rem;
    margin-bottom: 0.65rem;
}

.is-auth .card:hover {
    transform: none;
    box-shadow: var(--shadow);
}

.is-guest .container { width: min(420px, 100% - 1.25rem); }

.site-header--guest {
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner--guest { justify-content: space-between; gap: 1rem; min-height: 52px; }

.main-content--guest {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.toast-root { top: 1rem; }

@media (max-width: 768px) {
    .app-shell { max-width: none; }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: var(--shadow);
    }

    .sidebar.is-open { transform: translateX(0); }

    .mobile-top { display: flex; }

    .app-main { max-width: none; }

    .is-auth { padding-bottom: 3.5rem; }

    .bottom-nav { display: flex; }
}

@media (min-width: 769px) {
    .bottom-nav { display: none !important; }
    .mobile-top { display: none !important; }
}

.news-list { display: flex; flex-direction: column; gap: 0.75rem; }
.news-card-title { margin: 0 0 0.25rem; font-size: 1.15rem; }
.news-card-meta { margin: 0; font-size: 0.78rem; opacity: 0.65; }
.news-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; }
.news-card-actions { display: flex; gap: 0.25rem; flex-shrink: 0; }
.news-card-body {
    margin-top: 0.65rem;
    line-height: 1.55;
    font-size: 0.95rem;
    color: var(--ink);
    white-space: pre-wrap;
    word-break: break-word;
}
.news-composer .section-title { margin-top: 0; }

.info-block h2 { margin: 0 0 0.65rem; font-size: 1.1rem; }
.info-block p { margin: 0 0 0.5rem; line-height: 1.5; }
.info-steps { margin: 0; padding-left: 1.25rem; line-height: 1.55; }
.info-steps li { margin-bottom: 0.45rem; }
.info-block .btn-lg { margin: 0.75rem 0; }

.info-contact-card,
.info-purpose-card {
    position: relative;
    overflow: hidden;
    border-left: 10px solid #d3ff7e;
}

.info-contact-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.info-contact-icon {
    display: inline-grid;
    place-items: center;
    width: 4.2rem;
    height: 4.2rem;
    border: 3px solid var(--ink);
    border-radius: 14px;
    background: var(--ico-messages-bg);
    color: var(--ico-messages);
    box-shadow: 4px 4px 0 var(--ink);
}

.info-contact-main h2,
.info-purpose-card h2 {
    margin: 0;
    font-size: 1.55rem;
    line-height: 1.05;
    text-transform: uppercase;
}

.info-contact-kicker {
    display: inline-block;
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 900;
    text-transform: uppercase;
}

.info-contact-main p {
    max-width: 54rem;
    margin: 0.75rem 0 0;
    color: var(--muted);
    font-weight: 700;
    line-height: 1.5;
}

.info-contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1rem;
}

.info-contact-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.info-purpose-head {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.info-purpose-text {
    display: grid;
    gap: 0.75rem;
    max-width: 58rem;
}

.info-purpose-text p {
    margin: 0;
    color: #2f343b;
    font-weight: 650;
    line-height: 1.62;
}

.info-purpose-text strong {
    color: var(--ink);
    font-weight: 900;
}

.install-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 0.9rem;
    margin-bottom: 1rem;
    overflow: hidden;
    border-left: 7px solid var(--lime);
    background:
        radial-gradient(circle at 86% 12%, rgba(122, 214, 255, 0.28) 0 4.4rem, transparent 4.5rem),
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(241, 255, 218, 0.92) 54%, rgba(224, 247, 255, 0.9));
}

.install-card::after {
    content: "";
    position: absolute;
    right: 1.25rem;
    bottom: -2.7rem;
    width: 9rem;
    height: 9rem;
    border: 2px solid rgba(17, 17, 17, 0.07);
    border-radius: 2rem;
    transform: rotate(-10deg);
    background: rgba(255, 255, 255, 0.36);
    pointer-events: none;
}

.install-card-main {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 1rem;
    min-width: 0;
}

.install-app-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 4.6rem;
    width: 4.6rem;
    height: 4.6rem;
    border: 4px solid var(--ink);
    border-radius: 1.15rem;
    background: linear-gradient(145deg, var(--lime), #fff 68%);
    box-shadow: 5px 5px 0 var(--ink);
    color: var(--ink);
    font-size: 2.35rem;
    font-weight: 900;
    line-height: 1;
}

.install-app-icon em {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.85rem;
    border: 3px solid var(--ink);
    border-radius: 0.48rem;
    background: var(--card);
    font-style: normal;
}

.install-card-copy {
    min-width: 0;
}

.install-kicker {
    display: inline-flex;
    margin-bottom: 0.18rem;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 900;
    text-transform: uppercase;
}

.install-card h2 {
    margin: 0;
    font-size: clamp(1.45rem, 3vw, 2.05rem);
    line-height: 1.05;
}

.install-card p {
    max-width: 42rem;
    margin: 0.45rem 0 0;
    line-height: 1.45;
}

.install-chips {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.28rem;
    margin-top: 0.7rem;
}

.install-chips span {
    display: inline-flex;
    align-items: center;
    min-height: 1.78rem;
    padding: 0.16rem 0.46rem;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--card);
    box-shadow: 2px 2px 0 var(--ink);
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.install-card-action {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: stretch;
    gap: 0.35rem;
    min-width: 0;
    max-width: 100%;
}

.install-button {
    width: 100%;
    min-height: 3rem;
    box-shadow: 4px 4px 0 var(--ink);
}

.install-hint {
    max-width: none;
    margin: 0;
    text-align: left;
    font-size: 0.82rem;
    font-weight: 800;
}

.info-registered-card {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    overflow: hidden;
    border-left: 7px solid var(--sky);
    background:
        linear-gradient(135deg, rgba(217, 255, 143, 0.88), rgba(244, 251, 255, 0.96) 52%, rgba(198, 239, 255, 0.78)),
        repeating-linear-gradient(90deg, rgba(17, 17, 17, 0.045) 0 1px, transparent 1px 32px);
}

.info-registered-card::after {
    content: "";
    position: absolute;
    right: 1.3rem;
    top: -1.9rem;
    width: 8rem;
    height: 8rem;
    border: 2px solid rgba(17, 17, 17, 0.08);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    pointer-events: none;
}

.info-registered-icon {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4.4rem;
    height: 4.4rem;
    border: 3px solid var(--ink);
    border-radius: 1.05rem;
    background: var(--ico-profile-bg);
    color: var(--ico-profile);
    box-shadow: var(--shadow-sm);
}

.info-registered-main {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 0.08rem;
    min-width: 0;
}

.info-registered-label,
.info-registered-text {
    color: var(--muted);
    font-weight: 900;
}

.info-registered-label {
    font-size: 0.92rem;
    text-transform: uppercase;
}

.info-registered-main strong {
    color: var(--ink);
    font-size: clamp(2.6rem, 6vw, 4.1rem);
    line-height: 0.95;
    font-weight: 900;
}

.info-registered-text {
    font-size: 1.05rem;
}

.info-registered-badge {
    position: relative;
    z-index: 1;
    align-self: end;
    padding: 0.35rem 0.75rem;
    border: 3px solid var(--ink);
    border-radius: 999px;
    background: var(--card);
    box-shadow: 3px 3px 0 var(--ink);
    font-size: 0.82rem;
    font-weight: 900;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .info-contact-card {
        grid-template-columns: 1fr;
    }

    .info-contact-icon {
        width: 3.6rem;
        height: 3.6rem;
    }

    .info-contact-main h2,
    .info-purpose-card h2 {
        font-size: 1.3rem;
    }

    .info-registered-card {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 0.75rem;
    }

    .info-registered-icon {
        width: 3.7rem;
        height: 3.7rem;
    }

    .info-registered-badge {
        grid-column: 1 / -1;
        justify-self: start;
        font-size: 0.76rem;
    }

    .install-card {
        grid-template-columns: 1fr;
    }

    .install-card-main {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: flex-start;
    }

    .install-app-icon {
        flex-basis: 3.8rem;
        width: 3.8rem;
        height: 3.8rem;
        box-shadow: 4px 4px 0 var(--ink);
        font-size: 1.8rem;
    }

    .install-app-icon em {
        width: 1.95rem;
        height: 2.35rem;
    }

    .install-card-action {
        justify-items: stretch;
        min-width: 0;
    }

    .install-hint {
        max-width: none;
        text-align: left;
    }
}

/* FIX personal messages scroll: the dialog has its own stable scroll area. */
.page-chat .app-shell {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
}
.page-chat .app-main {
    min-height: 0;
    height: 100dvh;
    overflow: hidden;
}
.page-chat .main-content {
    min-height: 0;
    overflow: hidden;
}
.page-chat .chat-box {
    height: 100%;
    overflow: hidden;
}
.page-chat .chat-messages {
    overscroll-behavior: contain;
}
.page-chat .site-footer {
    display: none;
}
.page-chat .scroll-top {
    display: none !important;
}
@media (max-width: 768px) {
    .page-chat .app-shell,
    .page-chat .app-main {
        height: 100dvh;
        min-height: 100dvh;
    }
    .page-chat .main-content {
        padding-bottom: 0;
    }
}


/* v20260526: Личные сообщения — открывать диалог сразу в конце переписки. */
.page-chat .app-shell,
.page-chat .app-main {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}
.page-chat .app-main {
    display: flex;
    flex-direction: column;
}
.page-chat .main-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.page-chat .chat-box {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.page-chat .chat-messages {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: auto;
}
.page-chat .chat-scroll-anchor {
    display: block;
    flex: 0 0 1px;
    width: 1px;
    height: 1px;
    min-height: 1px;
    visibility: hidden;
}


/* FIX 20260526-3: личный диалог не должен улетать к старым сообщениям после F5.
   column-reverse делает scrollTop=0 нижней частью списка. */
.page-chat .chat-messages.chat-messages--reverse {
    display: flex;
    flex-direction: column-reverse;
    overflow-y: auto;
    scroll-behavior: auto;
    overflow-anchor: none;
}
.page-chat .chat-messages.chat-messages--reverse .chat-scroll-anchor {
    flex: 0 0 1px;
    height: 1px;
    min-height: 1px;
}


/* FIX 20260526-10: личные сообщения всегда снизу, без column-reverse. */
.page-chat .chat-messages {
    display: flex !important;
    flex-direction: column !important;
    overflow-y: auto !important;
    overflow-anchor: none !important;
    scroll-behavior: auto !important;
}
.page-chat .chat-messages.chat-messages--reverse {
    flex-direction: column !important;
}
.page-chat .chat-scroll-anchor {
    display: block !important;
    flex: 0 0 1px !important;
    height: 1px !important;
    min-height: 1px !important;
}

/* v20260526-11: private messages */
.messages-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}
.messages-subtitle {
    margin: -0.25rem 0 0;
    font-size: 0.9rem;
    opacity: 0.7;
}
.messages-start {
    padding: 0.8rem;
    margin-bottom: 0.8rem;
    border: var(--border);
    border-radius: 12px;
    background: var(--card);
    box-shadow: var(--shadow-sm);
}
.messages-start-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.55rem;
}
.messages-start-form input {
    min-width: 0;
    margin: 0;
}
.messages-start-form .btn {
    gap: 0.35rem;
    white-space: nowrap;
}
.messages-start .hint {
    margin: 0.55rem 0 0;
}
.conversation-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.55rem;
}
.conversation-item {
    margin: 0;
}
.conversation-link {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 0.65rem;
    align-items: center;
    padding: 0.7rem;
    color: var(--ink);
    text-decoration: none;
    border: var(--border);
    border-radius: 12px;
    background: var(--card);
    box-shadow: var(--shadow-sm);
}
.conversation-link:hover {
    transform: translate(-1px, -1px);
    box-shadow: var(--shadow);
}
.conversation-item.has-unread .conversation-link {
    background: #fff7ed;
}
.conv-title-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}
.conv-title-row strong,
.conv-last {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.conv-title-row time {
    flex-shrink: 0;
    font-size: 0.72rem;
    opacity: 0.58;
}
.conv-last {
    display: block;
    margin-top: 0.18rem;
    font-size: 0.86rem;
    opacity: 0.78;
}
.conv-last em {
    font-style: normal;
    font-weight: 700;
}
.conv-last--empty {
    opacity: 0.52;
}
.conv-unread {
    display: inline-grid;
    place-items: center;
    min-width: 1.65rem;
    height: 1.65rem;
    padding: 0 0.35rem;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--pink);
    font-size: 0.78rem;
    font-weight: 800;
}
.messages-empty {
    text-align: center;
    padding: 1.5rem 1rem;
    border: var(--border);
    border-radius: 12px;
    background: var(--card);
    box-shadow: var(--shadow-sm);
}
.messages-empty h2 {
    margin: 0;
    font-size: 1.08rem;
}
.messages-empty p {
    margin: 0.35rem auto 0.8rem;
    max-width: 22rem;
    opacity: 0.7;
}
.avatar-xs {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--ink);
    background: var(--paper);
}
.page-chat .main-content {
    padding-top: 0.6rem;
}
.messenger {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: var(--border);
    border-radius: 12px;
    background: var(--card);
    box-shadow: var(--shadow-sm);
}
.messenger-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
    padding: 0.65rem 0.75rem;
    border-bottom: var(--border);
    background: #f8fafc;
}
.messenger-back {
    display: inline-grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
    color: var(--ink);
    text-decoration: none;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--paper);
    transform: rotate(-90deg);
}
.messenger-peer {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    color: var(--ink);
    text-decoration: none;
}
.messenger-peer span {
    min-width: 0;
}
.messenger-peer strong,
.messenger-peer small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.messenger-peer small {
    font-size: 0.78rem;
    opacity: 0.62;
}
.chat-empty {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 0.35rem;
    flex: 1 1 auto;
    min-height: 12rem;
    padding: 1rem;
    text-align: center;
    color: var(--ink);
}
.chat-empty[hidden] {
    display: none;
}
.chat-empty span {
    opacity: 0.65;
}
.page-chat .chat-messages {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    margin: 0;
    padding: 0.85rem;
    gap: 0.55rem;
    background:
        linear-gradient(rgba(17, 17, 17, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(17, 17, 17, 0.025) 1px, transparent 1px),
        var(--paper);
    background-size: 28px 28px;
}
.chat-msg {
    display: flex;
    align-items: flex-end;
    gap: 0.35rem;
    width: fit-content;
    max-width: min(86%, 36rem);
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}
.chat-msg.mine {
    margin-left: auto;
    background: transparent;
}
.chat-bubble {
    display: block;
    min-width: 0;
    padding: 0.52rem 0.65rem;
    border: 2px solid var(--ink);
    border-radius: 12px 12px 12px 4px;
    background: var(--card);
    box-shadow: 2px 2px 0 var(--ink);
}
.chat-msg.mine .chat-bubble {
    border-radius: 12px 12px 4px 12px;
    background: var(--lime);
}
.chat-bubble strong {
    display: block;
    margin-bottom: 0.18rem;
    font-size: 0.78rem;
}
.chat-text {
    display: block;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.chat-msg time {
    display: block;
    margin-top: 0.25rem;
    text-align: right;
    font-size: 0.68rem;
    opacity: 0.55;
}
.chat-compose {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 2.6rem;
    gap: 0.5rem;
    align-items: end;
    flex-shrink: 0;
    padding: 0.65rem;
    border-top: var(--border);
    background: #f8fafc;
}

.chat-photo {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 2.45rem;
    height: 2.45rem;
    border: 3px solid var(--ink);
    border-radius: 10px;
    background: var(--paper);
    box-shadow: var(--shadow-sm);
    font-weight: 1000;
    cursor: pointer;
}

.chat-photo [data-photo-name]:empty {
    display: none;
}
.chat-compose textarea {
    width: 100%;
    min-height: 2.6rem;
    max-height: 8rem;
    margin: 0;
    resize: none;
    line-height: 1.35;
}
.chat-send {
    display: inline-grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    border: var(--border);
    border-radius: 10px;
    background: var(--lime);
    color: var(--ink);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}
.chat-send:disabled {
    cursor: wait;
    opacity: 0.6;
}
.chat-error {
    flex-shrink: 0;
    margin: 0;
    border-width: 0 0 2px;
    border-radius: 0;
}
@media (max-width: 640px) {
    .messages-start-form {
        grid-template-columns: 1fr;
    }
    .conversation-link {
        grid-template-columns: 44px minmax(0, 1fr) auto;
        padding: 0.6rem;
    }
    .conversation-link .avatar-md {
        width: 44px;
        height: 44px;
    }
    .page-chat .main-content {
        padding: 0;
    }
    .messenger {
        border-left: 0;
        border-right: 0;
        border-radius: 0;
        box-shadow: none;
    }
    .page-chat .chat-messages {
        padding: 0.7rem;
    }
    .chat-compose {
        grid-template-columns: minmax(0, 1fr) 2.35rem;
        gap: 0.4rem;
        padding: 0.55rem;
        padding-bottom: calc(0.55rem + env(safe-area-inset-bottom));
    }
    .chat-compose textarea {
        min-height: 2.35rem;
        padding: 0.55rem 0.7rem;
        font-size: 0.95rem;
    }
    .chat-send {
        width: 2.35rem;
        height: 2.35rem;
        border-radius: 9px;
        box-shadow: 2px 2px 0 var(--ink);
    }
    .chat-send .icon {
        width: 18px;
        height: 18px;
    }
    .chat-msg {
        max-width: 92%;
    }
}

/* v20260526-25: brighter tab pages */
.is-auth .page-hero,
.messages-head.page-hero,
.online-page-head.page-hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.is-auth .page-hero .page-title,
.messages-head.page-hero .page-title,
.online-page-head.page-hero .page-title {
    margin: 0;
    font-size: 1.45rem;
    line-height: 1;
}

.page-hero .messages-subtitle,
.page-hero .online-page-subtitle {
    margin: 0.3rem 0 0;
    opacity: 1;
}

.page-hero .page-hero-kicker {
    margin: 0 0 0.18rem;
}

.info-block h2,
.page-section-card h2 {
    display: inline-flex;
    align-items: center;
    margin: 0 0 0.65rem;
    padding: 0.2rem 0.55rem;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--lime);
    box-shadow: 2px 2px 0 var(--ink);
    font-size: 1rem;
}

.search-panel input[type="search"] {
    min-height: 3rem;
    font-size: 1rem;
}

.useful-section {
    margin-top: 1.2rem;
}

.useful-section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.75rem;
}

.useful-section-head h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.05;
    text-transform: uppercase;
}

.useful-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0.25rem 0.75rem;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--lime);
    box-shadow: var(--shadow-sm);
    font-size: 0.8rem;
    font-weight: 900;
    white-space: nowrap;
}

.useful-pill--fish {
    background: var(--ico-useful-bg);
}

.useful-weather {
    overflow: hidden;
}

.useful-weather-list {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.55rem;
}

.useful-weather-card {
    min-width: 0;
    padding: 0.65rem;
    border: 2px solid var(--ink);
    border-radius: 10px;
    background: #f8fafc;
    box-shadow: 3px 3px 0 var(--ink);
}

.useful-weather-card.is-today {
    background:
        linear-gradient(135deg, rgba(217, 249, 157, 0.9), rgba(125, 211, 252, 0.32)),
        var(--card);
}

.useful-weather-day,
.useful-weather-desc,
.useful-weather-meta {
    display: block;
}

.useful-weather-day {
    min-height: 2.05rem;
    color: rgba(17, 17, 17, 0.68);
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1.15;
    text-transform: uppercase;
}

.useful-weather-card strong {
    display: block;
    margin: 0.35rem 0 0.2rem;
    font-size: 1.15rem;
    line-height: 1;
}

.useful-weather-desc {
    font-size: 0.82rem;
    font-weight: 850;
}

.useful-weather-meta {
    margin-top: 0.35rem;
    color: rgba(17, 17, 17, 0.65);
    font-size: 0.72rem;
    font-weight: 750;
}

.useful-loading {
    grid-column: 1 / -1;
    padding: 0.8rem;
    border: 2px dashed rgba(17, 17, 17, 0.3);
    border-radius: 10px;
    font-weight: 800;
}

.useful-loading--error {
    background: #fee2e2;
}

.useful-fishing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 0.75rem;
}

.useful-fish-card {
    margin: 0;
    border-left: 7px solid var(--ico-useful-bg);
}

.useful-fish-card h3,
.useful-holiday-card h3,
.useful-month-card h3 {
    margin: 0 0 0.45rem;
    font-size: 1rem;
    font-weight: 900;
    text-transform: uppercase;
}

.useful-fish-card p {
    min-height: 3.8rem;
    margin: 0 0 0.65rem;
    font-weight: 650;
}

.useful-date-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: var(--lime);
    box-shadow: 2px 2px 0 var(--ink);
    font-size: 0.78rem;
}

.useful-date-line + .useful-date-line {
    margin-top: 0.45rem;
}

.useful-date-line--quiet {
    background: #f1f5f9;
}

.useful-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.45rem;
    font-size: 0.72rem;
    font-weight: 850;
}

.useful-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.useful-mark {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    border: 2px solid var(--ink);
    border-radius: 4px;
}

.useful-mark--state { background: var(--pink); }
.useful-mark--church { background: var(--sky); }
.useful-mark--fish { background: var(--lime); }

.useful-holiday-panels {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.useful-holiday-card {
    margin: 0;
}

.useful-holiday-card ul {
    display: grid;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.useful-holiday-card li {
    display: grid;
    grid-template-columns: 3.2rem minmax(0, 1fr);
    gap: 0.5rem;
    align-items: center;
    padding: 0.35rem 0.45rem;
    border: 2px solid rgba(17, 17, 17, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
}

.useful-holiday-card time {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0.35rem;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--card);
    font-size: 0.72rem;
    font-weight: 900;
}

.useful-holiday-card span {
    min-width: 0;
    font-weight: 750;
}

.useful-year-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 0.75rem;
}

.useful-month-card {
    padding: 0.75rem;
    border: var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: var(--shadow-sm);
}

.useful-weekdays,
.useful-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.22rem;
}

.useful-weekdays {
    margin-bottom: 0.25rem;
    color: rgba(17, 17, 17, 0.55);
    font-size: 0.62rem;
    font-weight: 900;
    text-align: center;
    text-transform: uppercase;
}

.useful-date {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    min-width: 0;
    border: 1.5px solid rgba(17, 17, 17, 0.18);
    border-radius: 7px;
    background: #fff;
    font-size: 0.72rem;
    font-weight: 850;
}

.useful-date--blank {
    visibility: hidden;
}

.useful-date--state {
    background: var(--pink);
    border-color: var(--ink);
}

.useful-date--church {
    box-shadow: inset 0 -4px 0 var(--sky);
    border-color: var(--ink);
}

.useful-date--fish {
    outline: 2px solid var(--lime);
    outline-offset: -3px;
}

@media (max-width: 920px) {
    .useful-weather-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .useful-section-head,
    .useful-holiday-panels {
        grid-template-columns: 1fr;
    }

    .useful-section-head {
        display: grid;
        align-items: start;
    }

    .useful-legend {
        justify-content: flex-start;
    }
}

@media (max-width: 440px) {
    .useful-weather-list,
    .useful-fishing-grid,
    .useful-year-grid {
        grid-template-columns: 1fr;
    }
}

/* v20260527-3: Useful page mobile fit */
.page-useful .main-content--guest {
    display: block;
    align-items: initial;
    justify-content: initial;
    padding-top: 1rem;
}

.useful-section,
.useful-weather,
.useful-fish-card,
.useful-holiday-card,
.useful-month-card,
.useful-section-head,
.useful-section-head > *,
.useful-weather-card {
    min-width: 0;
}

.useful-section-head h2,
.useful-fish-card p,
.useful-holiday-card span,
.useful-weather-day,
.useful-weather-desc,
.useful-weather-meta,
.useful-loading {
    overflow-wrap: anywhere;
}

.useful-date-line {
    flex-wrap: wrap;
    align-items: flex-start;
}

.useful-date-line span {
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 768px) {
    .is-auth .main-content {
        padding: 0.75rem 0.75rem 1rem;
    }

    .is-auth .site-footer {
        padding-inline: 0.75rem;
    }

    .footer-line {
        flex-wrap: wrap;
        white-space: normal;
        row-gap: 0.3rem;
        line-height: 1.35;
    }

    .footer-weather-button {
        max-width: calc(100vw - 2rem);
    }

    .footer-weather-value {
        min-width: 0;
        max-width: 13rem;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .weather-popover {
        left: auto;
        right: -0.35rem;
        width: min(340px, calc(100vw - 1rem));
        transform: none;
    }

    .weather-popover::after {
        left: auto;
        right: 1.4rem;
        transform: rotate(45deg);
    }

    .useful-section-head h2 {
        font-size: 1.12rem;
    }

    .useful-pill {
        width: fit-content;
        max-width: 100%;
        white-space: normal;
        text-align: center;
    }

    .useful-weather-list {
        grid-template-columns: 1fr;
    }

    .useful-weather-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 0.25rem 0.6rem;
        padding: 0.55rem 0.6rem;
    }

    .useful-weather-card strong {
        margin: 0;
        text-align: right;
        white-space: nowrap;
    }

    .useful-weather-desc,
    .useful-weather-meta {
        grid-column: 1 / -1;
    }

    .useful-weather-day {
        min-height: 0;
    }

    .useful-fish-card p {
        min-height: 0;
    }
}

@media (max-width: 520px) {
    .page-useful .main-content--guest,
    .is-auth .main-content {
        padding-inline: 0.55rem;
    }

    .page-hero {
        gap: 0.65rem;
        padding: 0.75rem;
        border-radius: 12px;
    }

    .page-hero .page-title {
        font-size: 1.12rem;
    }

    .page-hero p {
        font-size: 0.84rem;
        line-height: 1.35;
    }

    .useful-section {
        margin-top: 0.9rem;
    }

    .useful-weather,
    .useful-fish-card,
    .useful-holiday-card,
    .useful-month-card {
        box-shadow: 3px 3px 0 var(--ink);
    }

    .useful-holiday-panels,
    .useful-fishing-grid,
    .useful-year-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.6rem;
    }

    .useful-holiday-card li {
        grid-template-columns: 2.8rem minmax(0, 1fr);
        gap: 0.4rem;
        padding: 0.32rem;
    }

    .useful-month-card {
        padding: 0.55rem;
    }

    .useful-weekdays,
    .useful-days {
        gap: 0.14rem;
    }

    .useful-weekdays {
        font-size: 0.56rem;
    }

    .useful-date {
        border-width: 1px;
        border-radius: 5px;
        font-size: 0.66rem;
    }
}

@media (max-width: 360px) {
    .useful-holiday-card li {
        grid-template-columns: 1fr;
    }

    .useful-holiday-card time {
        width: fit-content;
    }

    .footer-weather-value {
        max-width: 10rem;
    }
}

/* v20260527-4: phone-safe weather sheet and menu */
@media (max-width: 768px) {
    .sidebar {
        max-width: min(82vw, 220px);
    }

    .weather-popover {
        position: fixed;
        left: max(0.55rem, env(safe-area-inset-left));
        right: max(0.55rem, env(safe-area-inset-right));
        bottom: calc(4.7rem + env(safe-area-inset-bottom));
        width: auto;
        max-width: none;
        max-height: min(62dvh, 520px);
        transform: none;
        padding: 0.6rem;
        border-radius: 14px;
        z-index: 400;
    }

    .weather-popover::after {
        display: none;
    }

    .weather-popover-head {
        position: sticky;
        top: -0.6rem;
        z-index: 1;
        margin: -0.6rem -0.6rem 0.5rem;
        padding: 0.6rem;
        background: var(--card);
        border-bottom: 2px solid rgba(17, 17, 17, 0.12);
    }

    .weather-popover-head strong,
    .weather-popover-head span {
        min-width: 0;
    }

    .weather-popover-head span {
        white-space: normal;
        text-align: right;
    }

    .weather-day-summary {
        margin-bottom: 0.5rem;
        padding: 0.32rem 0.45rem;
        line-height: 1.25;
    }

    .weather-hourly {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.35rem;
    }

    .weather-hour-card {
        padding: 0.4rem;
        box-shadow: 1.5px 1.5px 0 var(--ink);
    }

    .weather-hour-time {
        font-size: 0.64rem;
    }

    .weather-hour-card strong {
        font-size: 0.98rem;
    }

    .weather-hour-desc {
        font-size: 0.68rem;
        white-space: normal;
    }

    .weather-hour-meta {
        font-size: 0.62rem;
        overflow-wrap: anywhere;
    }

    body:has(.footer-weather.is-weather-open) {
        overflow-x: hidden;
    }
}

@media (max-width: 360px) {
    .weather-hourly {
        grid-template-columns: 1fr;
    }

    .weather-popover {
        bottom: calc(4.25rem + env(safe-area-inset-bottom));
        max-height: 58dvh;
    }
}

/* v20260527-5: mobile uses top menu only, clearer calendars */
.useful-month-card {
    background: #ffffff;
}

.useful-weekdays {
    color: rgba(17, 17, 17, 0.74);
}

.useful-date {
    background: #ffffff;
    border-color: rgba(17, 17, 17, 0.42);
    color: var(--ink);
    box-shadow: inset 0 0 0 999px rgba(255, 255, 255, 0.18);
}

.useful-date--state {
    background: #fda4af;
    box-shadow: inset 0 0 0 999px rgba(255, 255, 255, 0.05);
}

.useful-date--church {
    background: #dff7ff;
    box-shadow: inset 0 -5px 0 #7dd3fc;
}

.useful-date--fish {
    background: #ecfccb;
    outline-color: #65a30d;
}

/* v20260527-10: groups page and tighter sidebar */
.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 0.8rem;
}

.groups-admin-link {
    margin: -0.25rem 0 0.85rem;
}

.group-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0;
    border-left: 7px solid var(--ico-groups-bg);
}

.group-card--sky { border-left-color: var(--sky); }
.group-card--lime { border-left-color: var(--lime); }
.group-card--pink { border-left-color: var(--pink); }
.group-card--purple { border-left-color: #c4b5fd; }

.group-card-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.7rem;
}

.group-avatar {
    display: inline-grid;
    place-items: center;
    width: 3.1rem;
    height: 3.1rem;
    border: 2px solid var(--ink);
    border-radius: 12px;
    background: var(--ico-groups-bg);
    box-shadow: var(--shadow-sm);
}

.group-card-title {
    min-width: 0;
}

.group-card-title h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.1;
    text-transform: uppercase;
}

.group-card-title span {
    color: rgba(17, 17, 17, 0.62);
    font-size: 0.8rem;
    font-weight: 800;
}

.group-card p {
    margin: 0;
    color: rgba(17, 17, 17, 0.74);
    font-weight: 650;
    line-height: 1.35;
}

.group-card-foot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    margin-top: auto;
    padding-top: 0.7rem;
    border-top: 2px dashed rgba(17, 17, 17, 0.16);
}

.group-card-foot .btn {
    min-width: 8.5rem;
    text-align: center;
    justify-content: center;
}

.group-back {
    margin: -0.25rem 0 0.8rem;
}

.announcement-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0 0 0.85rem;
}

.announcement-category-field {
    display: grid;
    gap: 0.35rem;
    margin-bottom: 0.7rem;
    font-size: 0.82rem;
    font-weight: 900;
    text-transform: uppercase;
}

.announcement-category-field select {
    min-height: 2.6rem;
    border: 3px solid var(--ink);
    border-radius: 10px;
    background: var(--paper);
    color: var(--ink);
    padding: 0.45rem 0.75rem;
    font: inherit;
    font-weight: 800;
    box-shadow: var(--shadow-sm);
}

.announcement-badge {
    display: inline-flex;
    align-items: center;
    width: max-content;
    max-width: 100%;
    margin: 0.45rem 0 0.55rem;
    padding: 0.16rem 0.55rem;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--sky);
    box-shadow: 2px 2px 0 var(--ink);
    font-size: 0.78rem;
    font-weight: 900;
}

.group-empty-card {
    margin-top: 0;
}

.group-composer {
    margin-bottom: 1rem;
}

.group-posts {
    display: grid;
    gap: 0.75rem;
}

.admin-group-form {
    display: grid;
    gap: 0.75rem;
}

.admin-group-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.admin-group-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.8rem;
    align-items: center;
    border-left: 7px solid var(--lime);
}

.admin-group-item h2 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    text-transform: uppercase;
}

.admin-group-item p {
    margin: 0;
    color: rgba(17, 17, 17, 0.72);
    font-weight: 650;
}

.admin-group-item small {
    display: inline-block;
    margin-top: 0.4rem;
    color: rgba(17, 17, 17, 0.62);
    font-weight: 800;
}

.admin-group-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: flex-end;
}

.poll-admin-card,
.event-admin-card {
    margin-bottom: 1rem;
}

.poll-admin-card h2,
.event-admin-card h2 {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
    text-transform: uppercase;
}

.poll-admin-form,
.event-admin-form {
    display: grid;
    gap: 0.75rem;
}

.event-admin-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
}

.poll-list,
.event-list {
    display: grid;
    gap: 0.85rem;
}

.poll-card {
    display: grid;
    gap: 0.75rem;
}

.poll-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 0.75rem;
}

.poll-head h2 {
    margin: 0;
    font-size: 1.12rem;
    line-height: 1.2;
}

.poll-total,
.event-kind {
    display: inline-flex;
    width: max-content;
    max-width: 100%;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--paper);
    box-shadow: 2px 2px 0 var(--ink);
    font-size: 0.78rem;
    font-weight: 900;
    padding: 0.18rem 0.55rem;
}

.poll-options {
    display: grid;
    gap: 0.45rem;
}

.poll-option {
    position: relative;
    display: grid;
    grid-template-columns: 1.2rem minmax(0, 1fr);
    align-items: center;
    column-gap: 0.65rem;
    row-gap: 0.22rem;
    overflow: hidden;
    border: 2px solid var(--ink);
    border-radius: 10px;
    background: var(--paper);
    padding: 0.52rem 0.65rem;
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.poll-option input {
    position: relative;
    z-index: 2;
    width: 1.05rem;
    height: 1.05rem;
    margin: 0;
    accent-color: #8ee000;
    pointer-events: none;
}

.poll-option i {
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 0;
    background: rgba(211, 255, 126, 0.55);
    transition: width 0.2s ease;
}

.poll-option-main {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    font-weight: 850;
}

.poll-option-main span {
    min-width: 0;
}

.poll-option.is-selected,
.poll-option:has(input:checked) {
    border-color: #5f9900;
    background: #ecffb9;
    box-shadow: 3px 3px 0 var(--ink);
    transform: translate(-1px, -1px);
}

.poll-option.is-selected i,
.poll-option:has(input:checked) i {
    background: rgba(178, 255, 62, 0.72);
}

.poll-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.2rem;
}

.poll-delete {
    justify-self: end;
}

.event-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.8rem;
    align-items: start;
    border-left: 7px solid #bfdbfe;
}

.event-card--birthday { border-left-color: #f9a8d4; }
.event-card--holiday { border-left-color: #fde68a; }
.event-card--meeting { border-left-color: #c4b5fd; }
.event-card--fishing { border-left-color: #7dd3fc; }
.event-card--cleanup { border-left-color: #86efac; }
.event-card--concert { border-left-color: #fca5a5; }
.event-card--important { border-left-color: #93c5fd; }

.event-date {
    display: grid;
    place-items: center;
    min-width: 4.2rem;
    border: 3px solid var(--ink);
    border-radius: 10px;
    background: var(--lime);
    box-shadow: var(--shadow-sm);
    color: var(--ink);
    text-decoration: none;
    padding: 0.42rem 0.5rem;
}

.event-date strong {
    font-size: 1.45rem;
    line-height: 1;
}

.event-date span {
    font-size: 0.76rem;
    font-weight: 900;
}

.event-main {
    min-width: 0;
}

.event-main h2 {
    margin: 0.42rem 0 0.15rem;
    font-size: 1.08rem;
    line-height: 1.18;
}

.event-meta,
.event-desc {
    margin: 0;
    color: rgba(17, 17, 17, 0.72);
    font-weight: 700;
}

.event-desc {
    margin-top: 0.42rem;
}

.event-delete {
    align-self: center;
}

@media (max-width: 620px) {
    .admin-group-item {
        grid-template-columns: 1fr;
    }

    .admin-group-actions {
        justify-content: flex-start;
    }

    .event-admin-grid,
    .event-card {
        grid-template-columns: 1fr;
    }

    .poll-head,
    .poll-option-main {
        align-items: flex-start;
    }

    .event-delete,
    .poll-delete {
        justify-self: start;
    }
}

/* v20260528-4: clean tab headers */
.is-auth .page-hero > div > p {
    display: none !important;
}

.is-auth .page-hero {
    padding-block: 0.9rem;
}

.is-auth .page-hero .page-title {
    font-size: 1.5rem;
}

.sidebar-logo {
    padding: 0.8rem 0.9rem 0.55rem;
}

.sidebar-user {
    margin: 0 0.45rem 0.55rem;
    padding: 0.55rem;
}

.sidebar-nav {
    gap: 0.08rem;
    padding-inline: 0.45rem;
}

.sidebar-link {
    gap: 0.55rem;
    padding: 0.42rem 0.55rem;
    border-radius: 9px;
    font-size: 0.86rem;
}

.sidebar-icon {
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 7px;
}

.sidebar-player {
    margin: 0.35rem 0.45rem 0.45rem;
    padding: 0.45rem;
}

.player-head {
    margin-bottom: 0.35rem;
}

.player-controls {
    gap: 0.22rem;
}

.player-btn {
    height: 1.8rem;
    border-radius: 7px;
}

.player-progress {
    height: 0.36rem;
    margin-top: 0.35rem;
}

.sidebar-foot {
    padding: 0.4rem 0.45rem;
}

@media (max-height: 760px) and (min-width: 769px) {
    .sidebar-logo {
        padding-top: 0.55rem;
        padding-bottom: 0.35rem;
        font-size: 0.82rem;
    }

    .sidebar-user {
        margin-bottom: 0.35rem;
        padding: 0.42rem;
    }

    .sidebar-user .avatar-sm {
        width: 34px;
        height: 34px;
    }

    .sidebar-link {
        min-height: 2.18rem;
        padding-block: 0.28rem;
        font-size: 0.8rem;
    }

    .sidebar-icon {
        width: 1.65rem;
        height: 1.65rem;
    }

    .sidebar-player {
        padding: 0.36rem;
    }

    .player-icon {
        width: 1.45rem;
        height: 1.45rem;
    }

    .player-title {
        font-size: 0.68rem;
    }

    .player-btn {
        height: 1.55rem;
    }
}

@media (max-width: 768px) {
    .is-auth {
        padding-bottom: 0 !important;
    }

    .bottom-nav {
        display: none !important;
    }

    .scroll-top {
        bottom: calc(1rem + env(safe-area-inset-bottom));
    }

    .is-auth .scroll-top {
        bottom: calc(1rem + env(safe-area-inset-bottom));
    }

    .weather-popover {
        bottom: calc(1rem + env(safe-area-inset-bottom));
        max-height: min(70dvh, 560px);
    }
}

/* v20260527-6: solid weather popover */
.is-auth .footer-line > span:first-child,
.is-auth .footer-dot {
    color: rgba(17, 17, 17, 0.62);
}

.weather-popover,
.weather-popover * {
    opacity: 1;
}

.weather-hour-card {
    background: #ffffff;
}

.weather-hour-time,
.weather-hour-desc,
.weather-hour-meta,
.weather-popover-head span {
    color: rgba(17, 17, 17, 0.72);
}

.weather-hour-card strong,
.weather-popover-head strong {
    color: #111111;
}

.weather-day-summary {
    color: #111111;
}

.notification-list.page-list-card li,
.user-list.card li {
    border-radius: 10px;
}

.notification-list.page-list-card {
    padding: 0.55rem 0.65rem;
}

.notification-list.page-list-card li {
    min-height: auto;
    padding: 0.52rem 0.58rem;
    gap: 0.55rem;
}

.notification-list.page-list-card .avatar {
    width: 2rem;
    height: 2rem;
    flex: 0 0 2rem;
}

.notification-list.page-list-card li.unread {
    margin: 0;
    padding: 0.52rem 0.58rem;
    border: 2px solid var(--ink);
    box-shadow: 2px 2px 0 var(--ink);
}

.notification-list.page-list-card li + li,
.user-list.card li + li {
    margin-top: 0.35rem;
}

@media (max-width: 680px) {
    .notifications-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .notifications-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .is-auth .page-hero,
    .messages-head.page-hero,
    .online-page-head.page-hero,
    .search-panel {
        grid-template-columns: 1fr;
        justify-items: start;
    }

    .page-hero-icon {
        width: 2.75rem;
        height: 2.75rem;
    }

    .page-hero-count {
        justify-self: start;
    }
}

/* v20260603-4: keep the PWA install card in normal document flow. */
.install-card {
    display: block !important;
}

.install-card-main {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 1rem !important;
}

.install-card-copy,
.install-card h2,
.install-card p {
    min-width: 0 !important;
    max-width: none !important;
}

.install-card h2 {
    width: 100% !important;
}

.install-card-action {
    display: grid !important;
    position: relative !important;
    z-index: 2 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    margin-top: 0.9rem !important;
    justify-items: stretch !important;
}

.install-button {
    width: 100% !important;
    white-space: normal !important;
}

.install-hint {
    max-width: none !important;
    margin-top: 0.45rem !important;
    text-align: left !important;
}

.install-chips {
    margin-top: 0.85rem !important;
}

@media (max-width: 640px) {
    .install-card-main {
        grid-template-columns: 1fr !important;
    }
}

/* v20260612-2: unified information page cards. */
.info-card {
    position: relative !important;
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    gap: 1rem !important;
    align-items: start !important;
    margin-bottom: 1rem !important;
    overflow: hidden !important;
    background: #fff !important;
    border-left: 8px solid #d3ff7e !important;
}

.info-card::after,
.install-card::after,
.info-registered-card::after {
    display: none !important;
}

.info-card-icon,
.info-contact-icon,
.info-registered-icon {
    width: 4rem !important;
    height: 4rem !important;
    min-width: 4rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 3px solid #111 !important;
    border-radius: 18px !important;
    background: #d8fff5 !important;
    color: #0c7f70 !important;
    box-shadow: 6px 6px 0 #111 !important;
}

.info-card-main,
.info-contact-main,
.info-registered-main,
.install-card-copy {
    min-width: 0 !important;
    position: relative !important;
    z-index: 1 !important;
}

.info-card-kicker,
.info-contact-kicker,
.install-kicker,
.info-registered-label {
    display: block !important;
    margin: 0 0 0.35rem !important;
    color: var(--muted) !important;
    font-size: 0.86rem !important;
    font-weight: 800 !important;
    line-height: 1.1 !important;
    text-transform: uppercase !important;
}

.info-card h2,
.info-contact-main h2,
.info-purpose-card h2,
.install-card h2 {
    margin: 0 !important;
    max-width: 100% !important;
    font-size: clamp(1.35rem, 2.5vw, 1.75rem) !important;
    line-height: 1.08 !important;
    text-transform: uppercase !important;
}

.info-card p,
.info-contact-main p,
.install-card p {
    margin: 0.55rem 0 0 !important;
    max-width: 58rem !important;
    color: #343434 !important;
    line-height: 1.5 !important;
}

.info-card-number {
    display: block !important;
    margin: -0.1rem 0 0 !important;
    font-size: clamp(2.7rem, 6vw, 4.2rem) !important;
    line-height: 0.92 !important;
}

.info-card-text {
    display: block !important;
    margin-top: 0.25rem !important;
    font-weight: 800 !important;
}

.info-card--stats {
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    align-items: center !important;
}

.info-card-badge {
    align-self: center !important;
    justify-self: end !important;
    display: inline-flex !important;
    align-items: center !important;
    min-height: 2.5rem !important;
    padding: 0.35rem 1rem !important;
    border: 3px solid #111 !important;
    border-radius: 999px !important;
    background: #fff !important;
    box-shadow: 4px 4px 0 #111 !important;
    font-weight: 900 !important;
    white-space: nowrap !important;
}

.info-card-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.65rem !important;
    margin-top: 1rem !important;
}

.info-card .inline-form {
    margin: 0 !important;
}

.info-contact-card .info-card-actions,
.info-contact-card .inline-form,
.info-admin-button {
    width: 100% !important;
}

.info-admin-button {
    justify-content: center !important;
}

.info-purpose-text {
    margin-top: 0.7rem !important;
}

.info-purpose-text p + p {
    margin-top: 0.7rem !important;
}

.install-card {
    background: #fff !important;
}

.install-card-main {
    display: contents !important;
}

.install-app-icon {
    display: none !important;
}

.info-app-icon {
    background: #d3ff7e !important;
    color: #111 !important;
}

.info-app-icon em {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 2rem !important;
    height: 2.45rem !important;
    border: 3px solid #111 !important;
    border-radius: 8px !important;
    background: #d3ff7e !important;
    font-size: 1.5rem !important;
    font-style: normal !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    transform: rotate(-4deg) !important;
}

.install-chips {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
    margin-top: 0.85rem !important;
}

.install-chips span {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 2.05rem !important;
    padding: 0.25rem 0.75rem !important;
    border: 2px solid #111 !important;
    border-radius: 999px !important;
    background: #f5f1ff !important;
    box-shadow: 3px 3px 0 #111 !important;
    font-weight: 800 !important;
}

.install-card-action {
    width: 100% !important;
    margin-top: 1rem !important;
}

@media (max-width: 640px) {
    .info-card {
        grid-template-columns: 1fr !important;
        gap: 0.85rem !important;
        padding: 1rem !important;
    }

    .info-card-icon,
    .info-contact-icon,
    .info-registered-icon {
        width: 3.45rem !important;
        height: 3.45rem !important;
        min-width: 3.45rem !important;
        border-radius: 16px !important;
    }

    .info-card-badge {
        justify-self: start !important;
    }

    .info-card .btn {
        width: 100% !important;
        justify-content: center !important;
    }
}

/* v20260613-4: desktop day sidebar */
.is-auth .app-shell {
    width: calc(100% - 8rem);
    max-width: none;
    margin-inline: auto;
    align-items: stretch;
    gap: 1rem;
}

.is-auth .app-main {
    max-width: 760px;
    min-height: 100vh;
}

body:has(.quiz-layout) .app-main,
body:has(.games-grid) .app-main {
    max-width: 880px;
}

.day-sidebar {
    position: sticky;
    top: 0;
    flex: 0 0 270px;
    width: 270px;
    height: 100vh;
    padding: 1rem 0.65rem 1rem;
    overflow-y: auto;
    background: var(--card);
    border-left: var(--border);
    box-shadow: var(--shadow-sm);
}

.day-card {
    display: grid;
    gap: 0.55rem;
    margin: 0;
    padding: 0.8rem 0.55rem;
    border: 0;
    border-bottom: 2px dashed var(--line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.day-card--weather {
    margin-bottom: 0.35rem;
    padding: 0.8rem;
    border: 3px solid var(--ink);
    border-radius: 12px;
    background: var(--lime);
    box-shadow: var(--shadow-sm);
}

.day-card-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.55rem;
    align-items: center;
}

.day-card-head--plain {
    grid-template-columns: minmax(0, 1fr);
}

.day-card-head p,
.day-card-head h2,
.day-list,
.day-list li,
.day-empty,
.day-feature,
.day-weather-value {
    min-width: 0;
    overflow-wrap: anywhere;
}

.day-card-head p {
    margin: 0 0 0.08rem;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
}

.day-card-head h2 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.05;
    text-transform: uppercase;
}

.day-card-icon {
    display: inline-grid;
    place-items: center;
    width: 2.35rem;
    height: 2.35rem;
    border: 2px solid var(--ink);
    border-radius: 9px;
    background: #dbeafe;
    color: #2563eb;
    box-shadow: 3px 3px 0 var(--ink);
}

.day-card-icon--calendar { background: #dbeafe; color: #2563eb; }
.day-card-icon--birthday { background: #fce7f3; color: #db2777; }
.day-card-icon--holiday { background: #fef3c7; color: #ca8a04; }
.day-card-icon--next { background: #dcfce7; color: #16a34a; }

.day-weather-value,
.day-feature {
    display: block;
    padding: 0.55rem 0.65rem;
    border: 2px solid var(--ink);
    border-radius: 10px;
    background: #fff;
    font-weight: 900;
    line-height: 1.25;
}

.day-list {
    display: grid;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.day-list li {
    display: grid;
    gap: 0.1rem;
    padding: 0.48rem 0.55rem;
    border: 2px solid var(--ink);
    border-radius: 9px;
    background: #fff;
}

.day-list span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 850;
}

.day-list strong {
    font-size: 0.86rem;
    line-height: 1.18;
}

.day-empty {
    margin: 0;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 750;
    line-height: 1.25;
}

.day-card-link {
    width: fit-content;
    color: var(--ink);
    font-weight: 900;
    font-size: 0.82rem;
}

.day-card-link--button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 2.25rem;
    border: 2px solid var(--ink);
    border-radius: 10px;
    background: var(--lime);
    box-shadow: 3px 3px 0 var(--ink);
    text-decoration: none;
}

@media (max-width: 1180px) {
    .is-auth .app-shell {
        width: 100%;
        max-width: 980px;
        gap: 0;
    }

    .day-sidebar {
        display: none;
    }

    .is-auth .app-main,
    body:has(.quiz-layout) .app-main,
    body:has(.games-grid) .app-main {
        max-width: none;
    }
}
