:root {
    --bg-color: #f4f1e7;
    --surface-1: rgba(255, 252, 246, 0.9);
    --surface-2: rgba(246, 241, 231, 0.84);
    --card-bg: rgba(255, 252, 247, 0.88);
    --primary: #4ba66a;
    --primary-soft: #dff3df;
    --primary-glow: rgba(75, 166, 106, 0.18);
    --accent-sky: #80b8dc;
    --accent-amber: #d8a353;
    --accent-rose: #db8ea1;
    --text-main: #22322b;
    --text-muted: #5b6b63;
    --glass-border: rgba(64, 85, 73, 0.1);
    --glass-shadow: 0 18px 42px rgba(92, 89, 72, 0.12);
    --focus-ring: 0 0 0 3px rgba(128, 184, 220, 0.22);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 8% 10%, rgba(111, 189, 130, 0.16), transparent 24%),
        radial-gradient(circle at 92% 4%, rgba(128, 184, 220, 0.12), transparent 22%),
        linear-gradient(180deg, #f5f1e8 0%, #f0ebde 44%, #ebe5d7 100%);
    background-size: auto, auto, auto;
    color: var(--text-main);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.sheet-open {
    overflow: hidden;
}

::selection {
    color: #203128;
    background: var(--primary-soft);
}

button,
input,
select,
textarea,
label[role="button"] {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
label[role="button"]:focus-visible,
a:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.app-container {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    padding-bottom: 126px;
}

.login-screen {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 20% 15%, rgba(111, 189, 130, 0.2), transparent 32%),
        radial-gradient(circle at 78% 12%, rgba(128, 184, 220, 0.14), transparent 26%),
        linear-gradient(145deg, #f5f0e4 0%, #f0ebde 48%, #e7e0d0 100%);
}

.login-screen.hidden {
    display: none;
}

.login-panel {
    width: min(100%, 360px);
    padding: 28px;
    border: 1px solid rgba(64, 85, 73, 0.1);
    border-radius: 20px;
    background: linear-gradient(160deg, rgba(255, 252, 247, 0.96), rgba(245, 239, 228, 0.92));
    box-shadow: 0 24px 80px rgba(92, 89, 72, 0.14);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.login-mark {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: rgba(67, 224, 131, 0.14);
    font-size: 1.7rem;
    margin-bottom: 18px;
}

.login-panel h1 {
    font-size: 2rem;
    line-height: 1;
    margin-bottom: 8px;
}

.login-panel p {
    color: var(--text-muted);
}

.identity-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 22px 0 14px;
}

.identity-btn,
.login-submit {
    border: 1px solid rgba(64, 85, 73, 0.12);
    border-radius: 14px;
    min-height: 44px;
    color: var(--text-main);
    background: rgba(255,255,255,0.62);
    font-weight: 700;
    cursor: pointer;
}

.identity-btn.active {
    color: #203128;
    border-color: rgba(75, 166, 106, 0.6);
    background: var(--primary);
}

.login-input {
    width: 100%;
    min-height: 48px;
    border-radius: 14px;
    border: 1px solid rgba(64, 85, 73, 0.12);
    background: rgba(255,255,255,0.7);
    color: var(--text-main);
    padding: 0 14px;
    font-size: 1rem;
    outline: none;
}

.login-input:focus {
    border-color: rgba(67, 224, 131, 0.78);
    box-shadow: 0 0 0 3px rgba(67, 224, 131, 0.12);
}

.login-submit {
    width: 100%;
    margin-top: 12px;
    color: #203128;
    background: linear-gradient(135deg, #74c08c, #e2f2df);
}

.login-submit:disabled {
    opacity: 0.65;
}

.login-error {
    min-height: 20px;
    margin-top: 10px;
    color: #ff7f9b !important;
    font-size: 0.88rem;
}

/* Glass Header */
.glass-header {
    background: linear-gradient(180deg, rgba(248, 244, 235, 0.94), rgba(248, 244, 235, 0.8));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(64, 85, 73, 0.08);
    padding: calc(14px + env(safe-area-inset-top)) 18px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
}

body.map-active {
    overflow: hidden;
}

body.map-active .glass-header {
    display: none;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}

.logo-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.logo h1 {
    font-size: 1.32rem;
    font-weight: 700;
    background: linear-gradient(to right, #23342c, #4ba66a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    padding: 8px;
}
.icon-btn:hover {
    transform: scale(1.1);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    position: relative;
}

.toolbar-btn {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 16px;
    background: rgba(255,255,255,0.6);
    border: 1px solid rgba(64, 85, 73, 0.1);
    color: var(--text-main);
    line-height: 1;
    box-shadow: 0 8px 18px rgba(92, 89, 72, 0.08), inset 0 1px 0 rgba(255,255,255,0.6);
}

#view-map-btn.toolbar-btn,
#open-news-btn.toolbar-btn,
#open-archive-btn.toolbar-btn {
    width: 46px;
    height: 46px;
    min-width: 46px;
    min-height: 46px;
    border-radius: 16px;
    font-size: 1rem;
}

.toolbar-btn:hover {
    border-color: rgba(75, 166, 106, 0.24);
    background: rgba(255,255,255,0.86);
    box-shadow: 0 12px 24px rgba(92, 89, 72, 0.12), inset 0 1px 0 rgba(255,255,255,0.7);
}

.toolbar-icon {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #466457;
    background: linear-gradient(180deg, rgba(255,255,255,0.72), rgba(240, 235, 225, 0.92));
}

.toolbar-icon.map-icon {
    color: #477265;
    background: linear-gradient(180deg, rgba(223, 244, 235, 0.92), rgba(242, 249, 245, 0.96));
}

.toolbar-icon.news-icon {
    color: #6b5e43;
    background: linear-gradient(180deg, rgba(250, 241, 214, 0.92), rgba(253, 248, 236, 0.96));
}

.toolbar-icon.archive-icon {
    color: #556d61;
    background: linear-gradient(180deg, rgba(234, 239, 232, 0.92), rgba(247, 249, 246, 0.96));
}

.toolbar-btn:hover .toolbar-icon {
    color: var(--primary);
}

.top-news-entry {
    display: none;
}

.user-pill {
    display: inline-flex;
    align-items: center;
    flex: 0 1 auto;
    max-width: 92px;
    padding: 6px 10px;
    border: 1px solid rgba(46, 213, 115, 0.32);
    border-radius: 999px;
    background: rgba(46, 213, 115, 0.1);
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-pill.hidden {
    display: none;
}

.top-user-pill::before {
    content: "·";
    margin-right: 6px;
    color: rgba(46, 213, 115, 0.72);
}

@media (max-width: 420px) {
    .glass-header {
        padding: calc(12px + env(safe-area-inset-top)) 10px 12px;
        gap: 6px;
    }

    .logo {
        gap: 7px;
    }

    .logo h1 {
        font-size: 1rem;
    }

    .header-actions {
        gap: 6px;
    }

    #view-map-btn,
    #open-news-btn,
    #open-archive-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }

    #open-archive-btn.record-nav-btn {
        width: 40px;
        min-width: 40px;
        padding: 0;
        gap: 0;
        font-size: 0;
    }

    #open-archive-btn.record-nav-btn::before {
        content: "📒";
        font-size: 1.08rem;
    }

    #open-news-btn.news-nav-btn {
        width: 40px;
        min-width: 40px;
        padding: 0;
        font-size: 1.08rem;
    }

    .top-user-pill {
        max-width: 58px;
        padding: 5px 8px;
        font-size: 0.72rem;
    }

    #view-map-btn.toolbar-btn,
    #open-news-btn.toolbar-btn,
    #open-archive-btn.toolbar-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }

    .toolbar-icon {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 600px) {
    .glass-header {
        padding-right: 16px;
    }

    .header-actions {
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;
        z-index: auto;
        transform: none;
        display: flex;
        width: auto;
        gap: 6px;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    #view-map-btn,
    #open-news-btn,
    #open-archive-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        border-radius: 999px;
        font-size: 1.08rem;
    }

    #open-archive-btn.record-nav-btn {
        width: 40px;
        min-width: 40px;
        padding: 0;
        gap: 0;
        font-size: 0;
    }

    #open-archive-btn.record-nav-btn::before {
        content: "📒";
        font-size: 1.12rem;
    }

    .fab-container {
        right: 16px;
        bottom: calc(18px + env(safe-area-inset-bottom));
        z-index: 180;
    }

    #view-map-btn.toolbar-btn,
    #open-news-btn.toolbar-btn,
    #open-archive-btn.toolbar-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        border-radius: 14px;
    }

    .breathing-fab {
        min-width: 136px;
        height: 54px;
        padding: 0 16px 0 12px;
    }

    .fab-label {
        font-size: 0.9rem;
    }

    .source-sheet-panel {
        margin: 0 10px 10px;
    }
}

/* Status bar */
.status-bar {
    padding: 16px 16px 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.stats-card {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.84), rgba(255,255,255,0.68)),
        linear-gradient(145deg, rgba(250, 246, 238, 0.98), rgba(242, 236, 225, 0.94));
    border: 1px solid rgba(64, 85, 73, 0.08);
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 18px 48px rgba(92, 89, 72, 0.12);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.stats-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

.stats-eyebrow {
    display: block;
    color: #73827b;
    font-size: 0.76rem;
    letter-spacing: 0;
    margin-bottom: 6px;
}

.stats-card h2 {
    color: var(--text-main);
    font-size: 1.56rem;
    line-height: 1.14;
}

.stats-total {
    min-width: 72px;
    height: 72px;
    padding: 0 14px;
    border-radius: 24px;
    display: grid;
    place-items: center;
    color: #203128;
    background: linear-gradient(135deg, #86cf9c, #edf7ea);
    font-size: 1.8rem;
    font-weight: 900;
    box-shadow: 0 12px 28px rgba(75, 166, 106, 0.14);
}

.stats-public-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.stat-tile {
    min-height: 106px;
    border-radius: 18px;
    border: 1px solid rgba(64, 85, 73, 0.08);
    background: linear-gradient(180deg, rgba(255,255,255,0.72), rgba(247, 243, 234, 0.95));
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-tile.total {
    grid-column: span 2;
}

.stat-tile.plant {
    border-color: rgba(67, 224, 131, 0.18);
}

.stat-tile i {
    font-style: normal;
    color: var(--primary);
    font-size: 1.1rem;
}

.stat-tile span {
    color: #617067;
    font-size: 0.76rem;
    font-weight: 600;
}

.stat-tile strong {
    color: var(--text-main);
    font-size: 1.7rem;
    line-height: 1;
}

.stat-tile.scenery i {
    color: var(--accent-sky);
}

.stat-tile.animal i {
    color: var(--accent-amber);
}

.stats-foot {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 12px;
    margin-top: 16px;
    color: #5f6d66;
    font-size: 0.84rem;
}

.observer-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-start;
}

.observer-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 5px 8px 5px 5px;
    background: rgba(255,255,255,0.64);
    border: 1px solid rgba(64, 85, 73, 0.08);
}

.observer-chip b {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #0b0f0c;
    background: var(--primary);
    font-size: 0.72rem;
}

.observer-chip em {
    color: #5f6d66;
    font-style: normal;
}

.observer-chip strong {
    color: var(--text-main);
}

.feed-filter-bar {
    position: sticky;
    top: 72px;
    z-index: 80;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 14px;
    padding: 6px;
    border: 1px solid rgba(64, 85, 73, 0.08);
    border-radius: 18px;
    background: rgba(255, 250, 242, 0.9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.feed-filter-bar button {
    min-height: 40px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: #516058;
    font-weight: 800;
    cursor: pointer;
}

.feed-filter-bar button:focus-visible,
.home-author-filter button:focus-visible {
    box-shadow: inset 0 0 0 1px rgba(123, 199, 255, 0.55), var(--focus-ring);
}

.feed-filter-bar button.active {
    color: #203128;
    background: linear-gradient(135deg, #86cf9c, #edf7ea);
    box-shadow: 0 10px 22px rgba(75, 166, 106, 0.12);
}

.home-author-filter {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    padding: 2px 1px 4px;
    scrollbar-width: none;
}

.home-author-filter::-webkit-scrollbar {
    display: none;
}

.home-author-filter button {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid rgba(64, 85, 73, 0.08);
    border-radius: 999px;
    background: rgba(255,255,255,0.68);
    color: #516058;
    font-weight: 800;
    cursor: pointer;
}

.home-author-filter button.active {
    color: #203128;
    background: linear-gradient(135deg, #86cf9c, #edf7ea);
    border-color: rgba(75, 166, 106, 0.3);
}

.home-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.home-stats span {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 9px 8px;
    text-align: center;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.78rem;
}

.author-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.author-stats span {
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(46, 213, 115, 0.08);
    color: var(--primary);
    border: 1px solid rgba(46, 213, 115, 0.18);
    font-size: 0.78rem;
    font-weight: 700;
}

@media (max-width: 760px) {
    .stats-card {
        border-radius: 18px;
        padding: 16px;
    }

    .stats-public-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stat-tile {
        min-height: 88px;
        padding: 10px;
    }

    .feed-filter-bar {
        top: 64px;
    }
}

@media (max-width: 420px) {
    .feed-container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .status-bar {
        padding-left: 12px;
        padding-right: 12px;
    }

    .card-image-wrap {
        height: 235px;
    }

    .stats-card h2 {
        font-size: 1.34rem;
    }

    .feed-filter-bar {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 4px;
        padding: 4px;
    }

    .feed-filter-bar button,
    .home-author-filter button {
        font-size: 0.84rem;
    }
}

@media (min-width: 761px) and (max-width: 1100px) {
    .stats-public-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Feed Container */
.feed-container {
    padding: 10px 16px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Glass Card */
.glass-card {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.4), transparent 34%),
        var(--card-bg);
    border: 1px solid rgba(64, 85, 73, 0.09);
    border-radius: 18px;
    padding: 10px;
    box-shadow: 0 12px 34px rgba(92, 89, 72, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:active {
    transform: scale(0.98);
}

.card-image-wrap {
    width: 100%;
    height: 255px;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    margin-bottom: 14px;
    background: rgba(236, 232, 223, 0.9);
}

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

.card-confidence {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.78);
    backdrop-filter: blur(4px);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    border: 1px solid rgba(75, 166, 106, 0.2);
}

.card-content h3 {
    font-size: 1.42rem;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    line-height: 1.22;
}

.card-content {
    padding: 2px 4px 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.scientific-name {
    padding-top: 2px;
}

.common-name {
    color: var(--text-main);
    min-width: 0;
    overflow-wrap: anywhere;
}

.recognition-pill {
    flex-shrink: 0;
    align-self: center;
    margin-left: 10px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    font-style: normal;
    letter-spacing: 0;
}

.recognition-pill.pending {
    color: #0b0f0c;
    background: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}

.recognition-pill.failed {
    color: #fff;
    background: #ff4757;
}

.scientific-name {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: -6px;
    margin-bottom: 0;
}

.card-meta {
    font-size: 0.8rem;
    color: #5d6a63;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.compact-meta {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 2px;
    padding-top: 14px;
    border-top: 1px solid rgba(64, 85, 73, 0.12);
}

.compact-meta span:not(:last-child)::after {
    content: "·";
    margin-left: 6px;
    color: rgba(164, 176, 175, 0.48);
}

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

.btn-card-action {
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    border-radius: 12px;
    min-height: 36px;
    padding: 7px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.btn-card-action.retry {
    color: #0b0f0c;
    background: var(--primary);
    border-color: var(--primary);
}

.delete-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 50, 50, 0.7);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    font-size: 0.9rem;
    color: white;
}

.delete-btn:focus-visible {
    box-shadow: var(--focus-ring);
}
.delete-btn:hover {
    transform: scale(1.1);
    background: #FF3B30;
}

.card-desc {
    font-size: 0.85rem;
    color: #33423b;
    line-height: 1.6;
    margin: 10px 0 12px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.065);
    border-radius: 12px;
    background: rgba(255,255,255,0.035);
    display: block;
    overflow: visible;
}

.card-desc {
    margin: 0;
    padding: 0 0 14px;
    border: 0;
    border-bottom: 1px solid rgba(64, 85, 73, 0.12);
    border-radius: 0;
    background: transparent;
}

.scenery-image-wrap {
    height: 240px;
}

.scenery-card-content .common-name {
    color: var(--text-main);
}

.scenery-card-content h3 {
    font-size: 1.45rem;
}

.scenery-subtitle {
    font-style: normal;
    color: #5d6a63;
}

.scenery-desc {
    color: #33423b;
    font-size: 0.92rem;
    border-bottom: none;
    padding-bottom: 4px;
}

.scenery-desc {
    padding-bottom: 14px;
}

.tag-row,
.map-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 12px;
}

.tag-row span,
.map-tag-row span {
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(255,255,255,0.075);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.compact-meta span::after {
    content: none !important;
}

.card-actions {
    margin-top: 2px;
    padding-top: 12px;
    border-top: 1px solid rgba(64, 85, 73, 0.12);
}

.btn-card-action {
    background: rgba(255,255,255,0.72);
    border: 1px solid rgba(64, 85, 73, 0.12);
}

.tag-row span,
.map-tag-row span {
    padding: 6px 10px;
    background: rgba(244, 239, 231, 0.95);
    border: 1px solid rgba(64, 85, 73, 0.1);
    color: #5f6d66;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Modern Breathing FAB */
.fab-container {
    position: fixed;
    right: 18px;
    bottom: calc(18px + env(safe-area-inset-bottom));
    z-index: 140;
    display: flex;
}

.breathing-fab {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 150px;
    height: 58px;
    padding: 0 18px 0 14px;
    background: linear-gradient(135deg, rgba(255, 252, 246, 0.96), rgba(245, 238, 226, 0.98));
    border: 1px solid rgba(75, 166, 106, 0.18);
    border-radius: 22px;
    color: var(--text-main);
    cursor: pointer;
    box-shadow: 0 16px 34px rgba(92, 89, 72, 0.14), inset 0 1px 0 rgba(255,255,255,0.5);
    animation: breathing 4s infinite ease-in-out;
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.fab-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(134, 207, 156, 0.28), rgba(223, 243, 223, 0.8));
    color: var(--primary);
}

.fab-label {
    font-size: 0.96rem;
    font-weight: 800;
    letter-spacing: 0;
}

.breathing-fab::before {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 28px;
    border: 1px solid rgba(75, 166, 106, 0.14);
    animation: fab-pulse 2.4s infinite ease-out;
    pointer-events: none;
}

.breathing-fab:hover {
    transform: translateY(-1px);
    border-color: rgba(75, 166, 106, 0.28);
    box-shadow: 0 20px 36px rgba(92, 89, 72, 0.18);
}
.breathing-fab:active {
    transform: scale(0.98);
}

.breathing-fab svg {
    filter: none;
}

@keyframes breathing {
    0% { box-shadow: 0 16px 34px rgba(92, 89, 72, 0.14), 0 0 0 rgba(75, 166, 106, 0); }
    50% { box-shadow: 0 18px 38px rgba(92, 89, 72, 0.18), 0 0 0 6px rgba(75, 166, 106, 0.04); }
    100% { box-shadow: 0 16px 34px rgba(92, 89, 72, 0.14), 0 0 0 rgba(75, 166, 106, 0); }
}

@keyframes fab-pulse {
    0% {
        opacity: 0.75;
        transform: scale(0.78);
    }
    72% {
        opacity: 0;
        transform: scale(1.28);
    }
    100% {
        opacity: 0;
        transform: scale(1.28);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .breathing-fab,
    .breathing-fab::before,
    .scan-line,
    .amap-plant-marker.is-highlighted {
        animation: none !important;
    }
}

/* Archive Elements */
.archive-toggle-btn {
    position: fixed;
    bottom: 50px;
    right: 20px;
    z-index: 90;
    background: rgba(11, 15, 12, 0.8);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 10px 16px;
    border-radius: 20px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    cursor: pointer;
    transition: background 0.2s, min-width 0.2s;
}
.archive-toggle-btn:hover {
    background: rgba(25, 33, 28, 0.9);
}

/* Drawer */
.drawer {
    position: fixed;
    top: 0;
    bottom: 0; /* Fully mitigates iOS bottom home-bar sizing gap */
    right: -100%;
    width: 100%;
    max-width: 600px; /* Desktop cap */
    background:
        radial-gradient(circle at 100% 0%, rgba(128, 184, 220, 0.1), transparent 28%),
        rgba(247, 243, 234, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 200;
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    /* Converted to native block vertical scroll to prevent ANY screen cutoff */
    display: block;
    overflow-y: auto;
    overscroll-behavior: contain;
}
@media (min-width: 601px) {
    .drawer:not(.hidden) {
        right: calc(50% - 300px); /* Slides precisely into centered PC layout container */
    }
}
@media (max-width: 600px) {
    .drawer:not(.hidden) {
        right: 0;
    }
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: calc(20px + env(safe-area-inset-top)) 20px 20px;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}
.drawer-header h2 {
    font-weight: 600;
    color: var(--text-main);
}

/* Calendar Styles */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    color: var(--text-main);
    font-weight: 600;
    margin-top: 10px;
    flex-shrink: 0;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: 46px; /* CRITICAL FIX: explicit row height blocks grid track spanning anomalies */
    gap: 5px;
    padding: 5px 20px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.cal-cell {
    aspect-ratio: 1;
    width: 100%;
    max-width: 38px;
    max-height: 38px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    font-size: 0.9rem;
    color: var(--text-main);
    transition: background 0.2s;
}
.cal-cell.empty {
    cursor: default;
    background: transparent;
}
.cal-cell.day {
    background: rgba(255,255,255,0.05);
}
.cal-cell.day:hover {
    background: rgba(255,255,255,0.15);
}
.cal-cell.has-flower::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    background: #ff4757;
    border-radius: 50%;
    box-shadow: 0 0 6px #ff4757;
}
.cal-cell.selected {
    background: rgba(46, 213, 115, 0.4);
    color: #fff;
    font-weight: bold;
    border: 1px solid var(--primary);
}
.cal-cell.today {
    border: 1px solid rgba(255,255,255,0.3);
}
.cal-header-day {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-bottom: 8px;
}

.archive-day-summary {
    padding: 0 20px 16px;
}

.archive-day-summary.hidden {
    display: none;
}

.archive-summary-card {
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(31, 43, 35, 0.82), rgba(12, 20, 15, 0.72));
    box-shadow: 0 14px 34px rgba(0,0,0,0.22);
    padding: 14px;
}

.archive-summary-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.archive-summary-head span {
    display: block;
    color: rgba(164, 176, 175, 0.78);
    font-size: 0.72rem;
    margin-bottom: 4px;
}

.archive-summary-head h3 {
    color: var(--text-main);
    font-size: 1rem;
}

.archive-summary-head strong {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--primary);
    color: #0b0f0c;
    font-size: 1.05rem;
}

.archive-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.archive-summary-grid span {
    min-width: 0;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    background: rgba(255,255,255,0.045);
    color: var(--text-muted);
    font-size: 0.76rem;
    padding: 8px 6px;
    text-align: center;
}

.archive-summary-grid b {
    color: var(--text-main);
    margin-left: 2px;
}

.archive-summary-authors {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.day-author-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    border: 1px solid rgba(46, 213, 115, 0.18);
    background: rgba(46, 213, 115, 0.08);
    color: var(--primary);
    padding: 6px 9px;
    font-size: 0.74rem;
}

.day-author-chip b {
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: var(--text-main);
}

.day-author-chip em {
    font-style: normal;
    color: var(--text-muted);
}

@media (max-width: 420px) {
    .archive-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.btn-sm {
    background: rgba(255,255,255,0.1);
    border: none;
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-sm:hover {
    background: rgba(255,255,255,0.2);
}

.drawer-tools {
    display: flex;
    gap: 10px;
    padding: 16px 20px 0;
    flex-shrink: 0; /* Important: prevents search box from being zero-sized */
}

.modern-input {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 10px 16px;
    border-radius: 30px;
    outline: none;
    transition: border-color 0.2s;
}
.modern-input:focus {
    border-color: var(--primary);
}

.modern-select {
    min-width: 82px;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    color: var(--text-main);
    padding: 0 12px;
    outline: none;
    font-weight: 700;
}

#archive-container {
    display: block;
    padding-bottom: 80px; 
}

.news-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px 6px;
}

.news-toolbar .modern-select {
    flex: 1;
    min-height: 42px;
}

.news-container {
    padding: 12px 20px 90px;
}

.news-date-btn {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.news-calendar-overlay {
    margin: 0 20px 10px;
    border: 1px solid rgba(64, 85, 73, 0.09);
    border-radius: 16px;
    background: rgba(255,255,255,0.68);
    padding: 12px;
}

.news-calendar-overlay.hidden {
    display: none;
}

.news-calendar-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.news-calendar-title {
    flex: 1 1 auto;
    color: var(--text-main);
    font-weight: 900;
    font-size: 0.9rem;
    text-align: center;
}

.news-calendar-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.news-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: center;
}

.news-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.news-cal-day {
    border-radius: 10px;
    border: 1px solid rgba(64, 85, 73, 0.08);
    background: rgba(255,255,255,0.56);
    color: #425149;
    padding: 8px 0;
    font-size: 0.85rem;
    cursor: pointer;
}

.news-cal-day.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.news-cal-day.empty {
    background: transparent;
    border-color: transparent;
    cursor: default;
}

.news-cal-day.selected {
    background: rgba(67, 224, 131, 0.12);
    border-color: rgba(67, 224, 131, 0.35);
    color: var(--primary);
    font-weight: 900;
}

.news-brief {
    border: 1px solid rgba(64, 85, 73, 0.1);
    border-radius: 14px;
    background:
        radial-gradient(circle at 100% 0%, rgba(128, 184, 220, 0.14), transparent 30%),
        linear-gradient(145deg, rgba(252, 248, 240, 0.98), rgba(244, 238, 228, 0.95));
    box-shadow: 0 16px 40px rgba(92, 89, 72, 0.1);
    padding: 16px;
    margin-bottom: 16px;
}

.news-brief span,
.news-brief small {
    color: var(--text-muted);
    font-size: 0.76rem;
}

.news-brief h2 {
    color: var(--text-main);
    font-size: 1.2rem;
    margin: 6px 0 10px;
}

.news-brief p {
    color: #44534b;
    line-height: 1.65;
    font-size: 0.92rem;
    margin-bottom: 10px;
}

.news-section {
    margin-top: 18px;
}

.news-section h3 {
    color: var(--primary);
    font-size: 0.95rem;
    margin: 0 0 10px;
}

.news-item {
    border: 1px solid rgba(64, 85, 73, 0.09);
    border-radius: 12px;
    background: rgba(255,255,255,0.62);
    padding: 13px;
    margin-bottom: 10px;
}

.news-item:hover {
    border-color: rgba(64, 85, 73, 0.14);
    background: rgba(255,255,255,0.78);
}

.news-item-head {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 8px;
    justify-content: space-between;
}

.news-item-head .news-tags {
    max-width: 170px;
}

.news-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 0 0 auto;
    max-width: 190px;
}

.news-tag {
    flex: 0 0 auto;
    max-width: 92px;
    border-radius: 999px;
    padding: 4px 8px;
    background: rgba(67, 224, 131, 0.12);
    border: 1px solid rgba(67, 224, 131, 0.24);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 800;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    cursor: pointer;
}

.news-tag.news-tag-chip {
    max-width: 76px;
    padding: 3px 7px;
    font-size: 0.68rem;
    font-weight: 900;
    background: rgba(67, 224, 131, 0.10);
    border-color: rgba(67, 224, 131, 0.20);
}

.news-filter {
    margin: 0 0 14px;
    padding: 10px 12px;
    border: 1px solid rgba(64, 85, 73, 0.09);
    border-radius: 12px;
    background: rgba(255,255,255,0.62);
    color: #4b5a53;
    font-size: 0.88rem;
}

.news-filter a.news-filter-clear {
    margin-left: 8px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 800;
}

.news-watch {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(64, 85, 73, 0.12);
    color: #5d6a63;
}

.news-watch strong {
    color: var(--accent-amber);
}

.news-item-head h4 {
    flex: 1 1 auto;
}

.news-item h4 {
    min-width: 0;
    color: var(--text-main);
    font-size: 0.98rem;
    line-height: 1.35;
    margin: 0;
}

.news-item p {
    color: #44534b;
    line-height: 1.62;
    font-size: 0.88rem;
}

/* Notes specific */
.glass-input-area {
    margin-top: 4px;
    padding: 14px;
    border-top: 1px solid rgba(64, 85, 73, 0.12);
    background: rgba(248, 244, 236, 0.86);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.note-input {
    background: rgba(255,255,255,0.78);
    border: 1px solid rgba(64, 85, 73, 0.12);
    color: var(--text-main);
    border-radius: 12px;
    padding: 12px;
    resize: none;
    min-height: 84px;
    font-family: inherit;
}
.note-input:focus {
    border-color: rgba(75, 166, 106, 0.38);
    outline: none;
}
.btn-save-note {
    align-self: flex-end;
    background: linear-gradient(135deg, #86cf9c, #edf7ea);
    color: #203128;
    border: 1px solid rgba(75, 166, 106, 0.16);
    padding: 9px 16px;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s ease;
    box-shadow: 0 8px 20px rgba(75, 166, 106, 0.12);
}
.btn-save-note:active {
    transform: scale(0.95);
}
.saved-note-text {
    background: rgba(244, 239, 231, 0.92);
    border: 1px solid rgba(64, 85, 73, 0.1);
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 0.85rem;
    color: #33423b;
    margin-top: 4px;
}

/* Modal / Overlay */
.upload-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.upload-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.source-sheet {
    position: fixed;
    inset: 0;
    z-index: 960;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.22s ease;
}

.source-sheet.hidden {
    opacity: 0;
    pointer-events: none;
}

.source-sheet-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.source-sheet-panel {
    position: relative;
    width: min(100%, 600px);
    margin: 0 12px 12px;
    padding: 14px 14px calc(16px + env(safe-area-inset-bottom));
    border: 1px solid rgba(64, 85, 73, 0.08);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(244, 238, 228, 0.98));
    box-shadow: 0 28px 70px rgba(92, 89, 72, 0.18);
    transform: translateY(0);
    transition: transform 0.22s ease;
}

.source-sheet.hidden .source-sheet-panel {
    transform: translateY(18px);
}

.source-sheet-handle {
    width: 42px;
    height: 5px;
    margin: 0 auto 14px;
    border-radius: 999px;
    background: rgba(64, 85, 73, 0.18);
}

.source-sheet-head {
    padding: 0 6px 8px;
}

.source-sheet-eyebrow {
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.source-sheet-head h2 {
    font-size: 1.28rem;
    line-height: 1.2;
    margin-bottom: 6px;
}

.source-sheet-copy {
    color: #66766e;
    font-size: 0.92rem;
    line-height: 1.5;
}

.source-sheet-actions {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.source-option {
    width: 100%;
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(64, 85, 73, 0.08);
    background: rgba(255,255,255,0.56);
    color: var(--text-main);
    text-align: left;
    cursor: pointer;
}

.source-option.primary {
    border-color: rgba(75, 166, 106, 0.2);
    background: linear-gradient(135deg, rgba(134, 207, 156, 0.24), rgba(255,255,255,0.5));
}

.source-option-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    flex: 0 0 46px;
    border-radius: 14px;
    background: rgba(255,255,255,0.74);
    color: var(--primary);
}

.source-option-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.source-option-text strong {
    font-size: 0.98rem;
}

.source-option-text small {
    color: #66766e;
    font-size: 0.82rem;
}

.glass-modal {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    width: 100%;
    max-width: 400px;
    padding: 24px;
    box-shadow: var(--glass-shadow);
}

.edit-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1300;
    background: rgba(0,0,0,0.72);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.edit-modal,
.install-help {
    width: 100%;
    max-width: 430px;
    background: rgba(255, 252, 246, 0.98);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    box-shadow: var(--glass-shadow);
    padding: 18px;
}

.edit-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.edit-modal-header h3,
.install-help h3 {
    color: var(--primary);
    font-size: 1.05rem;
}

.edit-modal-close {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.4rem;
    cursor: pointer;
}

.edit-modal label {
    display: block;
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-top: 10px;
}

.edit-modal input,
.edit-modal textarea {
    width: 100%;
    margin-top: 5px;
    background: rgba(0,0,0,0.32);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 10px;
    font-family: inherit;
}

.edit-modal textarea {
    min-height: 82px;
    resize: vertical;
}

.edit-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.install-help p {
    color: var(--text-muted);
    line-height: 1.6;
    margin: 10px 0 16px;
}

.modal-header h2 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    text-align: center;
    color: var(--primary);
}

.scanner-animation {
    width: 160px;
    height: 160px;
    margin: 0 auto 20px;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    border: 2px solid var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

.scanner-animation img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: #fff;
    box-shadow: 0 0 10px 4px var(--primary);
    animation: scan 2s infinite ease-in-out;
}

@keyframes scan {
    0% { top: 0; }
    50% { top: 100%; }
    100% { top: 0; }
}

.progress-bar-container {
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    margin-top: 20px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--primary);
    transition: width 0.3s ease;
}

.status-text {
    font-size: 0.9rem;
    color: #5b6b63;
}

.mode-choice {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.mode-choice.hidden {
    display: none;
}

.mode-choice-btn {
    min-height: 86px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    background: rgba(255,255,255,0.06);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

.mode-choice-btn span {
    font-size: 1.7rem;
}

.mode-choice-btn strong {
    font-size: 0.88rem;
}

.mode-choice-btn.plant {
    border-color: rgba(46, 213, 115, 0.42);
}

.mode-choice-btn.scenery {
    border-color: rgba(123, 199, 255, 0.42);
}

.mode-choice-btn.animal {
    border-color: rgba(255, 191, 105, 0.46);
}

.mode-hint-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

.mode-hint-wrap.hidden {
    display: none;
}

.mode-hint-input {
    min-width: 0;
    flex: 1;
    height: 42px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(0,0,0,0.24);
    color: var(--text-main);
    padding: 0 12px;
    outline: none;
}

.mode-hint-input.hidden {
    display: none;
}

.mode-hint-back {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
}

.mode-hint-selected {
    min-width: 76px;
    max-width: 96px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border-radius: 14px;
    background: rgba(46, 213, 115, 0.1);
    border: 1px solid rgba(46, 213, 115, 0.22);
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
}

.mode-hint-input:focus {
    border-color: rgba(46,213,115,0.62);
}

.mode-hint-submit {
    width: 72px;
    border: 0;
    border-radius: 14px;
    color: #0b0f0c;
    background: var(--primary);
    font-weight: 800;
    cursor: pointer;
}

@media (max-width: 420px) {
    .mode-choice {
        gap: 8px;
    }

    .mode-choice-btn {
        min-height: 78px;
        border-radius: 14px;
    }

    .mode-choice-btn strong {
        font-size: 0.78rem;
    }

    .mode-hint-wrap {
        flex-wrap: wrap;
    }

    .mode-hint-input {
        flex-basis: 100%;
        order: 4;
    }
}

/* Map View */
.map-view {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    opacity: 1;
    transition: opacity 0.3s ease;
    background: var(--bg-color);
}

.map-view.hidden {
    opacity: 0;
    pointer-events: none;
}

#map {
    width: 100%;
    height: 100%;
}

.map-detail-card {
    position: absolute;
    left: 20px;
    top: 20px;
    z-index: 1000;
    pointer-events: auto;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.map-detail-card.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
}

.map-bottom-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1120;
    padding: 10px 0 calc(18px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(11, 15, 12, 0), rgba(11, 15, 12, 0.84) 28%, rgba(11, 15, 12, 0.96));
    pointer-events: auto;
    transition: transform 0.22s ease, opacity 0.22s ease;
}

.map-bottom-sheet.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(26px);
}

.map-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(720px, calc(100% - 28px));
    margin: 0 auto 8px;
    color: var(--text-main);
    font-size: 0.78rem;
    font-weight: 800;
}

.map-sheet-close {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 50%;
    color: var(--text-main);
    background: rgba(255,255,255,0.08);
    cursor: pointer;
}

.map-sheet-track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 7.5vw;
    padding: 0 7.5vw;
    scrollbar-width: none;
}

.map-sheet-track::-webkit-scrollbar {
    display: none;
}

.map-sheet-card {
    flex: 0 0 85vw;
    max-width: 420px;
    min-height: 116px;
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    scroll-snap-align: center;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(25, 33, 28, 0.96);
    box-shadow: 0 16px 44px rgba(0,0,0,0.42);
    padding: 10px;
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.map-sheet-card.active {
    border-color: rgba(46, 213, 115, 0.7);
    transform: translateY(-2px);
}

.map-sheet-card img {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
}

.map-sheet-card h4 {
    margin: 0 0 5px;
    color: var(--text-main);
    font-size: 1rem;
    line-height: 1.25;
}

.map-sheet-card p {
    margin: 0 0 8px;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.35;
}

.map-sheet-card span {
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
}

@media (max-width: 600px) {
    .map-detail-card {
        max-width: calc(100% - 32px);
    }

    .map-detail-card .amap-plant-popup {
        width: 100%;
    }

    .map-detail-card .amap-plant-popup img {
        width: 100%;
    }
}

.map-close-btn {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(11, 15, 12, 0.85);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

/* 高德地图样式覆盖 */
.amap-logo {
    display: none !important;
}

.amap-copyright {
    color: rgba(255,255,255,0.5) !important;
    font-size: 10px !important;
}

.amap-controls {
    z-index: 1000 !important;
}

/* 高德地图标记样式 */
.amap-plant-marker {
    transition: transform 0.2s, box-shadow 0.2s;
}

.amap-plant-marker:hover {
    transform: scale(1.15) !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5), 0 0 0 4px rgba(255,255,255,0.3) !important;
}

.amap-plant-marker.is-highlighted {
    animation: map-marker-soft-focus 1.15s ease-out 1;
    transform: translateY(-2px) scale(1.08);
    box-shadow: 0 6px 16px rgba(0,0,0,0.34), 0 0 0 2px rgba(255,255,255,0.54), 0 0 18px rgba(255,255,255,0.36) !important;
}

.amap-plant-marker.is-active {
    transform: translateY(-4px) scale(1.22);
    box-shadow: 0 8px 22px rgba(0,0,0,0.42), 0 0 0 4px rgba(46,213,115,0.72), 0 0 24px rgba(46,213,115,0.44) !important;
}

.amap-cluster-bubble {
    border-radius: 50%;
    background: rgba(46, 213, 115, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 2px 8px rgba(46,213,115,.32), 0 0 0 2px rgba(255,255,255,.22);
    cursor: pointer;
    border: 1px solid rgba(255,255,255,.32);
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

@keyframes map-marker-soft-focus {
    0% {
        transform: translateY(0) scale(0.96);
        filter: brightness(1);
    }
    45% {
        transform: translateY(-3px) scale(1.12);
        filter: brightness(1.14);
    }
    100% {
        transform: translateY(-2px) scale(1.08);
        filter: brightness(1.04);
    }
}

/* 高德点聚合标记容器 */
.amap-marker-cluster {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* 高德聚合标记样式（绿色毛玻璃气泡） */
.amap-cluster-marker {
    z-index: 100;
}

/* 高德地图自定义弹窗样式 */
.amap-info-window {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.amap-info-content {
    padding: 0 !important;
    overflow: hidden !important;
}

.amap-info-close {
    color: #fff !important;
    font-size: 20px !important;
    width: 24px !important;
    height: 24px !important;
    right: 4px !important;
    top: 4px !important;
    z-index: 100 !important;
}

.amap-plant-popup {
    width: 200px;
    background: rgba(25, 33, 28, 0.98);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.15);
}

.amap-plant-popup img {
    width: 200px;
    height: 120px;
    object-fit: cover;
    display: block;
    background: #1a1a1a;
}

.amap-plant-popup .popup-content {
    padding: 12px 16px 16px;
}

.amap-plant-popup h4 {
    margin: 0 0 4px;
    font-size: 1.1rem;
    color: var(--primary);
    font-weight: 600;
}

.amap-plant-popup .latin {
    margin: 0 0 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

.amap-plant-popup .map-atmosphere {
    margin: 8px 0 10px;
    color: rgba(241, 242, 246, 0.88);
    font-size: 0.82rem;
    line-height: 1.55;
}

.amap-plant-popup .meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex;
    gap: 12px;
}

.amap-plant-popup .author {
    font-size: 0.8rem;
    color: var(--primary);
    margin-top: 8px;
    font-weight: 500;
}

/* 高德地图信息窗体箭头 */
.amap-info-sharp {
    border-top-color: rgba(25, 33, 28, 0.98) !important;
}

/* 保留的聚类图标样式（如需要其他地图可复用） */
.cluster-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(46, 213, 115, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    box-shadow: 0 3px 12px rgba(46, 213, 115, 0.5), 0 0 0 4px rgba(255,255,255,0.3), inset 0 0 10px rgba(255,255,255,0.2);
}

.amap-plant-marker {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.4), 0 0 0 3px rgba(255,255,255,0.2);
    transition: transform 0.2s;
}

/* 保留的 Leaflet 兼容样式（用于旧数据兼容） */
.plant-popup {
    width: 200px;
    max-width: 200px;
    overflow: hidden;
    background: rgba(25, 33, 28, 0.98);
}

.plant-popup img {
    width: 200px;
    height: 120px;
    max-width: 200px;
    object-fit: cover;
    display: block;
    border-radius: 0;
    background: #1a1a1a;
}

.plant-popup .popup-content {
    padding: 12px 16px 16px;
}

.plant-popup h4 {
    margin: 0 0 4px;
    font-size: 1.1rem;
    color: var(--primary);
    font-weight: 600;
}

.plant-popup .latin {
    margin: 0 0 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

.plant-popup .meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex;
    gap: 12px;
}

.plant-popup .author {
    font-size: 0.8rem;
    color: var(--primary);
    margin-top: 8px;
    font-weight: 500;
}
