/* ==========================================================================
   Confessions — Anonymous Confessions Channel
   Mobile-first messenger / social-app design (WhatsApp · Telegram · IG vibes)
   Theme-aware: reacts to html[data-bs-theme] set by the global graddle client.
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

/* --- Tokens ------------------------------------------------------------- */
:root {
    --bg: #efeaf8;
    --bg-grad-1: rgba(124, 58, 237, 0.14);
    --bg-grad-2: rgba(236, 72, 153, 0.12);
    --surface: #ffffff;
    --surface-2: #f6f2fd;
    --surface-3: #eee8fa;
    --ink: #1a1330;
    --text: #2c2446;
    --muted: #8a82a6;
    --faint: #b7b0cc;
    --line: #ece6f7;
    --line-strong: #ddd4f0;

    --primary: #7c3aed;
    --primary-strong: #6d28d9;
    --primary-soft: #efe7fe;
    --pink: #ec4899;
    --pink-soft: #fde8f4;
    --accent: #f79009;
    --accent-soft: #fdf0dc;

    --ok: #12b76a;
    --ok-soft: #d9f7e9;
    --danger: #f04438;
    --danger-soft: #fee4e2;
    --neutral: #667085;
    --neutral-soft: #eef1f6;

    --ring-a: #7c3aed;
    --ring-b: #ec4899;
    --ring-c: #f79009;

    --shadow-sm: 0 1px 3px rgba(26, 19, 48, 0.06);
    --shadow: 0 10px 30px rgba(26, 19, 48, 0.08);
    --shadow-lg: 0 24px 70px rgba(26, 19, 48, 0.18);
    --shadow-brand: 0 8px 22px rgba(124, 58, 237, 0.34);

    --r-xs: 10px;
    --r-sm: 14px;
    --r: 18px;
    --r-lg: 24px;
    --r-xl: 32px;

    --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    --grad-brand: linear-gradient(135deg, #7c3aed 0%, #a855f7 48%, #ec4899 100%);
    --grad-strip: linear-gradient(135deg, #2a1156 0%, #5b21b6 40%, #9d2bc7 74%, #db2777 100%);
}

html[data-bs-theme="dark"] {
    --bg: #0e0b16;
    --bg-grad-1: rgba(124, 58, 237, 0.22);
    --bg-grad-2: rgba(236, 72, 153, 0.14);
    --surface: #171221;
    --surface-2: #1f1830;
    --surface-3: #2a2140;
    --ink: #f5f1ff;
    --text: #e5def7;
    --muted: #9b92ba;
    --faint: #6f6690;
    --line: #2a2242;
    --line-strong: #3a3057;
    --primary: #a78bfa;
    --primary-strong: #c4b5fd;
    --primary-soft: #2c2052;
    --pink: #f472b6;
    --pink-soft: #431f3c;
    --accent: #fbbf24;
    --accent-soft: #412f10;
    --ok: #34d399;
    --ok-soft: #0e3326;
    --danger: #fb7185;
    --danger-soft: #441520;
    --neutral: #94a3b8;
    --neutral-soft: #232c3b;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.7);
    --shadow-brand: 0 8px 26px rgba(167, 139, 250, 0.35);
}

/* --- Reset & base ------------------------------------------------------- */
* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
}

body {
    background:
        radial-gradient(60% 46% at 10% -6%, var(--bg-grad-1), transparent 62%),
        radial-gradient(52% 40% at 96% 0%, var(--bg-grad-2), transparent 58%),
        var(--bg);
    background-attachment: fixed;
    -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
h4 {
    margin: 0;
    color: var(--ink);
}

p {
    margin: 0;
}

button {
    font: inherit;
    cursor: pointer;
    border: 0;
    background: none;
    color: inherit;
}

input,
select,
textarea {
    font: inherit;
}

.hidden {
    display: none !important;
}

/* --- Stage + phone frame ------------------------------------------------ */
.stage {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: stretch;
}

.app {
    position: relative;
    width: 100%;
    max-width: 520px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

@media (min-width: 620px) {
    .stage {
        padding: 18px 0;
    }

    .app {
        min-height: calc(100vh - 36px);
        height: calc(100vh - 36px);
        border-radius: var(--r-xl);
        border: 1px solid var(--line);
        box-shadow: var(--shadow-lg);
        overflow: hidden;
        background: var(--surface);
    }
}

/* --- App bar ------------------------------------------------------------ */
.appbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 1rem 0.6rem;
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border-bottom: 1px solid var(--line);
}

.appbar-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.chan-avatar {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--grad-brand);
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    box-shadow: var(--shadow-brand);
}

.chan-id {
    min-width: 0;
    line-height: 1.2;
}

.chan-name {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 800;
    font-size: 1rem;
    color: var(--ink);
    white-space: nowrap;
}

.verified {
    display: inline-grid;
    place-items: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3b82f6;
    color: #fff;
    font-size: 0.58rem;
    font-weight: 800;
}

.chan-sub {
    font-size: 0.72rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appbar-right {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.05rem;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--line);
    transition: transform 0.12s ease, background 0.15s ease;
}

.icon-btn:active {
    transform: scale(0.92);
}

.chip-btn {
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.82rem;
    background: var(--grad-brand);
    color: #fff;
    box-shadow: var(--shadow-brand);
    transition: transform 0.12s ease;
    white-space: nowrap;
}

.chip-btn:active {
    transform: scale(0.95);
}

.chip-ok {
    background: var(--ok-soft);
    color: var(--ok);
    box-shadow: none;
    border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent);
}

/* --- Channel strip ------------------------------------------------------ */
.channel-strip {
    position: relative;
    overflow: hidden;
    color: #fff;
    background: var(--grad-strip);
    padding: 1.15rem 1.1rem 1rem;
    margin: 0.6rem 0.9rem 0;
    border-radius: var(--r-lg);
    box-shadow: 0 14px 30px rgba(88, 28, 135, 0.35);
}

.channel-strip::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(120px 120px at 92% -10%, rgba(255, 255, 255, 0.22), transparent 60%);
    pointer-events: none;
}

.strip-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    padding: 0.28rem 0.7rem;
    margin-bottom: 0.6rem;
}

.strip-copy h1 {
    color: #fff;
    font-size: 1.35rem;
    line-height: 1.2;
    margin-bottom: 0.8rem;
}

.strip-copy h1 em {
    font-style: normal;
    background: linear-gradient(90deg, #f9a8d4, #fbbf24);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.strip-stats {
    display: flex;
    gap: 0.9rem;
}

.ss {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
}

.ss b {
    font-size: 1rem;
    font-weight: 800;
}

.ss em {
    font-style: normal;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.78);
}

/* --- Stories (category rings) ------------------------------------------ */
.stories {
    padding: 0.8rem 0.5rem 0.4rem;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 60%, transparent);
    backdrop-filter: blur(2px);
}

.stories-scroll {
    display: flex;
    gap: 0.85rem;
    overflow-x: auto;
    padding: 0.15rem 0.6rem 0.4rem;
    scrollbar-width: none;
}

.stories-scroll::-webkit-scrollbar {
    display: none;
}

.story {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    width: 58px;
}

.story-ring {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    padding: 2.5px;
    background: conic-gradient(from 210deg, var(--ring-a), var(--ring-b), var(--ring-c), var(--ring-a));
    transition: transform 0.15s ease;
}

.story:active .story-ring {
    transform: scale(0.92);
}

.story-ring.is-active {
    background: var(--grad-brand);
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4);
}

.story-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--surface);
    display: grid;
    place-items: center;
    font-size: 1.35rem;
    border: 2px solid var(--surface);
}

.story-label {
    font-size: 0.64rem;
    font-weight: 700;
    color: var(--muted);
    max-width: 58px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.story.is-active .story-label {
    color: var(--primary);
}

/* --- Screens ------------------------------------------------------------ */
.screen {
    display: none;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0.9rem 0.9rem 1.2rem;
    scrollbar-width: thin;
}

.screen.is-active {
    display: block;
}

.screen-head {
    padding: 0.3rem 0.2rem 0.9rem;
}

.screen-head h2 {
    font-size: 1.35rem;
}

.screen-head p {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 0.2rem;
}

/* --- Feed tools --------------------------------------------------------- */
.feed-tools {
    display: flex;
    gap: 0.55rem;
    margin-bottom: 0.8rem;
}

.searchbox {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 0.85rem;
}

.sb-icon {
    color: var(--muted);
    font-size: 1rem;
}

.searchbox input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: none;
    color: var(--text);
    padding: 0.55rem 0;
    outline: none;
    font-size: 0.88rem;
}

.sort-select {
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    border-radius: 999px;
    padding: 0 0.7rem;
    font-size: 0.78rem;
    font-weight: 700;
    outline: none;
    max-width: 118px;
}

.feed-meta {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--muted);
    padding: 0 0.25rem 0.6rem;
}

/* --- Feed cards --------------------------------------------------------- */
.feed {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.post {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    animation: rise 0.32s ease both;
}

.post.featured {
    border: 0;
    background:
        linear-gradient(var(--surface), var(--surface)) padding-box,
        var(--grad-brand) border-box;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.9rem 0.4rem;
}

.post-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--grad-brand);
    display: grid;
    place-items: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.post-id {
    min-width: 0;
    line-height: 1.25;
}

.post-channel {
    font-weight: 800;
    font-size: 0.86rem;
    color: var(--ink);
}

.post-time {
    font-size: 0.7rem;
    color: var(--muted);
}

.post-badge {
    margin-left: auto;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.24rem 0.6rem;
    white-space: nowrap;
}

.post.featured .post-badge {
    background: var(--grad-brand);
    color: #fff;
    border: 0;
}

.post-cat {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0.15rem 0.9rem 0.4rem;
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 999px;
    padding: 0.26rem 0.7rem;
}

.post-body {
    padding: 0.1rem 0.9rem 0.5rem;
}

.post-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 0.35rem;
    cursor: pointer;
    line-height: 1.3;
}

.post-title:active {
    color: var(--primary);
}

.post-text {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
}

.post-text.clamped {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    display: inline-block;
    margin-top: 0.3rem;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--primary);
}

/* Gauge + actions */
.post-gauge {
    padding: 0.45rem 0.9rem 0.15rem;
}

.gauge-track {
    display: flex;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--neutral-soft);
}

.gauge-agree {
    background: linear-gradient(90deg, #10b981, #34d399);
    transition: width 0.4s ease;
}

.gauge-disagree {
    background: linear-gradient(90deg, #f43f5e, #fb7185);
    transition: width 0.4s ease;
}

.post-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem 0.75rem;
    margin-top: 0.35rem;
    border-top: 1px solid var(--line);
}

.action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 0.4rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--line);
    transition: all 0.15s ease;
}

.action:active {
    transform: scale(0.94);
}

.action.is-on[data-kind="agree"] {
    background: var(--ok-soft);
    border-color: var(--ok);
    color: var(--ok);
}

.action.is-on[data-kind="disagree"] {
    background: var(--danger-soft);
    border-color: var(--danger);
    color: var(--danger);
}

.action-spacer {
    flex: 1;
}

/* --- Empty + load more -------------------------------------------------- */
.empty {
    text-align: center;
    padding: 2.4rem 1rem;
    color: var(--muted);
}

.empty-emoji {
    font-size: 2.4rem;
    margin-bottom: 0.5rem;
}

.empty h3 {
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
}

.empty p {
    font-size: 0.85rem;
}

.load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.btn-soft {
    padding: 0.55rem 1.3rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--primary);
    background: var(--primary-soft);
    border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
}

.btn-soft:active {
    transform: scale(0.96);
}

/* --- Buttons ------------------------------------------------------------ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border-radius: 999px;
    padding: 0.68rem 1.2rem;
    font-weight: 800;
    font-size: 0.9rem;
    color: #fff;
    background: var(--grad-brand);
    box-shadow: var(--shadow-brand);
    transition: transform 0.12s ease;
    border: 0;
}

.btn-primary:active {
    transform: scale(0.96);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border-radius: 999px;
    padding: 0.62rem 1.1rem;
    font-weight: 800;
    font-size: 0.88rem;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--line);
}

.btn-ghost:active {
    transform: scale(0.96);
}

.btn-block {
    width: 100%;
}

/* --- Bottom tab bar ----------------------------------------------------- */
.tabbar {
    position: sticky;
    bottom: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0.45rem 0.6rem calc(0.5rem + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border-top: 1px solid var(--line);
}

.tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.25rem 0.55rem;
    border-radius: var(--r-sm);
    color: var(--faint);
    transition: color 0.15s ease, transform 0.1s ease;
}

.tab:active {
    transform: scale(0.92);
}

.tab.is-active {
    color: var(--primary);
}

.tab-ico {
    font-size: 1.25rem;
    line-height: 1;
}

.tab-lbl {
    font-size: 0.62rem;
    font-weight: 700;
}

.tab-write {
    position: relative;
}

.fab {
    width: 52px;
    height: 52px;
    margin-top: -26px;
    border-radius: 50%;
    background: var(--grad-brand);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    box-shadow: var(--shadow-brand);
    border: 4px solid var(--bg);
    transition: transform 0.15s ease;
}

.fab:active {
    transform: scale(0.9) rotate(12deg);
}

/* --- Sheets ------------------------------------------------------------- */
.sheet {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    /* Above the sticky stories rail (Bootstrap's .sticky-top is z-index 1020):
       a full-screen sheet has to own the top of the stack, or the stories row
       paints over its header and swallows taps on the back button. */
    z-index: 1030;
    width: 100%;
    max-width: 520px;
    height: 92vh;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    border: 1px solid var(--line);
    border-bottom: 0;
    box-shadow: var(--shadow-lg);
    animation: sheetUp 0.32s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.sheet-narrow {
    height: auto;
    max-height: 84vh;
}

@keyframes sheetUp {
    from {
        transform: translateX(-50%) translateY(40px);
        opacity: 0.4;
    }

    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.sheet-bar {
    display: flex;
    justify-content: center;
    padding: 0.6rem 0 0.2rem;
}

.sheet-grip {
    width: 44px;
    height: 5px;
    border-radius: 999px;
    background: var(--line-strong);
}

.sheet-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.9rem 0.7rem;
    border-bottom: 1px solid var(--line);
}

.sheet-head-title {
    flex: 1;
    text-align: center;
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sheet-head-spacer {
    width: 38px;
}

.sheet-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0.9rem;
}

/* --- Detail: chat thread ------------------------------------------------ */
.detail-thread {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.detail-card {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 0.9rem;
    box-shadow: var(--shadow-sm);
}

.detail-cat {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 999px;
    padding: 0.26rem 0.7rem;
    margin-bottom: 0.5rem;
}

.detail-title {
    font-size: 1.2rem;
    line-height: 1.3;
    margin-bottom: 0.45rem;
}

.detail-text {
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
}

.detail-gauge {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 0.8rem 0.9rem;
    margin-top: 0.8rem;
}

.gauge-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.35rem;
    font-size: 0.74rem;
    font-weight: 800;
    color: var(--muted);
}

.gl-agree {
    color: var(--ok);
}

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

/* Chat-thread opinions */
.thread-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0.2rem 0.1rem 0.4rem;
}

.thread-head h3 {
    font-size: 0.95rem;
}

.thread-head span {
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 700;
}

.opinions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bubble {
    display: flex;
    gap: 0.55rem;
    max-width: 88%;
    animation: rise 0.3s ease both;
}

.bubble.me {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.bubble-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary-soft);
    display: grid;
    place-items: center;
    font-size: 0.85rem;
    flex-shrink: 0;
    align-self: flex-end;
}

.bubble-content {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 16px;
    border-bottom-left-radius: 6px;
    padding: 0.55rem 0.75rem;
    min-width: 0;
}

.bubble.me .bubble-content {
    background: var(--primary-soft);
    border-color: color-mix(in srgb, var(--primary) 25%, transparent);
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 6px;
}

.bubble-top {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.15rem;
    flex-wrap: wrap;
}

.bubble-author {
    font-weight: 800;
    font-size: 0.74rem;
    color: var(--ink);
}

.bubble-time {
    font-size: 0.64rem;
    color: var(--faint);
}

.opinion-tag {
    font-size: 0.6rem;
    font-weight: 800;
    border-radius: 999px;
    padding: 0.14rem 0.5rem;
}

.opinion-tag.agree {
    background: var(--ok-soft);
    color: var(--ok);
}

.opinion-tag.disagree {
    background: var(--danger-soft);
    color: var(--danger);
}

.opinion-tag.neutral {
    background: var(--neutral-soft);
    color: var(--neutral);
}

.bubble-body {
    font-size: 0.86rem;
    line-height: 1.55;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
}

/* Composer bar */
.composer {
    border-top: 1px solid var(--line);
    padding: 0.55rem 0.85rem calc(0.6rem + env(safe-area-inset-bottom));
    background: var(--surface);
    display: grid;
    gap: 0.5rem;
}

.opinion-pills {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.pill {
    border-radius: 999px;
    padding: 0.36rem 0.8rem;
    font-size: 0.76rem;
    font-weight: 800;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--line);
    transition: all 0.15s ease;
}

.pill:active {
    transform: scale(0.94);
}

.pill.is-on[data-opinion="agree"] {
    background: var(--ok-soft);
    border-color: var(--ok);
    color: var(--ok);
}

.pill.is-on[data-opinion="disagree"] {
    background: var(--danger-soft);
    border-color: var(--danger);
    color: var(--danger);
}

.pill.is-on[data-opinion="neutral"] {
    background: var(--neutral-soft);
    border-color: var(--neutral);
    color: var(--neutral);
}

.composer-row {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

.composer-input {
    flex: 1;
    resize: none;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    border-radius: 999px;
    padding: 0.6rem 0.95rem;
    font-size: 0.9rem;
    outline: none;
    max-height: 110px;
}

.composer-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.send-btn {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--grad-brand);
    color: #fff;
    font-size: 1rem;
    display: grid;
    place-items: center;
    box-shadow: var(--shadow-brand);
    transition: transform 0.12s ease;
}

.send-btn:active {
    transform: scale(0.9);
}

.composer-gate {
    border-top: 1px solid var(--line);
    padding: 0.8rem 1rem calc(0.9rem + env(safe-area-inset-bottom));
    background: var(--surface);
    text-align: center;
    display: grid;
    gap: 0.6rem;
}

.composer-gate p {
    font-size: 0.84rem;
    color: var(--muted);
}

/* --- Compose sheet ------------------------------------------------------ */
.compose-form {
    display: grid;
    gap: 0.7rem;
}

.field {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--surface-2);
    color: var(--text);
    padding: 0.7rem 0.85rem;
    outline: none;
    resize: vertical;
    font-size: 0.9rem;
}

.field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    user-select: none;
    padding: 0.2rem 0.1rem;
}

.toggle-row input {
    display: none;
}

.toggle-ui {
    position: relative;
    width: 46px;
    height: 26px;
    border-radius: 999px;
    background: var(--line-strong);
    transition: background 0.2s ease;
    flex-shrink: 0;
}

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

.toggle-row input:checked+.toggle-ui {
    background: var(--ok);
}

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

/* --- Join sheet --------------------------------------------------------- */
.join-state {
    display: grid;
    gap: 0.85rem;
    text-align: center;
    padding: 0.3rem 0.2rem 0.6rem;
}

.join-emoji {
    font-size: 2.6rem;
}

.join-state h3 {
    font-size: 1.15rem;
}

.join-state p {
    font-size: 0.87rem;
    color: var(--muted);
    line-height: 1.55;
}

.fee-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 auto;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 999px;
    padding: 0.42rem 1rem;
    font-size: 0.85rem;
    font-weight: 800;
}

.member-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 auto;
    background: var(--ok-soft);
    color: var(--ok);
    border-radius: 999px;
    padding: 0.42rem 1rem;
    font-size: 0.85rem;
    font-weight: 800;
}

.member-badge.expired {
    background: var(--danger-soft);
    color: var(--danger);
}

.join-actions {
    display: grid;
    gap: 0.55rem;
}

/* --- Me screen ---------------------------------------------------------- */
.me-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 1.1rem;
    box-shadow: var(--shadow-sm);
    text-align: center;
    display: grid;
    gap: 0.7rem;
    margin-bottom: 0.9rem;
}

.me-avatar {
    width: 66px;
    height: 66px;
    margin: 0 auto;
    border-radius: 50%;
    background: var(--grad-brand);
    display: grid;
    place-items: center;
    font-size: 1.9rem;
    box-shadow: var(--shadow-brand);
}

.me-card h3 {
    font-size: 1.1rem;
}

.me-card p {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.55;
}

.section-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0.8rem 0.2rem 0.5rem;
}

.my-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.my-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 0.8rem 0.9rem;
    box-shadow: var(--shadow-sm);
    display: grid;
    gap: 0.3rem;
}

.my-item-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.my-item-top .post-cat {
    margin: 0;
}

.my-item h4 {
    font-size: 0.92rem;
}

.my-item p {
    font-size: 0.78rem;
    color: var(--muted);
}

.status-badge {
    font-size: 0.62rem;
    font-weight: 800;
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    margin-left: auto;
    white-space: nowrap;
}

.status-badge.approved,
.status-badge.active {
    background: var(--ok-soft);
    color: var(--ok);
}

.status-badge.pending {
    background: var(--accent-soft);
    color: var(--accent);
}

.status-badge.rejected,
.status-badge.expired {
    background: var(--danger-soft);
    color: var(--danger);
}

/* --- Moderation --------------------------------------------------------- */
.mod-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    margin-bottom: 0.9rem;
}

.mod-kpi {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 0.8rem 0.9rem;
    box-shadow: var(--shadow-sm);
}

.mod-kpi .mk-num {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--ink);
}

.mod-kpi .mk-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--muted);
}

.mod-tabs {
    display: flex;
    gap: 0.3rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: 0.8rem;
}

.mod-tabs button {
    padding: 0.6rem 0.8rem;
    font-weight: 800;
    font-size: 0.84rem;
    color: var(--muted);
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.mod-tabs button.is-active {
    color: var(--primary);
    border-color: var(--primary);
}

.tab-count {
    background: var(--danger);
    color: #fff;
    border-radius: 999px;
    font-size: 0.66rem;
    padding: 0.1rem 0.45rem;
    font-weight: 800;
}

.mod-pane {
    display: none;
}

.mod-pane.is-active {
    display: block;
}

.mod-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.review {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 0.85rem 0.9rem;
    box-shadow: var(--shadow-sm);
}

.review-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
}

.review-head .post-cat {
    margin: 0;
}

.review-meta {
    font-size: 0.7rem;
    color: var(--muted);
    font-weight: 600;
}

.review h4 {
    font-size: 0.95rem;
    margin: 0.25rem 0;
}

.review-text {
    font-size: 0.84rem;
    line-height: 1.55;
    color: var(--text);
    white-space: pre-wrap;
    max-height: 96px;
    overflow: hidden;
    position: relative;
}

.review-text::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 32px;
    background: linear-gradient(transparent, var(--surface));
}

.review-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.7rem;
    flex-wrap: wrap;
}

.btn-approve {
    background: var(--ok);
    color: #fff;
}

.btn-reject {
    background: var(--danger-soft);
    color: var(--danger);
    border: 1px solid transparent;
}

.table-wrap {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: auto;
    box-shadow: var(--shadow-sm);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.admin-table th,
.admin-table td {
    text-align: left;
    padding: 0.6rem 0.7rem;
    border-bottom: 1px solid var(--line);
}

.admin-table th {
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

/* --- Toast -------------------------------------------------------------- */
.toast {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%) translateY(-90px);
    /* Feedback stays visible even with a sheet open. */
    z-index: 1200;
    background: var(--ink);
    color: var(--surface);
    padding: 0.7rem 1.15rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.84rem;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition: all 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
    max-width: calc(100vw - 2rem);
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.ok {
    background: var(--ok);
    color: #fff;
}

.toast.err {
    background: var(--danger);
    color: #fff;
}

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 520px) {
    .stage {
        padding: 0;
    }

    .app {
        min-height: 100vh;
    }

    .sheet {
        max-width: 100%;
    }
}

/* ==========================================================================
   Desktop layout — aside sections + taller scrolling feed
   (mobile keeps the single-column phone shell; ≥1080px expands to 3 columns)
   ========================================================================== */
.app-body {
    display: block;
    min-width: 0;
}

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

.aside {
    display: none;
}

/* --- Aside cards --------------------------------------------------------- */
.aside-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

.aside-card-title {
    font-weight: 800;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    color: var(--ink);
    margin-bottom: 0.55rem;
}

.aside-card-sub {
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 0.6rem;
}

.aside-chan-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.aside-nav {
    display: grid;
    gap: 0.3rem;
    padding: 0.5rem;
}

.aside-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.7rem;
    border-radius: var(--r-sm);
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text);
    background: transparent;
    text-align: left;
    transition: background 0.15s ease, color 0.15s ease;
}

.aside-nav-btn:hover {
    background: var(--surface-2);
}

.aside-nav-btn.is-active {
    background: var(--primary-soft);
    color: var(--primary);
}

.aside-nav-btn span {
    font-size: 1.05rem;
}

.aside-cat-list {
    display: grid;
    gap: 0.2rem;
}

.aside-cat {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.6rem;
    border-radius: var(--r-sm);
    font-weight: 700;
    font-size: 0.84rem;
    color: var(--text);
    background: transparent;
    text-align: left;
    transition: background 0.15s ease, color 0.15s ease;
}

.aside-cat:hover {
    background: var(--surface-2);
}

.aside-cat.is-active {
    background: var(--primary-soft);
    color: var(--primary);
}

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

.aside-how-list li {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.78rem;
    color: var(--text);
}

.aside-how-list li span {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 800;
    font-size: 0.7rem;
    display: grid;
    place-items: center;
}

.aside-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.aside-stat {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 0.55rem 0.6rem;
    display: grid;
    gap: 0.1rem;
}

.aside-stat b {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--ink);
}

.aside-stat span {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--muted);
}

.trend-list {
    display: grid;
    gap: 0.4rem;
}

.trend-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.55rem;
    border-radius: var(--r-sm);
    background: var(--surface-2);
    border: 1px solid var(--line);
    text-align: left;
    transition: transform 0.12s ease, border-color 0.15s ease;
}

.trend-item:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.trend-rank {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--grad-brand);
    color: #fff;
    font-weight: 800;
    font-size: 0.72rem;
    display: grid;
    place-items: center;
}

.trend-body {
    min-width: 0;
    display: grid;
    gap: 0.1rem;
}

.trend-title {
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trend-meta {
    font-size: 0.68rem;
    color: var(--muted);
    font-weight: 600;
}

.aside-muted {
    font-size: 0.78rem;
    color: var(--muted);
}

/* --- Wide screens -------------------------------------------------------- */
@media (min-width: 1080px) {
    .stage {
        padding: 18px 0;
        align-items: stretch;
    }

    .app {
        width: 100%;
        max-width: 1400px;
        min-height: 0;
        height: calc(100vh - 36px);
        border-radius: var(--r-xl);
        border: 1px solid var(--line);
        box-shadow: var(--shadow-lg);
        overflow: hidden;
        background: var(--surface);
    }

    .app-body {
        flex: 1;
        min-height: 0;
        display: grid;
        grid-template-columns: 280px minmax(0, 1fr) 320px;
        gap: 1.1rem;
        padding: 1.1rem 1.2rem;
        overflow: hidden;
    }

    .app-main {
        min-width: 0;
        min-height: 0;
        display: flex;
        flex-direction: column;
        gap: 0.9rem;
        overflow: hidden;
    }

    /* The aside carries channel identity/stats — drop the mobile banner. */
    .app-main .channel-strip {
        display: none;
    }

    /* Stories become a compact card at the top of the main column. */
    .app-main .stories {
        flex: none;
        margin: 0;
        padding: 0.6rem 0.5rem 0.4rem;
        border-radius: var(--r-lg);
        border: 1px solid var(--line);
        background: var(--surface);
        box-shadow: var(--shadow-sm);
    }

    /* Screens fill the remaining height and scroll independently, giving
       the feed list much more scroll space than the mobile shell. */
    .app-main .screen {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        padding: 0.2rem 0.6rem 1.4rem 0;
        scrollbar-width: thin;
    }

    .app-main .screen.is-active {
        display: block;
    }

    /* Keep the feed search/sort pinned while scrolling the list. */
    .feed-tools {
        position: sticky;
        top: 0;
        z-index: 6;
        padding: 0.5rem 0.2rem 0.55rem;
        margin: 0 0 0.6rem;
        background: color-mix(in srgb, var(--surface) 92%, transparent);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-radius: 0 0 var(--r) var(--r);
    }

    /* Independently scrollable aside columns. */
    .aside {
        display: block;
        min-width: 0;
        min-height: 0;
        overflow-y: auto;
        scrollbar-width: thin;
        padding-right: 0.15rem;
    }

    .aside-inner {
        display: grid;
        gap: 0.9rem;
        align-content: start;
    }

    /* The bottom nav is replaced by the left-aside nav on desktop. */
    .tabbar {
        display: none;
    }
}

/* ==========================================================================
   Custom scrollbars — match the brand (feed/main + aside columns)
   ========================================================================== */
.screen,
.aside {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--primary) 45%, transparent) transparent;
}

.screen::-webkit-scrollbar,
.aside::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

.screen::-webkit-scrollbar-track,
.aside::-webkit-scrollbar-track {
    background: transparent;
}

.screen::-webkit-scrollbar-thumb,
.aside::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--primary) 40%, transparent);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
    min-height: 40px;
}

.screen::-webkit-scrollbar-thumb:hover,
.aside::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--primary) 75%, transparent);
    background-clip: padding-box;
    border: 2px solid transparent;
}

.screen::-webkit-scrollbar-corner,
.aside::-webkit-scrollbar-corner {
    background: transparent;
}

/* ==========================================================================
   Place banner — the E-Tours (/space) bridge
   Shown when a place link scopes the channel to a county or country, or when
   the visitor filters/searches the channel themselves.
   ========================================================================== */
.place-banner {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    background: linear-gradient(135deg,
            color-mix(in srgb, var(--primary) 12%, var(--surface)),
            color-mix(in srgb, var(--pink) 9%, var(--surface)));
    border: 1px solid color-mix(in srgb, var(--primary) 26%, transparent);
    border-radius: var(--r);
    padding: 0.7rem 0.85rem;
    margin-bottom: 0.85rem;
}

/* `.hidden` is declared earlier in this file, so the banner's own `display`
   has to opt out explicitly for the class to actually hide it. */
.place-banner.hidden,
.pb-btn.hidden {
    display: none;
}

.place-banner-main {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    min-width: 0;
}

.place-banner-icon {
    font-size: 1rem;
    line-height: 1.4;
}

.place-banner-copy {
    flex: 1;
    min-width: 0;
}

.place-banner-text {
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--text);
}

.place-banner-stats,
.geo-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.45rem;
}

.geo-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: color-mix(in srgb, var(--surface) 72%, transparent);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.16rem 0.55rem;
    font-size: 0.72rem;
    color: var(--muted);
}

.geo-stat strong {
    color: var(--ink);
}

.geo-stat.muted {
    font-style: italic;
}

.geo-chips-label {
    width: 100%;
    font-size: 0.72rem;
    color: var(--muted);
}

.geo-chip {
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.16s, border-color 0.16s;
}

.geo-chip:hover {
    background: var(--primary-soft);
    border-color: color-mix(in srgb, var(--primary) 45%, transparent);
}

.geo-chip .muted {
    color: var(--muted);
    font-weight: 600;
}

.place-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.pb-btn {
    background: var(--surface);
    border: 1px solid var(--line-strong);
    color: var(--text);
    border-radius: 999px;
    padding: 0.32rem 0.7rem;
    font: inherit;
    font-size: 0.73rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.16s, border-color 0.16s;
}

.pb-btn:hover {
    background: var(--primary-soft);
    border-color: color-mix(in srgb, var(--primary) 45%, transparent);
}

.pb-btn-ghost {
    background: transparent;
}

/* The place pill rides with the category pill on a card… */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin: 0.15rem 0.9rem 0.4rem;
}

.post-tags .post-cat {
    margin: 0;
}

.post-place {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    background: var(--primary-soft);
    color: var(--primary-strong);
    border-radius: 999px;
    padding: 0.14rem 0.55rem;
    font-size: 0.68rem;
    font-weight: 800;
    white-space: nowrap;
}

/* …and with the category badge in the detail sheet / moderation queue. */
.detail-card .post-place {
    margin: 0 0 0.5rem 0.4rem;
}

.review-head .post-place {
    margin: 0;
}

/* The place filter sits beside search + sort. */
.place-select {
    max-width: 132px;
}

.field-hint {
    font-size: 0.72rem;
    line-height: 1.4;
    color: var(--muted);
}

@media (max-width: 520px) {

    /* Three controls do not fit one phone row — let search own its own line. */
    .feed-tools {
        flex-wrap: wrap;
    }

    .searchbox {
        flex: 1 1 100%;
    }

    .place-select,
    .sort-select {
        flex: 1 1 0;
        max-width: none;
    }
}