:root {
    --primary: #ffde59;
    --primary-hover: #f5c400;
    --bg-main: #f8fafc;
    --bg-panel: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --item-hover: #f1f5f9;
    
    --status-blue: #2563eb;
    --status-amber: #d97706;
    --status-green: #16a34a;
    --status-red: #dc2626;
    --status-grey: #64748b;

    --radius-lg: 14px;
    --radius-md: 8px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 10px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --transition: 0.25s ease;
}

[data-theme="dark"] {
    --bg-main: #0f172a;
    --bg-panel: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --item-hover: #334155;
    
    --status-blue: #3b82f6;
    --status-amber: #f59e0b;
    --status-green: #22c55e;
    --status-red: #ef4444;
    --status-grey: #9ca3af;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    transition: background-color var(--transition), color var(--transition);
}

.app-container { display: flex; flex-direction: column; height: 100vh; }
.header-top { display: flex; justify-content: space-between; align-items: center; }

.theme-toggle-btn {
    background: transparent;
    border: 1px solid var(--border);
    padding: 0.4rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1.1rem;
}

.sidebar {
    background-color: var(--bg-panel);
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 50vh;
    z-index: 10;
}

.sidebar-header, .search-section, .upload-section {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

/* Import button */
.import-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: #ffde59;
    color: #1c1917;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 3px 10px rgba(255, 222, 89, 0.4);
}
.import-btn:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(234, 179, 8, 0.5);
}
.import-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(234, 179, 8, 0.3);
}
.import-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    flex-shrink: 0;
}
.import-btn-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.import-btn-title {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.import-btn-hint {
    font-size: 0.7rem;
    opacity: 0.75;
    font-weight: 400;
}
[data-theme="dark"] .import-btn {
    box-shadow: 0 3px 12px rgba(255, 222, 89, 0.4);
}

/* Once the user has places, shrink the Import banner — it's mainly an
   onboarding prompt and shouldn't compete with Filters/Folders below. */
.upload-section.compact {
    padding: 0.5rem 1.25rem;
}
.upload-section.compact .import-btn {
    padding: 0.4rem 0.7rem;
    gap: 0.5rem;
    background: rgba(255, 222, 89, 0.12);
    color: var(--text-main);
    border: 1.5px solid rgba(255, 222, 89, 0.5);
    box-shadow: none;
}
.upload-section.compact .import-btn:hover {
    border-color: #ffde59;
    box-shadow: 0 4px 12px rgba(255, 222, 89, 0.25);
}
.upload-section.compact .import-btn-icon {
    width: 26px;
    height: 26px;
    background: rgba(255, 222, 89, 0.35);
    color: #9a7b00;
}
[data-theme="dark"] .upload-section.compact .import-btn {
    background: rgba(255, 222, 89, 0.08);
    border-color: rgba(255, 222, 89, 0.3);
}
[data-theme="dark"] .upload-section.compact .import-btn-icon {
    background: rgba(255, 222, 89, 0.18);
    color: #ffde59;
}
.upload-section.compact .import-btn-hint {
    font-size: 0.65rem;
}

.section-block {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.section-block h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.section-header-row { display: flex; justify-content: space-between; align-items: center; }
.icon-action-btn { background: transparent; border: none; cursor: pointer; font-size: 1rem; }

.folders-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.folder-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-panel);
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    border: 1.5px solid var(--border);
    transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    position: relative;
    z-index: 1;
}
.folder-item.menu-open {
    z-index: 10;
}
.folder-item:hover {
    border-color: #ffde59;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 222, 89, 0.25);
}
.folder-item.active {
    border-color: #ffde59;
    background: var(--item-hover);
}

.folder-name-text {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    overflow: hidden;
    min-width: 0;
    flex: 1;
}
.folder-name-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.folder-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: #fff7d6;
    font-size: 1.05rem;
    color: #9a7b00;
}
[data-theme="dark"] .folder-icon {
    background: rgba(255, 222, 89, 0.15);
    color: #ffde59;
}

.folder-actions { position: relative; }
.folder-menu-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-md);
    color: var(--text-main);
}
.folder-menu-btn:hover { background: var(--item-hover); }
.folder-menu {
    position: fixed;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 170px;
    overflow: hidden;
}
.folder-menu.hidden { display: none; }
.folder-menu button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.55rem 0.85rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-main);
    white-space: nowrap;
}
.folder-menu button:hover { background: var(--item-hover); }

.recent-added-list { display: flex; flex-direction: column; gap: 0.4rem; }
.recent-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: var(--bg-panel);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    border: 1.5px solid var(--border);
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.recent-item:hover {
    border-color: #ffde59;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 222, 89, 0.25);
}
.recent-item-icon { flex-shrink: 0; font-size: 1rem; }
.recent-item-text { overflow: hidden; flex: 1; }
.recent-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-item-date { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }
.places-section { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.places-header { padding: 0.75rem 1.25rem; background: var(--bg-main); border-bottom: 1px solid var(--border); }
.places-list { flex: 1; overflow-y: auto; list-style: none; }
.place-item { padding: 0.85rem 1.25rem; border-bottom: 1px solid var(--border); cursor: pointer; display: flex; gap: 1rem; align-items: center; }
.place-item:hover { background-color: var(--item-hover); }
.place-item.active { background-color: var(--item-hover); border-left: 4px solid var(--primary); }

.emoji-marker {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition);
    color: white !important;
}

.emoji-marker.needs-review {
    box-shadow: 0 0 0 3px #f59e0b, var(--shadow-md);
}
.review-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    font-size: 12px;
    line-height: 1;
    background: #fff;
    border-radius: 50%;
    padding: 1px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.emoji-marker:hover { transform: scale(1.12); }
.cat-Custom         { background-color: #0ea5e9 !important; }
.status-Want-to-Try { background-color: var(--status-blue) !important; }
.status-Want-to-Go  { background-color: var(--status-blue) !important; }
.status-Been-There  { background-color: var(--status-amber) !important; }
.status-Loved-It    { background-color: var(--status-green) !important; }
.status-Meh         { background-color: #8d6e63 !important; }
.status-Skip-It     { background-color: var(--status-red) !important; }
.status-Unsorted    { background-color: var(--status-grey) !important; }
.status-Favourite   { background-color: #eab308 !important; }

.custom-categories-list {
    margin-top: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    background: var(--bg-main);
    font-size: 0.82rem;
}
.custom-cat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0.1rem;
    border-bottom: 1px solid var(--border);
}
.custom-cat-row:last-of-type { border-bottom: none; }
.custom-cat-delete {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    opacity: 0.6;
}
.custom-cat-delete:hover { opacity: 1; }

/* Emoji picker */
.emoji-pick-btn {
    width: 44px;
    height: 34px;
    padding: 0.3rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-main);
    color: var(--text-main);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.emoji-pick-btn:hover { border-color: var(--primary); }
.emoji-picker-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 1190;
}
.emoji-picker-popover {
    position: absolute;
    z-index: 1200;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    padding: 0.5rem;
    width: 220px;
}
.emoji-picker-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.15rem;
    max-height: 180px;
    overflow-y: auto;
}
.emoji-picker-option {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.15rem;
    border-radius: 6px;
    padding: 0.25rem 0;
    line-height: 1;
}
.emoji-picker-option:hover { background: var(--bg-hover, rgba(0,0,0,0.06)); }
.emoji-picker-custom-row {
    display: flex;
    gap: 0.3rem;
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 1px solid var(--border);
}
.emoji-picker-custom-row input {
    flex: 1;
    width: 0;
    padding: 0.25rem 0.4rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-main);
    color: var(--text-main);
    font-size: 0.85rem;
    text-align: center;
}
.emoji-picker-custom-row button {
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-size: 0.78rem;
}

/* Sidebar footer */
.sidebar-footer {
    padding: 0.65rem 1.25rem;
    border-top: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    background: var(--bg-panel);
    text-align: center;
    flex-shrink: 0;
    margin-top: auto;
}

/* Unpinned section */
.unpinned-section {
    margin: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid #f59e0b;
    overflow: hidden;
}
.unpinned-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0.85rem;
    background: #fffbeb;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    color: #92400e;
    user-select: none;
}
[data-theme="dark"] .unpinned-header {
    background: #451a03;
    color: #fcd34d;
}
.unpinned-count {
    background: #f59e0b;
    color: #fff;
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
}
.unpinned-hint {
    margin: 0;
    padding: 0.5rem 0.85rem;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--text-muted);
    background: var(--bg-panel);
    border-top: 1px solid var(--border);
}
.unpinned-list {
    list-style: none;
    max-height: 180px;
    overflow-y: auto;
    background: var(--bg-panel);
}
.unpinned-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0.85rem;
    font-size: 0.82rem;
    border-top: 1px solid var(--border);
}
.unpinned-item:hover { background: var(--item-hover); }
.unpinned-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unpinned-edit-btn { background: none; border: none; cursor: pointer; font-size: 0.9rem; flex-shrink: 0; }

.filters-container { display: flex; gap: 0.75rem; }
.filter-group { flex: 1; display: flex; flex-direction: column; gap: 0.25rem; }
.filter-group label { font-size: 0.7rem; font-weight: 600; color: var(--text-muted); }

.search-input, select {
    width: 100%;
    padding: 0.55rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: var(--bg-main);
    color: var(--text-main);
    outline: none;
    font-size: 0.9rem;
}

.triage-notes-input {
    width: 100%;
    padding: 0.55rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: var(--bg-main);
    color: var(--text-main);
    outline: none;
    font-size: 0.85rem;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}
.triage-notes-input:focus {
    border-color: var(--primary);
}

/* Search bar: icon and field on one line, modern pill style */
.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.search-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.95rem;
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
}
.search-section .search-input {
    border-radius: var(--radius-md);
    padding: 0.65rem 1rem 0.65rem 2.6rem;
    background: rgba(37, 99, 235, 0.06);
    font-size: 0.9rem;
    border: 1.5px solid rgba(37, 99, 235, 0.25);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
[data-theme="dark"] .search-section .search-input {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.3);
}
.search-section .search-input:focus {
    border-color: var(--status-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}
.search-hint-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}
.search-hint {
    flex: 1;
    margin: 0;
    font-size: 0.78rem;
    color: #333;
    line-height: 1.4;
    background: #fff8dc;
    border-left: 3px solid #ffde59;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    display: block !important;
}
.search-hint-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    color: #999;
    padding: 0.3rem;
    line-height: 1;
    flex-shrink: 0;
}
.search-hint-close:hover { color: #555; }
.search-hint-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
    padding: 0;
    opacity: 0.6;
}
.search-hint-toggle:hover { opacity: 1; }
.search-hint-toggle.hidden { display: none; }

.form-group {
    margin-bottom: 0.6rem;
}
.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
}

.map-container { flex: 1; position: relative; height: 50vh; }
#map { width: 100%; height: 100%; }

/* Triage Panel Styling Overhauls matching mockups */
.triage-panel {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 390px;
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 1.25rem;
    z-index: 1000;
    border: 1px solid var(--border);
}

.triage-panel.hidden { display: none !important; }
.hidden { display: none !important; }

.place-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #ddd);
    border-radius: 0.5rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    z-index: 9999;
    max-height: 280px;
    overflow-y: auto;
    margin-top: 4px;
}
.place-search-dropdown .dropdown-item {
    padding: 0.6rem 0.9rem;
    cursor: pointer;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border, #eee);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.place-search-dropdown .dropdown-item:last-child { border-bottom: none; }
.place-search-dropdown .dropdown-item:hover { background: var(--item-hover, #f5f5f5); }
.place-search-dropdown .dropdown-item .item-icon { font-size: 1rem; flex-shrink: 0; }
.place-search-dropdown .dropdown-item .item-text { flex: 1; }
.place-search-dropdown .dropdown-item .item-name { font-weight: 600; }
.place-search-dropdown .dropdown-item .item-addr { font-size: 0.75rem; opacity: 0.6; }
.place-search-dropdown .dropdown-section-label {
    padding: 0.3rem 0.9rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.5;
    background: var(--bg, #f9f9f9);
}

.triage-title-input {
    font-size: 1.3rem;
    font-weight: 700;
    border: none;
    background: transparent;
    color: var(--text-main);
    width: 90%;
    margin-bottom: 0.25rem;
    outline: none;
}

.triage-address-input {
    font-size: 0.85rem;
    color: var(--text-muted);
    border: none;
    background: transparent;
    width: 100%;
    margin-bottom: 0.75rem;
    outline: none;
}

.gmaps-link-container {
    margin-bottom: 1rem;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 0.5rem;
}

.needs-review-banner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    background: #fffbeb;
    border: 1px solid #f59e0b;
    color: #92400e;
    border-radius: var(--radius-md);
    padding: 0.6rem 0.75rem;
    font-size: 0.8rem;
    line-height: 1.4;
    margin: -0.5rem 0 0.85rem;
}
[data-theme="dark"] .needs-review-banner {
    background: #451a03;
    color: #fcd34d;
    border-color: #b45309;
}
.needs-review-dismiss {
    flex-shrink: 0;
    margin-left: auto;
    background: #f59e0b;
    color: #1c1917;
    border: none;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

.triage-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
}
.triage-link:hover { text-decoration: underline; }

.save-modifications-btn {
    flex: 1;
    background-color: #10b981 !important; /* Green tone from mockup */
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    width: 100%;
}

/* Elimination block alignment */
.delete-confirm {
    margin-top: 0.75rem;
    background: #fee2e2;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid #fca5a5;
}
[data-theme="dark"] .delete-confirm {
    background: #451a03;
    border-color: #78350f;
}

.delete-confirm p {
    font-size: 0.9rem;
    color: #991b1b;
    margin-bottom: 0.5rem;
    font-weight: 500;
}
[data-theme="dark"] .delete-confirm p { color: #fecaca; }

.delete-confirm-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.confirm-yes-btn { background: #dc2626; color: white; border: none; padding: 0.35rem 1rem; border-radius: 4px; cursor: pointer;}
.confirm-no-btn { background: #64748b; color: white; border: none; padding: 0.35rem 1rem; border-radius: 4px; cursor: pointer;}

.delete-place-btn {
    background: transparent;
    border: 1px solid #ef4444;
    color: #b91c1c;
    width: 100%;
    padding: 0.6rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
}
[data-theme="dark"] .delete-place-btn { color: #fca5a5; }

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem 1.25rem;
    gap: 0.6rem;
    border-bottom: 1px solid var(--border);
}
.empty-state-icon { font-size: 2.5rem; line-height: 1; }
.empty-state h3 { font-size: 1rem; font-weight: 700; color: var(--text-main); }
.empty-state p { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; }

.demo-btn {
    margin-top: 0.25rem;
    padding: 0.6rem 1.2rem;
    background: #ffde59;
    color: #1c1917;
    border: none;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 3px 10px rgba(202,138,4,0.3);
    transition: opacity 0.2s, transform 0.15s;
}
.demo-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.demo-btn:active { transform: translateY(0); }

.sidebar-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.clear-demo-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.72rem;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: color 0.2s, border-color 0.2s;
}
.clear-demo-btn:hover { color: #dc2626; border-color: #dc2626; }

/* Geocode status indicator */
.geocode-status {
    font-size: 0.78rem;
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-md);
    margin-top: -0.25rem;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
}
.geocode-status.loading {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}
.geocode-status.success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}
.geocode-status.error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}
[data-theme="dark"] .geocode-status.loading { background: #1e3a5f; color: #93c5fd; border-color: #1d4ed8; }
[data-theme="dark"] .geocode-status.success { background: #14532d; color: #86efac; border-color: #166534; }
[data-theme="dark"] .geocode-status.error   { background: #450a0a; color: #fca5a5; border-color: #991b1b; }

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-muted);
}

.import-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #0f172a;
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 9999;
}
.import-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }

/* ─── Top bar ─────────────────────────────────────────────────────────── */
.topbar { display: none; }

/* Brand: title + tagline */
.topbar-brand {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    flex: 1;
}
.topbar-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
}
.topbar-tagline {
    font-size: 0.65rem;
    font-weight: 500;
    color: #1c1917;
    opacity: 0.6;
    display: none; /* shown on desktop only */
}
.topbar-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.topbar-menu-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #1c1917;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    padding: 0.4rem 0.5rem;
    border-radius: var(--radius-md);
    -webkit-tap-highlight-color: transparent;
}
.topbar-menu-btn:active { background: rgba(0,0,0,0.08); }

.topbar-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1c1917;
    letter-spacing: -0.01em;
    line-height: 1;
}

/* Sidebar drawer header */
.sidebar-header h1 {
    font-size: 1rem;
    color: var(--text-main);
}
.sidebar-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
    font-weight: 400;
}

/* Topbar icon buttons */
.topbar-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid rgba(0,0,0,0.2);
    background: rgba(0,0,0,0.08);
    color: #1c1917;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s;
}
.topbar-icon-btn:active { background: rgba(0,0,0,0.15); }

/* Notification bell badge */
.notif-btn {
    position: relative;
}
.notif-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 8px;
    height: 8px;
    background: #e53935;
    border-radius: 50%;
    border: 2px solid var(--topbar-bg, #fff);
    display: none;
}
.notif-badge.visible {
    display: block;
}

/* Notifications banner */
.notif-banner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    background: #e53935;
    color: #fff;
    padding: 20px 24px;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
    max-width: 300px;
    width: 90%;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
}
.notif-banner.hidden { display: none; }
.notif-banner-close {
    background: rgba(255,255,255,0.25);
    border: none;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 18px;
    border-radius: 20px;
    letter-spacing: 0.03em;
}

/* Notification items */
.notif-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border, #eee);
}
.notif-item:last-child { border-bottom: none; }
.notif-item-date {
    font-size: 0.75rem;
    color: var(--text-muted, #999);
}
.notif-item-title {
    font-weight: 600;
    font-size: 0.95rem;
}
.notif-item-body {
    font-size: 0.875rem;
    color: var(--text-secondary, #555);
    line-height: 1.5;
}

/* Help modal */
.help-modal {
    position: fixed;
    inset: 0;
    z-index: 900;
}
.help-modal.hidden { display: none !important; }

.help-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
}

.help-modal-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-panel);
    border-radius: 20px 20px 0 0;
    max-height: 88dvh;
    overflow-y: auto;
    padding: 0 1.25rem 2.5rem;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.2);
    animation: slideUp 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.help-modal-handle {
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 99px;
    margin: 0.75rem auto 1rem;
}

.help-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.25rem;
}
.help-modal-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
}
.help-modal-close {
    background: var(--item-hover);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-modal-body { display: flex; flex-direction: column; gap: 1.5rem; }

.help-section {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
}
.help-section-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 2px;
}
.help-section h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: var(--text-main);
}
.help-section p {
    font-size: 0.83rem;
    color: var(--text-muted);
    line-height: 1.55;
}
.help-steps {
    margin-top: 0.5rem;
    padding-left: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.help-steps li {
    font-size: 0.83rem;
    color: var(--text-muted);
    line-height: 1.5;
}
.help-steps li strong { color: var(--text-main); }
.help-steps li em { font-style: italic; opacity: 0.8; }

/* Folders toggle */
.folders-toggle {
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.folders-toggle:active { opacity: 0.75; }
.folders-chevron {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--bg-panel);
    background: var(--primary);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    line-height: 1;
}
.folders-chevron.collapsed { transform: rotate(-90deg); }
.active-folder-label {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--primary);
    margin-left: 0.3rem;
    text-transform: none;
    letter-spacing: 0;
}
#folders-body,
#saved-trips-body,
#recent-added-body,
.filters-container,
.tools-body {
    overflow: hidden;
    transition: max-height 0.28s ease, opacity 0.2s ease;
    max-height: 3000px;
    opacity: 1;
}
#folders-body.collapsed,
#saved-trips-body.collapsed,
#recent-added-body.collapsed,
.filters-container.collapsed,
.tools-body.collapsed {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}
.tools-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ─── Drawer overlay ──────────────────────────────────────────────────── */
.drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 590;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.drawer-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* ─── FAB ─────────────────────────────────────────────────────────────── */
.fab { display: none; }

@media (min-width: 768px) {

    /* ── Topbar ── */
    .topbar {
        display: flex;
        align-items: center;
        position: fixed;
        top: 0; left: 0; right: 0;
        height: 56px;
        padding: 0 1.5rem;
        background: #ffde59;
        border-bottom: none;
        z-index: 700;
        box-shadow: 0 2px 8px rgba(255,222,89,0.4);
    }
    .topbar-menu-btn { display: none; }
    .topbar-brand { align-items: center; justify-content: flex-start; flex: 1; }
    .topbar-title { font-size: 1.15rem; }
    .topbar-tagline { display: block; }
    .topbar-actions { gap: 0.6rem; }

    /* Hide redundant sidebar header on desktop */
    .sidebar-header { display: none; }

    /* Hide FAB on desktop — sidebar search is always visible */
    .fab { display: none !important; }

    /* ── Layout ── */
    .app-container { display: block; }

    /* ── Sidebar: always-visible left panel ── */
    .sidebar {
        position: fixed;
        top: 56px;
        left: 0;
        width: 320px;
        height: calc(100vh - 56px);
        transform: none !important;
        border-radius: 0;
        border-top: none;
        border-right: 1px solid var(--border);
        border-bottom: none;
        overflow-y: auto;
        z-index: 100;
        box-shadow: none;
    }
    .drawer-overlay { display: none !important; }
    .sheet-handle { display: none; }

    /* ── Map ── */
    .map-container {
        position: fixed;
        top: 56px;
        left: 320px;
        right: 0;
        bottom: 0;
        height: auto !important;
    }
    #map { width: 100%; height: 100%; }

    /* ── Triage panel: floating card right side ── */
    .triage-panel {
        position: fixed;
        bottom: 1.5rem;
        right: 1.5rem;
        left: auto;
        width: 360px;
        max-width: 360px;
        transform: none;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
        border-radius: var(--radius-lg);
        border: 1px solid var(--border);
    }
    .triage-panel.hidden {
        display: none !important;
        pointer-events: none;
    }
    .triage-panel:not(.hidden) {
        transform: none;
        transition: none;
    }
    .triage-panel::before { display: none; }

    /* ── FAB ── */
    .fab {
        display: flex;
        position: absolute;
        bottom: 1.5rem;
        right: 1.5rem;
        z-index: 450;
    }

    /* ── Leaflet ── */
    .leaflet-top, .leaflet-bottom { z-index: 400 !important; }
    .leaflet-control { z-index: 400 !important; }

    /* ── Misc ── */
    .import-toast { bottom: 1.5rem; left: 340px; transform: translateX(0) translateY(20px); }
    .import-toast.visible { transform: translateX(0) translateY(0); }

    /* Stack filters on desktop too — the 320px sidebar is too narrow for
       Category/Status/Country selects to share a row without truncation. */
    .filters-container { flex-direction: column; gap: 0.5rem; }
}

/* ─── Mobile layout ───────────────────────────────────────────────────── */
@media (max-width: 767px) {

    /* ── Top bar ── */
    .topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 56px;
        padding: 0 0.75rem;
        background: #ffde59;
        border-bottom: none;
        z-index: 700;
        box-shadow: 0 2px 16px rgba(255, 222, 89, 0.45);
    }
    [data-theme="dark"] .topbar {
        background: #ffde59;
        box-shadow: 0 2px 16px rgba(0,0,0,0.5);
    }
    /* Theme toggle in topbar: dark style on lemon */
    #theme-toggle-mobile {
        border-color: rgba(0,0,0,0.2);
        background: rgba(0,0,0,0.08);
        color: #1c1917;
    }
    #theme-toggle-mobile:hover {
        background: rgba(0,0,0,0.15);
    }

    /* ── Full-screen map ── */
    .app-container {
        display: block;
        position: relative;
    }

    .map-container {
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        bottom: 0;
        height: auto !important;
        z-index: 0;
    }

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

    /* Push Leaflet controls below the topbar — not needed now, but keep safe */
    .leaflet-top, .leaflet-bottom { z-index: 400 !important; }
    .leaflet-control { z-index: 400 !important; }

    /* ── Sidebar → left drawer ── */
    .sidebar {
        position: fixed;
        top: 56px;
        left: 0;
        width: 87%;
        max-width: 320px;
        height: calc(100dvh - 56px);
        border-radius: 0;
        border-top: none;
        border-right: 1px solid var(--border);
        border-bottom: none;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
        z-index: 600;
        box-shadow: none;
        display: flex;
        flex-direction: column;
        background: var(--bg-panel);
    }

    .sidebar.drawer-open {
        transform: translateX(0);
        box-shadow: 4px 0 32px rgba(0,0,0,0.18);
    }

    [data-theme="dark"] .sidebar.drawer-open {
        box-shadow: 4px 0 32px rgba(0,0,0,0.5);
    }

    /* Overlay visible when drawer open */
    .drawer-overlay { display: block; }

    /* Hide the redundant header inside the drawer on mobile */
    .sidebar-header { display: none; }

    /* Always scrollable */
    .sidebar-scroll-body {
        overflow-y: auto;
        flex: 1;
        -webkit-overflow-scrolling: touch;
    }

    /* Hide the old sheet handle — replaced by topbar */
    .sheet-handle { display: none; }

    /* Section padding tighter on mobile */
    .sidebar-header,
    .search-section,
    .upload-section {
        padding: 0.85rem 1.1rem;
    }
    .section-block { padding: 0.85rem 1.1rem; }

    /* Folder items: bigger touch targets */
    .folder-item {
        padding: 0.75rem 0.9rem;
        border-radius: 12px;
        font-size: 0.9rem;
        gap: 0.5rem;
        min-height: 48px;
    }
    .folders-list {
        gap: 0.5rem;
        max-height: none;
    }
    .folder-menu-btn {
        font-size: 1.3rem;
        padding: 0.2rem 0.5rem;
        min-width: 36px;
        min-height: 36px;
    }
    .folder-menu button {
        padding: 0.7rem 0.9rem;
        font-size: 0.95rem;
    }

    /* ── FAB ── */
    .fab {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        bottom: 1.5rem;
        right: 1.25rem;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: #ffde59;
        color: #1c1917;
        font-size: 1.8rem;
        font-weight: 300;
        line-height: 1;
        border: none;
        cursor: pointer;
        box-shadow: 0 4px 16px rgba(202,138,4,0.45);
        z-index: 450;
        transition: transform 0.15s ease, box-shadow 0.15s ease;
        -webkit-tap-highlight-color: transparent;
    }
    .fab:active {
        transform: scale(0.92);
        box-shadow: 0 2px 8px rgba(202,138,4,0.4);
    }

    /* ── Triage panel → bottom sheet ── */
    .triage-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: auto;
        max-width: none;
        border-radius: 20px 20px 0 0;
        max-height: 85dvh;
        overflow-y: auto;
        padding: 1.25rem 1rem 2rem;
        transform: translateY(0);
        z-index: 550;
    }

    .triage-panel.hidden {
        display: block !important;
        transform: translateY(110%);
        pointer-events: none;
        transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    }

    .triage-panel:not(.hidden) {
        transform: translateY(0);
        transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    }

    /* Drag handle on triage sheet */
    .triage-panel::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        background: var(--border);
        border-radius: 99px;
        margin: 0 auto 1rem;
    }

    /* ── Misc ── */
    .sidebar-footer {
        flex-shrink: 0;
        margin-top: auto;
        font-size: 0.8rem;
        padding: 0.6rem 1.1rem;
        padding-bottom: calc(0.6rem + env(safe-area-inset-bottom));
    }

    .import-toast { bottom: 1.5rem; }


    .filters-container { flex-direction: column; gap: 0.5rem; }
}
/* ═══ Trip planner ═══════════════════════════════════════════════════════ */

.trip-planner-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-panel);
    color: var(--text-main);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.trip-planner-btn:hover {
    border-color: #ffde59;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 222, 89, 0.25);
}
.trip-btn-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: #fff7d6;
    font-size: 1.1rem;
    color: #9a7b00;
}
[data-theme="dark"] .trip-btn-icon {
    background: rgba(255, 222, 89, 0.15);
    color: #ffde59;
}
.trip-btn-text { display: flex; flex-direction: column; gap: 0.1rem; }
.trip-btn-title { font-weight: 700; font-size: 0.9rem; }
.trip-btn-hint { font-size: 0.72rem; color: var(--text-muted); }

.backup-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: -0.15rem 0 0.1rem;
}
.backup-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.backup-replace-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 0.25rem;
}

.trip-modal-hint {
    margin-top: 0.75rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

#trip-modal .form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}
#trip-modal select {
    width: 100%;
    padding: 0.55rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-main);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.88rem;
}

/* Itinerary panel */
.trip-panel {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 330px;
    max-width: calc(100% - 2rem);
    max-height: calc(100% - 2rem);
    display: flex;
    flex-direction: column;
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    z-index: 1000;
    overflow: hidden;
}
.trip-panel.hidden { display: none !important; }

.trip-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.9rem 1rem 0.5rem;
}
.trip-panel-header h3 { margin: 0; font-size: 1rem; }
.trip-panel-subtitle { font-size: 0.75rem; color: var(--text-muted); }

.trip-panel-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.trip-save-btn {
    font-size: 0.78rem;
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-main);
    color: var(--text-main);
    cursor: pointer;
    white-space: nowrap;
}
.trip-save-btn:hover { border-color: #ffde59; }
.trip-exit-btn {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

.trip-day-tabs {
    display: flex;
    gap: 0.35rem;
    padding: 0.25rem 1rem 0.6rem;
    overflow-x: auto;
    flex-shrink: 0;
}
.trip-day-tab {
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    border: 1.5px solid var(--day-color);
    background: transparent;
    color: var(--day-color);
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
}
.trip-day-tab.active {
    background: var(--day-color);
    color: #fff;
}

.trip-day-body {
    overflow-y: auto;
    padding: 0 1rem 1rem;
}
.trip-day-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    padding: 0.3rem 0 0.6rem;
}
.trip-gmaps-link {
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    background: #ffde59;
    color: #1c1917;
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    font-size: 0.75rem;
}

.trip-stop-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.trip-stop {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    padding: 0.45rem 0.5rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.trip-stop:hover { background: var(--item-hover); }
.trip-stop-num {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--day-color);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}
.trip-stop-name { font-size: 0.85rem; font-weight: 600; }
.trip-stop-addr {
    font-size: 0.72rem;
    color: var(--text-muted);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

/* Numbered day markers on the map */
.trip-marker {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--day-color);
    color: #fff;
    font-weight: 800;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2.5px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.trip-marker-dim { opacity: 0.35; }

/* Mobile: itinerary panel docks to the bottom like the triage panel */
@media (max-width: 767px) {
    .trip-panel {
        top: auto;
        bottom: 4.5rem;
        left: 0.75rem;
        right: 0.75rem;
        width: auto;
        max-height: 55vh;
    }
}

/* "Show all folders" expander */
.folders-show-all-btn {
    width: 100%;
    padding: 0.45rem 0.5rem;
    margin-top: 0.1rem;
    background: transparent;
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.folders-show-all-btn:hover {
    color: var(--text-main);
    border-color: #ffde59;
}

/* Trip modal: status chips, mode toggle, advisor hint */
.trip-status-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.trip-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.6rem;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    color: var(--text-muted);
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.trip-status-chip input { display: none; }
.trip-status-chip.checked {
    border-color: #ffde59;
    background: rgba(255, 222, 89, 0.18);
    color: var(--text-main);
}

.trip-mode-toggle { display: flex; gap: 1rem; }
.trip-mode-option {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    cursor: pointer;
}

.trip-hint-warning {
    margin-top: 0.4rem;
    color: #b45309;
    font-weight: 600;
}
[data-theme="dark"] .trip-hint-warning { color: #fcd34d; }
.trip-hint-ok {
    margin-top: 0.4rem;
    color: var(--status-green);
    font-weight: 600;
}
.trip-use-days-btn {
    border: none;
    background: #ffde59;
    color: #1c1917;
    font-weight: 700;
    font-size: 0.78rem;
    padding: 0.2rem 0.55rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
}

/* ═══ Stats page ═════════════════════════════════════════════════════════ */

.stats-hero {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1rem;
}
.stats-hero-card {
    flex: 1;
    text-align: center;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.8rem 0.4rem;
}
.stats-hero-num {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
}
.stats-hero-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.stats-highlights {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
    padding: 0.7rem 0.85rem;
    background: rgba(255, 222, 89, 0.15);
    border: 1px solid #ffde59;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
}

.stats-section { margin-bottom: 1.1rem; }
.stats-section h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.stats-bar-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
    font-size: 0.83rem;
}
.stats-bar-label {
    flex: 0 0 42%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.stats-bar-track {
    flex: 1;
    height: 10px;
    background: var(--bg-main);
    border-radius: 999px;
    overflow: hidden;
}
.stats-bar-fill {
    height: 100%;
    background: #ffde59;
    border-radius: 999px;
}
.stats-bar-count {
    flex: 0 0 2rem;
    text-align: right;
    font-weight: 700;
    font-size: 0.78rem;
}

.stats-progress-track {
    height: 14px;
    background: var(--status-blue);
    border-radius: 999px;
    overflow: hidden;
}
.stats-progress-visited {
    height: 100%;
    background: var(--status-green);
    border-radius: 999px 0 0 999px;
}
.stats-progress-legend {
    display: flex;
    justify-content: space-between;
    margin-top: 0.35rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.stats-status-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.stats-status-chip {
    padding: 0.3rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.78rem;
    background: var(--bg-main);
}
