:root {
    color-scheme: light;
    --bg: #f6f1ea;
    --surface: #fffdf8;
    --text: #241f1a;
    --muted: #746b62;
    --line: #e6ddd2;
    --accent: #e9897c;
    --tertiary: #7f7ce9;
    --chip: #e9897c;
    --ink: #2a241e;
    --card: #f6f1e8;
    --danger: #b42318;
    font-family: "Livvic", Nunito, "Avenir Next", "Segoe UI", "Noto Sans", sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --bg: #161311;
        --surface: #241f1b;
        --text: #f6f1ea;
        --muted: #b7aea4;
        --line: #3c342e;
        --danger: #ffb4ab;
    }
}

* { box-sizing: border-box; }

html, body, #root {
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    overflow: hidden;
}

body {
    background: #1c1916;
    color: var(--text);
    overscroll-behavior: none;
}

button, input, textarea, select { font: inherit; }

button { cursor: pointer; }

[hidden] { display: none !important; }

#root {
    height: 100%;
    min-height: 0;
}

.boot {
    min-height: 100%;
    height: 100%;
    display: grid;
    place-items: center;
}

.spinner { display: block; }

.shell {
    width: min(100%, 800px);
    height: 100%;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    background: #111;
}

@media (min-width: 540px) {
    .shell {
        box-shadow: 0 0 80px rgba(0, 0, 0, .4);
    }
}

.page-shell {
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
}

.page-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    padding: calc(12px + env(safe-area-inset-top)) 14px 8px;
    z-index: 4;
    background: var(--bg);
}

.page-head h1 {
    flex: 1;
    margin: 0;
    font-size: 22px;
    letter-spacing: -0.03em;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.page-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 8px 18px 108px;
}

.icon-btn, .profile-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    display: grid;
    place-items: center;
    position: relative;
    padding: 0;
    overflow: visible;
    flex: 0 0 auto;
}

.icon-btn svg {
    width: 20px;
    height: 20px;
    display: block;
}

.page-shell .icon-btn, .page-shell .profile-btn {
    border-color: var(--line);
    background: var(--surface);
    color: var(--text);
}

.profile-btn {
    border: 0;
    box-shadow: 0 0 0 2px #fff;
}

.page-shell .profile-btn {
    box-shadow: 0 0 0 2px var(--line);
}

.page-head.has-profile {
    position: relative;
    padding-right: 70px;
}

.top-actions {
    position: absolute;
    right: 16px;
    top: calc(12px + env(safe-area-inset-top));
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
    z-index: 6;
}

.topbar .profile-btn {
    position: relative;
    right: auto;
    top: auto;
    width: 44px;
    height: 44px;
    box-shadow: 0 0 0 2px #fff;
}

.page-head .profile-btn {
    position: absolute;
    right: 16px;
    top: calc(12px + env(safe-area-inset-top));
    width: 44px;
    height: 44px;
    box-shadow: 0 0 0 2px #fff;
}

.profile-btn .face, .profile-btn img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.plus-mark, .plus-badge {
    font-weight: 800;
    line-height: 1;
}

.plus-mark { font-size: 28px; }

.plus-badge {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    color: #222;
    font-size: 14px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}

.sparkles {
    position: absolute;
    inset: -18px;
    z-index: 4;
    pointer-events: none;
}

.spark {
    position: absolute;
    background: #fff;
    clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
    filter: drop-shadow(0 0 5px #fff6c8);
    animation: sparkle 1.5s ease-in-out infinite;
}

.spark.s1 { width: 14px; height: 14px; top: 2px; right: 8px; }
.spark.s2 { width: 8px; height: 8px; top: 16px; left: -2px; animation-delay: .2s; }
.spark.s3 { width: 16px; height: 16px; right: -8px; bottom: 6px; animation-delay: .45s; }
.spark.s4 { width: 7px; height: 7px; top: -6px; left: 16px; animation-delay: .7s; }
.spark.s5 { width: 10px; height: 10px; left: 6px; bottom: -8px; animation-delay: .95s; }
.spark.s6 { width: 6px; height: 6px; top: 22px; right: -6px; animation-delay: 1.15s; }

@keyframes sparkle {
    0%, 100% { transform: scale(.25) rotate(0deg); opacity: .15; }
    45% { transform: scale(1) rotate(18deg); opacity: 1; }
    70% { transform: scale(.55) rotate(-8deg); opacity: .7; }
}

.first-post-bubble {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: max-content;
    max-width: min(220px, calc(100vw - 40px));
    padding: 8px 12px;
    border-radius: 16px;
    background: #fff;
    color: #241f1a;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.25;
    text-align: right;
    white-space: nowrap;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .22);
    z-index: 5;
    animation: bubble-bob 1.6s ease-in-out infinite;
}

.first-post-bubble::after {
    content: "";
    position: absolute;
    top: -5px;
    right: 16px;
    width: 10px;
    height: 10px;
    background: #fff;
    transform: rotate(45deg);
    border-radius: 2px;
}

@keyframes bubble-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(7px); }
}

.stage {
    position: absolute;
    inset: 0;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.swipe-hint {
    position: absolute;
    inset: 0;
    z-index: 7;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    pointer-events: none;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .55);
    animation: swipe-hint-flash .55s ease-in-out 2 forwards;
}

.swipe-hint-arrow {
    font-size: 64px;
    line-height: 1;
    font-weight: 700;
}

.swipe-hint-text {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

@keyframes swipe-hint-flash {
    0%, 100% { opacity: 0; }
    40%, 60% { opacity: 1; }
}

.slide, .photo { position: absolute; inset: 0; }

.photo {
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.photo-track {
    display: flex;
    height: 100%;
    width: 100%;
    will-change: transform;
}

.photo-frame {
    flex: 0 0 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 6;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: calc(16px + env(safe-area-inset-top)) 16px 8px;
    pointer-events: none;
}

.topbar .profile-btn,
.topbar .notify-btn { pointer-events: auto; }

.feed-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: calc(100% - 10rem);
    min-width: 0;
}

.location {
    color: #fff;
    font-weight: 800;
    font-size: 22px;
    font-family: inherit;
    letter-spacing: -0.03em;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .85), 0 1px 8px rgba(0, 0, 0, .45);
    text-align: center;
    background: none;
    border: 0;
    padding: 0 4px;
    cursor: pointer;
    pointer-events: auto;
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feed-app-name {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    opacity: .82;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .85), 0 1px 8px rgba(0, 0, 0, .45);
    margin-top: 2px;
    padding: 0 4px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 539px) {
    .topbar {
        justify-content: flex-start;
    }

    .feed-brand {
        align-items: flex-start;
        width: 100%;
        max-width: none;
    }

    .location,
    .feed-app-name {
        text-align: left;
        padding-left: 0;
        max-width: calc(100% - 10rem);
    }
}

.card-stack {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 4;
    transition: opacity .18s ease;
}

.slide.peeking .card-stack {
    opacity: 0;
    pointer-events: none;
}

.card {
    position: relative;
    z-index: 1;
    margin: 0 14px;
    background: var(--card);
    color: var(--ink);
    border-radius: 22px;
    padding: 28px 16px 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .18);
    min-height: 148px;
}

.name-chip {
    position: absolute;
    top: -16px;
    left: 16px;
    background: linear-gradient(to bottom right, color-mix(in srgb, white 35%, var(--accent)), var(--tertiary));
    color: #fff;
    font-weight: 800;
    border: 0;
    border-radius: 999px;
    padding: 6px 16px;
    font-size: 20px;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: calc(100% - 32px);
    cursor: pointer;
    box-shadow: 2px 2px 0 0 #00000024;
}

.name-chip.has-face { padding: 4px 14px 4px 4px; }

.name-chip .name-face {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background: #d9d0c6;
    flex: 0 0 auto;
}

.name-chip > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message {
    margin: 4px 0 8px 0;
    min-height: 1.8em;
    font-size: 20px;
    line-height: 1.35;
    font-weight: 700;
}

.message-time {
    margin-left: 0.4em;
    opacity: 0.5;
    font-weight: 600;
    white-space: nowrap;
}

.message-star {
    margin-left: 0.4em;
    text-shadow: 0 0 2px #0008;
}

.see-more-ellipsis,
.see-more {
    display: none;
}

.message.ready {
    cursor: pointer;
}

.message.ready .see-more-ellipsis,
.message.ready .see-more {
    display: inline;
}

.see-more {
    margin-left: 0.35em;
    border: 0;
    padding: 0;
    background: none;
    color: var(--muted);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.post-sheet-body {
    overflow: auto;
    min-height: 120px;
    max-height: 70vh;
    padding: 0 16px 20px;
    display: grid;
    gap: 4px;
}

.post-sheet-message {
    margin: 0 0 8px;
    font-size: 20px;
    line-height: 1.35;
    font-weight: 700;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.play {
    position: absolute;
    right: 14px;
    bottom: 74px;
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    display: grid;
    place-items: center;
    padding: 0;
}

.card-actions {
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    gap: 8px;
}

.reply {
    width: 100%;
    border: 0;
    border-radius: 12px;
    background: #fff;
    color: #b0a89e;
    text-align: left;
    padding: 14px 16px;
    font-size: 16px;
    border: 1px solid var(--line);
}

.share-btn {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--accent);
    display: grid;
    place-items: center;
    padding: 0 10px;
}

.share-btn svg {
    width: 22px;
    height: 22px;
    display: block;
}

.avatar {
    position: absolute;
    right: 14px;
    bottom: 100%;
    z-index: 0;
    height: min(36vh, 360px);
    width: auto;
    max-width: 68%;
    object-fit: contain;
    object-position: right bottom;
    pointer-events: none;
    opacity: 0;
    transform: translateY(calc(20% + var(--avatar-enter, 50px)));
    filter: drop-shadow(0 12px 16px rgba(0, 0, 0, .28));
    transition: opacity 480ms ease, transform 520ms cubic-bezier(.2, .7, .2, 1);
}

.avatar.shown {
    opacity: 1;
    transform: translateY(20%);
}

.empty {
    min-height: 70%;
    display: grid;
    place-items: center;
    align-content: center;
    text-align: center;
    color: #fff;
    padding: 24px;
}

.page-shell .empty { color: var(--text); }

.empty h2 { margin: 0 0 8px; }

.field, .studio { display: grid; gap: 6px; margin: 14px 0; }

.field span, h3 { font-weight: 800; }

h3 { margin: 22px 0 8px; }

input, textarea, select {
    width: 100%;
    border: 2px solid var(--line);
    background: var(--surface);
    color: var(--text);
    border-radius: 14px;
    padding: 12px 14px;
}

textarea { min-height: 110px; resize: vertical; }

small, .hint { color: var(--muted); font-size: 13px; }

.primary, .secondary, .plus-fab {
    border: 0;
    border-radius: 999px;
    font-weight: 800;
}

.primary:disabled {
    opacity: .45;
    cursor: default;
}

.primary, .secondary {
        background: linear-gradient(to bottom right, color-mix(in srgb, white 35%, var(--accent)), var(--tertiary));
    color: #fff;
    padding: 14px 18px;
    box-shadow: 0 0 2px 2px rgba(255, 255, 255, .5) inset;
    padding: 14px 18px;
}

.secondary { background: linear-gradient(to bottom right, color-mix(in srgb, white 35%, #f6f1ea), color-mix(in srgb, white 65%, #7f7ce9)); }

@media (prefers-color-scheme: dark) {
    .secondary { linear-gradient(to bottom right, color-mix(in srgb, white 35%, #f6f1ea), color-mix(in srgb, white 65%, #7f7ce9)); color: #1c1916; }
}

.text-button {
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 10px;
    width: 100%;
}

.danger { color: var(--danger); }

.form-error { color: var(--danger); margin: 8px 0; font-weight: 700; }

.dialog-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 16, 12, .46);
    display: flex;
    align-items: safe center;
    justify-content: safe center;
    padding: 20px;
    overflow: auto;
    z-index: 8;
    backdrop-filter: blur(2px);
    transition: bottom .18s ease;
}

.dialog-backdrop.stacked,
.confirm-backdrop {
    z-index: 10;
}

.dialog {
    width: min(100%, 380px);
    background: var(--surface);
    color: var(--text);
    border-radius: 22px;
    padding: 22px 18px 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .28);
}

.dialog h2 { margin: 0 0 8px; text-align: center; }

.dialog h3 { margin: 14px 0 8px; text-align: left; }

.dialog h2 + h3 { margin-top: 4px; }

.dialog.mini-profile,
.profile-sheet-head {
    width: 100%;
    text-align: center;
    display: grid;
    justify-items: center;
    gap: 8px;
}

.dialog.visitor-welcome {
    text-align: center;
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 28px 22px 16px;
}

.visitor-welcome-emojis {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 8px;
    height: 76px;
    font-size: 54px;
    line-height: 1;
}

.visitor-welcome-emojis span {
    display: inline-block;
    transform-origin: 50% 80%;
    animation: float-bob 2.6s ease-in-out infinite;
}

.visitor-welcome-emojis .bob-1 { animation-delay: 0s; }
.visitor-welcome-emojis .bob-2 { animation-delay: .28s; font-size: 62px; }
.visitor-welcome-emojis .bob-3 { animation-delay: .56s; }

.visitor-welcome-text {
    margin: 4px 0 8px;
    font-size: 17px;
    font-weight: 500;
    line-height: 1.45;
    white-space: pre-wrap;
}

@keyframes float-bob {
    0%, 100% { transform: translate3d(0, 4px, 0) rotate(-6deg); }
    50% { transform: translate3d(0, -12px, 0) rotate(6deg); }
}

@media (prefers-reduced-motion: reduce) {
    .visitor-welcome-emojis span { animation: none; }
}

.mini-profile h2 { margin: 4px 0 0; }

.mini-profile-location {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.mini-profile-intro {
    margin: 4px 0 8px;
    white-space: pre-wrap;
    line-height: 1.45;
}

.dialog .primary, .dialog .secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 8px auto 0;
    text-align: center;
}

.profile-upload {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--text);
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 8px 0 4px;
}

.face {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    display: grid;
    place-items: center;
    background-color: #d9d0c6;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #2a241e;
    font-weight: 800;
    overflow: hidden;
    flex: 0 0 auto;
    aspect-ratio: 1;
    box-sizing: border-box;
}

.face.large { width: 96px; height: 96px; font-size: 32px; }

.upload {
    width: min(100%, 220px);
    aspect-ratio: 9 / 16;
    margin: 8px auto 16px;
    border-radius: 18px;
    border: 2px dashed var(--line);
    background: var(--surface);
    overflow: hidden;
    display: grid;
    place-items: center;
    position: relative;
    color: var(--muted);
    padding: 0;
}

.composer-photo-stage {
    position: relative;
    width: min(100%, 220px);
    margin: 8px auto 16px;
}

.composer-photo-stage .upload {
    width: 100%;
    margin: 0;
}

.composer-photo-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 36px;
    height: 36px;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

.upload-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
}

.composer-photos {
    display: grid;
    justify-items: center;
}

.photo-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    width: min(100%, 220px);
    margin: -4px auto 16px;
    padding-bottom: 8px;
}

.photo-thumbs.reordering {
    touch-action: none;
}

.photo-thumbs.reordering .photo-thumb {
    transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.photo-thumb {
    width: 40px;
    height: 71px;
    flex: 0 0 auto;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    padding: 0;
    background: var(--surface);
    position: relative;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    cursor: grab;
}

.photo-thumb.selected { border-color: var(--accent); }

.photo-thumb.ghost {
    display: grid;
    place-items: center;
    border: 2px dashed var(--line);
    background: transparent;
    color: var(--muted);
    font-size: 22px;
    font-weight: 200;
    line-height: 1;
    cursor: pointer;
}

.photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    -webkit-user-drag: none;
}

.photo-thumb.photo-ghost {
    opacity: 0.4;
    cursor: grabbing;
}

.photo-thumb.lifting {
    z-index: 40;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .28);
    cursor: grabbing;
    overflow: hidden;
}

.avatar-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.avatar-choice, .avatar-tile {
    width: 92px;
    height: 124px;
    flex: 0 0 auto;
    border-radius: 16px;
    border: 2px solid transparent;
    background: transparent;
    padding: 0;
    overflow: hidden;
    color: var(--ink);
}

.avatar-tile {
    width: 148px;
    height: auto;
    min-height: 148px;
    display: grid;
    align-content: end;
    gap: 6px;
    padding: 8px;
    font-size: 12px;
    background: var(--surface);
    color: var(--text);
    border-color: var(--line);
}

.avatar-choice.selected { border-color: var(--accent); }

.avatar-choice.none {
    display: grid;
    place-items: center;
    border: 2px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.avatar-choice.none.selected {
    border-color: var(--accent);
    color: var(--accent);
}

.avatar-choice.ghost {
    display: grid;
    place-items: center;
    border: 2px dashed var(--line);
    background: transparent;
    color: var(--muted);
    font-size: 40px;
    font-weight: 200;
    line-height: 1;
}

.avatar-choice.ghost.open {
    border-color: var(--accent);
    color: var(--accent);
}

.avatar-choice.generating {
    display: grid;
    place-items: center;
    border-color: var(--line);
    background: var(--surface);
}

.avatar-choice.generating .avatar-spinner {
    margin: 0;
}

.avatar-choice img, .avatar-tile img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.avatar-tile img {
    height: 96px;
    border-radius: 10px;
    background: transparent;
}

.avatar-state, .avatar-tile small { display: block; line-height: 1.3; }

.avatar-actions { display: flex; gap: 4px; flex-wrap: wrap; }

.tiny {
    border: 0;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 800;
    background: var(--bg);
    color: var(--text);
}

.tiny.danger, .primary.danger { background: var(--danger); color: #fff; }

.dialog-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 12px;
}

.dock {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    height: calc(78px + env(safe-area-inset-bottom));
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 18px calc(12px + env(safe-area-inset-bottom));
    pointer-events: none;
    background: linear-gradient(to top, var(--bg) 62%, transparent);
}

.dock .plus-fab, .dock .primary { pointer-events: auto; }

.plus-fab {
    width: 56px;
    height: 56px;
    background: #2a241e;
    color: #fff;
    font-size: 32px;
    line-height: 1;
}

@media (prefers-color-scheme: dark) {
    .plus-fab { background: #f6f1ea; color: #1c1916; }
}

.dock-wide .primary {
    width: 100%;
    flex: 1 1 auto;
    text-align: center;
}

.toast {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: calc(24px + env(safe-area-inset-bottom));
    z-index: 12;
    background: #2a241e;
    color: #fff;
    border-radius: 14px;
    padding: 12px 14px;
    text-align: center;
}

.initial { font-size: 16px; }

.edit-badge {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(to bottom right, color-mix(in srgb, white 35%, var(--accent)), var(--tertiary));
    color: #fff;
    display: grid;
    place-items: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}

.edit-badge svg { display: block; }

.avatar-spinner {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid var(--line);
    border-top-color: var(--accent);
    animation: spin .8s linear infinite;
    display: block;
    margin: 8px auto;
}

button.busy {
    display: grid;
    place-items: center;
    min-height: 48px;
}

button.busy .avatar-spinner {
    width: 18px;
    height: 18px;
    margin: 0;
    border-width: 2px;
}

.avatar-tile.generating {
    justify-items: center;
    align-content: center;
}

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

.avatar-nudge {
    margin: 28px 8px 8px;
    text-align: center;
    font-weight: 800;
    font-size: 18px;
    line-height: 1.4;
}

.profile-arrow {
    position: absolute;
    top: calc(50px + env(safe-area-inset-top));
    right: 24px;
    width: 76px;
    height: 108px;
    color: var(--accent);
    pointer-events: none;
    z-index: 7;
    animation: point-bob 1.15s ease-in-out infinite;
}

.profile-arrow svg { display: block; width: 100%; height: 100%; }

@keyframes point-bob {
    0%, 100% { transform: translate(-8px, 8px); }
    50% { transform: translate(8px, -8px); }
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 22px;
}

.section-head h3 { margin: 0; }

.see-all {
    border: 0;
    background: transparent;
    color: var(--accent);
    font-weight: 800;
    padding: 8px 0;
    flex: 0 0 auto;
}

.own-post {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    align-items: start;
    margin: 8px 0;
    border: 2px solid var(--line);
    background: var(--surface);
    border-radius: 16px;
    padding: 8px;
}

.own-post-photo {
    width: 72px;
    height: 96px;
    object-fit: cover;
    border-radius: 12px;
    background: var(--line);
}

.own-post-message {
    margin: 0;
    font-weight: 700;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.own-post-location {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.own-post-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.own-post-music {
    margin: 4px 0 0;
    font-weight: 700;
    font-size: 13px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.own-post-community {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 6px 0 0;
}

.own-post-community .community-chip {
    margin: 0;
    font-size: 13px;
    padding: 4px 10px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.own-post-community-only {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}

.post-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin: 6px 0 8px;
    color: var(--muted);
    font-size: 13px;
}

.post-stats b {
    color: var(--text);
    margin-right: 4px;
}

.share-panel {
    width: min(100%, 440px);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.share-preview {
    width: min(100%, 440px, max(180px, calc(100dvh - 330px)));
    aspect-ratio: 1;
    align-self: center;
    border-radius: 18px;
    overflow: hidden;
    background: #1c1916;
    display: grid;
    place-items: center;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .28);
}

.share-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.share-error {
    color: #fff;
    margin: 0 16px;
    text-align: center;
    font-weight: 700;
}

.share-panel .primary,
.share-panel .secondary,
.share-panel .text-button {
    width: 100%;
    margin: 0;
}

.share-panel .primary,
.share-panel .secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.share-sheet .text-button {
    color: #fff;
    font-weight: 800;
}

.share-panel button:disabled {
    opacity: .5;
    cursor: default;
}

.stats-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-bottom: 32px;
}

.stats-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}

.stats-live i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3cb371;
    box-shadow: 0 0 0 0 rgba(60, 179, 113, .7);
    animation: stats-pulse 1.6s infinite;
}

@keyframes stats-pulse {
    70% { box-shadow: 0 0 0 8px rgba(60, 179, 113, 0); }
}

.stats-hint {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.stats-ranges {
    display: flex;
    gap: 8px;
}

.stats-ranges button {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    border-radius: 999px;
    padding: 6px 12px;
    font-weight: 700;
    font-size: 13px;
}

.stats-ranges button.active {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

.stats-chart {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 10px 8px 8px;
}

.stats-svg {
    width: 100%;
    height: 240px;
    display: block;
}

.stats-grid {
    stroke: var(--line);
    stroke-width: 1;
}

.stats-axis {
    fill: var(--muted);
    font-size: 9px;
}

.stats-hover-line,
.stats-hover-dot {
    display: none;
    pointer-events: none;
}

.stats-chart.is-hovering .stats-hover-line,
.stats-chart.is-hovering .stats-hover-dot {
    display: unset;
}

.stats-hover-line {
    stroke: var(--text);
    stroke-width: 1;
    stroke-dasharray: 3 3;
    opacity: .35;
}

.stats-tooltip {
    position: absolute;
    top: 12px;
    pointer-events: none;
    background: var(--ink);
    color: #fff;
    font-size: 12px;
    padding: 8px 10px;
    border-radius: 10px;
    min-width: 150px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
    z-index: 2;
}

.stats-tooltip strong {
    display: block;
    margin-bottom: 6px;
}

.stats-tip-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
}

.stats-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stats-legend button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
}

.stats-legend button.off {
    opacity: .4;
}

.swatch {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    background: var(--accent);
}

.stats-today-title {
    margin: 8px 0 0;
    font-size: 16px;
}

.stats-today {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.stats-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px 12px;
}

.stats-card small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.stats-card b {
    font-size: 22px;
    letter-spacing: -0.03em;
}

.stats-error {
    margin: 12px;
    color: var(--muted);
    text-align: center;
}

.music-search { margin: 0 0 8px; }

.music-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    align-items: center;
}

.music-results { display: contents; }

.music-choice-wrap {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
    height: 44px;
    border-radius: 999px;
    border: 2px solid var(--line);
    background: var(--surface);
    padding: 2px 6px 2px 2px;
}

.music-choice-wrap.selected, .music-choice.selected { border-color: var(--accent); }

.music-choice {
    display: inline-flex;
    align-items: center;
    border: 0;
    background: transparent;
    color: var(--text);
    font-weight: 800;
    font-size: 13px;
    line-height: 1;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 10px;
    flex-shrink: 0;
}

.music-choice-wrap .music-choice {
    height: 100%;
}

.music-choice-wrap .tiny {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.music-row > .music-choice:not(.ghost) {
    height: 44px;
    border: 2px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
}

.music-row > .music-choice.selected { border-color: var(--accent); }

.music-choice.ghost {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    max-width: none;
    border-radius: 50%;
    border: 2px dashed var(--line);
    background: transparent;
    color: var(--muted);
    font-size: 28px;
    font-weight: 200;
    line-height: 1;
    padding: 0;
}

.music-choice.ghost.open {
    border-color: var(--accent);
    color: var(--accent);
}

.chip-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 8px 0;
    align-items: center;
}

.chip {
    border: 2px solid var(--line);
    background: var(--surface);
    color: var(--text);
    border-radius: 999px;
    padding: 8px 14px;.
    font-weight: 800;
}

.chip.selected {
    border-color: var(--text);
    background: linear-gradient(to bottom right, color-mix(in srgb, white 35%, var(--accent)), var(--tertiary));
    box-shadow: 0 0 0 2px color-mix(in srgb, transparent 85%, var(--text)) inset;
    color: #fff;
}

.chip:disabled { opacity: .4; }

.check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    margin: 8px 0;
}

.chip-row .check-row { margin: 0; }

.check-row input { width: auto; }

.music-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    min-width: 0;
}

.slide-meta {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 100%;
    z-index: 2;
    margin: 0 0 28px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .85), 0 1px 8px rgba(0, 0, 0, .45);
}

.slide-meta .music-line {
    margin: 0;
    color: inherit;
    text-shadow: inherit;
}

.slide-meta .mute-btn { color: #fff; }

.photo-dots {
    display: flex;
    justify-content: center;
    gap: 5px;
}

.photo-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, .4);
    transition: background-color .125s ease-out, scale .125s ease-out;
}

.photo-dot.on {
    background-color: rgba(255, 255, 255, 1);
    scale: 1.2;
}

.music-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
    font-size: 14px;
}

.mute-btn {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    font-size: 18px;
    line-height: 1;
    padding: 4px;
    color: var(--ink);
}

.music-tile {
    display: grid;
    gap: 6px;
    padding: 12px;
    border-radius: 16px;
    border: 2px solid var(--line);
    background: var(--surface);
    margin-bottom: 8px;
}

.music-lyrics {
    margin: 4px 0 0;
    white-space: pre-wrap;
    font-size: 13px;
    line-height: 1.4;
    color: var(--muted);
    font-family: inherit;
}

.auth-dialog { z-index: 12; }

.notify-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    display: grid;
    place-items: center;
    position: relative;
    padding: 0;
}

.notify-btn:hover {
    background: rgba(255, 255, 255, .24);
}

.notify-btn svg {
    width: 22px;
    height: 22px;
}

.notify-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #e23d2e;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    display: grid;
    place-items: center;
    box-shadow: 0 0 0 2px #fff;
}

.notify-dialog {
    width: min(100%, 420px);
    max-height: min(72vh, 560px);
    display: flex;
    flex-direction: column;
}

.notify-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.notify-head h2 {
    margin: 0;
    text-align: left;
    flex: 1;
}

.notify-head .mark-all-read {
    width: auto;
    padding: 8px 0;
    color: var(--accent);
    font-weight: 800;
}

.notify-list {
    overflow: auto;
    display: grid;
    gap: 8px;
    margin: 8px 0 12px;
    min-height: 80px;
}

.notify-item {
    display: grid;
    gap: 2px;
    text-align: left;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    border-radius: 14px;
    padding: 12px;
}

.notify-item.unread {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

.notify-item strong { font-size: 14px; }
.notify-item span { color: var(--muted); font-size: 13px; }
.notify-item em { font-style: normal; color: var(--muted); font-size: 12px; }

.collapsed-chat {
    display: grid;
    gap: 8px;
    overflow-x: auto;
}

.collapsed-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--ink);
    text-align: left;
    padding: 0;
    font-size: 13px;
    font-weight: 700;
    min-height: 20px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.collapsed-face {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    overflow: hidden;
    background: #d9d0c6;
    color: #2a241e;
    font-size: 10px;
    font-weight: 800;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    opacity: 1;
    transition: opacity .18s ease;
}

.collapsed-face img {
    width: 18px;
    height: 18px;
    object-fit: cover;
    display: block;
}

.collapsed-preview-text {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 1;
    transition: opacity .18s ease;
}

.collapsed-preview-text span {
    font-weight: 400;
}

.comment-count {
    flex: 0 0 auto;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    display: grid;
    place-items: center;
}

.comment-count:empty { display: none; }

.quick-replies {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 1px 0;
}

.quick-replies::-webkit-scrollbar { display: none; }

.quick-chip {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.comment-input {
    flex: 1 1 auto;
    min-width: 0;
    width: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: #b0a89e;
    text-align: left;
    padding: 12px 14px;
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.zalo-btn {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--accent);
    display: grid;
    place-items: center;
    padding: 0 10px;
}

.zalo-btn svg,
.share-btn svg {
    width: 22px;
    height: 22px;
}

.comment-backdrop {
    align-items: flex-end;
    padding: 0;
    overflow: hidden;
    overscroll-behavior: none;
}

.comment-sheet {
    width: 100%;
    max-height: min(88vh, 760px);
    background: var(--surface);
    color: var(--text);
    border-radius: 22px 22px 0 0;
    display: flex;
    flex-direction: column;
    transform: translate3d(0, 100%, 0);
    transition: transform .28s cubic-bezier(.2, .8, .2, 1), bottom .18s ease;
    padding-bottom: env(safe-area-inset-bottom);
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.comment-sheet.open { transform: translate3d(0, 0, 0); }

.location-sheet,
.profile-sheet,
.members-sheet {
    max-height: min(92vh, 860px);
}

.location-sheet .comment-bar h2,
.profile-sheet .comment-bar h2,
.members-sheet .comment-bar h2 {
    max-width: calc(100% - 72px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.location-sheet-body,
.profile-sheet-body,
.members-sheet-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 8px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.location-sheet-map {
    width: 100%;
    aspect-ratio: 16 / 10;
    min-height: 160px;
    max-height: 220px;
    border-radius: 18px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    flex: 0 0 auto;
}

.profile-sheet-actions { display: flex; align-items: center; gap: 12px; width: 100%; }
.profile-sheet-actions .profile-sheet-message { width: auto; flex: 1 1 auto; min-width: 0; }
.profile-sheet-add-to-group { flex: 0 0 44px; color: var(--text); border-color: var(--line); background: var(--surface); }
.profile-sheet-add-to-group svg { width: 22px; height: 22px; }

.profile-sheet-message,
.profile-sheet-copy-link {
    width: 100%;
    flex: 0 0 auto;
}

.location-sheet-actions { display: flex; align-items: center; gap: 12px; }
.location-sheet-actions .location-sheet-directions { flex: 1 1 auto; min-width: 0; }
.location-sheet-copy-link { flex: 0 0 44px; color: var(--text); border-color: var(--line); background: var(--surface); }

.location-sheet-count,
.profile-sheet-count {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
}

.location-sheet-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.location-sheet-grid .hint {
    grid-column: 1 / -1;
    margin: 8px 0 0;
}

.profile-sheet .location-post::after {
    display: none;
}

.location-post {
    position: relative;
    aspect-ratio: 9 / 16;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--line);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    cursor: pointer;
    font: inherit;
    color: #fff;
}

.location-post::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 46%;
    background: linear-gradient(transparent, rgba(20, 16, 12, .72));
    pointer-events: none;
}

.location-post-author {
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: 6px;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.location-post-caption {
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: 6px;
    z-index: 1;
    display: grid;
    gap: 8px;
    min-width: 0;
}

.location-post-caption .location-post-author {
    position: static;
}

.location-post-message {
    display: -webkit-box;
    overflow: hidden;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .85);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.location-post-author .face {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    font-size: 10px;
    border: 1px solid rgba(255, 255, 255, .85);
}

.location-post-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .65);
}

.sheet-grab {
    flex: 0 0 auto;
    touch-action: none;
    cursor: grab;
}

.sheet-grab .sheet-close {
    cursor: pointer;
}

.sheet-handle {
    width: 44px;
    height: 5px;
    border-radius: 999px;
    background: var(--line);
    margin: 10px auto 4px;
}

.comment-bar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 4px 48px 8px;
}

.comment-bar h2 {
    margin: 0;
    text-align: center;
    font-size: 18px;
}

.sheet-close {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border-color: var(--line);
    background: var(--surface);
    color: var(--text);
    width: 36px;
    height: 36px;
}

.comment-list {
    overflow: auto;
    min-height: 180px;
    max-height: 46vh;
    padding: 0 14px 8px;
    display: grid;
    gap: 10px;
}

.comment-empty {
    min-height: 140px;
    display: grid;
    place-items: center;
    margin: 0;
    text-align: center;
    color: var(--muted);
    font-weight: 400;
}

.comment-item {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: 8px;
    align-items: start;
}

.comment-face {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    object-fit: cover;
    background: #d9d0c6;
    display: grid;
    place-items: center;
    font-weight: 800;
}

.comment-body { min-width: 0; }
.comment-meta {
    display: flex;
    gap: 8px;
    align-items: baseline;
}
.comment-time { color: var(--muted); font-size: 12px; }
.comment-text { margin: 2px 0 0; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.comment-text a,
.comment-quote a,
.chat-text a,
.admin-comment-text a {
    color: var(--accent);
    font-weight: 700;
}
.comment-quote {
    margin: 4px 0;
    padding: 6px 8px;
    border-left: 3px solid var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
    border-radius: 3px 8px 8px 3px;
    font-size: 12px;
    color: var(--muted);
}

.comment-reply {
    border: 0;
    background: transparent;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    padding: 4px 0;
}

.comment-composer {
    border-top: 1px solid var(--line);
    padding: 10px 14px 12px;
    display: grid;
    gap: 8px;
}

.sheet-replies { padding-bottom: 2px; }

.comment-input-row {
    display: flex;
    gap: 8px;
}

.comment-field {
    flex: 1 1 auto;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    padding: 12px 14px;
}

.reply-target {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    background: var(--bg);
    border-radius: 12px;
    padding: 8px 10px;
}

.reply-target-quote {
    min-width: 0;
    flex: 1 1 auto;
    display: grid;
    gap: 2px;
}

.reply-target-quote strong {
    font-size: 12px;
}

.reply-target-quote span {
    color: var(--muted);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reply-target-clear {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 20px;
    line-height: 1;
    padding: 0;
}

.comment-send {
    flex: 0 0 auto;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(to bottom right, color-mix(in srgb, white 35%, var(--accent)), var(--tertiary));
    color: #fff;
    font-weight: 800;
    padding: 0 14px;
    box-shadow: 0 0 0 2px color-mix(in srgb, transparent 85%, var(--text)) inset;
}

.admin-users {
    display: grid;
    gap: 10px;
}

.admin-user {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    gap: 12px;
    align-items: start;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 16px;
    padding: 10px;
}

.admin-user-copy {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.admin-user-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-user-bio,
.admin-user-count {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.admin-user-bio {
    white-space: pre-wrap;
}

.admin-paused {
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 8px;
}

.admin-post-author {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.admin-post-author .face {
    width: 28px;
    height: 28px;
    font-size: 12px;
}

.admin-comments {
    display: grid;
    gap: 10px;
}

.admin-comment {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    gap: 12px;
    align-items: start;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 16px;
    padding: 10px;
}

.admin-comment-text {
    margin: 0;
    white-space: pre-wrap;
}

.admin-comment-post {
    min-width: 0;
    display: grid;
    gap: 2px;
    margin: 4px 0 0;
    padding: 6px 8px;
    border-left: 3px solid var(--line);
    background: var(--bg);
    border-radius: 3px 8px 8px 3px;
    color: var(--muted);
    font-size: 12px;
}

.admin-comment-post strong {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.admin-comment-post span {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    white-space: pre-wrap;
}

.topbar.community-top {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "back brand actions profile";
    justify-content: flex-start;
    align-items: center;
    column-gap: 8px;
}

.topbar.community-top .icon-btn,
.topbar.community-top .pill-btn,
.topbar.community-top .profile-btn,
.topbar.community-top .community-actions,
.community-title {
    pointer-events: auto;
}

.topbar.community-top .icon-btn { grid-area: back; }
.community-brand { grid-area: brand; }
.community-actions { grid-area: actions; }
.topbar.community-top .profile-btn { grid-area: profile; }

.community-brand {
    align-items: flex-start;
    min-width: 0;
    max-width: none;
}

.community-brand .location {
    font-size: 14px;
    text-align: left;
    padding-left: 0;
}

.community-title {
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    text-align: left;
    text-shadow: 0 1px 8px rgba(0, 0, 0, .55);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.community-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 539px) {
    .topbar.community-top {
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas:
            "back brand profile"
            ". actions actions";
        align-items: start;
        row-gap: 6px;
    }

    .community-actions {
        justify-self: start;
    }
}

.community-actions .pill-btn {
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    line-height: 1;
    white-space: nowrap;
}

.pill-btn {
    border-radius: 999px;
    border: 2px solid #fff;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font-weight: 800;
    font-family: inherit;
    padding: 8px 12px;
    font-size: 13px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .85), 0 1px 8px rgba(0, 0, 0, .45);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .28);
}

.community-picker {
    display: grid;
    gap: 8px;
    justify-items: start;
}

.community-open {
    width: 100%;
    justify-self: stretch;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    text-align: left;
    border: 2px solid var(--line);
    background: var(--surface);
    color: var(--text);
    border-radius: 14px;
    padding: 12px 14px;
    font: inherit;
    font-weight: 800;
}

.community-open::after {
    content: "▾";
    color: var(--muted);
    font-weight: 700;
}

.community-suggest {
    justify-self: start;
    border-radius: 999px;
    border: 1px dashed var(--accent);
    background: transparent;
    color: var(--text);
    font-weight: 800;
    font-family: inherit;
    padding: 8px 12px;
}

.switch-row {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-self: start;
    width: auto;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.switch-row[hidden],
.community-only-hint[hidden] { display: none; }

.switch-row input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    border: 0;
}

.switch-ui {
    width: 44px;
    height: 26px;
    border-radius: 999px;
    background: var(--line);
    position: relative;
    flex: 0 0 auto;
    transition: background .15s ease;
    box-shadow: 0 0 0 2px color-mix(in srgb, transparent 85%, var(--text)) inset;
}

.switch-ui::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
    transition: transform .15s ease;
}

.switch-row input:checked + .switch-ui { background: var(--accent); }

.switch-row input:checked + .switch-ui::after { transform: translateX(18px); }

.switch-row input:focus-visible + .switch-ui {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.community-list, .community-panel { display: grid; gap: 8px; width: 100%; }

.community-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.community-row .chooser-row {
    flex: 1;
    min-width: 0;
    width: auto;
}

.community-row .community-action {
    align-self: center;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    margin: 0;
}

.community-chip {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    border-radius: 999px;
    font-weight: 800;
    font-family: inherit;
    padding: 12px;
    margin: 0 0 8px;
}

.message .community-chip.in-message {
    float: right;
    margin: 0 0 6px 10px;
    max-width: 48%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: #fffdf8;
    color: #2a241e;
    border: 1px solid rgba(42, 36, 30, .16);
    box-shadow: none;
    font-size: 13px;
    padding: 4px 10px;
}

@media (prefers-color-scheme: dark) {
    .message .community-chip.in-message {
        background: rgba(22, 19, 17, .86);
        color: #f6f1ea;
        border-color: rgba(246, 241, 234, .35);
    }
}

.community-create, .community-create-section { display: grid; gap: 8px; }

.community-dialog .community-create-section { margin-top: 16px; }

.community-create-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.community-create-label {
    font-weight: 800;
    color: var(--text);
}

.community-cancel {
    padding: 0;
    min-height: 0;
    height: auto;
    width: auto;
    margin-left: auto;
    text-align: right;
}

.community-create-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.community-create-row input {
    width: auto;
}

.community-create-row .emoji-input {
    width: 64px;
    flex: 0 0 64px;
    text-align: center;
    padding: 12px 8px;
}

.community-create-row .name-input {
    flex: 1 1 auto;
    min-width: 0;
    width: 1%;
}

.create-community {
    flex: 0 0 auto;
    align-self: center;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
    font-family: inherit;
    padding: 0 14px;
}

.chooser-list { max-height: 36vh; overflow: auto; gap: 8px; margin-top: 16px; }

.chooser-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    text-align: left;
    border: 2px solid var(--line);
    border-radius: 14px;
    background: var(--bg);
    color: inherit;
    font: inherit;
    font-weight: 800;
    padding: 14px 16px;
}

.chooser-row.selected { color: var(--accent); }

.chooser-row small { color: var(--muted); font-weight: 700; }

.chooser-row.add-location {
    border-style: dashed;
    border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
    background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}

.chooser-row.add-location.selected {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 11%, var(--surface));
}

.add-location-icon {
    display: grid;
    place-items: center;
    border: 1px dashed var(--accent);
    color: var(--accent);
    font-size: 24px;
    font-weight: 600;
}

.location-picker-hint {
    margin: 8px 0 0;
}

.chooser-copy {
    flex: 1;
    min-width: 0;
    display: grid;
    align-content: center;
    gap: 4px;
}

.community-description {
    margin: 0;
    color: var(--muted);
    font-weight: 500;
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.community-description a {
    color: var(--accent);
    font-weight: 700;
}

.community-about {
    display: grid;
    gap: 8px;
    margin: 0 0 4px;
}

.community-about .text-button {
    width: auto;
    padding: 4px 0;
    justify-self: start;
}

.community-description-input {
    width: 100%;
    min-height: 88px;
    resize: vertical;
}

.community-description-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.community-description-actions .primary {
    width: auto;
    margin: 0;
}

.community-description-actions .text-button {
    width: auto;
}

.mini-communities {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.mini-communities .community-chip { margin: 0; }

.mini-communities .mini-communities-more {
    width: auto;
    margin: 0;
    padding: 4px 8px;
    color: var(--muted);
}

.member-list { max-height: 50vh; overflow: auto; }

.members-sheet .member-list { max-height: none; overflow: visible; }

.member-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: inherit;
    padding: 8px 0;
    font: inherit;
}

.people-row { gap: 8px; }

.people-profile { flex: 1; }

.people-post-thumb {
    display: block;
    flex: 0 0 48px;
    width: 48px;
    aspect-ratio: 9 / 16;
    overflow: hidden;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: var(--bg);
    cursor: pointer;
}

.people-post-photo { display: block; width: 100%; height: 100%; object-fit: cover; }

.member-copy { display: grid; min-width: 0; }

.member-copy small { color: var(--muted); }

.topbar .events-summary,
.topbar .pill-btn { pointer-events: auto; }

.events-summary {
    position: absolute;
    left: 16px;
    top: calc(12px + env(safe-area-inset-top));
    z-index: 6;
    max-width: 42%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 720px) {
    .events-summary {
        position: static;
        left: auto;
        top: auto;
        max-width: 100%;
        margin: 6px 0 2px;
        align-self: center;
    }
}

.location-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.location-map-btn {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    margin: 0;
}

.location-map-btn.has-place {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.event-composer { margin: 8px 0 16px; }

.event-fields { display: grid; gap: 0; }

.event-end-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
}

.event-end-row .field { margin: 8px 0; }

.event-end-remove {
    width: 44px;
    height: 44px;
    margin: 8px 0 8px 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.poll-composer { margin: 8px 0 16px; }

.question-composer { margin: 8px 0 16px; }

.question-fields { display: grid; gap: 0; }

.poll-fields { display: grid; gap: 0; }

.poll-option-fields { display: grid; gap: 0; }

.poll-option-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
}

.poll-option-row .field { margin: 8px 0; }

.poll-option-remove {
    width: 44px;
    height: 44px;
    margin: 0 0 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.poll-card {
    display: grid;
    gap: 10px;
    margin: 10px 0 4px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .72);
    color: var(--ink);
    border: 1px solid var(--ink);
}

.question-card {
    display: grid;
    gap: 10px;
    margin: 10px 0 4px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .72);
    color: var(--ink);
    border: 1px solid var(--ink);
}

.question-title {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
}

.question-field {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--ink);
    border-radius: 12px;
    background: transparent;
    color: inherit;
    font: inherit;
    padding: 10px 12px;
}

.question-field:disabled {
    opacity: .55;
    cursor: default;
}

.question-send {
    width: 100%;
    min-height: 44px;
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    font: inherit;
    font-size: 16px;
    font-weight: 800;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
}

.question-responses {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--ink);
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.question-sent {
    margin: 0;
    font-weight: 800;
}

.question-sheet-body {
    padding: 0 16px 16px;
    overflow: auto;
}

.answer-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.answer-row:last-child {
    border-bottom: 0;
}

.answer-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
    text-align: left;
}

.answer-text {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-weight: 400;
}

.answer-row .primary {
    width: auto;
    margin-left: auto;
    flex: 0 0 auto;
    padding: 8px 14px;
}

.poll-title {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}

.poll-choice {
    display: block;
}

.poll-option {
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    width: 100%;
    margin: 0;
    border: 1px solid var(--ink);
    border-radius: 12px;
    background: transparent;
    padding: 10px 12px;
    font: inherit;
    font-weight: 700;
    text-align: left;
    color: inherit;
    cursor: pointer;
}

.poll-option-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: rgba(233, 137, 124, .28);
    pointer-events: none;
}

.poll-option.voted { border-color: var(--accent); }

.poll-option-copy {
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
}

.poll-faces {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    margin-left: 8px;
    gap: 0;
    min-height: 28px;
    border: 0;
    background: none;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

.poll-faces .face + .face { margin-left: -8px; }

.poll-voter-group {
    margin: 12px 0 6px;
    font-size: 15px;
}

.event-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 14px;
    align-items: center;
    margin: 10px 0 4px;
    padding: 12px 12px 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .72);
    color: var(--ink);
    border: 1px solid var(--ink);
}

.event-details {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.event-when {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
}

.event-when-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.event-when-copy small {
    color: var(--muted);
    font-weight: 600;
}

.event-icon {
    flex: 0 0 auto;
    line-height: 1.2;
    font-size: 16px;
}

.event-place {
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
    border: 0;
    background: none;
    padding: 0;
    font: inherit;
    font-weight: 700;
    color: inherit;
    cursor: pointer;
}

.event-price {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-weight: 700;
    font-size: 13px;
}

.event-faces {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 0;
    background: none;
    padding: 0;
    font: inherit;
    font-weight: 700;
    color: inherit;
    cursor: pointer;
}

.event-face,
.face.event-face {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    padding: 0;
    flex: 0 0 28px;
    border-radius: 50%;
    object-fit: cover;
    aspect-ratio: 1;
    box-sizing: border-box;
}

img.event-face { display: block; }

span.event-face {
    display: grid;
    place-items: center;
    font-size: 11px;
}

.event-join {
    align-self: center;
    border: 0;
    border-radius: 32px;
    min-width: 88px;
    min-height: 56px;
    padding: 14px 20px;
    font: inherit;
    font-size: 16px;
    font-weight: 800;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
}

.cta-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 14px;
    align-items: center;
    margin: 10px 0 4px;
    padding: 12px 12px 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .72);
    color: var(--ink);
    border: 1px solid var(--ink);
}

.cta-card.no-title {
    grid-template-columns: 1fr;
}

.cta-title {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    min-width: 0;
    overflow-wrap: anywhere;
}

.cta-action {
    align-self: center;
    border: 0;
    border-radius: 32px;
    min-width: 88px;
    min-height: 56px;
    padding: 14px 20px;
    font: inherit;
    font-size: 16px;
    font-weight: 800;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
}

.cta-card.no-title .cta-action {
    width: 100%;
}

.cta-fields {
    display: grid;
    gap: 8px;
}

.cta-fields .field-label {
    font-weight: 800;
}

.cta-destinations { margin: 0; }

.cta-fields .hint { margin-top: -2px; }

.event-join.is-leave {
    background: none;
    color: var(--accent);
    opacity: 1;
}

.tiny.primary-lite {
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 999px;
    padding: 6px 12px;
    font-weight: 800;
}

.events-shell .page-body { padding-top: 4px; }

.post-search-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px 14px calc(16px + env(safe-area-inset-bottom));
}

.post-search-input {
    width: 100%;
    flex: 0 0 auto;
    border-radius: 14px;
    padding: 12px 14px;
    color: var(--text);
    background: var(--surface);
}

.post-search-grid {
    flex: 0 0 auto;
}

.search-feed-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    width: 100%;
    max-width: none;
    margin: 0;
    background: var(--bg);
}

.search-feed-top {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "back brand";
    justify-content: flex-start;
    column-gap: 10px;
    padding: calc(12px + env(safe-area-inset-top)) 14px 8px;
}

.search-feed-top > .icon-btn {
    grid-area: back;
    pointer-events: auto;
}

.search-feed-top .feed-brand {
    grid-area: brand;
    max-width: none;
}

.events-body {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 16px;
    min-height: 0;
    overflow: hidden;
    padding-bottom: 16px;
}

.events-col {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.events-col > h3 {
    margin: 0 0 6px;
    flex: 0 0 auto;
}

.events-map {
    width: 100%;
    aspect-ratio: 1;
    min-height: 240px;
    max-height: min(52vw, 420px);
    border-radius: 24px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
}

.events-map *,
.picker-map *,
.location-sheet-map * { box-sizing: content-box; }

.events-map img,
.picker-map img,
.location-sheet-map img {
    max-width: none !important;
    max-height: none !important;
}

.events-map .event-map-bubble,
.events-map .event-map-bubble *,
.events-map .user-location-dot,
.picker-map .event-map-bubble,
.picker-map .event-map-bubble *,
.location-sheet-map .event-map-bubble,
.location-sheet-map .event-map-bubble * {
    box-sizing: border-box;
}

.event-map-bubble {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 2;
    display: grid;
    gap: 3px;
    width: max-content;
    max-width: 168px;
    margin: 0;
    padding: 8px 10px 9px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 10px 24px rgba(36, 31, 26, .18);
    font: inherit;
    font-size: 12px;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
    transform: translate(-50%, calc(-100% - 10px)) scale(0);
    transform-origin: center bottom;
    transition: transform 220ms ease;
    pointer-events: none;
}

.event-map-bubble.is-shown {
    transform: translate(-50%, calc(-100% - 10px)) scale(1);
    pointer-events: auto;
}

.user-location-dot {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--accent);
    background-size: cover;
    background-position: center;
    box-shadow: 0 2px 8px rgba(36, 31, 26, .45), 0 0 2px 2px rgba(233, 137, 124, .24);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 0 2px black;
    transform: translate(-50%, -50%) scale(0);
    transform-origin: center;
    transition: transform 220ms ease;
    pointer-events: none;
}

.user-location-dot.is-shown {
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.custom-location-bubble {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.custom-location-bubble.has-photo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.custom-location-bubble-photo {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background-size: cover;
    background-position: center;
}

.custom-location-bubble-text {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.picker-map.is-placing { cursor: crosshair; }

.event-map-bubble::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -5px;
    width: 10px;
    height: 10px;
    background: var(--surface);
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    transform: translateX(-50%) rotate(45deg);
    box-sizing: border-box;
}

.event-map-bubble-title {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.event-map-bubble-emoji {
    flex: 0 0 auto;
    font-size: 16px;
    line-height: 1;
}

.event-map-bubble-title strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.event-map-bubble-meta,
.event-map-bubble-place {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-weight: 700;
    white-space: nowrap;
}

.event-map-bubble-place span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-map-bubble-faces {
    gap: 4px;
    color: var(--muted);
    font-size: 11px;
    min-width: 0;
    flex-wrap: wrap;
}

.event-map-bubble-faces .event-face,
.event-row .event-face {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    flex: 0 0 20px;
}

.event-map-bubble-faces span.event-face,
.event-row span.event-face {
    font-size: 9px;
}

.event-map-bubble:hover,
.event-map-bubble:focus-visible {
    z-index: 2147483647 !important;
    border-color: var(--accent);
    outline: none;
}

.events-lists {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    gap: 8px;
}

.events-tabs {
    display: none;
    flex: 0 0 auto;
    margin: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.events-tabs .chip {
    flex: 0 0 auto;
    white-space: nowrap;
}

.events-split {
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    min-height: 0;
    overflow: hidden;
    align-items: stretch;
}

@media (max-width: 720px) {
    .events-tabs { display: flex; }

    .events-col > h3 { display: none; }

    .events-split {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr);
    }

    .events-split .events-col:not(:first-child) { display: none; }

    .events-split.show-people .events-col { display: none; }

    .events-split.show-people .events-col:nth-child(2) { display: flex; }

    .events-split.show-communities .events-col { display: none; }

    .events-split.show-communities .events-col:nth-child(3) { display: flex; }
}

.event-list,
.events-col .member-list,
.events-col .community-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    max-height: none;
    align-content: start;
}

.event-day { margin: 8px 0 4px; }

.event-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 2px 8px;
    align-items: center;
    width: 100%;
    text-align: left;
    border: 0;
    background: var(--surface);
    color: inherit;
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 8px;
    font: inherit;
}

.event-row .event-icon {
    grid-row: 1 / span 2;
    font-size: 18px;
}

.event-row-copy { display: grid; gap: 2px; min-width: 0; }

.event-row small { color: var(--muted); }

.event-row .event-faces {
    margin-top: 4px;
    font-size: 12px;
}

.attendee-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.attendee-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    border: 0;
    background: none;
    padding: 0;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.attendee-row .member-copy { flex: 1; min-width: 0; text-align: left; }

.attendee-icon {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    background: var(--bg);
    color: inherit;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.attendee-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.location-dialog { width: min(520px, 100%); }

.picker-map {
    height: 220px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg);
    margin-top: 10px;
}

.place-recent, .place-results { display: grid; gap: 4px; }
.place-recent[hidden], .place-results[hidden] { display: none; }
.place-results { max-height: 28vh; overflow: auto; margin-top: 8px; }
.location-dialog .chooser-row { justify-content: flex-start; padding: 8px; }
.place-thumb {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 10px;
    background: var(--card);
}
.place-thumb.emoji { font-size: 28px; }
.place-thumb-photo { width: 100%; height: 100%; object-fit: cover; }
.place-row-copy { display: grid; flex: 1; min-width: 0; gap: 2px; }
.place-row-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-row-copy small { color: var(--muted); }
.location-dialog .chooser-row.selected { border-color: var(--accent); }

.page-shell .notify-btn {
    border: 2px solid var(--line);
    background: var(--surface);
    color: var(--text);
}

.messages-head, .chat-head {
    padding-right: 12px;
}

.messages-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.chat-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-bottom: 32px;
}

.chat-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    padding: 12px 4px;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    font: inherit;
}

.chat-row:last-child { border-bottom: 0; }

.chat-faces {
    display: flex;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    flex: 0 0 auto;
    position: relative;
    overflow: hidden;
}

.chat-faces .face {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    max-width: 48px;
    max-height: 48px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

.chat-faces.pair .face {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    max-width: 32px;
    max-height: 32px;
    position: absolute;
    overflow: hidden;
}

.chat-faces.pair .face:nth-child(1) {
    left: 0;
    top: 0;
}

.chat-faces.pair .face:nth-child(2) {
    right: 0;
    bottom: 0;
    border: 2px solid var(--bg);
}

.chat-row-copy {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 4px;
}

.chat-row-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-row-meta {
    display: grid;
    justify-items: end;
    align-content: start;
    gap: 4px;
    flex: 0 0 auto;
}

.chat-row-time {
    color: var(--muted);
    font-style: normal;
    font-size: 12px;
    flex: 0 0 auto;
}

.chat-row-time.unread { color: var(--accent); }

.chat-row-preview {
    color: var(--text);
    opacity: 0.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.chat-unread-count {
    background: var(--accent);
    color: #fff;
    border-radius: 999px;
    min-width: 20px;
    padding: 1px 6px;
    font-size: 12px;
    text-align: center;
}

.chat-shell {
    display: flex;
    flex-direction: column;
}

.chat-thread {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 8px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-bubble {
    max-width: 80%;
    align-self: flex-start;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px 18px 18px 6px;
    padding: 8px;
    display: grid;
    gap: 6px;
}

.chat-bubble.mine {
    align-self: flex-end;
    background: var(--card);
    color: var(--ink);
    border-radius: 18px 18px 6px 18px;
}

.chat-author {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    padding: 0;
    cursor: pointer;
}

.chat-author .face {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    max-width: 22px;
    max-height: 22px;
    flex: 0 0 22px;
    aspect-ratio: 1 / 1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 50%;
    overflow: hidden;
}

.chat-author > span:not(.face) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-text { margin: 0; white-space: pre-wrap; word-break: break-word; }

.chat-photos { display: grid; gap: 6px; }

.chat-photo {
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    display: block;
}

.chat-reactions { display: flex; flex-wrap: wrap; gap: 4px; }

.reaction-chip, .reaction-pick {
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--text);
    border-radius: 999px;
    padding: 4px 8px;
    font: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.reaction-pick svg {
    width: 16px;
    height: 16px;
    display: block;
}

.reaction-chip.mine { border-color: var(--accent); }

.reaction-defaults { display: flex; gap: 8px; flex-wrap: wrap; }

.chat-typing {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px 8px;
    color: var(--muted);
}

.typing-dots {
    letter-spacing: 2px;
    animation: typing-pulse 1s ease-in-out infinite;
}

@keyframes typing-pulse {
    0%, 100% { opacity: .35; }
    50% { opacity: 1; }
}

.face.tiny {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    max-width: 22px;
    max-height: 22px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    font-size: 50%;
    overflow: hidden;
}

.chat-composer {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--bg);
}

.chat-input {
    flex: 1;
    min-height: 40px;
    max-height: 120px;
    resize: none;
    border-radius: 16px;
    background: var(--surface);
    color: inherit;
    font: inherit;
    padding: 8px 12px;
    line-height: 22px;
}

.chat-send {
    flex: 0 0 auto;
    height: 40px;
    min-height: 40px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.composer-photo { flex: 0 0 auto; }

.reaction-custom { display: grid; gap: 8px; margin-top: 8px; }

.reactions-dialog .attendee-row {
    width: 100%;
}

.reactions-dialog .attendee-row .face {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    flex: 0 0 auto;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    aspect-ratio: 1;
    overflow: hidden;
}

.reactions-dialog .attendee-row .text-button {
    width: auto;
    margin-left: auto;
    flex: 0 0 auto;
    padding: 8px 0 8px 12px;
}

.attendee-row .attendee-icon.member-menu {
    margin-left: auto;
}

.text-button.danger { color: var(--danger); }

.hint { color: var(--muted); }

.feature-form {
    display: grid;
    gap: 8px;
    margin: 8px 0 12px;
}

.feature-form textarea {
    min-height: 88px;
    resize: vertical;
}

.feature-row {
    display: grid;
    gap: 8px;
    margin: 8px 0;
    padding: 12px;
    border: 2px solid var(--line);
    border-radius: 14px;
}

.feature-row.resolved { opacity: 0.72; }

.feature-text {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.feature-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.feature-votes { color: var(--muted); font-weight: 700; font-size: 12px; }

.feature-resolved {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--accent);
}

.tiny.voted {
    background: var(--accent);
    color: #fff;
}

.products-preview,
.mini-products,
.product-list,
.product-order-list { display: grid; gap: 12px; }
.product-form { display: grid; gap: 10px; padding: 14px; border: 2px solid var(--line); border-radius: 18px; background: var(--surface); }
.page-body > .product-form { margin-bottom: 16px; }
.product-form h3 { margin: 0; }
.product-photo-input input { max-width: 100%; }
.product-photo-picker .upload { aspect-ratio: 1; }
.product-photo-picker .composer-photo-stage { width: min(100%, 220px); }
.product-photo-picker .photo-thumb { width: 40px; height: 40px; aspect-ratio: 1; }
.product-photo-picker .photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-card { display: flex; gap: 12px; min-width: 0; padding: 10px; border: 2px solid var(--line); border-radius: 16px; background: var(--surface); cursor: pointer; }
.shop-body { gap: 12px; }
.shop-search-input { flex: 0 0 auto; margin-bottom: 8px; }
.shop-product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 10px; }
.shop-product-card { flex-direction: column; gap: 8px; padding: 8px; }
.shop-product-card .product-card-photo { width: 100%; height: auto; aspect-ratio: 1; flex: 0 0 auto; }
.shop-product-card .product-name { display: -webkit-box; overflow: hidden; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.product-card-photo { width: 92px; height: 92px; flex: 0 0 92px; border-radius: 12px; object-fit: cover; background: var(--card); }
.product-photo-placeholder,
.product-detail-placeholder { display: grid; place-items: center; font-size: 30px; color: var(--muted); }
.product-card-copy { display: grid; align-content: start; gap: 4px; min-width: 0; }
.product-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-price,
.product-detail-price,
.product-order-price { color: var(--accent); font-weight: 800; }
.product-description-preview { display: -webkit-box; overflow: hidden; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.product-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.product-manage-card { display: grid; grid-template-columns: minmax(0, 1fr); }
.product-manage-card .product-actions { margin-top: 0; }
.mini-product-row { display: flex; gap: 10px; overflow-x: auto; padding: 2px 0 8px; scroll-snap-type: x mandatory; }
.mini-product-row .product-card { width: 230px; min-width: 230px; scroll-snap-align: start; }
.product-sheet { display: flex; flex-direction: column; }
.product-sheet .product-sheet-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 0 16px 18px; }
.product-sheet-body .product-sheet-seller { width: 100%; margin: 10px 0; }
.product-detail-title-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.product-detail-title-row .product-detail-name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.product-link-copy { flex: 0 0 44px; color: var(--text); border-color: var(--line); background: var(--surface); }
.product-detail-photos { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px; scroll-padding: 16px; scroll-snap-type: x mandatory; }
.product-detail-photo,
.product-detail-placeholder { width: min(84vw, 420px); height: min(84vw, 420px); flex: 0 0 min(84vw, 420px); border-radius: 16px; object-fit: cover; background: var(--card); scroll-snap-align: center; }
.product-detail-name { margin: 0; }
.product-detail-category { margin: 0; color: var(--muted); font-weight: 700; }
.product-detail-description { white-space: pre-wrap; overflow-wrap: anywhere; }
.product-buy-dock { position: sticky; z-index: 2; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.product-buy-dock .primary { width: 100%; }
.product-buy-dialog { max-height: calc(100dvh - 32px); overflow: auto; }
.product-contact-options { margin: 12px 0; }
.product-contact-select { appearance: none; font-weight: 700; cursor: pointer; }
.product-order .product-actions .primary { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.product-order .product-actions .tiny { font-size: inherit; }
.product-order-product { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.chat-product-attachment { display: flex; align-items: center; gap: 10px; width: min(100%, 320px); padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; }
.chat-product-attachment-photo { width: 64px; height: 64px; flex: 0 0 64px; border-radius: 10px; object-fit: cover; background: var(--card); }
.chat-product-attachment-copy { display: grid; min-width: 0; gap: 3px; }
.chat-product-attachment-copy small { color: var(--muted); }
.chat-product-attachment-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-product-attachment-copy span { color: var(--accent); font-weight: 800; }
.product-order { display: grid; gap: 8px; padding: 14px; border: 2px solid var(--line); border-radius: 16px; background: var(--surface); }
.product-order:not(.resolved) { border-color: var(--accent); }
.product-order h3 { margin: 0; }
.product-order.resolved { opacity: .75; }
.product-order-status { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.product-order-message { white-space: pre-wrap; overflow-wrap: anywhere; }
.product-editor-dialog { max-height: calc(100dvh - 24px); overflow: auto; }
.product-editor-dialog .product-form { padding: 0; border: 0; }

@media (min-width: 700px) {
    .product-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .product-manage-card { align-content: start; }
}
