:root,
:root[data-theme="dark"],
:root[data-theme="light"],
:root:not([data-theme="light"]) {
    --st-teal: #0E6B7A;
    --st-blue: #2E8CA3;
    --st-seafoam: #6FB8B6;
    --st-sand: #EADCC8;
    --st-white: #F7F5EF;

    color-scheme: light !important;
    --pico-font-size: 16px;
    --pico-font-family: 'Montserrat', sans-serif;
    --pico-background-color: var(--st-white) !important;
    --pico-color: #2d3436 !important;
    --pico-h1-color: var(--st-teal) !important;
    --pico-h2-color: var(--st-teal) !important;
    --pico-h3-color: var(--st-teal) !important;
    --pico-h4-color: var(--st-teal) !important;
    --pico-card-background-color: #fff !important;
    --pico-card-sectioning-background-color: rgba(14, 107, 122, 0.04) !important;
    --pico-card-border-color: var(--st-seafoam) !important;
    --pico-muted-color: #636e72 !important;
    --pico-muted-border-color: #dfe6e9 !important;
    --pico-secondary: #636e72 !important;
    --pico-secondary-hover: #2d3436 !important;
    --pico-table-border-color: #dfe6e9 !important;
    --pico-form-element-background-color: #fff !important;
    --pico-form-element-border-color: #dfe6e9 !important;
    --pico-form-element-focus-color: var(--st-teal) !important;
    --pico-switch-background-color: #c8d6db !important;
    --pico-switch-checked-background-color: #1a8fc4 !important;
    --pico-blockquote-border-color: var(--st-seafoam) !important;
    --pico-code-background-color: rgba(14, 107, 122, 0.06) !important;
    --pico-primary: var(--st-teal) !important;
    --pico-primary-hover: #0a5561 !important;
    --pico-primary-focus: rgba(14, 107, 122, 0.375) !important;
    --pico-primary-inverse: #fff !important;
    --pico-primary-background: var(--st-teal) !important;
    --pico-primary-hover-background: #0a5561 !important;
    --pico-primary-border: var(--st-teal) !important;
    --pico-primary-hover-border: #0a5561 !important;
    --pico-primary-underline: rgba(14, 107, 122, 0.5) !important;
}

.nav-logo {
    height: 50px;
    width: auto;
    border-radius: 0;
    object-fit: contain;
}

.st-icon {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: middle;
}

.st-icon-nav {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.st-icon-action {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: middle;
}

.st-icon-menu {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: var(--st-teal);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: middle;
    margin-right: 0.5rem;
}

body {
    background: url("/static/images/beach-bg.8642f146cbdc.png") center bottom / cover no-repeat fixed;
    background-color: var(--st-white);
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(247, 245, 239, 0.8);
    z-index: -1;
    pointer-events: none;
}

main.container {
    min-height: calc(100dvh - 7rem);
}

input, select, textarea,
input[type="search"],
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="datetime-local"] {
    background-color: #fff !important;
    color: #2d3436 !important;
    border-color: #dfe6e9 !important;
}

input::placeholder, textarea::placeholder {
    color: #636e72 !important;
}

nav.container ul li a {
    color: var(--st-teal) !important;
}

main.container h2,
main.container h3 {
    color: var(--st-teal) !important;
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    margin-top: 0.75rem;
}


/* Profile action buttons */
.profile-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

button.profile-action-btn,
button.profile-action-btn:hover {
    margin: 0;
    padding: 0.4rem 0.6rem;
    font-size: 1.25rem;
    line-height: 1;
    min-width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
}

button.profile-action-btn:disabled {
    opacity: 0.7;
    cursor: default;
}

form.profile-action-form {
    margin: 0;
    padding: 0;
    display: contents;
}

.shell-card {
    margin-bottom: 1rem;
}

.shell-card img {
    max-width: 100%;
    border-radius: var(--pico-border-radius);
}

.tide-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    display: block;
}

/* Carousel */
.carousel-wrap {
    position: relative;
    overflow: hidden;
}

.carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.carousel::-webkit-scrollbar {
    display: none;
}

.carousel-item {
    min-width: 100%;
    width: 100%;
    flex-shrink: 0;
    scroll-snap-align: start;
}

.carousel-item img,
.carousel-item video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--pico-border-radius);
    object-fit: contain;
    max-height: 500px;
}

.carousel-counter {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 0.15rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    z-index: 1;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem 0;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--pico-muted-border-color, #ccc);
    transition: background 0.2s;
}

.carousel-dot.active {
    background: var(--pico-primary, var(--st-teal));
}

/* Media edit grid */
.media-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.media-thumb {
    text-align: center;
    transition: opacity 0.2s;
}

.media-thumb-preview {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--pico-border-radius);
    display: block;
    margin-bottom: 0.25rem;
}

.media-remove-btn {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    width: auto;
    margin: 0;
}

/* Messaging — Chat View */
.chat-view {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 80px);
    margin: -1rem;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--pico-muted-border-color);
    background: var(--pico-background-color);
    flex-shrink: 0;
}

.chat-back {
    font-size: 1.25rem;
    text-decoration: none;
    color: var(--pico-primary);
    line-height: 1;
    padding: 0.25rem;
}

.chat-header-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.chat-header-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--pico-muted-border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.chat-header-info {
    flex: 1;
    min-width: 0;
}

.chat-header-info strong {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-header-info small {
    display: block;
    line-height: 1.2;
}

.chat-options {
    margin: 0;
}

.chat-options-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    color: var(--pico-color);
    margin: 0;
}

.chat-action-bar {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--pico-muted-border-color);
    background: var(--pico-card-background-color, var(--pico-background-color));
}

.chat-action-bar-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin: 0;
}

.chat-action-bar-form input {
    flex: 1;
    margin: 0;
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
}

.chat-action-bar-form button {
    margin: 0;
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    opacity: 0.6;
}

.chat-empty p {
    margin: 0;
}

/* Message bubbles */
.msg {
    max-width: 70%;
    display: flex;
    flex-direction: column;
}

.msg-sent {
    align-self: flex-end;
}

.msg-received {
    align-self: flex-start;
}

.msg-body {
    padding: 0.5rem 0.75rem;
    border-radius: 1.125rem;
    word-wrap: break-word;
}

.msg-body p {
    margin: 0;
    line-height: 1.4;
}

.msg-sent .msg-body {
    background: var(--pico-primary);
    color: var(--pico-primary-inverse, #fff);
    border-bottom-right-radius: 0.25rem;
}

.msg-received .msg-body {
    background: var(--pico-muted-border-color);
    color: var(--pico-color);
    border-bottom-left-radius: 0.25rem;
}

.msg-deleted {
    opacity: 0.5;
    font-style: italic;
}

.msg-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.125rem 0.25rem;
    font-size: 0.7rem;
    color: var(--pico-muted-color, #999);
}

.msg-sent .msg-meta {
    justify-content: flex-end;
}

.msg-delete {
    background: none;
    border: none;
    color: var(--pico-muted-color, #999);
    cursor: pointer;
    padding: 0;
    margin: 0;
    font-size: 0.7rem;
    width: auto;
    opacity: 0;
    transition: opacity 0.15s;
}

.msg:hover .msg-delete {
    opacity: 1;
}

.msg-media {
    margin-top: 0.25rem;
}

.msg-media img,
.msg-media video {
    max-width: 100%;
    max-height: 250px;
    border-radius: 0.75rem;
    display: block;
}

/* Chat input */
.chat-input {
    flex-shrink: 0;
    padding: 0.5rem 1rem 0.75rem;
    border-top: 1px solid var(--pico-muted-border-color);
    background: var(--pico-background-color);
}

.chat-input-form {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    margin: 0;
}

.chat-attach {
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.5rem 0.25rem;
    margin: 0;
    flex-shrink: 0;
    line-height: 1;
}

.chat-attach input {
    display: none;
}

textarea.chat-text-input,
textarea.chat-text-input:focus {
    flex: 1;
    margin: 0;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    height: 5rem;
    max-height: 10rem;
    font-size: 0.95rem;
    resize: vertical;
    line-height: 1.4;
    border: 1px solid var(--pico-muted-border-color);
    background: var(--pico-background-color);
    color: var(--pico-color);
    box-sizing: border-box;
}

button.chat-send-btn,
button.chat-send-btn:hover {
    margin: 0 0 0.5rem 0;
    padding: 0;
    width: 1.75rem;
    height: 1.75rem;
    min-width: 1.75rem;
    border-radius: 50%;
    font-size: 0.85rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: none;
    cursor: pointer;
}

/* Inbox */
.chat-inbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.chat-inbox-header h2 {
    margin: 0;
}

.chat-inbox-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.9rem;
}

.chat-inbox-actions a {
    white-space: nowrap;
}

/* Conversation list */
.chat-convo-list {
    display: flex;
    flex-direction: column;
}

.chat-convo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.5rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--pico-muted-border-color);
    transition: background 0.1s;
}

.chat-convo-link:hover {
    background: var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
}

.chat-convo-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.chat-convo-avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--pico-muted-border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.chat-convo-info {
    flex: 1;
    min-width: 0;
}

.chat-convo-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}

.chat-convo-top strong {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-convo-top small {
    flex-shrink: 0;
    font-size: 0.75rem;
}

.chat-convo-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.125rem;
    font-size: 0.85rem;
}

.chat-convo-preview span,
.chat-convo-preview em {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.4rem;
    border-radius: 1rem;
    background: var(--pico-primary);
    color: var(--pico-primary-inverse, #fff);
    font-size: 0.7rem;
    font-weight: 600;
    flex-shrink: 0;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 0.25rem;
}

/* User search results (new message) */
.chat-user-result {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--pico-muted-border-color);
    margin: 0;
}

.chat-user-result-info {
    flex: 1;
    min-width: 0;
}

.chat-user-result-info strong {
    display: block;
}

.chat-user-result-info small {
    display: block;
    line-height: 1.2;
}

/* Notifications */
.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.notification-header h2 {
    margin: 0;
}

.notification-item {
    margin: 0;
    border-bottom: 1px solid var(--pico-muted-border-color);
    background: rgba(255, 255, 255, 0.92);
    border-radius: 8px;
    margin-bottom: 0.25rem;
}

.notification-item.unread {
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

button.notification-btn,
button.notification-btn:hover {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 0.5rem;
    margin: 0;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    color: #2d3436 !important;
    font-size: 0.9rem;
}

.notification-text {
    flex: 1;
    min-width: 0;
}

.notification-time {
    flex-shrink: 0;
    white-space: nowrap;
    color: #636e72 !important;
}

.avatar-sm-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--pico-muted-border-color);
    font-size: 1rem;
    flex-shrink: 0;
}

/* Comments */
.comment-section {
    padding: 0.5rem 0;
    border-top: 1px solid var(--pico-muted-border-color);
}

.comment-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.35rem 0;
    gap: 0.5rem;
}

.comment-content {
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.comment-content strong {
    margin-right: 0.3rem;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

button.comment-delete-btn,
button.comment-delete-btn:hover {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0;
    margin: 0;
    color: var(--pico-muted-color);
    width: auto;
    line-height: 1;
}

.comment-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin: 0.35rem 0 0;
}

input.comment-input,
input.comment-input:focus {
    flex: 1;
    margin: 0;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 1rem;
    border: 1px solid var(--pico-muted-border-color);
}

button.comment-submit-btn,
button.comment-submit-btn:hover {
    margin: 0;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    white-space: nowrap;
    width: auto;
}

/* Post actions (like, comment, share) */
.post-actions {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0;
    align-items: center;
}

button.post-action-btn,
button.post-action-btn:hover {
    background: none !important;
    border: none !important;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem 0.5rem;
    margin: 0;
    color: var(--st-teal) !important;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    width: auto;
    line-height: 1;
}

.post-action-btn .st-icon,
.post-actions .st-icon {
    stroke: var(--st-teal) !important;
    width: 20px;
    height: 20px;
}

.post-actions .st-icon.st-liked {
    fill: #e74c3c !important;
    stroke: #e74c3c !important;
}

span.post-action-btn {
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--st-teal) !important;
}

button.post-action-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.post-action-count {
    font-size: 0.85rem;
}

.shared-attribution {
    display: block;
    padding: 0.25rem 0;
    color: var(--pico-muted-color);
}

.rare-badge {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    background: #ffeaa7;
    color: #6c5200;
    margin-right: 0.5rem;
}

/* Rarity badges */
.rarity-badge {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 0.5rem;
}

.rarity-common {
    background: #dfe6e9;
    color: #2d3436;
}

.rarity-uncommon {
    background: #55efc4;
    color: #00695c;
}

.rarity-rare {
    background: #ffeaa7;
    color: #6c5200;
}

.rarity-very_rare {
    background: #fd79a8;
    color: #6c1438;
}

.chat-action-bar-form select {
    flex: 1;
    margin: 0;
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
}

/* Shell Society tier grid */
.tier-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .tier-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .tier-grid {
        grid-template-columns: 1fr;
    }
}

.tier-grid article {
    margin: 0;
}

.tier-grid [id^="paypal-button-"] {
    max-width: 250px;
    margin: 0 auto;
}

.ticket-tier-price {
    font-size: 1.25rem;
    color: var(--st-teal);
    font-weight: 600;
}

.speaker-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.booth-photo {
    width: 60px;
    height: 60px;
    border-radius: var(--pico-border-radius);
    object-fit: cover;
    flex-shrink: 0;
}

/* Event cards */
.event-card {
    margin-bottom: 1rem;
}

.event-card img {
    max-width: 100%;
    border-radius: var(--pico-border-radius);
}

.convention-badge {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--st-seafoam);
    color: #2d3436;
    margin-right: 0.5rem;
}

/* Event Ad Cards */
.event-ad-card {
    border: 2px solid var(--st-seafoam);
    border-radius: var(--pico-border-radius);
    overflow: hidden;
    margin-bottom: 1rem;
}
.event-ad-banner {
    background: linear-gradient(135deg, var(--st-teal), var(--st-blue));
    color: #fff;
    text-align: center;
    padding: 0.35rem 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.event-ad-body {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    align-items: start;
}
.event-ad-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: var(--pico-border-radius);
    flex-shrink: 0;
}
.event-ad-details {
    flex: 1;
    min-width: 0;
}
@media (max-width: 576px) {
    .event-ad-body {
        flex-direction: column;
    }
    .event-ad-image {
        width: 100%;
        height: 150px;
    }
}

/* Map ad banner */
.map-ad-banner {
    margin-top: 0.75rem;
    border: 2px solid var(--st-seafoam);
    border-radius: var(--pico-border-radius);
    overflow: hidden;
}
.map-ad-banner .event-ad-banner {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
}
.map-ad-banner .event-ad-body {
    padding: 0.5rem;
    gap: 0.5rem;
}
.map-ad-banner .event-ad-image {
    width: 70px;
    height: 70px;
}

/* ===== Mobile Navigation ===== */

.mobile-top-bar {
    display: none;
}

.mobile-bottom-nav {
    display: none;
}

.mobile-hamburger-menu {
    display: none;
}

.hamburger-backdrop {
    display: none;
}

@media (max-width: 768px) {
    .desktop-nav {
        display: none !important;
    }

    .mobile-top-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.5rem 1rem;
        background: var(--pico-background-color);
        border-bottom: 2px solid var(--st-seafoam);
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 250;
    }

    /* Offset content below fixed top bar */
    body {
        padding-top: 3.75rem;
    }

    /* Native app: push header below the Dynamic Island / status bar */
    .capacitor-native .mobile-top-bar {
        padding-top: env(safe-area-inset-top, 1rem);
    }
    .capacitor-native body {
        padding-top: calc(3.5rem + env(safe-area-inset-top, 1rem));
    }

    .mobile-logo {
        font-size: 1.5rem;
        text-decoration: none;
    }

    .mobile-top-actions {
        display: flex;
        align-items: flex-end;
        gap: 0.75rem;
        align-self: flex-end;
    }

    .mobile-top-icon {
        font-size: 1.25rem;
        text-decoration: none;
        color: var(--pico-color);
        position: relative;
    }

    .mobile-badge {
        position: absolute;
        top: -6px;
        right: -8px;
        background: var(--st-teal);
        color: #fff;
        font-size: 0.6rem;
        font-weight: 700;
        min-width: 16px;
        height: 16px;
        border-radius: 8px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0 3px;
    }

    .mobile-hamburger-btn {
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0.25rem;
        margin: 0;
        color: var(--st-teal);
        width: auto;
        line-height: 1;
    }

    /* Hamburger backdrop */
    .hamburger-backdrop {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.4);
        z-index: 199;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    .hamburger-backdrop.open {
        opacity: 1;
        pointer-events: auto;
    }

    /* Hamburger overlay */
    .mobile-hamburger-menu {
        display: block;
        position: fixed;
        top: calc(3.25rem + env(safe-area-inset-top, 0px));
        right: -280px;
        width: 280px;
        height: calc(100dvh - 3.25rem - env(safe-area-inset-top, 0px));
        background: var(--pico-background-color);
        border-left: 2px solid var(--st-seafoam);
        z-index: 200;
        transition: right 0.25s ease;
        overflow-y: auto;
    }

    .mobile-hamburger-menu.open {
        right: 0;
        box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    }

    .hamburger-menu-content {
        display: flex;
        flex-direction: column;
        padding: 1.5rem;
    }

    .hamburger-menu-content a {
        display: block;
        padding: 0.85rem 0;
        text-decoration: none;
        color: var(--pico-color);
        font-size: 1.1rem;
        border-bottom: 1px solid var(--pico-muted-border-color);
    }

    .hamburger-menu-content a:last-child {
        border-bottom: none;
    }

    /* Bottom nav bar */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--pico-background-color);
        border-top: 2px solid var(--st-seafoam);
        z-index: 100;
        padding: 0.25rem 0;
        padding-bottom: calc(0.25rem + env(safe-area-inset-bottom));
    }

    .bottom-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 0.35rem 0;
        text-decoration: none;
        color: var(--pico-muted-color);
        font-size: 0.7rem;
        gap: 0.15rem;
        transition: color 0.15s;
        position: relative;
    }

    .bottom-nav-item.active {
        color: var(--st-teal);
    }

    .bottom-nav-icon {
        font-size: 1.3rem;
        line-height: 1;
        position: relative;
    }

    .bottom-nav-label {
        font-weight: 500;
    }

    /* Main content padding to clear bottom nav */
    main.container {
        padding-bottom: 4.5rem;
    }

    /* Chat view adjustment for bottom nav */
    .chat-view {
        height: calc(100dvh - 80px - 3.5rem);
    }
}

/* ===== General Mobile Responsive Fixes ===== */

@media (max-width: 768px) {
    .chat-inbox-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .media-thumb-preview {
        width: 60px;
        height: 60px;
    }

    main.container h2,
    main.container h3 {
        font-size: 1.85rem;
    }
}

@media (max-width: 768px) {
    #nearby-list {
        padding-bottom: 4rem;
    }
}

@media (max-width: 576px) {
    .nearby-listbox {
        max-height: 160px;
    }

    .map-legend {
        gap: 0.75rem;
        font-size: 0.75rem;
    }
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Marketplace */
.marketplace-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .marketplace-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.marketplace-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: var(--pico-border-radius);
    border: 1px solid var(--st-seafoam);
    overflow: hidden;
    position: relative;
    transition: box-shadow 0.2s;
}

.marketplace-card:hover {
    box-shadow: 0 2px 8px rgba(14, 107, 122, 0.15);
}

.marketplace-card-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.marketplace-no-img {
    background: var(--st-sand);
    display: flex;
    align-items: center;
    justify-content: center;
}

.marketplace-card-body {
    padding: 0.5rem 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.marketplace-card-body strong {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.marketplace-card-body small {
    color: var(--pico-muted-color);
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.marketplace-price {
    color: var(--st-teal);
    font-weight: 600;
}

.marketplace-sold-badge {
    display: inline-block;
    background: var(--st-seafoam);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 0.25rem;
    vertical-align: middle;
}

/* Shell Hut */
.shellhut-progress-card {
    margin-bottom: 1.5rem;
}

.shellhut-progress-bar {
    width: 100%;
    height: 12px;
    background: var(--st-sand);
    border-radius: 6px;
    overflow: hidden;
}

.shellhut-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--st-teal), var(--st-blue));
    border-radius: 6px;
    transition: width 0.4s ease;
}

.shellhut-section {
    margin-bottom: 1.5rem;
}

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

@media (min-width: 768px) {
    .shellhut-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.shellhut-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: var(--pico-border-radius);
    border: 2px solid transparent;
    overflow: hidden;
    position: relative;
    text-align: center;
    transition: border-color 0.2s, filter 0.2s;
}

.shellhut-found {
    border-color: var(--st-teal);
    box-shadow: 0 0 8px rgba(14, 107, 122, 0.2);
}

.shellhut-unfound {
    filter: grayscale(80%) opacity(0.6);
}

.shellhut-unfound:hover {
    filter: grayscale(40%) opacity(0.8);
}

.shellhut-card-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.shellhut-no-img {
    background: var(--st-sand);
    display: flex;
    align-items: center;
    justify-content: center;
}

.shellhut-check {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 26px;
    height: 26px;
    background: var(--st-teal);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shellhut-card-name {
    padding: 0.3rem 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shellhut-rarity-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.6rem;
    border-radius: 0.25rem;
    color: #fff;
}

.shellhut-rarity-common { background: #999; }
.shellhut-rarity-rare { background: var(--st-blue); }

/* Footer */
.site-footer {
    text-align: center;
    padding: 2rem 1rem 6rem;
    font-size: 0.8rem;
    color: var(--pico-muted-color);
}

.site-footer a {
    color: var(--st-seafoam);
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

.footer-dot {
    margin: 0 0.4rem;
}

/* Desktop landing overlay */
.desktop-landing {
    display: none;
}

@media (min-width: 768px) {
    .desktop-landing {
        display: flex;
        position: fixed;
        inset: 0;
        z-index: 9999;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        background: linear-gradient(135deg, var(--st-teal) 0%, var(--st-blue) 50%, var(--st-seafoam) 100%);
    }

    .desktop-landing-content {
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .desktop-promo {
        max-width: 900px;
        width: 90vw;
        border-radius: 1rem;
        box-shadow: 0 8px 30px rgba(0,0,0,0.3);
        margin-bottom: 2rem;
    }

    .desktop-qr-wrap {
        background: rgba(255, 255, 255, 0.95);
        border-radius: 1rem;
        padding: 1.5rem;
        display: inline-block;
        box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    }

    .desktop-qr {
        width: 160px;
        height: 160px;
    }

    .desktop-qr-label {
        font-family: 'Montserrat', sans-serif;
        font-size: 0.85rem;
        color: var(--st-teal);
        font-weight: 600;
        margin-top: 0.75rem;
        margin-bottom: 0;
    }
}

/* Searchable Select */
.ss-wrap {
    position: relative;
}

.ss-display {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--pico-form-element-border-color);
    border-radius: var(--pico-border-radius);
    background: var(--pico-form-element-background-color);
    cursor: pointer;
    color: var(--pico-muted-color);
    line-height: 1.5;
    margin-bottom: 0;
}

.ss-display.ss-has-value {
    color: var(--pico-color);
}

.ss-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--pico-form-element-background-color);
    border: 1px solid var(--pico-form-element-border-color);
    border-top: none;
    border-radius: 0 0 var(--pico-border-radius) var(--pico-border-radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 260px;
    overflow: hidden;
    display: none;
    pointer-events: none;
}

.ss-dropdown.open {
    display: flex;
    flex-direction: column;
    pointer-events: auto;
}

.ss-search {
    padding: 0.5rem 0.75rem;
    border: none;
    border-bottom: 1px solid var(--pico-form-element-border-color);
    outline: none;
    font-size: 0.9rem;
    background: transparent;
    flex-shrink: 0;
}

.ss-list {
    list-style: none !important;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1;
}

.ss-option {
    list-style: none !important;
    padding: 0.45rem 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.ss-option:hover {
    background: rgba(14, 107, 122, 0.08);
}

.ss-option.ss-placeholder {
    color: var(--pico-muted-color);
    font-style: italic;
}

/* Rare Find toggle button */
.rare-toggle-btn {
    background: var(--st-teal);
    color: #fff;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: var(--pico-border-radius);
    font-weight: 600;
    cursor: pointer;
    width: auto;
    margin-bottom: 1rem;
}

.rare-toggle-btn.rare-active {
    background: #b0bec5;
}

.btn-danger {
    background: #c0392b;
    border-color: #c0392b;
    color: #fff;
}
.btn-danger:hover {
    background: #a93226;
    border-color: #a93226;
}
