:root {
    color-scheme: light;
    /* Color Tokens (HSL for engine consistency) */
    --bg-primary: hsl(48, 20%, 97%);   /* #FAF9F5 */
    --bg-secondary: hsl(0, 0%, 100%);  /* #FFFFFF */
    --text-primary: hsl(0, 0%, 10%);   /* #1A1A1A */
    --text-secondary: hsl(0, 0%, 33%); /* #555555 */
    --accent-sage: hsl(156, 11%, 60%); /* #8DA399 */
    --accent-sage-dark: hsl(153, 19%, 30%); /* #3E5A4D */
    --accent-clay: hsl(30, 52%, 64%);  /* #D4A373 */
    --border-light: hsl(0, 0%, 88%);   /* #E0E0E0 */
    --bg-glass: hsla(0, 0%, 100%, 0.7);
    --accent-sage-text: hsl(152, 11%, 40%); /* #5A7367 */

    /* Geometry Tokens (rem for accessible scaling) */
    --radius-sm: 0.75rem; /* 12px */
    --radius-md: 1.5rem;  /* 24px */
    --radius-lg: 1.75rem; /* 28px */
    --radius-full: 9999px;

    --space-xs: 0.25rem; /* 4px */
    --space-sm: 0.5rem;  /* 8px */
    --space-md: 0.75rem;    /* 12px */
    --space-lg: 1.25rem;  /* 20px */
    --space-xl: 1.5rem;    /* 24px */
    --space-xxl: 4rem;   /* 64px */
}

@media (prefers-color-scheme: dark) {
    body {
        filter: none !important;
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    margin: 0;
    padding: 0;
}

@keyframes fold-in {
    0% {
        opacity: 0;
        transform: translateY(15px) scale(0.98);
        filter: blur(4px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.fold-in-animate {
    animation: fold-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    will-change: transform, opacity, filter;
}

/* --- Premium Feed Grid Layout --- */
.content-grid-layout {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    margin: 0 auto;
    padding: 2rem 1.5rem 1.5rem 1.5rem;
    box-sizing: border-box;
}


html,
body {
    width: 100%;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    min-height: -webkit-fill-available;
    overflow-x: hidden;
}

html {
    scrollbar-gutter: stable;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    padding-top: 0;
    padding-bottom: env(safe-area-inset-bottom, var(--space-xl));
    overflow-x: hidden;
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(circle at 10% 0%, hsla(156, 11%, 60%, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 90% 100%, hsla(30, 52%, 64%, 0.12) 0%, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.app-content-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 3rem auto 0 auto;
    padding: 0 1rem;
    box-sizing: border-box;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    contain: layout;
}

input, textarea, .drop-input, #note-desc {
    -webkit-user-select: auto !important;
    user-select: auto !important;
}


body::-webkit-scrollbar,
html::-webkit-scrollbar,
#notes-container::-webkit-scrollbar {
    display: none;
}

body,
html,
#notes-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

#notes-container {
    width: 100%;
    min-height: auto;
    column-width: 280px;
    column-gap: 1.5rem;
    padding-bottom: 100px;
    display: block;
}

body,
#root,
.app-container {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    -webkit-text-size-adjust: 100%;
}


/* --- App Header (Top Nav) --- */
.app-header {
    position: sticky;
    top: 0;
    z-index: 9990;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 1.5rem 2rem;
    box-sizing: border-box;
    contain: layout paint;
    transform: translateZ(0);
}

h1 {
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 900;
    letter-spacing: -0.05em;
    font-size: 2rem;
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
    font-display: swap;
}

.sub-header {
    text-align: center;
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    font-weight: 500;
    max-width: 25rem;
    margin-left: auto;
    margin-right: auto;
}

main {
    width: 100%;
    margin-top: 24px;
}

/* Tighten the spacing so it feels like a cohesive list */
#welcome-overlay {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.step-block {
    margin-bottom: 20px;
}

.step-title {
    font-size: 1.1em;
    color: #111;
    display: block;
    margin-bottom: 2px;
    line-height: 1.1;
}

/* Make the subtext stand out just a bit more */
.step-subtext {
    font-style: italic;
    color: #666; /* Ensure this is readable, not too faint */
    margin-left: 20px; /* Indent the subtext slightly to visually anchor it under the step */
    display: block;
    font-size: 0.95em;
}

/* Ensure the bottom privacy note has room to breathe */
.privacy-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(0,0,0,0.06); /* Adds a subtle separator that makes it look official */
    font-weight: 500;
    color: #555;
    font-size: 0.9em;
    text-align: center;
}


@keyframes weight-pulse {
    0% { font-weight: 300; }
    50% { font-weight: 900; }
    100% { font-weight: 300; }
}

.global-logo {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 9999;
    display: inline-block;
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0;
    color: var(--accent-sage-dark) !important;
    letter-spacing: -0.05em;
    text-decoration: none;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.global-logo:hover {
    opacity: 0.8;
}



.radar-status {
    text-align: center;
    color: var(--accent-sage-dark);
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 1rem;
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.interactive-location {
    cursor: pointer;
    color: var(--accent-sage-dark) !important;
}

.pill-btn {
    cursor: pointer;
    background: var(--accent-sage-dark);
    color: white !important;
    font-weight: 900;
    letter-spacing: 0.05em;
    font-family: inherit;
    font-size: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-full);
    box-shadow: 0 4px 12px rgba(62, 90, 77, 0.25);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.interactive-location .pill-btn {
    animation: location-pulse 2.5s infinite ease-in-out;
}

@keyframes location-pulse {
    0% { background-color: var(--accent-sage-dark); box-shadow: 0 4px 12px rgba(62, 90, 77, 0.25); text-shadow: none; }
    50% { background-color: #437d57; box-shadow: 0 6px 18px rgba(67, 125, 87, 0.4); text-shadow: 0 0 10px rgba(255, 255, 255, 0.9), 0 0 20px rgba(255, 255, 255, 0.5); }
    100% { background-color: var(--accent-sage-dark); box-shadow: 0 4px 12px rgba(62, 90, 77, 0.25); text-shadow: none; }
}
.pill-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(62, 90, 77, 0.35);
}
.pill-btn:active {
    transform: scale(0.96);
}

.radar-status::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: #2e7d32;
    border-radius: 50%;
    box-shadow: 0 0 8px #2e7d32;
    animation: pulse-dot 2s infinite ease-in-out;
}

/* Hide the radar dot if the user hasn't shared location yet */
.radar-status:has(.interactive-location)::before {
    display: none;
}

@keyframes pulse-dot {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }

    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

/* Leaning Pulse: Directional nudge in No Man's Land */
.radar-status.liminal::before {
    background-color: #A0A0A0; /* Desaturated */
    box-shadow: 0 0 0.5rem #A0A0A0;
    animation: leaning-pulse 3s infinite ease-in-out;
}

@keyframes leaning-pulse {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    50% { transform: translate(3px, -2px) scale(1.1); opacity: 0.7; } /* Slight lean */
    100% { transform: translate(0, 0) scale(1); opacity: 1; }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.welcome-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.4s ease;
    cursor: pointer;
}

/* Strip native OS styling from all form elements */
.drop-input, 
.category-btn, 
#note-desc {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-sizing: border-box;
    font-family: inherit;
    border-radius: 12px; /* Smoother premium radius */
}

/* Use 1rem to rely entirely on user accessibility settings */
.drop-input, 
#note-desc {
    font-size: 1rem; 
    border: 1px solid var(--border-light); 
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    width: 100%;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02), 0 2px 8px rgba(0,0,0,0.02);
}

.drop-input:focus, 
#note-desc:focus {
    outline: none;
    border-color: var(--accent-sage);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02), 0 0 0 4px hsla(156, 11%, 60%, 0.2);
    transform: translateY(-1px);
}

/* Remove default iOS inner shadows on textareas */
#note-desc {
    box-shadow: none; 
}

.drop-input::placeholder,
#note-desc::placeholder {
    font-size: 0.65em;
    font-weight: 500;
}

.drop-input {
    padding: 0.6rem 0.8rem;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

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

.note-card {
    background: #ffffff;
    width: 100%;
    max-width: 420px;
    min-width: 0;
    margin-bottom: 1.5rem;
    padding: 16px;
    border-radius: 24px;
    box-shadow: 
        0 12px 32px rgba(0,0,0,0.06), 
        0 4px 12px rgba(0,0,0,0.04),
        inset 0 1px 0 rgba(255,255,255,1);
    position: relative;
    border: 1px solid rgba(0,0,0,0.04);
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) backwards;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    will-change: opacity, transform;
    box-sizing: border-box;
    break-inside: avoid;
    content-visibility: auto;
    contain-intrinsic-size: 0 400px;
    overflow-wrap: anywhere;
}

.note-card strong {
    display: block;
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    font-weight: 800;
    margin: 0 0 8px 0;
    color: var(--text-primary);
    line-height: 1.15;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.note-card p {
    margin: 0 0 14px 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.note-card:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 16px 38px rgba(0,0,0,0.08), 
        0 6px 16px rgba(0,0,0,0.05);
}

.note-card.boosted-note-card {
    background: linear-gradient(180deg, #FFF9EF 0%, #FFFFFF 68%);
    border: 2px solid rgba(212, 163, 115, 0.65);
    box-shadow: 0 18px 45px rgba(212, 163, 115, 0.22);
    position: relative;
    overflow: visible;
    content-visibility: visible !important;
}

.note-card.boosted-note-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.75);
}

/* Sparkle sitting on the top-left corner */
.boosted-sparkle {
    position: absolute;
    top: -10px;
    left: -6px;
    background: transparent;
    padding: 0;
    font-size: 1rem;
    z-index: 5;
    pointer-events: none;
    line-height: 1;
    /* Soft glow to mask the border without a sharp square edge */
    text-shadow: 0 0 4px #fff, 0 0 4px #fff, 0 0 6px #FFF9EF, 0 0 6px #FFF9EF;
}

/* BOOSTED text embedded in the bottom-right border */
.boosted-label {
    position: absolute;
    bottom: -0.48em;
    right: 1rem;
    background: transparent;
    padding: 0;
    font-weight: 900;
    font-size: 0.68rem;
    color: #c98c1c;
    z-index: 5;
    pointer-events: none;
    line-height: 1;
    letter-spacing: 0.06em;
    /* Heavy text shadow masks the border cleanly without looking like a blocky square */
    text-shadow: 
        -2px -2px 0 #fff,  
         2px -2px 0 #fff,
        -2px  2px 0 #fff,
         2px  2px 0 #fff,
         0 0 4px #fff, 0 0 8px #fff;
}

/* Override for boosted cards too */
.note-card.boosted-note-card .boosted-label,
.note-card.boosted-note-card .boosted-sparkle {
    background: transparent;
}

/* Hide old ribbon style completely */
.boosted-ribbon {
    display: none;
}

.boosted-time-chip {
    background: rgba(212, 163, 115, 0.16);
    color: #7A4E25;
    border: 1px solid rgba(212, 163, 115, 0.35);
    font-weight: 800;
}

.image-count-pill {
    position: absolute;
    right: 10px;
    bottom: 10px;
    background: rgba(0,0,0,0.65);
    color: white;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 0.72rem;
    font-weight: 800;
}

.boosted-footer-note {
    margin-top: 10px;
    font-size: 0.75rem;
    font-weight: 800;
    color: #8A5A2B;
    display: flex;
    align-items: center;
    gap: 6px;
    border-top: 1px solid rgba(212, 163, 115, 0.2);
    padding-top: 10px;
}

.image-swiper-container {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Hide scrollbar Firefox */
    -ms-overflow-style: none; /* Hide scrollbar IE/Edge */
    border-radius: 12px;
}
.image-swiper-container::-webkit-scrollbar {
    display: none; /* Hide scrollbar Chrome/Safari */
}
.swiper-image {
    scroll-snap-align: center;
    flex: 0 0 100%;
    max-width: 100%;
}


.time-badge {
    background: transparent;
    color: var(--accent-clay);
    padding: 2px 0px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 900;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    letter-spacing: -1px;
    box-shadow: none;
    display: flex;
    align-items: center;
    gap: 4px;
    border: none;
    margin-left: auto;
}

.note-card.poof-exit {
    opacity: 0;
    transform: scale(0.95) translateY(0.625rem); /* 10px */
    pointer-events: none;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }

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

#mist-layer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 1500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease;
    filter: blur(20px);
    will-change: opacity, filter;
}

#mist-layer.active {
    opacity: 0.8;
    pointer-events: all;
}

.pulsing-skeleton {
    display: inline-block;
    width: 120px;
    height: 12px;
    background: rgba(141, 163, 153, 0.3);
    border-radius: 6px;
    animation: pulse-opacity 1.5s ease-in-out infinite;
}

@keyframes pulse-opacity {
    0% {
        opacity: 0.4;
    }

    50% {
        opacity: 0.8;
    }

    100% {
        opacity: 0.4;
    }
}

.price-tag {
    font-weight: 800;
    color: #8b5e34;
    background: rgba(139, 94, 52, 0.15);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 14px;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
}

.type-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 4px 0;
    border-radius: 0;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    pointer-events: none;
}


.metadata {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    min-width: 0;
    max-width: 100%;
}

.note-card-header {
    min-width: 0;
    max-width: 100%;
}

.metadata-main {
    min-width: 0;
    flex: 1 1 auto;
    max-width: 100%;
}

.how-it-works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 40px;
    width: 100%;
    min-width: 0;
}

.how-it-works-card {
    background: rgba(141,163,153,0.05);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(141,163,153,0.1);
    min-width: 0;
    overflow-wrap: anywhere;
}

.how-it-works-card strong {
    color: var(--accent-sage-dark);
    font-size: 0.9em;
}

.how-it-works-card p {
    margin: 5px 0 0 0;
    font-size: 0.85em;
    color: var(--text-secondary);
}

.how-it-works-card strong,
.how-it-works-card p {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.comment-bubble .neighbor-tag {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.owner-badge {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-weight: 500;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
    vertical-align: middle;
}

.dist-tag, .note-timer {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.kebab-menu {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.comment-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}



.thread-toggle-btn {
    margin-left: auto;
    flex: 0 0 auto;
    border: 0;
    border-radius: 999px;
    padding: 9px 14px;
    background: var(--accent-sage-dark);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.2s ease;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.thread-toggle-btn:hover {
    background: #2F4A3D;
    transform: translateY(-1px);
}

.thread-toggle-btn:active {
    background: #2F4A3D;
    transform: scale(0.96);
}

.connect-container {
    display: flex;
    align-items: center;
}

.connect-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--accent-clay), hsl(30, 42%, 54%));
    color: white;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
    padding: 0;
    margin: 0;
}

.connect-action-btn.waiting {
    background: linear-gradient(135deg, #8ca298, #6b8478);
}

.connect-action-btn:active {
    transform: scale(0.98);
}

.card-footer-meta {
  display: flex;
  justify-content: space-between; /* Pushes text left, video icon right */
  align-items: center;
  background: transparent; /* Stripped background */
  border: none; /* Stripped border */
  padding: 12px 0 0 0; 
  margin-top: 12px;
  border-top: 1px solid #F0F0F0; /* Clean divider instead of a full box */
  font-size: 12px; /* Smaller footprint */
  color: #777;
}

.safety-text {
  display: flex;
  align-items: center;
  gap: 4px;
}

.safety-text a {
  color: #3A5A40; 
  font-weight: 700;
  text-decoration: underline;
  white-space: nowrap; /* Forces links to stay on one horizontal line */
}

.divider {
  color: #CCC;
  margin: 0 2px;
}

.btn-ghost-video {
  background: transparent !important;
  border: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 16px; /* Slightly larger since there's no bounding box */
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: var(--accent-sage-dark);
  box-shadow: none !important;
  outline: none !important;
  margin: 0;
}

.btn-ghost-video:hover {
  background: rgba(141, 163, 153, 0.1); /* Subtle sage highlight */
}

/* --- Drop Zone & Form Architecture --- */
.drop-zone {
    display: none;
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 25rem; /* 400px */
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--radius-md);
    box-shadow: 0 1.25rem 3.75rem rgba(0, 0, 0, 0.2);
    z-index: 1001;
    box-sizing: border-box;
    max-height: calc(100dvh - 2rem);
    display: flex;
    flex-direction: column;
}

.drop-form-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 2rem;
    -webkit-overflow-scrolling: touch;
}

.drop-form-footer {
    flex-shrink: 0;
    background: transparent;
    border-top: none;
    margin: 0;
    padding: 0.5rem 1rem 1.5rem 1rem;
}

.field-group {
    margin-bottom: 0.4rem;
    text-align: left;
}

.field-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.char-counter {
    text-align: right;
    font-size: 0.65rem;
    color: #999;
    margin-top: 0.25rem;
    font-weight: 700;
}

/* The box wrapping the switch */
.switch-group {
    margin-top: 30px;
    padding: 12px;
    border: 1px solid #EAEAEA; /* Matches the drop-input border */
    border-radius: 8px;
    position: relative;
    background: transparent;
    display: flex;
    justify-content: space-between; /* Keeps toggle and text aligned */
    align-items: center;
}

/* The text sitting on the border */
.manifesto-label {
    position: absolute;
    top: -8px; /* Pulls the text up onto the border line */
    left: 15px;
    background: #FFFFFF; /* Essential: creates the cutout effect over the line */
    padding: 0 8px;
    font-size: 10px;
    font-weight: 500;
    font-style: italic;
    color: #8DA399; /* Sage green aesthetic */
    letter-spacing: 0.3px;
}

/* === PWA App Header Install === */
.install-header-prompt {
    background: linear-gradient(135deg, hsla(30, 52%, 64%, 0.1), hsla(156, 11%, 60%, 0.05));
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-light);
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.install-header-prompt button {
    background: var(--accent-sage-dark);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
}



.switch-label {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--accent-sage-dark);
}

#broadcast-btn {
    width: 100%;
    background: var(--accent-sage-dark);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 800;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.125rem;
    padding: 0.65rem;
    font-size: 0.8rem;
    transition: transform 0.1s, background 0.2s;
}

#broadcast-btn:active {
    transform: scale(0.98);
}

/* --- Drop Form Typography & Spacing --- */
.drop-title {
    font-weight: 800;
    letter-spacing: -0.05em;
    margin-block-start: 0;
    margin-block-end: 0.125rem; /* ~2px */
    font-size: 1.4rem;
}

.drop-subtitle {
    font-size: 0.8rem;
    color: hsl(0, 0%, 40%); /* Replaces #666 */
    margin-block-end: 0.5rem; /* ~8px */
}

/* --- Switch Group Elements --- */
.switch-text-stack {
    display: flex;
    flex-direction: column;
    gap: 0.25rem; /* ~4px */
}

.switch-helper {
    display: block;
    margin-block-start: 0.25rem;
    font-size: 0.7rem;
    color: hsl(0, 0%, 40%);
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
    line-height: 1.4;
}

/* --- Premium Upload & Boost Bridge --- */
.image-upload-wrapper {
    margin-block-start: 1rem; /* ~15px */
}

.premium-helper {
    font-size: 0.65rem;
    color: var(--accent-clay);
    margin-block-start: 0.35rem; /* ~5px */
    font-weight: bold;
    text-transform: uppercase;
}

.boost-bridge-container {
    margin-block-end: 1rem; /* ~15px */
    text-align: center;
}

.quick-boost-btn {
    background: hsla(148, 14%, 60%, 0.1); /* Translates rgba(141, 163, 153, 0.1) */
    border: 1px dashed var(--accent-sage);
    color: var(--accent-sage);
    padding: 0.625rem 1rem; /* ~10px 15px */
    border-radius: 0.75rem; /* ~12px */
    width: 100%;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.quick-boost-btn:hover {
    background: hsla(148, 14%, 60%, 0.2);
}

.privacy-manifesto {
    font-size: 0.7rem;
    color: hsl(0, 0%, 60%); /* Replaces #999 */
    margin-block-start: 0.5rem; /* ~8px */
    font-weight: 500;
    font-style: italic;
}

/* --- Welcome Overlay Geometry --- */
.welcome-card {
    background: var(--bg-glass);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    padding: 1.75rem 1.75rem;
    border-radius: var(--radius-lg);
    max-width: 92%;
    width: 440px;
    text-align: center;
    box-shadow: 
        0 24px 60px rgba(0,0,0,0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.6);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Match the dark blur "toast" style for the browser switch modal */
#browser-switch-overlay .welcome-card {
    background: rgba(40, 40, 40, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15); 
    color: #FFF; 
    border-radius: 20px; 
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2); 
}


.welcome-button-stack {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
    align-items: center;
    width: 100%;
}

.welcome-button-primary {
    width: 100%;
    max-width: 320px;
    padding: 0.85rem;
    font-size: 1.1rem;
    border-radius: var(--radius-full);
    background: var(--accent-sage-dark);
    color: var(--bg-secondary);
    border: none;
    border-radius: var(--radius-full);
    box-shadow: 0 0.25rem 1rem rgba(141, 163, 153, 0.3);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
}

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

.welcome-button-secondary {
    background: transparent;
    color: #555555;
    border: none;
    padding: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: var(--radius-full);
    transition: opacity 0.2s;
}

.welcome-button-secondary:hover {
    opacity: 0.7;
}

/* --- Drop Zone Desktop Fixes --- */
@media (min-width: 768px) {
    .drop-zone {
        max-height: 85vh;
        width: 500px;
        left: 50%;
        transform: translate(-50%, 0);
        top: 2rem;
        padding: 2rem;
        border-radius: var(--radius-md);
    }
    
    .drop-form-footer {
        padding: 1rem 1.25rem;
        margin: 0 -1.25rem -1.25rem -1.25rem;
    }
}
/* --- Category Selector in Form --- */
.category-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 0.5rem;
}

.category-btn {
    flex: 1;
    min-width: calc(50% - 4px);
    padding: 10px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 800;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.category-btn.active {
    background: var(--accent-sage-dark);
    color: white;
    border-color: var(--accent-sage-dark);
    box-shadow: 0 4px 12px rgba(62, 90, 77, 0.2);
}

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

@media (min-width: 480px) {
    .category-btn {
        min-width: calc(25% - 6px);
    }
}

/* === CLS Prevention: Footer (Critical Path) === */
footer { text-align: center; margin-top: auto; padding-bottom: 20px; padding-top: 40px; min-height: auto; }
.footer-links { margin-bottom: 12px; display: flex; flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; gap: 16px; }
.footer-links a { color: var(--text-secondary); text-decoration: none; font-size: 0.65em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; display: inline-block; padding: 0; opacity: 0.6; transition: opacity 0.2s; min-height: auto; line-height: 1.5; box-sizing: border-box; }
.footer-links a:hover { opacity: 1; }
.footer-link-button {
    background: transparent;
    border: 0;
    border-radius: 4px;
    box-shadow: none !important;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-block;
    font: inherit;
    font-size: 0.65em;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.5;
    opacity: 0.6;
    padding: 0;
    text-transform: uppercase;
    transform: none !important;
    transition: opacity 0.2s;
    width: auto !important;
    min-height: auto !important;
}
.footer-link-button:hover { opacity: 1; }
.copyright { color: var(--text-secondary); font-size: 0.65em; letter-spacing: 0.5px; opacity: 0.5; margin-bottom: 16px; }

/* === CLS Prevention: FAB (Critical Path) === */
.fab { position: fixed; bottom: max(1.5rem, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: linear-gradient(135deg, var(--accent-clay), hsl(30, 42%, 54%)); color: white; padding: 10px 20px; border-radius: 99px; display: flex; align-items: center; justify-content: center; flex-wrap: nowrap; white-space: nowrap; gap: 12px; font-weight: 800; font-size: 14px; text-transform: uppercase; letter-spacing: 2px; box-shadow: 0 12px 24px hsla(30, 52%, 64%, 0.4), 0 4px 8px rgba(0, 0, 0, 0.1), inset 0 1px 0 hsla(0, 0%, 100%, 0.4); cursor: pointer; z-index: 1000; overflow: hidden; transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); border: 1px solid hsla(30, 52%, 64%, 0.8); }
.fab::before { content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%; background: linear-gradient(to right, transparent, rgba(255,255,255,0.3), transparent); transform: skewX(-20deg); animation: shine 4s infinite cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes shine { 0% { left: -100%; } 20% { left: 200%; } 100% { left: 200%; } }
.fab:hover { transform: translateX(-50%) translateY(-4px) scale(1.02); box-shadow: 0 16px 32px hsla(30, 52%, 64%, 0.5), 0 8px 16px rgba(0, 0, 0, 0.15), inset 0 1px 0 hsla(0, 0%, 100%, 0.5); }
.fab:active { transform: translateX(-50%) scale(0.96); }

/* === CLS Prevention: Note Cards & Action Rows === */
.note-card {
    min-height: auto;
}

.card-footer-meta {
    min-height: 48px;
}

/* === CLS Prevention: Note Images === */
.note-image-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    overflow: hidden;
    background: transparent;
}

.note-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    margin-bottom: 0;
    cursor: pointer;
}

/* === Swipe Carousel === */
.swipe-carousel::-webkit-scrollbar {
    display: none;
}

.swipe-carousel {
    -ms-overflow-style: none;
    scrollbar-width: none;
    scroll-behavior: auto;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
}

.carousel-progress-track {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.15);
    z-index: 5;
    border-radius: 0 0 14px 14px;
    overflow: hidden;
}

.carousel-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #85c4a6, #ecbe8a, #85c4a6);
    background-size: 200% 100%;
    border-radius: 3px;
    transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 8px rgba(133, 196, 166, 0.8), 0 0 16px rgba(236, 190, 138, 0.5);
    animation: bioShimmer 3s ease-in-out infinite;
}

@keyframes bioShimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* === Image Lightbox Overlay === */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100000;
    opacity: 0;
    transition: opacity 0.25s ease;
    cursor: zoom-out;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    overscroll-behavior: contain;
    touch-action: none;
}

.lightbox-overlay.active {
    opacity: 1;
}

.lightbox-overlay img {
    max-width: 92%;
    max-height: 90%;
    border-radius: 10px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    object-fit: contain;
    transform: scale(0.92);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.lightbox-overlay.active img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    color: #fff;
    font-size: 20px;
    font-weight: 300;
    cursor: pointer;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    transition: background 0.2s ease;
    line-height: 1;
    z-index: 10;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15) !important;
    color: white !important;
    border: none !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    min-height: 32px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    font-size: 16px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100001;
    transition: background 0.2s ease, transform 0.2s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.lightbox-nav:hover { background: rgba(255, 255, 255, 0.3) !important; transform: translateY(-50%) scale(1.1); }
.lightbox-nav:active { transform: translateY(-50%) scale(0.9); }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

/* === Unified Base Card Class for Forms & Panels === */
.panel-card {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.875rem; /* ~14px tight padding */
    border-radius: var(--radius-sm); /* 12px */
    box-shadow: 0 0.25rem 0.375rem -0.06rem rgba(0, 0, 0, 0.05), 0 1.25rem 1.56rem -0.3rem rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-sizing: border-box;
}

/* Tightened margins for inputs inside panel cards */
.panel-card .field-group,
.panel-card .checkbox-container {
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

.panel-card .drop-input,
.panel-card .modern-input,
.panel-card input[type="text"],
.panel-card select,
.panel-card textarea {
    padding: 0.5rem 0.75rem; /* Compact padding */
    box-sizing: border-box;
}

/* Description textarea bounds constraints */
#seed-desc {
    min-height: 5rem; /* ~80px */
    max-height: 9.375rem; /* ~150px */
    resize: vertical;
}

/* Form container size limits and horizontal centering */
#seed-tab .panel-card {
    width: 100%;
    max-width: 30rem; /* 480px */
    margin: 0 auto 1.25rem auto;
}

/* Checkbox Alignment & Visibility Fixes */
.checkbox-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
}

.checkbox-container label {
    cursor: pointer;
    user-select: none;
    flex: 1;
}

.checkbox-container input[type="checkbox"] {
    -webkit-appearance: auto !important;
    appearance: auto !important;
    width: 1.25rem;
    height: 1.25rem;
    min-width: 1.25rem;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--accent-sage);
    margin: 0;
    padding: 0;
}

/* Prevent button text from stacking/wrapping */
button, .pill-btn, .btn, .fab, .quick-boost-btn, .category-btn, .welcome-button-primary, .welcome-button-secondary {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.boosted-card {
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
}

.follow-btn {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--accent-sage-dark);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    margin-top: 4px;
}

/* === Modal Typography Adjustments for Small Screens === */
@media (max-width: 420px) {
    #feedback-zone h2, #flag-zone h2 { font-size: 1.2em !important; }
    #feedback-zone p, #flag-zone p { font-size: 0.7em !important; }
    #feedback-zone textarea, #flag-zone textarea { font-size: 14px !important; }
    #feedback-zone .field-label, #flag-zone .field-label { font-size: 0.6em !important; }
    #feedback-zone button, #flag-zone button { font-size: 0.75em !important; }
}
/* Center the empty state card and explainer card within the CSS Grid or Multi-column container */
#notes-container .empty-feed-card,
#notes-container #explainer-card {
    grid-column: 1 / -1; /* Forces the card to span the entire width of the grid */
    column-span: all;    /* Forces the card to span the entire width of the multi-column layout */
    -webkit-column-span: all;
    margin: 0 auto;      /* Centers the constrained card horizontally */
    max-width: 460px;    /* Constrains the width so it doesn't look stretched */
    width: 100%;
}

#notes-container .empty-feed-card {
    text-align: center;
}

#notes-container .empty-feed-card .note-card-header {
    justify-content: center !important;
    padding-right: 0 !important;
}

#notes-container .empty-feed-card > strong,
#notes-container .empty-feed-card > p {
    display: block;
    text-align: center;
}

.empty-state-actions {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.empty-state-share {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.empty-state-share span {
    font-size: 0.8em;
    color: var(--text-muted);
    font-weight: 500;
}

/* --- Mobile Spacing Adjustments --- */
@media (max-width: 768px) {
    .app-header {
        padding: 1rem; 
    }
}

/* --- Mobile Spacing Adjustments --- */
@media (max-width: 480px) {
    
    .content-grid-layout {
        padding: 1.5rem 1rem 1rem 1rem;
    }

    #notes-container {
        /* Force single column on tiny screens if they drop below 280px width */
        grid-template-columns: 1fr;
        gap: 1rem;
        padding-bottom: 48px;
        column-width: auto;
        column-count: 1;
    }

    .note-card {
        max-width: 100%;
        border-radius: 20px;
    }

    .how-it-works-grid {
        grid-template-columns: 1fr !important;
    }

    .note-card strong {
        font-size: clamp(1.15rem, 7vw, 1.45rem);
    }

    .metadata {
        gap: 8px;
    }

    .price-tag {
        max-width: min(120px, 45vw);
    }

    .dist-tag,
    .note-timer,
    .type-label {
        font-size: 0.68rem;
    }

    .fab,
    #main-fab {
        max-width: calc(100vw - 24px);
        white-space: normal;
        text-align: center;
        letter-spacing: 1px;
        gap: 8px;
    }
}

/* Force Header to be pinned flush at the top */
.app-header {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 1rem 1.5rem !important;
    background: var(--bg-primary) !important;
    border: none !important;
    z-index: 99999 !important;
}

/* Force body to hug the viewport and push content below header */
body {
    margin: 0 !important;
    padding: 80px 0 0 0 !important;
}

/* Kill all excessive spacing */
.app-content-wrapper {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

main {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* =========================================================
   PREMIUM VIDEO MODAL OVERHAUL (NATIVE APP FEEL)
   ========================================================= */
.burner-video-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 20000 !important;
    background: rgba(10, 14, 12, 0.95) !important; /* Deep Night Forest backdrop */
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.burner-video-container {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
}

#remote-video {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    z-index: 1 !important;
}

#local-video {
    position: absolute !important;
    top: max(40px, env(safe-area-inset-top, 40px)) !important;
    right: 20px !important;
    width: clamp(100px, 28vw, 130px) !important;
    aspect-ratio: 9/16 !important;
    object-fit: cover !important;
    border-radius: 16px !important;
    box-shadow: 0 12px 32px rgba(0,0,0,0.6) !important;
    border: 2px solid rgba(163, 201, 184, 0.5) !important; /* Bioluminescent border */
    z-index: 10 !important;
}

.burner-controls {
    position: absolute !important;
    bottom: max(40px, env(safe-area-inset-bottom, 40px)) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    gap: 24px !important;
    background: rgba(15, 20, 18, 0.8) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    padding: 16px 32px !important;
    border-radius: 999px !important;
    border: 1px solid rgba(163, 201, 184, 0.2) !important;
    z-index: 10 !important;
    box-shadow: 0 12px 32px rgba(0,0,0,0.5) !important;
}

/* =========================================================
   PREMIUM COMMENTS THREAD CARDS
   ========================================================= */
.comment-wrapper {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
    margin-bottom: 0.75rem !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.comment-wrapper.is-reply {
    margin-left: 2.5rem !important;
    max-width: calc(100% - 2.5rem) !important;
}

.comment-wrapper .neighbor-avatar {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    background: #e6edf8 !important;
    color: var(--accent-sage-dark) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.85rem !important;
    border: none !important;
    box-shadow: none !important;
    flex-shrink: 0 !important;
    margin-top: 2px !important;
}

.comment-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    flex: 1 !important;
    min-width: 0 !important;
}

.comment-bubble {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    position: relative !important;
    width: 100% !important;
}

.comment-bubble .neighbor-tag {
    font-weight: 800 !important;
    font-size: 0.82rem !important;
    color: var(--text-primary) !important;
}

.comment-bubble .comment-body {
    font-size: 0.85rem !important;
    line-height: 1.35 !important;
    color: var(--text-secondary) !important;
    word-wrap: break-word !important;
}

.comment-wrapper .reaction-footer {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 1rem !important;
    margin-top: 0.35rem !important;
    margin-left: 0.5rem !important;
    position: relative !important;
}

.comment-wrapper .comment-timestamp {
    font-size: 0.75rem !important;
    color: #8da399 !important;
    font-weight: 600 !important;
}

.comment-wrapper .react-trigger {
    font-size: 0.75rem !important;
    color: #8da399 !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: color 0.2s !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    line-height: 1 !important;
}

.comment-wrapper .react-trigger:hover {
    color: var(--text-primary) !important;
}

.comment-bubble .reaction-summary {
    position: absolute !important;
    bottom: -8px !important;
    right: -8px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    padding: 2px 4px !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    font-size: 0.75rem !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15) !important;
    cursor: pointer !important;
    z-index: 2 !important;
}

.comment-bubble .reaction-summary .rxn-badge {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    font-size: 0.65rem !important;
    color: #444 !important;
}

.comment-bubble .reaction-summary .rxn-badge b {
    color: #444 !important;
    font-weight: 700 !important;
}

.comment-bubble .reaction-summary:empty {
    display: none !important;
}

.mini-reply-box {
    align-items: center !important;
    gap: 0.5rem !important;
    margin-top: 0.5rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.mini-reply-input {
    flex: 1 !important;
    min-width: 0 !important;
    background: #F4F7F6 !important;
    border: 1px solid rgba(163, 201, 184, 0.2) !important;
    border-radius: 1.25rem !important;
    padding: 0.5rem 0.75rem !important;
    color: var(--text-primary) !important;
    font-size: 16px !important;
    height: auto !important;
}

.mini-reply-input::placeholder {
    font-size: 13px !important;
}

.mini-reply-input:focus {
    outline: none !important;
    border-color: var(--accent-sage) !important;
}

.mini-reply-submit {
    background: transparent !important;
    border: none !important;
    color: var(--accent-sage) !important;
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    cursor: pointer !important;
    padding: 0.25rem 0.5rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    box-shadow: none !important;
}

/* =========================================================
   DROP NOTE BUTTON PLACEMENT FIX
   ========================================================= */
.fab, #main-fab, .submit-btn, #drop-note-btn, #broadcast-btn, .drop-btn {
    position: fixed !important;
    bottom: max(24px, env(safe-area-inset-bottom)) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 99999 !important;
    /* Ensure it doesn't get misaligned or lost during scroll */
}

/* =========================================================
   MOBILE INPUT AUTO-ZOOM PREVENTION
   ========================================================= */
input, textarea, select, .drop-input, #note-desc {
    font-size: 16px !important; /* Prevents iOS auto-zoom on focus */
}

/* =========================================================
   DROP NOTE BUTTON PLACEMENT FIX REFINEMENT
   ========================================================= */
.fab, #main-fab {
    position: fixed !important;
    bottom: max(24px, env(safe-area-inset-bottom)) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 99999 !important;
}

/* Revert form submit buttons to standard flow */
.submit-btn, #drop-note-btn, #broadcast-btn, .drop-btn {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 16px !important;
    margin-bottom: 24px !important;
    z-index: 10 !important;
}

/* =========================================================
   DROP FORM BOTTOM WHITESPACE ERADICATION
   ========================================================= */
.form-container, .drop-form-wrapper, .drop-card {
    padding-bottom: 16px !important;
    margin-bottom: 0 !important;
}

.submit-btn, #drop-note-btn, #broadcast-btn, .drop-btn {
    margin-bottom: 0 !important;
}

/* Ensure the body doesn't artificially stretch the scroll */
body {
    min-height: 100vh !important;
    padding-bottom: 24px !important;
}

footer {
    padding-bottom: 24px !important;
}

/* =========================================================
   HEADER-TO-CONTENT SPACING REFINEMENT
   ========================================================= */
body {
    padding-top: clamp(56px, 8vh, 72px) !important; 
}

h1, .main-heading, .page-header {
    margin-top: 0 !important;
}

/* =========================================================
   DROP FORM PREMIUM BOOST CARD & CTA STYLING
   ========================================================= */

.premium-boost-card {
    background: linear-gradient(145deg, rgba(55, 75, 65, 0.45), rgba(30, 42, 36, 0.55)) !important;
    backdrop-filter: blur(24px) !important;
    border: 1px solid rgba(163, 201, 184, 0.3) !important;
    border-radius: 20px !important;
    padding: 24px !important;
    box-shadow: 0 16px 40px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    text-align: left !important;
}

.boost-card-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 8px !important;
}

.boost-title {
    font-size: 1.15rem !important;
    font-weight: 900 !important;
    color: var(--text-primary) !important;
    letter-spacing: -0.5px !important;
    text-transform: uppercase !important;
}

.boost-badge {
    font-weight: 800 !important;
    color: #8b5e34 !important;
    background: rgba(139, 94, 52, 0.15) !important;
    padding: 4px 10px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    box-shadow: none !important;
    border: none !important;
}

.boost-features {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

.boost-features li {
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
    opacity: 0.9 !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}

.boost-features li span {
    font-size: 0.95rem !important;
}

.premium-interactive-zone {
    margin-top: 8px !important;
    padding-top: 16px !important;
    border-top: 1px solid rgba(163, 201, 184, 0.15) !important;
}

.boost-manifesto {
    font-size: 0.65rem !important;
    font-weight: 800 !important;
    color: var(--accent-sage) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    line-height: 1.4 !important;
    opacity: 0.8 !important;
    text-align: center !important;
    margin-top: 8px !important;
}

/* Split CTA Container */
.split-cta-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
}

.premium-cta-btn {
    width: 100% !important;
    padding: 16px !important;
    border-radius: 99px !important;
    background: linear-gradient(135deg, var(--accent-clay), hsl(30, 42%, 54%)) !important;
    color: white !important;
    font-size: 1.1rem !important;
    font-weight: 800 !important;
    text-transform: none !important;
    letter-spacing: 0.5px !important;
    border: 1px solid hsla(30, 52%, 64%, 0.8) !important;
    cursor: pointer !important;
    box-shadow: 0 12px 24px hsla(30, 52%, 64%, 0.4), 0 4px 8px rgba(0, 0, 0, 0.1), inset 0 1px 0 hsla(0, 0%, 100%, 0.4) !important;
    transition: all 0.2s ease !important;
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    margin-bottom: 0 !important;
}

.premium-cta-btn:active {
    transform: scale(0.98) !important;
}

.free-cta-btn {
    width: 100% !important;
    padding: 16px !important;
    border-radius: 99px !important;
    background: var(--accent-sage-dark) !important;
    color: white !important;
    font-size: 1.1rem !important;
    font-weight: 800 !important;
    text-transform: none !important;
    text-decoration: none !important;
    letter-spacing: 0.5px !important;
    border: none !important;
    cursor: pointer !important;
    box-shadow: 0 8px 20px rgba(62,90,77,0.3) !important;
    transition: all 0.2s ease !important;
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    margin-bottom: 0 !important;
}

.free-cta-btn:hover {
    color: var(--text-primary) !important;
}

.premium-interactive-zone {
    transition: all 0.3s ease !important;
}

.premium-cta-btn {
    transition: all 0.3s ease !important;
}

#boost-features-list {
    transition: all 0.3s ease !important;
}

/* =========================================================
   PREMIUM BOOST CARD REFINEMENT
   ========================================================= */
.premium-boost-card {
    background: rgba(141, 163, 153, 0.15) !important;
    box-shadow: none !important;
    padding: 16px !important;
    gap: 8px !important;
}

/* =========================================================
   AGGRESSIVE EMPTY SPACE CRUSHING
   ========================================================= */
.premium-boost-card {
    padding: 12px !important;
    gap: 6px !important;
}
.boost-title {
    line-height: 1 !important;
}
#boost-features-list {
    line-height: 1.2 !important;
    margin-top: 0 !important;
    font-size: 0.7rem !important;
}
.premium-interactive-zone {
    margin-top: 6px !important;
    padding-top: 10px !important;
}
.split-cta-container { gap: 6px !important; }

/* =========================================================
   HEADER OVERLAP FIX
   ========================================================= */
.app-header {
    position: relative !important; 
}

body {
    padding-top: 0 !important; 
}

h1, .main-heading, .page-header {
    margin-top: 1rem !important; 
}

/* =========================================================
   OVERLAY Z-INDEX DOMINANCE OVERRIDE
   ========================================================= */
.burner-video-overlay, 
#video-modal, 
.welcome-overlay, 
#browser-switch-overlay, 
#toast-alert {
    z-index: 999999 !important; 
}

#video-modal, .burner-video-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    inset: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    max-height: none !important;
}

body:has(#video-modal[style*="display: block"]) .fab,
body:has(#video-modal[style*="display: flex"]) .fab,
body:has(#video-modal[style*="display: block"]) .app-header,
body:has(#video-modal[style*="display: flex"]) .app-header {
    display: none !important;
}

.fab,
#main-fab {
    position: fixed !important;
    bottom: max(24px, env(safe-area-inset-bottom)) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: calc(100vw - 24px) !important;
    min-height: 44px !important;
    padding: 10px 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    border-radius: 99px !important;
    font-size: 14px !important;
    line-height: 1 !important;
    font-weight: 800 !important;
    letter-spacing: 2px !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    z-index: 99999 !important;
}

/* =========================================================
   PREMIUM MODAL & TOAST UPGRADES
   ========================================================= */

@keyframes sonarPulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.6); opacity: 0; }
}

@keyframes dropIn {
    0% { transform: translateY(-40px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

#toast-alert {
    position: fixed !important;
    top: -100px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: rgba(30, 40, 35, 0.85) !important; /* Night Forest theme */
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(163, 201, 184, 0.3) !important;
    color: #FFF !important;
    padding: 14px 28px !important;
    border-radius: 99px !important;
    font-weight: 800 !important;
    font-size: 0.9rem !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4) !important;
    z-index: 999999 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    text-align: center !important;
    width: auto !important;
    max-width: 90% !important;
}

#toast-alert.show {
    top: 40px !important;
    opacity: 1 !important;
}

/* Ensure global Z-index dominance again just to be safe */
#missed-call-modal, .burner-video-overlay, #ringing-overlay {
    z-index: 999999 !important;
}

/* =========================================================
   GLOBAL HEADER POSITIONING SWEEP
   ========================================================= */
header, 
.app-header, 
.page-header, 
.drop-header, 
.global-header,
#main-header,
.site-header {
    position: relative !important;
    top: auto !important;
    transform: none !important;
}

@keyframes breathingPulseBtn {
    0% { transform: scale(1); box-shadow: 0 4px 12px rgba(62,90,77,0.05); }
    50% { transform: scale(1.02); box-shadow: 0 8px 20px rgba(62,90,77,0.1); }
    100% { transform: scale(1); box-shadow: 0 4px 12px rgba(62,90,77,0.05); }
}

.unlock-local-notes-btn {
    background: #FFFFFF;
    border: 1px solid var(--accent-sage);
    border-radius: 12px;
    margin: 0 auto 20px auto;
    max-width: 600px;
    padding: 10px 24px;
    display: flex;
    width: fit-content;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(62,90,77,0.05);
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
    animation: breathingPulseBtn 3s infinite ease-in-out;
}

.unlock-local-notes-btn:hover {
    background: rgba(141, 163, 153, 0.08);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 24px rgba(62,90,77,0.15);
    animation-play-state: paused;
}

.unlock-local-notes-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(62,90,77,0.05);
}

/* Style button based on semantic state */
.thread-toggle-btn[aria-expanded="true"] {
    background: transparent;
    color: var(--accent-sage-dark);
    border: 2px solid var(--accent-sage-dark);
    font-weight: 800;
    box-shadow: none;
}

/* =========================================================
   GHOST NOTES
   ========================================================= */
.ghost-note {
    pointer-events: auto;
    cursor: pointer;
}

.ghost-note .reply-input,
.ghost-note .note-image-wrap {
    pointer-events: none;
}
/* Ensure the parent card container remains visible */
.boost-card {
    display: flex !important;
    flex-direction: column;
}

/* Force visibility regardless of the #boost-toggle state */
.boost-title {
    display: block !important;
    visibility: visible !important;
}

a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible {
    outline: 3px solid var(--accent-sage-dark) !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 5px rgba(141, 163, 153, 0.28) !important;
}

.mini-reply-input:focus-visible,
.thread-toggle-btn:focus-visible,
.pin-digit-input:focus-visible {
    outline: 3px solid var(--accent-sage-dark) !important;
    outline-offset: 3px !important;
}
