/* Organic - Anti-AI Social Media App */

:root {
    /* Phones: match the real layout viewport (100dvw when supported). Desktop: capped column. */
    --app-width: 100vw;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --bottom-nav-h: 80px;
    --bottom-nav-total: calc(var(--bottom-nav-h) + var(--safe-bottom));
    --post-media-gutter: 14px;
    --post-image-radius: 24px;
    /* Brand orange — burnt orange (#F15A24), aligned with logo + login gradient */
    --brand-orange: #f15a24;
    --brand-orange-mid: #eb5e28;
    --brand-orange-light: #ff7a4d;
    --brand-orange-soft: #f06b3a;
    --brand-orange-deep: #c4491d;
    --brand-orange-darker: #9e3b18;
    --brand-gradient-avatar: linear-gradient(135deg, var(--brand-orange-light), var(--brand-orange));
    --brand-gradient-video: linear-gradient(90deg, var(--brand-orange-deep) 0%, var(--brand-orange) 50%, var(--brand-orange-light) 100%);
    --brand-gradient-video-mid: linear-gradient(90deg, var(--brand-orange-deep), var(--brand-orange) 45%, var(--brand-orange-light));
    /* Legacy alias — most UI references this name */
    --brand-red: var(--brand-orange);
    --bg-dark: #000000;
    --bg-darker: #000000;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    /* Neutral rails — slightly clearer warm-grey lines */
    --divider: rgba(255, 255, 255, 0.11);
    --divider-strong: rgba(255, 255, 255, 0.18);
    --border-subtle: var(--divider);
    /* Orange accents (inputs on focus, active chips, subtle fills) */
    --outline-orange: rgba(241, 90, 36, 0.42);
    --outline-orange-muted: rgba(241, 90, 36, 0.16);
    --outline-orange-soft: rgba(241, 90, 36, 0.1);
    /* Focus rings (dark = brand orange; light theme overrides to black) */
    --focus-outline: var(--brand-red);
    --focus-outline-shadow: rgba(241, 90, 36, 0.35);
    --input-focus-bg: rgba(241, 90, 36, 0.05);
    --bg-primary: #0a0a0a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@supports (width: 100dvw) {
    :root {
        --app-width: 100dvw;
    }
}

/* Centered column only on wide desktops — 641px matched iPads + “Request Desktop Site” and looked like a narrow strip */
@media (min-width: 960px) {
    :root {
        --app-width: min(640px, 100vw);
        --post-media-gutter: 14px;
    }

    @supports (width: 100dvw) {
        :root {
            --app-width: min(640px, 100dvw);
        }
    }
}

html {
    height: 100%;
    /* iOS Safari / Home Screen: use visible viewport, not the tall 100vh bug */
    height: -webkit-fill-available;
    overflow-x: clip;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #000000;
    color: var(--text-primary);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    width: 100%;
    max-width: 100%;
    min-height: 100%;
    min-height: -webkit-fill-available;
}

/* Screen Management */
.screen {
    display: none;
    /* Full-bleed on phones; centered column from breakpoint */
    left: 0;
    right: 0;
    width: auto;
    max-width: none;
    transform: none;
    /* Dynamic viewport avoids iOS 100vh extending under the URL bar */
    height: 100vh;
    height: 100dvh;
    min-height: -webkit-fill-available;
    position: absolute;
    top: 0;
    box-sizing: border-box;
}

@media (min-width: 960px) {
    .screen {
        width: var(--app-width);
        max-width: 100%;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* ===== CAPTURE SCREEN ===== */
.camera-viewfinder {
    width: 100%;
    height: 100%;
    background: #000;
    position: relative;
    overflow: hidden;
}

#camera-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* contain = full sensor frame (matches canvas crop math); cover zoomed past the capture region */
    object-fit: contain;
    transform: scaleX(-1); /* Mirror front camera */
}

.viewfinder-overlay {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    z-index: 2;
    pointer-events: none;
}

.viewfinder-overlay > * {
    pointer-events: auto;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 60px 24px 16px;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.aspect-ratio-bar {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 0 16px 12px;
    flex-shrink: 0;
    pointer-events: auto;
    position: relative;
    z-index: 2;
}

.aspect-preset-btn {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.55);
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.aspect-preset-btn:hover {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(0, 0, 0, 0.65);
}

.aspect-preset-btn.active {
    background: var(--brand-red);
    border-color: var(--brand-red);
    color: #fff;
}

.camera-frame {
    flex: 1;
    min-height: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* Position/size set in camera.js from stream resolution + same crop as photo/video capture */
.aspect-guide {
    box-sizing: border-box;
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 1;
    border: 2px solid rgba(255, 255, 255, 0.55);
    border-radius: 6px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.52);
}

.aspect-guide.is-visible {
    visibility: visible;
}

.viewfinder-overlay > .aspect-guide {
    pointer-events: none;
}

.time {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.organic-logo {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 0.5px;
    color: var(--brand-red);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.shutter-button {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--brand-red);
    margin: 0 auto 60px;
    flex-shrink: 0;
    border: 4px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 4px 20px rgba(241, 90, 36, 0.4);
}

.shutter-button:active {
    transform: scale(0.9);
    box-shadow: 0 2px 10px rgba(241, 90, 36, 0.6);
}

.shutter-button.shutter-button--recording {
    background: #c41e3a;
    border-color: rgba(255, 255, 255, 0.55);
    box-shadow:
        0 0 0 3px rgba(255, 80, 80, 0.45),
        0 4px 24px rgba(196, 30, 58, 0.55);
    animation: shutter-rec-pulse 1.1s ease-in-out infinite;
}

@keyframes shutter-rec-pulse {
    50% {
        box-shadow:
            0 0 0 5px rgba(255, 80, 80, 0.35),
            0 4px 28px rgba(196, 30, 58, 0.65);
    }
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #000000;
    min-height: 70px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

/* In-app headers: feed grid mark (profile, etc.) */
.header-feed-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--brand-red);
}

.header-feed-mark svg {
    width: 32px;
    height: 32px;
    display: block;
}

a.header-feed-mark {
    text-decoration: none;
    color: var(--brand-red);
    transition: color 0.2s ease, transform 0.2s ease;
}

a.header-feed-mark:hover {
    color: var(--brand-orange-light);
    transform: scale(1.05);
}

a.header-feed-mark:active {
    transform: scale(0.98);
}

.icon-btn:hover {
    color: var(--brand-red);
    transform: scale(1.1);
}

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

/* Feed — account search (compact, centered, black / white) */
.feed-search-wrap {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: max(8px, var(--safe-top)) 12px 10px;
    box-sizing: border-box;
    flex-shrink: 0;
    background: #000000;
    overflow: visible;
    /* Above .feed so the notifications dropdown (which overlaps the feed) isn’t painted under scroll content */
    z-index: 20;
    border: none;
    box-shadow: none;
}

.feed-search-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    max-width: 304px;
    margin: 0 auto;
    border: none;
    box-shadow: none;
}

.feed-notif-wrap {
    position: relative;
    flex-shrink: 0;
    z-index: 150;
}

.feed-notif-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.feed-notif-btn:hover {
    color: var(--text-primary);
    background: var(--outline-orange-soft);
}

.feed-notif-btn:focus-visible {
    outline: 2px solid var(--focus-outline);
    outline-offset: 2px;
}

.feed-notif-icon {
    display: block;
}

.feed-notif-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--brand-red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 0 0 2px #000000;
    pointer-events: none;
}

.feed-notif-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(320px, calc(var(--app-width) - 32px));
    max-height: min(360px, 52vh);
    overflow-x: hidden;
    overflow-y: auto;
    /* Above .bottom-nav (z-index 100) so the list is visible */
    z-index: 200;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Opaque surface; isolation keeps it visually solid over the feed */
    isolation: isolate;
    background-color: #121212;
    background: #121212;
    color: var(--text-primary);
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.75);
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.feed-notif-panel::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.feed-notif-toolbar {
    display: flex;
    justify-content: flex-end;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.feed-notif-mark-all {
    margin: 0;
    padding: 4px 8px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--brand-orange);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.feed-notif-mark-all:hover {
    background: var(--outline-orange-soft);
}

.feed-notif-mark-all:focus-visible {
    outline: 2px solid var(--focus-outline);
    outline-offset: 2px;
}

.feed-notif-empty {
    padding: 20px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
}

.feed-notif-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 14px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: background 0.12s ease;
}

.feed-notif-item:hover {
    background: var(--outline-orange-soft);
}

.feed-notif-item:focus-visible {
    outline: 2px solid var(--focus-outline);
    outline-offset: -2px;
}

.feed-notif-item--unread {
    background: rgba(241, 90, 36, 0.06);
}

.feed-notif-text {
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-primary);
}

.feed-notif-text strong {
    font-weight: 600;
    color: var(--text-primary);
}

.feed-notif-preview {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.35;
    color: var(--text-secondary);
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feed-notif-preview-k {
    color: var(--text-secondary);
    font-weight: 500;
}

.feed-notif-preview .mention-link {
    pointer-events: auto;
}

.feed-notif-actor {
    font-weight: 600;
}

a.mention-link {
    color: var(--brand-orange);
    font-weight: 600;
    text-decoration: none;
    word-break: break-word;
}

a.mention-link:hover {
    text-decoration: underline;
}

.post-thought-text .mention-link,
.post-caption .mention-link,
.post-comment-text .mention-link {
    color: var(--brand-orange);
}

.feed-notif-item-time {
    font-size: 11px;
    color: var(--text-secondary);
}

.feed-refresh-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.feed-refresh-btn:hover {
    color: var(--text-primary);
    background: var(--outline-orange-soft);
}

.feed-communities-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(255, 184, 128, 0.65);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 154, 73, 0.32), rgba(241, 90, 36, 0.32));
    color: #ffe2cc;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow:
        0 0 0 1px rgba(255, 120, 64, 0.2) inset,
        0 8px 22px rgba(241, 90, 36, 0.22);
    transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.feed-communities-btn:hover {
    color: #fff3e7;
    border-color: rgba(255, 205, 160, 0.92);
    background: linear-gradient(135deg, rgba(255, 168, 94, 0.48), rgba(241, 90, 36, 0.48));
    box-shadow:
        0 0 0 1px rgba(255, 145, 84, 0.35) inset,
        0 10px 28px rgba(241, 90, 36, 0.34);
}

.feed-communities-btn:active {
    transform: scale(0.96);
    box-shadow:
        0 0 0 1px rgba(255, 145, 84, 0.3) inset,
        0 5px 16px rgba(241, 90, 36, 0.24);
}

.feed-communities-btn:focus-visible {
    outline: 2px solid var(--focus-outline);
    outline-offset: 2px;
}

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

.feed-refresh-btn:focus-visible {
    outline: 2px solid var(--focus-outline);
    outline-offset: 2px;
}

.feed-search {
    width: 100%;
    max-width: 240px;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px 6px 12px;
    border-radius: 999px;
    border: none;
    /* Muted track always visible (was only on :focus-within) */
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
    box-sizing: border-box;
    box-shadow: none;
}

/* ===== Communities page ===== */
#communities-screen {
    background: var(--bg-darker);
}

.communities-header {
    gap: 10px;
}

.communities-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 14px;
    box-sizing: border-box;
}

.communities-content::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.community-create-panel {
    padding: 14px;
    border-radius: 14px;
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.02);
}

.community-create-title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 800;
}

.community-create-sub {
    margin: 0 0 12px;
    color: var(--text-secondary);
    font-size: 13px;
}

.community-create-form {
    display: grid;
    gap: 10px;
}

#communities-screen .edit-input,
#communities-screen .edit-textarea {
    width: 100%;
    box-sizing: border-box;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    font-size: 14px;
    padding: 10px 12px;
    outline: none;
}

#communities-screen .edit-textarea {
    resize: vertical;
    min-height: 74px;
}

#communities-screen .edit-input::placeholder,
#communities-screen .edit-textarea::placeholder {
    color: rgba(255, 255, 255, 0.48);
}

#communities-screen .edit-input:focus,
#communities-screen .edit-textarea:focus {
    border-color: rgba(241, 90, 36, 0.7);
    box-shadow: 0 0 0 1px rgba(241, 90, 36, 0.22);
}

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

#communities-screen .avatar-file-input,
#community-screen .avatar-file-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.community-image-preview {
    width: 100%;
    min-height: 120px;
    max-height: 320px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.2);
}

.community-image-preview img {
    width: 100%;
    max-height: 320px;
    height: auto;
    object-fit: contain;
    display: block;
}

.communities-list-wrap {
    margin-top: 14px;
}

.community-list-title {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 800;
}

.communities-list {
    display: grid;
    gap: 10px;
}

.community-card {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.02);
}

.community-card-actions {
    display: grid;
    gap: 6px;
    justify-items: end;
}

#communities-screen .btn-follow-list,
#community-screen .btn-follow-list {
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border-radius: 999px;
    height: 34px;
    padding: 0 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

#communities-screen .btn-follow-list.btn-follow-list--active,
#community-screen .btn-follow-list.btn-follow-list--active {
    border-color: transparent;
    background: linear-gradient(135deg, #ff7a4d, #f15a24);
    color: #ffffff;
}

.community-card-image {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ff7a4d, #f15a24);
    background-size: cover;
    background-position: center;
}

.community-card-name {
    margin: 0;
    font-size: 14px;
    font-weight: 800;
}

.community-card-link {
    color: var(--text-primary);
    text-decoration: none;
}

.community-card-link:hover {
    color: var(--brand-orange);
}

.community-card-desc {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.community-card-meta {
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-secondary);
}

.community-delete-btn {
    color: rgba(255, 119, 119, 0.9);
}

#community-screen {
    background: var(--bg-darker);
}

.community-hero {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.02);
}

.community-hero-image {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    background: linear-gradient(135deg, #ff7a4d, #f15a24);
    background-size: cover;
    background-position: center;
}

.community-hero-name {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
}

.community-hero-desc {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.community-hero-meta {
    margin: 6px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
}

#community-screen .community-create-panel {
    margin-top: 14px;
}

.feed-search:focus-within {
    /* Same fill as default — no “lights up” on click */
    background: rgba(255, 255, 255, 0.07);
    border: none;
    box-shadow: none;
    outline: none;
}

.feed-search-icon {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    color: rgba(255, 255, 255, 0.65);
}

.feed-search-input {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 4px 0;
    margin: 0;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 500;
    color: #ffffff;
    background: transparent;
    border: none;
    outline: none;
    box-shadow: none;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.feed-search-input:focus {
    outline: none;
    box-shadow: none;
}

/* Edge / some browsers still paint a hairline on type="search" */
.feed-search-input[type='search'] {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.feed-search-input[type='search']::-ms-clear {
    display: none;
    width: 0;
    height: 0;
}

.feed-search-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.feed-search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

.search-results {
    position: absolute;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(240px, calc(var(--app-width) - 24px));
    top: calc(100% - 2px);
    z-index: 50;
    max-height: min(240px, 40vh);
    overflow-y: auto;
    border-radius: 10px;
    border: none;
    background: #000000;
    color: var(--text-primary);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.65);
}

.search-results-status {
    padding: 16px;
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
}

.search-results-error {
    color: var(--brand-red);
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.search-result-item:hover,
.search-result-item:focus {
    background: rgba(241, 90, 36, 0.07);
    outline: none;
}

.search-result-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--brand-gradient-avatar);
}

.search-result-avatar:has(.search-result-avatar-img) {
    background: #1a1a1a;
}

.search-result-avatar-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.search-result-name {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
}

.search-result-sub {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Feed */
.feed {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding-bottom: var(--bottom-nav-total);
    max-width: 100%;
    box-sizing: border-box;
    scrollbar-width: none;
    border: none;
    box-shadow: none;
    position: relative;
    z-index: 0;
}

.post {
    margin-bottom: 36px;
    background: #000000;
    padding-bottom: 20px;
    overflow-x: hidden;
    max-width: 100%;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

a.post-header-author {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

a.post-header-author:hover .username,
a.post-header-author:focus-visible .username {
    text-decoration: underline;
}

a.post-header-author:focus-visible {
    outline: 2px solid var(--brand-red);
    outline-offset: 2px;
    border-radius: 4px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--brand-gradient-avatar);
    border: 2px solid var(--brand-red);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.username {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.timestamp {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.post-image {
    --post-image-max-h: min(56vh, 480px);
    width: calc(100% - (2 * var(--post-media-gutter)));
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    background: #000000;
    position: relative;
    overflow: hidden;
    border-radius: var(--post-image-radius, 24px);
    box-shadow: inset 0 0 0 1px var(--divider);
    box-sizing: border-box;
}

/* Feed-specific: remove the inset outline only in the main feed screen. */
#feed-screen .post-image {
    box-shadow: none;
}

.post-image:not(.post-image--video) {
    max-height: var(--post-image-max-h);
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-image img {
    width: 100%;
    max-height: var(--post-image-max-h);
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: inherit;
}

/* Grainy, authentic photo effects */
.post-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.009) 2px,
            rgba(255, 255, 255, 0.009) 4px
        );
    pointer-events: none;
    z-index: 2;
}

.post-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    background: 
        radial-gradient(circle at 20% 30%, rgba(241, 90, 36, 0.02), transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(0, 0, 0, 0.18), transparent 50%);
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 1;
}

.image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.image-text {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    font-style: italic;
    opacity: 0.6;
}

.grainy-1 {
    background: linear-gradient(135deg, #0d0503 0%, #000000 100%);
}

.grainy-2 {
    background: linear-gradient(180deg, #120805 0%, #000000 100%);
}

.grainy-3 {
    background: linear-gradient(45deg, #0d0503 0%, #000000 100%);
}

.post-caption {
    padding: 16px 20px 0;
}

.post-caption p {
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-primary);
    font-weight: 400;
}

/* Create: photo vs thought */
.post-type-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.post-type-modal[hidden] {
    display: none;
}

.post-type-modal-backdrop {
    position: absolute;
    inset: 0;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.72);
}

.post-type-modal-card {
    position: relative;
    width: 100%;
    max-width: 252px;
    padding: 16px 14px 12px;
    border-radius: 14px;
    border: 1px solid var(--divider-strong);
    background: #0a0a0a;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.post-type-heading {
    font-size: 16px;
    font-weight: 900;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 2px;
    letter-spacing: 0.02em;
}

.post-type-sub {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 12px;
    font-weight: 500;
    line-height: 1.35;
}

.post-type-actions {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.post-type-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid var(--divider-strong);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.post-type-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.post-type-btn:active {
    transform: scale(0.98);
}

/* Photo / Video / Thought — same Organic orange highlight */
.post-type-btn-photo,
.post-type-btn-video,
.post-type-btn-thought {
    border-color: rgba(241, 90, 36, 0.38);
    color: var(--text-primary);
}

.post-type-btn-photo:hover,
.post-type-btn-video:hover,
.post-type-btn-thought:hover {
    border-color: var(--brand-red);
    background: rgba(241, 90, 36, 0.14);
    color: var(--text-primary);
}

.post-type-btn-photo:focus-visible,
.post-type-btn-video:focus-visible,
.post-type-btn-thought:focus-visible {
    outline: none;
    border-color: var(--brand-red);
    background: rgba(241, 90, 36, 0.12);
    box-shadow: 0 0 0 2px rgba(241, 90, 36, 0.45);
}

.post-type-cancel {
    width: 100%;
    margin-top: 8px;
    padding: 8px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.post-type-cancel:hover {
    color: var(--text-primary);
}

/* Thought composer screen */
#thought-screen {
    background: #000000;
}

.thought-composer {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
}

.thought-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 48px 14px 12px;
    border-bottom: 1px solid var(--divider);
    flex-shrink: 0;
}

.thought-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
}

.thought-top-spacer {
    width: 56px;
    flex-shrink: 0;
}

.thought-input-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 12px 14px 0;
    box-sizing: border-box;
}

.thought-input {
    flex: 1;
    width: 100%;
    min-height: 140px;
    max-height: min(42vh, 300px);
    padding: 12px 14px;
    margin: 0;
    border: 1px solid var(--divider-strong);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.5;
    font-family: inherit;
    resize: none;
    box-sizing: border-box;
}

.thought-input::placeholder {
    color: var(--text-secondary);
}

.thought-input:focus {
    outline: none;
}

.thought-bottom {
    padding: 12px 16px 22px;
    flex-shrink: 0;
    border-top: 1px solid var(--divider);
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Thought-only post in feed */
.post--thought .post-thought {
    padding: 8px 20px 4px;
}

.post-thought-text {
    font-size: 17px;
    line-height: 1.55;
    color: var(--text-primary);
    font-weight: 500;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: auto;
    max-width: none;
    transform: none;
    height: var(--bottom-nav-total);
    min-height: var(--bottom-nav-total);
    background: #000000;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 max(24px, var(--safe-left)) var(--safe-bottom) max(24px, var(--safe-right));
    z-index: 100;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.55);
    box-sizing: border-box;
}

@media (min-width: 960px) {
    .bottom-nav {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: var(--app-width);
        max-width: 100%;
    }
}

.nav-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 12px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn.active:not(.capture-btn) {
    color: var(--brand-red);
}

.nav-btn:hover {
    color: var(--text-primary);
}

/* Capture uses a masked logo, not currentColor — don’t rely on generic nav hover */
.capture-btn:hover {
    color: inherit;
}

.capture-btn {
    position: relative;
    padding: 8px;
}

.capture-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
}

.capture-logo {
    --capture-base-glow:
        drop-shadow(0 0 1px rgba(255, 255, 255, 0.55))
        drop-shadow(0 0 2px rgba(255, 255, 255, 0.28))
        drop-shadow(0 0 10px rgba(255, 255, 255, 0.1));
    display: block;
    flex-shrink: 0;
    /* Mask uses PNG — logo.svg’s <text> is ignored by CSS masks in most browsers */
    width: 56px;
    height: 56px;
    background-color: var(--brand-red);
    -webkit-mask-image: url(favicon.png);
    mask-image: url(favicon.png);
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    filter: var(--capture-base-glow);
    transition: transform 0.2s ease, filter 0.2s ease;
}

.capture-btn:hover .capture-logo,
.capture-btn:focus-visible .capture-logo {
    filter: var(--capture-base-glow) drop-shadow(0 0 2px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 12px rgba(255, 255, 255, 0.65))
        drop-shadow(0 0 24px rgba(255, 255, 255, 0.4));
}

.capture-btn:active .capture-logo {
    transform: scale(0.9);
    filter: var(--capture-base-glow) drop-shadow(0 0 3px rgba(255, 255, 255, 1)) drop-shadow(0 0 16px rgba(255, 255, 255, 0.75))
        drop-shadow(0 0 28px rgba(255, 255, 255, 0.5));
}

/* Scrollbar (hidden; scroll still works) */
.feed::-webkit-scrollbar {
    width: 0;
    height: 0;
}

/* Phones, iPads, narrow windows: full-width shell + larger tab bar (avoid letterboxed 640px column) */
@media (max-width: 959px) {
    :root {
        --post-media-gutter: 0px;
        --post-image-radius: 0px;
        --bottom-nav-h: 120px;
    }

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

    .bottom-nav {
        width: 100%;
        max-width: 100%;
    }

    .nav-btn {
        padding: 20px 26px;
        min-width: 56px;
        min-height: 56px;
    }

    .nav-btn svg {
        width: 36px;
        height: 36px;
    }

    .capture-btn {
        padding: 12px 16px;
    }

    .capture-logo-wrap {
        width: 72px;
        height: 72px;
    }

    .capture-logo {
        width: 72px;
        height: 72px;
    }

    .feed-search-row {
        max-width: none;
    }

    .feed-search {
        max-width: none;
    }

    .search-results {
        width: calc(100% - 8px);
        max-width: min(420px, calc(100vw - 24px));
    }

    .thought-input-wrap,
    .thought-bottom {
        max-width: none;
        margin-left: 0;
        margin-right: 0;
    }

    .post-image {
        --post-image-max-h: min(70vh, 780px);
    }

    .post-image--video video,
    .organic-video-player video {
        max-height: min(70vh, 800px);
    }
}

@supports (height: 1dvh) {
    @media (max-width: 959px) {
        .post-image {
            --post-image-max-h: min(70dvh, 780px);
        }

        .post-image--video video,
        .organic-video-player video {
            max-height: min(70dvh, 800px);
        }
    }
}

/* Mobile Optimization */
@media (max-width: 480px) {
    .app-header {
        padding: 50px 16px 16px;
    }
    
    .post-header,
    .post-caption {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* Typography - Humanist Sans-Serif */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700;900&display=swap');

body {
    font-weight: 400;
}

h1, h2, h3, .username {
    font-weight: 900;
}

/* ===== LOGIN / VERIFY (auth) ===== */
.login-container {
    width: 100%;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-darker);
    padding: max(24px, var(--safe-top)) max(20px, var(--safe-right)) max(24px, var(--safe-bottom)) max(20px, var(--safe-left));
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.login-container::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.login-content {
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.login-logo {
    font-size: 48px;
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.login-logo-container {
    margin-bottom: 20px;
}

.login-logo-img {
    width: 120px;
    height: auto;
}

.login-tagline {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 40px;
    font-weight: 700;
}

.login-actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

/* Inline auth feedback (replaces browser alert on login / signup errors) */
.auth-form-message {
    margin: 0;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    text-align: left;
    border: 1px solid rgba(241, 90, 36, 0.45);
    background: rgba(241, 90, 36, 0.14);
    color: var(--text-primary);
    outline: none;
}

.auth-form-message:focus-visible {
    box-shadow: 0 0 0 2px var(--focus-outline-shadow);
}

.auth-form-message--success {
    border-color: rgba(76, 175, 80, 0.55);
    background: rgba(76, 175, 80, 0.12);
    font-weight: 600;
}

.auth-form-message[hidden] {
    display: none !important;
}

.auth-form input {
    width: 100%;
    padding: 16px 20px;
    background: #000000;
    border: 2px solid var(--divider-strong);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--brand-red);
    background: #000000;
    box-shadow: 0 0 0 1px rgba(241, 90, 36, 0.2);
}

.auth-form input::placeholder,
.auth-form textarea::placeholder {
    color: var(--text-secondary);
}

.auth-field-label {
    display: block;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    margin-bottom: 6px;
    margin-top: 4px;
}

.auth-signup-profile .auth-field-label:first-of-type {
    margin-top: 0;
}

.auth-optional {
    font-weight: 500;
    opacity: 0.85;
}

.auth-field-hint {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: left;
    margin: -2px 0 8px;
    line-height: 1.4;
}

.auth-form textarea {
    width: 100%;
    padding: 14px 18px;
    min-height: 88px;
    resize: vertical;
    background: #000000;
    border: 2px solid var(--divider-strong);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-form textarea:focus {
    outline: none;
    border-color: var(--brand-red);
    box-shadow: 0 0 0 1px rgba(241, 90, 36, 0.2);
}

.auth-bio-count {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: right;
    margin-top: 4px;
}

.auth-username-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    padding: 4px 6px 4px 12px;
    background: #000000;
    border: 2px solid var(--divider-strong);
    border-radius: 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-username-wrap:focus-within {
    border-color: var(--brand-red);
    box-shadow: 0 0 0 1px rgba(241, 90, 36, 0.2);
}

.auth-username-at {
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}

.auth-username-input {
    flex: 1;
    min-width: 0;
    padding: 12px 12px 12px 4px !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

.auth-username-input:focus {
    box-shadow: none !important;
}

.signup-avatar-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    justify-content: flex-start;
}

.signup-avatar-preview {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--brand-gradient-avatar);
    /* Single hairline ring — avoids the “double edge” from 2px border + clipped img */
    border: none;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow:
        0 0 0 1px var(--divider-strong),
        0 4px 16px rgba(0, 0, 0, 0.35);
}

.signup-avatar-preview.has-photo {
    background: #1a1a1a;
    box-shadow:
        0 0 0 1px rgba(241, 90, 36, 0.45),
        0 4px 16px rgba(0, 0, 0, 0.35);
}

.signup-avatar-preview.organic-avatar-loading {
    background: #1a1a1a;
    /* Match .has-photo ring so the outline doesn’t shift when the image fades in */
    box-shadow:
        0 0 0 1px rgba(241, 90, 36, 0.45),
        0 4px 16px rgba(0, 0, 0, 0.35);
}

.signup-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: 50%;
    /* Bleed past the clip by 1px to hide subpixel gaps / anti-alias halos */
    transform: scale(1.055);
    transform-origin: center center;
    opacity: 0;
    transition: opacity 0.28s ease-out;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.signup-avatar-img.signup-avatar-img--visible {
    opacity: 1;
}

.signup-avatar-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.signup-avatar-file-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.btn-secondary--compact {
    padding: 10px 16px;
    font-size: 14px;
    width: auto;
    align-self: flex-start;
}

.btn-text {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.btn-text:hover {
    color: var(--brand-red);
}

.btn-text:focus-visible {
    outline: 2px solid var(--focus-outline);
    outline-offset: 2px;
    border-radius: 4px;
}

.btn-primary {
    width: 100%;
    padding: 18px 32px;
    background: var(--brand-red);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(241, 90, 36, 0.3);
}

.btn-primary:hover {
    background: var(--brand-orange-deep);
    box-shadow: 0 6px 24px rgba(241, 90, 36, 0.4);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 12px rgba(241, 90, 36, 0.4);
}

.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--divider-strong);
}

.btn-secondary {
    width: 100%;
    padding: 18px 32px;
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--divider-strong);
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    border-color: var(--brand-red);
    color: var(--brand-red);
}

.btn-secondary.secondary-mode {
    border-color: var(--text-secondary);
    color: var(--text-secondary);
}

.btn-secondary.secondary-mode:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

/* Toggle login ↔ signup (inline, not a second full-width button) */
.auth-switch {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.auth-switch #auth-switch-prefix {
    margin-right: 6px;
}

.btn-inline {
    display: inline;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    font: inherit;
    font-size: inherit;
    font-weight: 700;
    color: var(--brand-red);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.btn-inline:hover {
    color: var(--brand-orange-light);
}

.btn-inline:focus-visible {
    outline: 2px solid var(--focus-outline);
    outline-offset: 2px;
    border-radius: 4px;
}

.login-disclaimer {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.6;
    font-weight: 700;
}

/* ===== Login / verify landing (radial orange gradient) ===== */
body.login-landing {
    background:
        radial-gradient(ellipse 120% 100% at 50% 36%, #ff7a4d 0%, #eb5e28 26%, #f15a24 52%, #c4491d 78%, #9e3b18 100%);
    background-color: #c4491d;
    background-attachment: fixed;
    color: #ffffff;
}

body.login-landing .login-x-link {
    position: fixed;
    top: max(12px, var(--safe-top));
    right: max(12px, var(--safe-right));
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    padding: 0;
    border-radius: 14px;
    background: #ffffff;
    color: #0f1419;
    border: 1px solid rgba(255, 255, 255, 0.65);
    text-decoration: none;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.12),
        0 8px 24px rgba(0, 0, 0, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

body.login-landing .login-x-link:hover {
    background: #fafafa;
    color: #0f1419;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.14),
        0 12px 32px rgba(0, 0, 0, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

body.login-landing .login-x-link:active {
    transform: scale(0.97);
    box-shadow:
        0 1px 4px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

body.login-landing .login-x-link:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.95);
    outline-offset: 3px;
}

body.login-landing .login-x-icon {
    display: block;
}

body.login-landing .login-container {
    background: transparent;
}

body.login-landing .login-landing-hero {
    margin-bottom: 28px;
}

body.login-landing .login-logo-img {
    width: 132px;
    max-width: min(40vw, 160px);
    height: auto;
    filter:
        brightness(0)
        invert(1)
        drop-shadow(0 2px 8px rgba(0, 0, 0, 0.12))
        drop-shadow(0 8px 32px rgba(0, 0, 0, 0.22));
}

body.login-landing .login-tagline {
    color: rgba(255, 255, 255, 0.96);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    margin-bottom: 0;
}

/* Wrapper only — no card chrome; form sits on the gradient */
body.login-landing .login-landing-panel {
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

body.login-landing .auth-form input,
body.login-landing .auth-form textarea {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.28);
    color: #ffffff;
}

body.login-landing .auth-form input:focus,
body.login-landing .auth-form textarea:focus {
    background: rgba(0, 0, 0, 0.58);
    border-color: rgba(255, 255, 255, 0.45);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

body.login-landing .auth-form input::placeholder,
body.login-landing .auth-form textarea::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

body.login-landing .auth-field-label {
    color: rgba(255, 255, 255, 0.82);
}

body.login-landing .auth-field-hint,
body.login-landing .auth-bio-count {
    color: rgba(255, 255, 255, 0.62);
}

body.login-landing .auth-username-wrap {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.28);
}

body.login-landing .auth-username-at {
    color: rgba(255, 255, 255, 0.55);
}

body.login-landing .btn-primary {
    background: #ffffff;
    color: var(--brand-orange);
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.22);
}

body.login-landing .btn-primary:hover {
    background: #fff8e1;
    color: var(--brand-orange-darker);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.26);
}

body.login-landing .btn-primary:active {
    box-shadow: 0 3px 16px rgba(0, 0, 0, 0.22);
}

body.login-landing .btn-primary:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.95);
    outline-offset: 3px;
}

body.login-landing .btn-text {
    color: rgba(255, 255, 255, 0.78);
}

body.login-landing .btn-text:hover {
    color: #fffde7;
}

body.login-landing .auth-form-message {
    border-color: rgba(255, 183, 77, 0.55);
    background: rgba(0, 0, 0, 0.35);
    color: #ffffff;
}

body.login-landing .auth-form-message--success {
    border-color: rgba(129, 199, 132, 0.65);
    background: rgba(0, 0, 0, 0.35);
}

body.login-landing .btn-inline {
    color: #fffde7;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

body.login-landing .btn-inline:hover {
    color: #ffffff;
}

body.login-landing .auth-switch {
    color: rgba(255, 255, 255, 0.88);
}

body.login-landing .btn-secondary {
    border-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
}

body.login-landing .btn-secondary:hover {
    border-color: #ffffff;
    color: #ffffff;
}

body.login-landing .login-disclaimer {
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

body.login-landing .divider {
    color: rgba(255, 255, 255, 0.75);
}

body.login-landing .divider::before,
body.login-landing .divider::after {
    background: rgba(255, 255, 255, 0.28);
}

body.login-landing .verify-title {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    margin-bottom: 8px;
}

body.login-landing .verify-subtitle {
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 0;
}

body.login-landing .login-trademark,
body.landing-page .login-trademark {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.82);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.24);
    z-index: 5;
    pointer-events: none;
    user-select: none;
}

/* ===== Public landing page (pre-auth) ===== */
body.landing-page {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    overflow: hidden;
    color: #ffffff;
    background:
        radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 20%, rgba(0, 0, 0, 0) 46%),
        radial-gradient(ellipse 120% 110% at 50% 45%, #ff7a4d 0%, #eb5e28 28%, #f15a24 54%, #c4491d 80%, #9e3b18 100%);
}

.landing-gradient-layer {
    position: fixed;
    inset: -18vmax;
    pointer-events: none;
    filter: blur(36px);
    opacity: 0.7;
    background:
        radial-gradient(34vmax 28vmax at 42% 36%, rgba(255, 198, 95, 0.45), rgba(255, 136, 42, 0.08) 68%, transparent 100%),
        radial-gradient(28vmax 24vmax at 64% 58%, rgba(255, 93, 33, 0.48), rgba(255, 93, 33, 0.08) 72%, transparent 100%);
    animation: landingFloatA 14s ease-in-out infinite alternate;
}

.landing-gradient-layer--second {
    opacity: 0.58;
    filter: blur(52px);
    animation: landingFloatB 18s ease-in-out infinite alternate;
}

.landing-x-link {
    position: fixed;
    top: max(12px, var(--safe-top));
    right: max(12px, var(--safe-right));
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: #ffffff;
    color: #0f1419;
    border: 1px solid rgba(255, 255, 255, 0.62);
    text-decoration: none;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.12),
        0 8px 24px rgba(0, 0, 0, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.92);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.landing-x-link:hover {
    background: #fafafa;
    transform: translateY(-1px);
}

.landing-x-link:active {
    transform: scale(0.97);
}

.landing-x-link:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.95);
    outline-offset: 3px;
}

.landing-x-icon {
    display: block;
}

.landing-shell {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(28px, var(--safe-top)) max(20px, var(--safe-right)) max(28px, var(--safe-bottom)) max(20px, var(--safe-left));
    box-sizing: border-box;
}

.landing-card {
    width: min(480px, 100%);
    text-align: center;
}

.landing-logo {
    width: clamp(112px, 28vw, 156px);
    height: auto;
    filter:
        brightness(0)
        invert(1)
        drop-shadow(0 2px 8px rgba(0, 0, 0, 0.12))
        drop-shadow(0 10px 34px rgba(0, 0, 0, 0.28));
}

.landing-headline {
    margin: 20px 0 10px;
    font-size: clamp(30px, 5.8vw, 46px);
    line-height: 1.06;
    letter-spacing: -0.02em;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.landing-subhead {
    margin: 0 auto;
    max-width: 34ch;
    color: rgba(255, 255, 255, 0.9);
    font-size: clamp(14px, 2.7vw, 17px);
    line-height: 1.5;
}

.landing-actions {
    margin-top: 28px;
    display: grid;
    gap: 10px;
}

.landing-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: 0.01em;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.landing-cta--primary {
    background: #ffffff;
    color: #d24a1f;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.22);
}

.landing-cta--primary:hover {
    background: #fff6df;
    transform: translateY(-1px);
}

.landing-cta--secondary {
    border: 1px solid rgba(255, 255, 255, 0.42);
    color: #ffffff;
    background: rgba(0, 0, 0, 0.16);
}

.landing-cta--secondary:hover {
    border-color: rgba(255, 255, 255, 0.78);
    background: rgba(0, 0, 0, 0.24);
    transform: translateY(-1px);
}

.landing-readme-btn {
    width: 100%;
    min-height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.52);
    border-radius: 14px;
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04)),
        rgba(0, 0, 0, 0.22);
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.24);
    transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.landing-readme-btn--top {
    position: fixed;
    top: max(12px, var(--safe-top));
    left: max(12px, var(--safe-left));
    z-index: 8;
    width: auto;
    min-height: 50px;
    padding: 0 14px;
    border-radius: 12px;
}

.landing-readme-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.landing-readme-btn:active {
    transform: scale(0.985);
}

.landing-readme-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
}

.landing-readme-modal[hidden] {
    display: none;
}

.landing-readme-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.68);
    cursor: pointer;
}

.landing-readme-card {
    position: relative;
    z-index: 1;
    width: min(740px, calc(100vw - 28px));
    max-height: min(84vh, 760px);
    margin: min(7vh, 56px) auto 0;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background:
        radial-gradient(120% 120% at 8% -10%, rgba(255, 165, 92, 0.22), transparent 48%),
        radial-gradient(100% 100% at 100% 0%, rgba(241, 90, 36, 0.24), transparent 42%),
        linear-gradient(170deg, rgba(36, 18, 10, 0.97), rgba(19, 11, 7, 0.98));
    box-shadow:
        0 34px 70px rgba(0, 0, 0, 0.48),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 0 40px rgba(241, 90, 36, 0.18);
    backdrop-filter: blur(8px);
    overflow: hidden;
}

.landing-readme-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0));
}

.landing-readme-title {
    margin: 0;
    font-size: 18px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #ffe5cf;
    text-shadow: 0 0 20px rgba(241, 90, 36, 0.35);
}

.landing-readme-close {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.landing-readme-close:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.12);
}

.landing-readme-body {
    padding: 16px;
    max-height: min(78vh, 680px);
    overflow: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    font-size: 14px;
    line-height: 1.58;
    color: rgba(255, 255, 255, 0.94);
}

.landing-readme-body::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.landing-readme-body h3 {
    margin: 18px 0 8px;
    font-size: 15px;
    color: #ffd9be;
}

.landing-readme-body p {
    margin: 0 0 10px;
}

.landing-readme-body ul,
.landing-readme-body ol {
    margin: 0 0 10px 18px;
    padding: 0;
}

.landing-readme-body li {
    margin-bottom: 6px;
}

.landing-note {
    margin-top: 14px;
    font-size: 12px;
    letter-spacing: 0.01em;
    color: rgba(255, 255, 255, 0.82);
}

@keyframes landingFloatA {
    0% { transform: translate3d(-2%, -1%, 0) scale(1); }
    100% { transform: translate3d(2%, 1.4%, 0) scale(1.06); }
}

@keyframes landingFloatB {
    0% { transform: translate3d(3%, -2%, 0) scale(1.04); }
    100% { transform: translate3d(-2%, 2%, 0) scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
    .landing-gradient-layer,
    .landing-gradient-layer--second {
        animation: none;
    }
}

body.login-landing[data-theme="light"] {
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.78);
    --divider-strong: rgba(255, 255, 255, 0.28);
    --focus-outline: #ffffff;
    --focus-outline-shadow: rgba(255, 255, 255, 0.35);
}

body.login-landing[data-theme="light"] .auth-form input,
body.login-landing[data-theme="light"] .auth-form textarea {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.28);
    color: #ffffff;
}

body.login-landing[data-theme="light"] .auth-form input:focus,
body.login-landing[data-theme="light"] .auth-form textarea:focus {
    background: rgba(0, 0, 0, 0.58);
    border-color: rgba(255, 255, 255, 0.45);
}

body.login-landing[data-theme="light"] .auth-username-wrap {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.28);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--divider);
    border-top-color: var(--brand-red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 40px auto;
}

.loading-text {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

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

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post {
    animation: fadeIn 0.3s ease;
}

/* Post Actions */
.post-actions {
    display: flex;
    gap: 24px;
    padding: 12px 20px;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 600;
}

.action-btn:hover {
    background: rgba(241, 90, 36, 0.08);
}

.action-btn svg {
    width: 20px;
    height: 20px;
}

/* Like = Organic logo mark (same mask as capture), scales with currentColor */
.like-logo {
    display: block;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    background-color: currentColor;
    -webkit-mask-image: url(favicon.png);
    mask-image: url(favicon.png);
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    transition: transform 0.18s ease, filter 0.2s ease;
}

.like-btn:hover .like-logo,
.like-btn.liked .like-logo {
    filter: drop-shadow(0 0 3px rgba(241, 90, 36, 0.45));
}

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

.like-logo--tab {
    width: 24px;
    height: 24px;
}

.like-logo--grid {
    width: 14px;
    height: 14px;
}

.like-logo--comment {
    width: 14px;
    height: 14px;
}

.post-comment-body-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-top: 6px;
}

.post-comment-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px 4px 6px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    transition: color 0.15s ease, background 0.15s ease;
    flex-shrink: 0;
    margin: 0;
    align-self: flex-start;
}

.post-comment-like-btn:hover {
    color: var(--brand-red);
    background: var(--outline-orange-soft);
}

.post-comment-like-btn--liked {
    color: var(--brand-red);
}

.post-comment-like-btn:hover .like-logo--comment,
.post-comment-like-btn--liked .like-logo--comment {
    filter: drop-shadow(0 0 2px rgba(241, 90, 36, 0.4));
}

.post-comment-like-btn:focus-visible {
    outline: 2px solid var(--focus-outline);
    outline-offset: 2px;
}

.post-comment-like-count {
    min-width: 1.25ch;
    line-height: 1;
}

.like-btn:hover {
    color: var(--brand-red);
}

.like-btn.liked {
    color: var(--brand-red);
}

.comment-btn:hover {
    color: var(--brand-red);
}

.comment-btn:focus-visible {
    outline: none;
    color: var(--brand-red);
    box-shadow: 0 0 0 2px rgba(241, 90, 36, 0.35);
    border-radius: 8px;
}

/* Inline comments (below caption) */
.post-comments {
    padding: 0 20px 16px;
    margin-top: 0;
    overflow-x: hidden;
    max-width: 100%;
    box-sizing: border-box;
}

.post-comments[hidden] {
    display: none !important;
}

.post-comments-list {
    list-style: none;
    margin: 0 0 12px;
    padding: 12px 0 0;
    max-height: min(240px, 40vh);
    overflow-x: hidden;
    overflow-y: auto;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.post-comments-empty {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 4px 0 8px;
}

.post-comment-item {
    padding: 10px 0;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.post-comment-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.post-comment-meta-main {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.post-comment-user {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
}

.post-comment-time {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    flex-shrink: 0;
}

.post-comment-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    color: var(--text-primary);
    font-weight: 500;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    min-width: 0;
    flex: 1;
}

.post-comment-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 4px;
    max-width: 100%;
    box-sizing: border-box;
}

.post-comment-input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 44px;
    max-height: 120px;
}

.post-comment-input:focus {
    outline: none;
    border-color: var(--brand-red);
    box-shadow: 0 0 0 1px rgba(241, 90, 36, 0.25);
}

.post-comment-input::placeholder {
    color: var(--text-secondary);
}

.post-comment-submit {
    align-self: flex-end;
    padding: 8px 18px;
    border-radius: 10px;
    border: none;
    background: rgba(241, 90, 36, 0.2);
    color: var(--brand-red);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease, color 0.15s ease;
}

.post-comment-submit:hover {
    background: rgba(241, 90, 36, 0.32);
    color: var(--brand-orange-light);
}

.post-comment-submit:active {
    transform: scale(0.98);
}

.action-count {
    font-size: 13px;
    font-weight: 600;
}


/* Camera Styles */
#camera-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: scaleX(-1);
}

#camera-canvas {
    display: none;
}

.camera-control-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.camera-control-btn:hover {
    color: var(--brand-red);
    transform: scale(1.1);
}

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

.camera-controls {
    position: absolute;
    bottom: 40px;
    left: 0;
    right: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding-bottom: 52px;
    pointer-events: auto;
}

.record-timer {
    font-size: 14px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
    letter-spacing: 0.04em;
}

.capture-screen--video .shutter-button {
    margin-bottom: 0;
}

.camera-controls .shutter-button {
    margin-bottom: 0;
}

.camera-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
    text-align: center;
}

.camera-frame .camera-error {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.72);
}

.error-message {
    color: var(--brand-red);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.error-hint {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Preview Screen */
#preview-screen {
    background: #000;
}

.preview-container {
    width: 100%;
    height: 100%;
    position: relative;
}

#preview-image,
#preview-video.preview-media {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.post-image--video {
    background: #000;
}

.post-image--video video {
    width: 100%;
    display: block;
    max-height: min(72vh, 640px);
    object-fit: contain;
    background: #000;
    border-radius: inherit;
}

/* Custom post video controls (Organic + orange accent) */
.organic-video-player {
    position: relative;
    width: 100%;
    border-radius: inherit;
    overflow: hidden;
    background: #000;
}

.organic-video-player video {
    width: 100%;
    display: block;
    max-height: min(72vh, 640px);
    object-fit: contain;
    background: #000;
}

.post-detail-body .organic-video-player video {
    max-height: min(70vh, 560px);
}

.grid-post-media-wrap .organic-video-player video {
    max-height: min(72vh, 520px);
    object-fit: cover;
}

.organic-video-player__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 2;
}

.organic-video-player.is-playing .organic-video-player__overlay {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.organic-video-player__play-big {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    padding: 0;
    border: 2px solid rgba(241, 90, 36, 0.95);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: var(--brand-orange);
    cursor: pointer;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 8px 28px rgba(0, 0, 0, 0.45);
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.organic-video-player__play-big:hover {
    transform: scale(1.06);
    background: rgba(241, 90, 36, 0.15);
    border-color: var(--brand-orange-light);
    color: #ff8a70;
}

.organic-video-player__play-big:focus-visible {
    outline: 2px solid var(--focus-outline);
    outline-offset: 3px;
}

.organic-video-player__chrome {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.5) 55%, transparent 100%);
    pointer-events: auto;
}

.organic-video-player__play,
.organic-video-player__mute {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--brand-orange);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.organic-video-player__play:hover,
.organic-video-player__mute:hover {
    background: rgba(241, 90, 36, 0.22);
    color: #ff8a70;
}

.organic-video-player__play:focus-visible,
.organic-video-player__mute:focus-visible {
    outline: 2px solid var(--focus-outline);
    outline-offset: 2px;
}

.organic-video-player__play svg,
.organic-video-player__mute svg {
    display: block;
}

.organic-video-player__progress-wrap {
    flex: 1;
    min-width: 0;
    height: 8px;
    border-radius: 999px;
    position: relative;
    cursor: pointer;
    touch-action: none;
}

.organic-video-player__progress-track {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.18);
}

.organic-video-player__progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0%;
    max-width: 100%;
    border-radius: inherit;
    background: var(--brand-gradient-video);
    box-shadow: 0 0 12px rgba(241, 90, 36, 0.35);
    pointer-events: none;
}

.organic-video-player__time {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.82);
    min-width: 7.5em;
    text-align: right;
}

body[data-theme='light'] .organic-video-player__time {
    color: rgba(255, 255, 255, 0.9);
}

.grid-post-video {
    object-fit: cover;
}

.preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.preview-top-bar {
    padding: 60px 20px 20px;
}

.preview-bottom {
    padding: 14px 14px 18px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.96), transparent);
    border-top: 1px solid var(--divider-strong);
}

.preview-caption-block {
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
}

.caption-label {
    display: block;
    font-size: 12px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: 0.03em;
}

.caption-optional {
    font-weight: 600;
    color: var(--text-secondary);
}

.caption-hint {
    font-size: 11px;
    color: var(--text-secondary);
    margin: 6px 0 0;
    line-height: 1.35;
    font-weight: 500;
}

.caption-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid var(--divider-strong);
    border-radius: 12px;
    padding: 12px 14px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    resize: none;
    min-height: 72px;
    max-height: 140px;
    margin-bottom: 12px;
    box-sizing: border-box;
}

.caption-input:focus {
    outline: none;
    border-color: var(--brand-red);
}

.caption-input::placeholder {
    color: var(--text-secondary);
}

.post-progress {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.35s ease, margin-bottom 0.3s ease;
}

.post-progress.is-visible {
    max-height: 20px;
    opacity: 1;
    margin-bottom: 12px;
}

.post-progress-track {
    height: 3px;
    border-radius: 999px;
    background: rgba(241, 90, 36, 0.15);
    overflow: hidden;
}

.post-progress-bar {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: var(--brand-gradient-video-mid);
    background-size: 140% 100%;
    transition: width 0.65s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 0 10px rgba(241, 90, 36, 0.35);
    animation: post-bar-shimmer 1.1s ease-in-out infinite;
    animation-play-state: paused;
}

.post-progress.is-visible .post-progress-bar {
    animation-play-state: running;
}

.post-progress-bar.is-filled {
    width: 100%;
}

@keyframes post-bar-shimmer {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

.btn-post {
    width: 100%;
    padding: 16px;
    background: var(--brand-red);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-post:hover {
    background: var(--brand-orange-deep);
    transform: translateY(-2px);
}

.btn-post:active {
    transform: translateY(0);
}

.btn-post:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Delete — posts (photo / video / thought) + comments */
.delete-post-btn,
.post-comment-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    font-family: inherit;
    line-height: 1;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.55);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.12s ease;
}

.delete-post-btn:hover,
.post-comment-delete:hover {
    background: rgba(241, 90, 36, 0.14);
    border-color: rgba(241, 90, 36, 0.5);
    color: var(--brand-red);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 2px 8px rgba(241, 90, 36, 0.15);
}

.delete-post-btn:focus-visible,
.post-comment-delete:focus-visible {
    outline: none;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 0 0 2px var(--focus-outline-shadow);
}

.delete-post-btn:active,
.post-comment-delete:active {
    transform: scale(0.96);
}

.delete-post-btn {
    padding: 6px 10px;
    min-height: 36px;
}

.delete-post-btn__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.delete-post-btn__icon svg {
    display: block;
}

.delete-post-btn__label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: inherit;
}

@media (max-width: 420px) {
    .delete-post-btn__label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .delete-post-btn {
        padding: 8px 9px;
    }
}

.post-comment-delete {
    width: 34px;
    height: 34px;
    margin: -4px -2px -4px 0;
    padding: 0;
    flex-shrink: 0;
    border-radius: 9px;
}

.post-comment-delete svg {
    display: block;
}

/* ===== Themed confirm dialog (replaces native confirm) ===== */
.organic-confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
    box-sizing: border-box;
}

.organic-confirm-modal[hidden] {
    display: none !important;
}

.organic-confirm-backdrop {
    position: absolute;
    inset: 0;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.72);
}

.organic-confirm-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 360px;
    padding: 22px 22px 18px;
    border-radius: 16px;
    background: var(--bg-primary, #0a0a0a);
    border: 1px solid var(--divider-strong);
    box-shadow:
        0 24px 48px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.organic-confirm-title {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1.25;
}

.organic-confirm-message {
    margin: 0 0 20px;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 500;
    color: var(--text-secondary);
}

.organic-confirm-message:empty,
.organic-confirm-message[hidden] {
    display: none;
}

.organic-confirm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.organic-confirm-btn {
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        transform 0.1s ease;
}

.organic-confirm-btn:active {
    transform: scale(0.98);
}

.organic-confirm-btn--secondary {
    border: 2px solid var(--divider-strong);
    background: transparent;
    color: var(--text-primary);
}

.organic-confirm-btn--secondary:hover {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.06);
}

.organic-confirm-btn--secondary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--focus-outline-shadow);
}

.organic-confirm-btn--danger {
    border: 2px solid var(--brand-red);
    background: var(--brand-red);
    color: #ffffff;
}

.organic-confirm-btn--danger:hover {
    background: var(--brand-orange-deep);
    border-color: var(--brand-orange-deep);
}

.organic-confirm-btn--danger:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--focus-outline-shadow);
}

.organic-confirm-btn--primary {
    border: 2px solid var(--brand-red);
    background: rgba(241, 90, 36, 0.12);
    color: var(--brand-red);
}

.organic-confirm-btn--primary:hover {
    background: rgba(241, 90, 36, 0.2);
}

body[data-theme="light"] .organic-confirm-backdrop {
    background: rgba(0, 0, 0, 0.45);
}

body[data-theme="light"] .organic-confirm-card {
    background: var(--bg-darker);
    border: none;
    box-shadow: none;
    border-radius: 0;
}

body[data-theme="light"] .organic-confirm-btn--secondary {
    border: none;
    background: rgba(0, 0, 0, 0.03);
}

body[data-theme="light"] .organic-confirm-btn--secondary:hover {
    background: rgba(0, 0, 0, 0.06);
}


/* Verify Email Styles */
.verify-title {
    font-size: 24px;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.verify-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-weight: 500;
}

.error-message {
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    background: rgba(241, 90, 36, 0.1);
    margin-top: 16px;
}

/* ========== Light theme (applies on all pages when data-theme="light") ========== */
body[data-theme="light"] {
    /* Softer than pure white; slightly warm gray */
    --bg-dark: #e3e2df;
    --bg-darker: #ebeae7;
    --text-primary: #141414;
    --text-secondary: #4a4a48;
    --divider: rgba(0, 0, 0, 0.11);
    --divider-strong: rgba(0, 0, 0, 0.17);
    --border-subtle: var(--divider);
    --outline-orange: rgba(0, 0, 0, 0.22);
    --outline-orange-muted: rgba(0, 0, 0, 0.1);
    --outline-orange-soft: rgba(0, 0, 0, 0.06);
    --focus-outline: #1a1a1a;
    --focus-outline-shadow: rgba(0, 0, 0, 0.35);
    --input-focus-bg: rgba(0, 0, 0, 0.04);
    --bg-primary: var(--bg-darker);
}

body[data-theme="light"] {
    background: var(--bg-darker);
    color: var(--text-primary);
}

body[data-theme="light"] .app-header {
    background: var(--bg-darker);
    box-shadow: none;
}

body[data-theme="light"] .feed-search-wrap {
    background: var(--bg-darker);
    border: none;
    box-shadow: none;
}

body[data-theme="light"] .feed-search {
    background: rgba(0, 0, 0, 0.06);
    border: none;
    box-shadow: none;
    color: var(--text-primary);
}

body[data-theme="light"] .feed-search-icon {
    color: var(--text-secondary);
}

body[data-theme="light"] .feed-search-input {
    color: var(--text-primary);
}

body[data-theme="light"] .feed-search-input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

body[data-theme="light"] .search-results {
    background: var(--bg-darker);
    border: none;
    box-shadow: none;
}

body[data-theme="light"] .feed-notif-btn {
    color: var(--text-secondary);
}

body[data-theme="light"] .feed-notif-btn:hover {
    color: var(--text-primary);
}

body[data-theme="light"] .feed-notif-badge {
    box-shadow: 0 0 0 2px var(--bg-darker);
}

body[data-theme="light"] .feed-notif-panel {
    background-color: #ffffff;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.14);
}

body[data-theme="light"] .feed-notif-toolbar {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

body[data-theme="light"] .feed-notif-item--unread {
    background: rgba(241, 90, 36, 0.08);
}

body[data-theme="light"] .feed-refresh-btn {
    color: var(--text-secondary);
}

body[data-theme="light"] .feed-refresh-btn:hover {
    color: var(--text-primary);
}

body[data-theme="light"] .post {
    background: transparent;
}

body[data-theme="light"] .post-comment-input {
    background: rgba(0, 0, 0, 0.05);
    border-color: transparent;
    color: var(--text-primary);
}

body[data-theme="light"] .post-comment-submit {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-primary);
    border: none;
}

body[data-theme="light"] .post-comment-submit:hover {
    background: rgba(0, 0, 0, 0.12);
    color: var(--text-primary);
}

body[data-theme="light"] .post-image::after {
    background:
        radial-gradient(circle at 20% 30%, rgba(0, 0, 0, 0.06), transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(0, 0, 0, 0.05), transparent 50%);
}

body[data-theme="light"] .bottom-nav {
    background: var(--bg-darker);
    box-shadow: none;
}

body[data-theme="light"] .camera-viewfinder {
    background: #e4e4e4;
}

body[data-theme="light"] .aspect-preset-btn {
    background: var(--bg-darker);
    color: #1a1a1a;
    border-color: rgba(0, 0, 0, 0.12);
}

body[data-theme="light"] .aspect-preset-btn:hover {
    background: #f5f4f2;
    border-color: rgba(0, 0, 0, 0.2);
}

body[data-theme="light"] .aspect-guide {
    border-color: rgba(0, 0, 0, 0.38);
    box-shadow: 0 0 0 9999px rgba(255, 255, 255, 0.55);
}

body[data-theme="light"] .camera-control-btn {
    color: #1a1a1a;
}

body[data-theme="light"] .camera-frame .camera-error {
    background: rgba(255, 255, 255, 0.9);
}

body[data-theme="light"] #preview-screen {
    background: var(--bg-darker);
}

body[data-theme="light"] .preview-bottom {
    background: linear-gradient(to top, rgba(255, 255, 255, 0.97), transparent);
    border-top: none;
}

body[data-theme="light"] .caption-input {
    background: var(--bg-darker);
    border-color: var(--divider-strong);
    color: var(--text-primary);
}

body[data-theme="light"] .auth-form input {
    background: var(--bg-dark);
    border-color: var(--divider-strong);
    color: var(--text-primary);
}

body[data-theme="light"] .auth-form input:focus {
    background: var(--bg-darker);
    border-color: var(--focus-outline);
}

body[data-theme="light"] .auth-form textarea {
    background: var(--bg-dark);
    border-color: var(--divider-strong);
    color: var(--text-primary);
}

body[data-theme="light"] .auth-form textarea:focus {
    background: var(--bg-darker);
    border-color: var(--focus-outline);
}

body[data-theme="light"] .auth-form-message {
    border-color: rgba(241, 90, 36, 0.5);
    background: rgba(241, 90, 36, 0.1);
    color: var(--text-primary);
}

body[data-theme="light"] .auth-form-message--success {
    border-color: rgba(56, 142, 60, 0.5);
    background: rgba(76, 175, 80, 0.12);
}

body[data-theme="light"] .auth-username-wrap {
    background: var(--bg-dark);
    border-color: var(--divider-strong);
}

body[data-theme="light"] .signup-avatar-preview {
    box-shadow:
        0 0 0 1px var(--divider-strong),
        0 4px 16px rgba(0, 0, 0, 0.1);
}

body[data-theme="light"] .signup-avatar-preview.has-photo {
    box-shadow:
        0 0 0 1px rgba(241, 90, 36, 0.55),
        0 4px 16px rgba(0, 0, 0, 0.1);
}

body[data-theme="light"] .signup-avatar-preview.organic-avatar-loading {
    box-shadow:
        0 0 0 1px rgba(241, 90, 36, 0.55),
        0 4px 16px rgba(0, 0, 0, 0.1);
}

body[data-theme="light"] .dropdown-menu {
    background: var(--bg-darker);
    border: none;
    box-shadow: none;
}

body[data-theme="light"] .dropdown-item:hover,
body[data-theme="light"] .dropdown-item:focus {
    background: rgba(0, 0, 0, 0.05);
}

body[data-theme="light"] .post-image {
    /* Same as dark mode behind media — avoids the big light-gray box */
    background: #000000;
}

body[data-theme="light"] .grid-post {
    background: transparent;
    box-shadow: none;
    border: none;
    border-radius: 0;
}

body[data-theme="light"] .grid-post--thought {
    border: none;
}

body[data-theme="light"] .grid-post-footer {
    border-top: none;
}

body[data-theme="light"] .grid-post--thought .grid-post-footer {
    border-top: none;
}

body[data-theme="light"] .grid-post-media-wrap {
    background: #000000;
}

body[data-theme="light"] .capture-logo {
    --capture-base-glow:
        drop-shadow(0 0 1px rgba(0, 0, 0, 0.22))
        drop-shadow(0 0 3px rgba(0, 0, 0, 0.12))
        drop-shadow(0 0 10px rgba(0, 0, 0, 0.14));
}

body[data-theme="light"] .capture-btn:hover .capture-logo,
body[data-theme="light"] .capture-btn:focus-visible .capture-logo {
    filter: var(--capture-base-glow) drop-shadow(0 0 4px rgba(0, 0, 0, 0.45)) drop-shadow(0 0 14px rgba(0, 0, 0, 0.2));
}

body[data-theme="light"] .capture-btn:active .capture-logo {
    filter: var(--capture-base-glow) drop-shadow(0 0 5px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 18px rgba(0, 0, 0, 0.28));
}

body[data-theme="light"] .post-type-modal-card {
    background: var(--bg-darker);
    border: none;
    box-shadow: none;
    border-radius: 0;
}

body[data-theme="light"] .post-type-btn {
    background: var(--bg-dark);
    border: none;
}

body[data-theme="light"] .post-type-btn-photo,
body[data-theme="light"] .post-type-btn-video,
body[data-theme="light"] .post-type-btn-thought {
    border: none;
}

body[data-theme="light"] .post-type-btn-photo:hover,
body[data-theme="light"] .post-type-btn-video:hover,
body[data-theme="light"] .post-type-btn-thought:hover {
    background: rgba(0, 0, 0, 0.06);
}

body[data-theme="light"] .post-type-btn-photo:focus-visible,
body[data-theme="light"] .post-type-btn-video:focus-visible,
body[data-theme="light"] .post-type-btn-thought:focus-visible {
    background: rgba(0, 0, 0, 0.05);
    box-shadow: 0 0 0 2px var(--focus-outline-shadow);
}

body[data-theme="light"] .post-type-modal-backdrop {
    background: rgba(0, 0, 0, 0.4);
}

body[data-theme="light"] #thought-screen {
    background: var(--bg-darker);
}

body[data-theme="light"] .thought-input {
    background: var(--bg-darker);
    border-color: transparent;
}

body[data-theme="light"] .thought-top-bar,
body[data-theme="light"] .thought-bottom {
    border: none;
}

body[data-theme="light"] .feed-search:focus-within {
    background: rgba(0, 0, 0, 0.06);
    border: none;
    box-shadow: none;
    outline: none;
}

body[data-theme="light"] .caption-input:focus {
    border-color: var(--focus-outline);
}

body[data-theme="light"] .comment-btn:focus-visible {
    color: var(--text-primary);
    box-shadow: 0 0 0 2px var(--focus-outline-shadow);
}

body[data-theme="light"] .post-comment-input:focus {
    border-color: var(--focus-outline);
    box-shadow: 0 0 0 1px var(--focus-outline-shadow);
}

body[data-theme="light"] .search-result-item:hover,
body[data-theme="light"] .search-result-item:focus {
    background: rgba(0, 0, 0, 0.05);
}

body[data-theme="light"] .search-result-item:focus-visible {
    outline: 2px solid var(--focus-outline);
    outline-offset: 2px;
}

body[data-theme="light"] .thought-input:focus {
    border-color: var(--focus-outline);
}

body[data-theme="light"] .delete-post-btn,
body[data-theme="light"] .post-comment-delete {
    border: none;
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-secondary);
    box-shadow: none;
}

body[data-theme="light"] .delete-post-btn:hover,
body[data-theme="light"] .post-comment-delete:hover {
    background: rgba(241, 90, 36, 0.1);
    border-color: rgba(241, 90, 36, 0.42);
    color: var(--brand-red);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        0 2px 8px rgba(241, 90, 36, 0.12);
}

body[data-theme="light"] .post-comment-like-btn:hover {
    color: var(--brand-red);
    background: var(--outline-orange-soft);
}

body[data-theme="light"] .post-comment-like-btn--liked {
    color: var(--brand-red);
}

body[data-theme="light"] .delete-post-btn:focus-visible,
body[data-theme="light"] .post-comment-delete:focus-visible {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        0 0 0 2px var(--focus-outline-shadow);
}

body[data-theme="light"] .feed-communities-btn {
    color: #d14f20;
    border-color: rgba(241, 90, 36, 0.45);
    background: linear-gradient(135deg, rgba(255, 204, 170, 0.5), rgba(255, 161, 118, 0.5));
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.7) inset,
        0 8px 20px rgba(241, 90, 36, 0.16);
}

body[data-theme="light"] .feed-communities-btn:hover {
    color: #b7431a;
    border-color: rgba(241, 90, 36, 0.65);
    background: linear-gradient(135deg, rgba(255, 218, 191, 0.75), rgba(255, 174, 136, 0.75));
}

body[data-theme="light"] #communities-screen,
body[data-theme="light"] #community-screen {
    background: var(--bg-darker);
}

body[data-theme="light"] .community-create-panel,
body[data-theme="light"] .community-card,
body[data-theme="light"] .community-hero {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

body[data-theme="light"] #communities-screen .edit-input,
body[data-theme="light"] #communities-screen .edit-textarea,
body[data-theme="light"] #community-screen .edit-textarea {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.14);
    color: var(--text-primary);
}

body[data-theme="light"] #communities-screen .edit-input::placeholder,
body[data-theme="light"] #communities-screen .edit-textarea::placeholder,
body[data-theme="light"] #community-screen .edit-textarea::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

body[data-theme="light"] #communities-screen .edit-input:focus,
body[data-theme="light"] #communities-screen .edit-textarea:focus,
body[data-theme="light"] #community-screen .edit-textarea:focus {
    border-color: rgba(241, 90, 36, 0.6);
    box-shadow: 0 0 0 1px rgba(241, 90, 36, 0.2);
}

body[data-theme="light"] .community-create-sub,
body[data-theme="light"] .community-card-desc,
body[data-theme="light"] .community-card-meta,
body[data-theme="light"] .community-hero-desc,
body[data-theme="light"] .community-hero-meta {
    color: var(--text-secondary);
}

body[data-theme="light"] .community-delete-btn {
    color: #d15151;
}

body[data-theme="light"] .community-card-link:hover {
    color: var(--brand-red);
}
