/* ════════════════════════════════════════════════════════════════
   TRIPS DASHBOARD — grid/list cards, create modal, recycle bin
   ════════════════════════════════════════════════════════════════ */

.trips-page { max-width: 1200px; margin: 0 auto; padding: 24px 20px 96px; }
@media (min-width: 768px) { .trips-page { padding: 32px 40px 64px; } }

/* ── Header ────────────────────────────────────────────────── */
.trips-header {
    display: flex; flex-direction: column; gap: 16px;
    margin-bottom: 24px;
}
@media (min-width: 640px) {
    .trips-header { flex-direction: row; justify-content: space-between; align-items: flex-end; }
}
.trips-header-title-wrap { min-width: 0; }
.trips-title     { font-size: 1.75rem; font-weight: 700; color: #fff; letter-spacing: -.01em; }
.trips-subtitle  { font-size: .875rem; color: rgba(255,255,255,.5); margin-top: 4px; }
.trips-back-link {
    display: inline-flex; align-items: center; gap: 6px;
    color: rgba(255,255,255,.55); font-size: .8rem; font-weight: 500;
    margin-bottom: 10px; transition: color .15s;
}
.trips-back-link:hover { color: #fff; }

.trips-header-actions { display: flex; align-items: center; gap: 8px; }

.trips-view-toggle {
    display: inline-flex; background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: 3px;
}
.trips-view-btn {
    padding: 6px 10px; border-radius: 7px; color: rgba(255,255,255,.5);
    display: inline-flex; align-items: center; transition: all .15s;
}
.trips-view-btn:hover        { color: #fff; }
.trips-view-btn.is-active    { background: rgba(255,255,255,.1); color: #fff; }

.trips-bin-link {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 12px; border-radius: 10px;
    color: rgba(255,255,255,.55); font-size: .8rem; font-weight: 500;
    border: 1px solid rgba(255,255,255,.08); transition: all .15s;
}
.trips-bin-link:hover { color: #fff; border-color: rgba(255,255,255,.2); }

.trips-new-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background-image:
        linear-gradient(180deg, rgba(255,255,255,.18) 0%, rgba(255,255,255,0) 60%),
        linear-gradient(180deg, #ee774b 0%, #e05a2b 55%, #c84d23 100%);
    background-blend-mode: screen, normal;
    color: #fff; font-weight: 600; font-size: .85rem;
    padding: 9px 14px; border-radius: 10px;
    border: 1px solid rgba(255,255,255,.22);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.35),
        inset 0 -1px 0 rgba(0,0,0,.08),
        0 4px 12px rgba(224,90,43,.28),
        0 1px 3px rgba(224,90,43,.15);
    text-shadow: 0 1px 1px rgba(0,0,0,.08);
    transition: box-shadow .2s, transform .1s;
}
.trips-new-btn:hover {
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.4),
        inset 0 -1px 0 rgba(0,0,0,.1),
        0 6px 18px rgba(224,90,43,.35),
        0 2px 6px rgba(224,90,43,.18);
}
.trips-new-btn:active { transform: scale(.97); }
.trips-new-btn-lg    { padding: 12px 22px; font-size: .95rem; margin-top: 18px; }

html:not(.dark) .trips-new-btn {
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.4),
        inset 0 -1px 0 rgba(0,0,0,.06),
        0 4px 12px rgba(224,90,43,.22),
        0 1px 3px rgba(224,90,43,.12);
}

/* ── Guest sign-in card ────────────────────────────────────── */
.trips-guest-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 380px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    background: var(--surface, #fff);
    border-radius: 1rem;
    border: 1px solid var(--border, rgba(0,0,0,0.08));
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    gap: 0.5rem;
}
.trips-guest-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-primary, #1a1a1a);
}
.trips-guest-desc {
    font-size: 0.875rem;
    color: var(--text-secondary, #666);
    line-height: 1.55;
    max-width: 280px;
}
.trips-guest-btn {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.625rem 2rem;
    background: #E05A2B;
    color: #fff !important;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 9999px;
    text-decoration: none;
    transition: background 0.15s, transform 0.12s;
    border: none;
}
.trips-guest-btn:hover {
    background: #c44d22;
    transform: translateY(-1px);
}
:root.dark .trips-guest-card {
    background: var(--surface, #1e2535);
    border-color: var(--border, rgba(255,255,255,0.08));
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
:root.dark .trips-guest-title { color: var(--text-primary, rgba(255,255,255,0.9)); }
:root.dark .trips-guest-desc  { color: var(--text-secondary, rgba(255,255,255,0.45)); }

/* ── States ────────────────────────────────────────────────── */
.trips-state {
    text-align: center; padding: 72px 20px; color: rgba(255,255,255,.55);
}
.trips-state h2 { color: #fff; font-size: 1.25rem; font-weight: 600; margin-bottom: 6px; }
.trips-state p  { font-size: .9rem; }
.trips-empty-art {
    font-size: 4rem; margin-bottom: 16px; filter: grayscale(.2);
}
.trips-spinner {
    width: 32px; height: 32px; margin: 0 auto 12px;
    border: 2.5px solid rgba(255,255,255,.1); border-top-color: #E05A2B;
    border-radius: 50%; animation: spin 900ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Groups / section headers ──────────────────────────────── */
.trips-group            { margin-bottom: 40px; }
.trips-group-header     {
    font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
    color: rgba(255,255,255,.4); margin-bottom: 14px;
    display: flex; align-items: center; gap: 8px;
}
.trips-group-count { color: rgba(255,255,255,.3); font-weight: 500; }

/* ── Grid view ─────────────────────────────────────────────── */
.trips-grid {
    display: grid; gap: 18px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.trip-card {
    position: relative; display: block; border-radius: 16px; overflow: hidden;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #1e293b, #334155);
    border: 1px solid rgba(255,255,255,.08);
    cursor: pointer; transition: transform .2s, border-color .2s;
}
.trip-card:hover { transform: translateY(-2px); border-color: rgba(224,90,43,.5); }
.trip-card.is-syncing { opacity: .75; pointer-events: none; }
.trip-card-cover {
    position: absolute; inset: 0; background-size: cover; background-position: center;
}
.trip-card-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.35) 45%, rgba(0,0,0,0) 80%);
}
.trip-card-body {
    position: absolute; left: 16px; right: 16px; bottom: 14px; color: #fff;
}
.trip-card-name {
    font-weight: 700; font-size: 1.05rem; line-height: 1.25;
    text-shadow: 0 1px 3px rgba(0,0,0,.6);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.trip-card-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; font-size: .75rem; }
.trip-card-dest {
    display: inline-flex; align-items: center; gap: 3px;
    background: rgba(255,255,255,.15); backdrop-filter: blur(8px);
    padding: 2px 8px; border-radius: 999px; color: rgba(255,255,255,.9);
}
.trip-card-dates { color: rgba(255,255,255,.8); }

.trip-card-avatars {
    position: absolute; top: 12px; right: 12px; display: flex;
}
.trip-card-avatar {
    width: 26px; height: 26px; border-radius: 50%;
    background: #475569; border: 2px solid rgba(15,23,35,.9);
    color: #fff; font-size: .65rem; font-weight: 600;
    display: inline-flex; align-items: center; justify-content: center;
    margin-left: -8px;
}
.trip-card-avatar:first-child { margin-left: 0; }

.trip-card-ctx {
    position: absolute; top: 12px; left: 12px;
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(0,0,0,.45); backdrop-filter: blur(8px);
    color: #fff; display: inline-flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity .15s;
}
.trip-card:hover .trip-card-ctx { opacity: 1; }
.trip-card-ctx:hover { background: rgba(0,0,0,.65); }

.trip-card-badge {
    position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,.6); backdrop-filter: blur(8px);
    color: rgba(255,255,255,.85); font-size: .7rem; font-weight: 500;
    padding: 3px 10px; border-radius: 999px;
}

/* ── List view ─────────────────────────────────────────────── */
.trips-list { display: flex; flex-direction: column; gap: 4px; }
.trip-row {
    display: flex; align-items: center; gap: 14px; padding: 10px 12px;
    border-radius: 12px; transition: background .15s;
    cursor: pointer;
}
.trip-row:hover { background: rgba(255,255,255,.05); }
.trip-row-thumb {
    width: 56px; height: 56px; border-radius: 10px; flex-shrink: 0;
    background-size: cover; background-position: center;
    background: linear-gradient(135deg, #1e293b, #334155);
}
.trip-row-main     { min-width: 0; flex: 1; }
.trip-row-name     { font-weight: 600; color: #fff; font-size: .95rem; }
.trip-row-meta     { display: flex; gap: 10px; font-size: .78rem; color: rgba(255,255,255,.5); margin-top: 2px; flex-wrap: wrap; }
.trip-row-updated  { font-size: .72rem; color: rgba(255,255,255,.35); white-space: nowrap; }
.trip-row-ctx      { padding: 6px; color: rgba(255,255,255,.4); border-radius: 8px; }
.trip-row-ctx:hover { background: rgba(255,255,255,.08); color: #fff; }

/* ── Archived toggle ───────────────────────────────────────── */
.trips-archived-wrap { text-align: center; margin-top: 20px; }
.trips-archived-btn {
    font-size: .8rem; color: rgba(255,255,255,.5);
    padding: 8px 16px; border-radius: 10px; border: 1px dashed rgba(255,255,255,.15);
}
.trips-archived-btn:hover { color: #fff; border-color: rgba(255,255,255,.3); }

/* ── Context menu ──────────────────────────────────────────── */
.trip-ctx-menu {
    position: fixed; z-index: 1200;
    background: #0f1723; border: 1px solid rgba(255,255,255,.1);
    border-radius: 10px; padding: 4px;
    min-width: 170px; box-shadow: 0 12px 32px rgba(0,0,0,.5);
}
.trip-ctx-item {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 8px 12px; border-radius: 7px;
    color: rgba(255,255,255,.8); font-size: .85rem; text-align: left;
}
.trip-ctx-item:hover           { background: rgba(255,255,255,.06); color: #fff; }
.trip-ctx-item.is-danger       { color: #f87171; }
.trip-ctx-item.is-danger:hover { background: rgba(248,113,113,.1); color: #fca5a5; }
.trip-ctx-divider { height: 1px; background: rgba(255,255,255,.08); margin: 4px 0; }

/* ── Create trip modal ─────────────────────────────────────── */
.trip-modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,.55); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    animation: trip-fade .15s ease-out;
}
@keyframes trip-fade { from { opacity: 0; } to { opacity: 1; } }

.trip-modal-sheet {
    background: #0f1723; border: 1px solid rgba(255,255,255,.08);
    width: 480px; max-width: 100%; max-height: 50vh;
    border-radius: 18px; display: flex; flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,.6);
    animation: trip-slide-in .2s cubic-bezier(.2,.9,.3,1);
}
@keyframes trip-slide-in {
    from { transform: translateY(12px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* Mobile: full-screen */
@media (max-width: 639px) {
    .trip-modal-overlay { background: #0d1117; backdrop-filter: none; align-items: stretch; }
    .trip-modal-sheet   {
        width: 100%; max-width: 100%; max-height: 100vh;
        height: 100vh; border-radius: 0; border: 0;
        animation: trip-slide-mobile .22s ease-out;
    }
    @keyframes trip-slide-mobile {
        from { transform: translateX(30px); opacity: 0; }
        to   { transform: translateX(0);    opacity: 1; }
    }
}

.trip-modal-header {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
}
.trip-modal-back  { display: none; color: rgba(255,255,255,.7); padding: 4px; border-radius: 8px; }
.trip-modal-back:hover { background: rgba(255,255,255,.08); color: #fff; }
@media (max-width: 639px) { .trip-modal-back { display: inline-flex; } }
.trip-modal-title { font-size: 1.05rem; font-weight: 600; color: #fff; flex: 1; }
.trip-modal-close {
    width: 32px; height: 32px; border-radius: 50%;
    color: rgba(255,255,255,.5); font-size: 1.4rem; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
}
.trip-modal-close:hover { background: rgba(255,255,255,.08); color: #fff; }
@media (max-width: 639px) { .trip-modal-close { display: none; } }

.trip-modal-body {
    flex: 1; padding: 20px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 18px;
}

.trip-field { display: flex; flex-direction: column; gap: 6px; position: relative; }
.trip-field-label {
    font-size: .78rem; font-weight: 600; color: rgba(255,255,255,.75);
    display: flex; align-items: baseline; gap: 6px;
}
.trip-field-opt { color: rgba(255,255,255,.35); font-weight: 400; font-size: .72rem; }
.trip-field-input {
    width: 100%; background: rgba(255,255,255,.04); color: #fff;
    border: 1px solid rgba(255,255,255,.08);
    padding: 11px 14px; border-radius: 10px; font-size: .92rem;
    transition: border-color .15s, background .15s;
}
.trip-field-input:focus {
    outline: none; border-color: #E05A2B; background: rgba(255,255,255,.06);
}
.trip-field-input::placeholder { color: rgba(255,255,255,.3); }
.trip-field-counter {
    position: absolute; right: 12px; bottom: 11px;
    font-size: .7rem; color: rgba(255,255,255,.35); pointer-events: none;
}
.trip-field-counter.is-warn { color: #facc15; }
.trip-field-error { font-size: .75rem; color: #f87171; }

.trip-dest-wrap { position: relative; display: flex; align-items: center; }
.trip-dest-icon {
    position: absolute; left: 14px; color: rgba(255,255,255,.5); pointer-events: none;
}
.trip-dest-input { padding-left: 38px; padding-right: 36px; }
.trip-dest-clear {
    position: absolute; right: 10px; width: 22px; height: 22px; border-radius: 50%;
    background: rgba(255,255,255,.08); color: rgba(255,255,255,.7);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .9rem; line-height: 1;
}
.trip-dest-clear:hover { background: rgba(255,255,255,.14); color: #fff; }

.trip-dest-results {
    position: absolute; top: 100%; left: 0; right: 0; margin-top: 6px;
    background: #0f1723; border: 1px solid rgba(255,255,255,.1);
    border-radius: 12px; max-height: 280px; overflow-y: auto; z-index: 10;
    box-shadow: 0 12px 32px rgba(0,0,0,.4);
}
.trip-dest-result {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer;
    transition: background .15s;
}
.trip-dest-result:hover, .trip-dest-result.is-active { background: rgba(255,255,255,.06); }
.trip-dest-result-thumb {
    width: 36px; height: 36px; border-radius: 8px; background-size: cover; background-position: center;
    background-color: rgba(255,255,255,.06); flex-shrink: 0;
}
.trip-dest-result-main   { min-width: 0; flex: 1; }
.trip-dest-result-name   { font-size: .88rem; color: #fff; font-weight: 500; }
.trip-dest-result-country{ font-size: .73rem; color: rgba(255,255,255,.5); }
.trip-dest-results-empty { padding: 14px; text-align: center; color: rgba(255,255,255,.4); font-size: .82rem; }

.trip-dates-wrap {
    display: flex; align-items: center; gap: 8px;
}
.trip-date { flex: 1; min-width: 0; }
.trip-date-sep { color: rgba(255,255,255,.35); flex-shrink: 0; }
.trip-dates-later {
    margin-top: 4px; font-size: .78rem; color: #E05A2B; align-self: flex-start;
}
.trip-dates-later:hover { text-decoration: underline; }

.trip-modal-footer {
    padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
}
.trip-create-btn {
    width: 100%; padding: 13px 20px; border-radius: 12px; font-weight: 600; font-size: .95rem;
    background-image:
        linear-gradient(180deg, rgba(255,255,255,.18) 0%, rgba(255,255,255,0) 60%),
        linear-gradient(180deg, #ee774b 0%, #e05a2b 55%, #c84d23 100%);
    background-blend-mode: screen, normal;
    color: #fff;
    border: 1px solid rgba(255,255,255,.22);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.35),
        inset 0 -1px 0 rgba(0,0,0,.08),
        0 6px 16px rgba(224,90,43,.32),
        0 1px 3px rgba(224,90,43,.18);
    text-shadow: 0 1px 1px rgba(0,0,0,.08);
    transition: box-shadow .2s, transform .1s;
}
.trip-create-btn:hover:not(:disabled) {
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.4),
        inset 0 -1px 0 rgba(0,0,0,.1),
        0 8px 22px rgba(224,90,43,.38),
        0 2px 6px rgba(224,90,43,.2);
}
.trip-create-btn:active:not(:disabled) { transform: scale(.97); }
.trip-create-btn:disabled {
    background-image: none;
    background: rgba(255,255,255,.08); color: rgba(255,255,255,.35);
    border-color: rgba(255,255,255,.06);
    box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
    text-shadow: none; cursor: not-allowed;
}

/* ── Tour tooltips ─────────────────────────────────────────── */
.trip-tour-backdrop {
    position: fixed; inset: 0; z-index: 900;
    background: rgba(0,0,0,.55);
}
.trip-tour-bubble {
    position: fixed; z-index: 950;
    max-width: 280px;
    background: #0f1723; border: 1px solid rgba(224,90,43,.4);
    border-radius: 12px; padding: 14px 16px; color: #fff; font-size: .85rem;
    box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.trip-tour-bubble h4 { font-weight: 600; color: #E05A2B; margin-bottom: 4px; }
.trip-tour-actions {
    display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px;
}
.trip-tour-skip { font-size: .75rem; color: rgba(255,255,255,.5); }
.trip-tour-skip:hover { color: #fff; }
.trip-tour-next {
    background: #E05A2B; color: #fff; font-weight: 600; font-size: .78rem;
    padding: 5px 12px; border-radius: 7px;
}
.trip-tour-next:hover { background: #c44d22; }

/* ── Recycle bin ───────────────────────────────────────────── */
.trips-bin-list { display: flex; flex-direction: column; gap: 8px; }
.trips-bin-list.hidden { display: none; }
.bin-row {
    display: flex; align-items: center; gap: 14px; padding: 12px 14px;
    background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.06);
    border-radius: 12px;
}
.bin-row-thumb {
    width: 52px; height: 52px; border-radius: 10px; flex-shrink: 0;
    background: linear-gradient(135deg, #334155, #1e293b); background-size: cover; background-position: center;
}
.bin-row-main { flex: 1; min-width: 0; }
.bin-row-name { color: #fff; font-weight: 600; font-size: .95rem; }
.bin-row-meta { color: rgba(255,255,255,.5); font-size: .78rem; margin-top: 2px; }
.bin-row-actions { display: flex; gap: 6px; flex-shrink: 0; }
.bin-btn {
    padding: 7px 12px; border-radius: 9px; font-size: .78rem; font-weight: 500;
    transition: all .15s;
}
.bin-btn-recover { background: rgba(16,185,129,.15); color: #34d399; border: 1px solid rgba(16,185,129,.3); }
.bin-btn-recover:hover { background: rgba(16,185,129,.25); }
.bin-btn-purge   { background: rgba(248,113,113,.12); color: #f87171; border: 1px solid rgba(248,113,113,.25); }
.bin-btn-purge:hover   { background: rgba(248,113,113,.22); }

#tripsPage .hidden,
#tripDetail .hidden,
#tripsBinPage .hidden,
.trip-modal-overlay.hidden,
.trip-tour-backdrop.hidden,
.trip-ctx-menu.hidden,
.trip-dest-results.hidden,
.trip-dest-clear.hidden,
.trip-field-counter.hidden,
.trip-field-error.hidden { display: none !important; }

/* ── Trip detail page ──────────────────────────────────────── */
.trip-detail-hero {
    position: relative; border-radius: 20px; overflow: hidden;
    margin: 8px 0 24px; border: 1px solid rgba(255,255,255,.08);
}
.trip-detail-cover {
    height: 220px; background-size: cover; background-position: center;
    background: linear-gradient(135deg, #1e293b, #334155);
}
@media (min-width: 768px) { .trip-detail-cover { height: 300px; } }
.trip-detail-hero-body {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 18px 20px; color: #fff;
    background: linear-gradient(to top, rgba(0,0,0,.85), rgba(0,0,0,0));
}
.trip-detail-title {
    font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em;
    text-shadow: 0 2px 6px rgba(0,0,0,.6);
}
@media (min-width: 768px) { .trip-detail-title { font-size: 2.1rem; } }
.trip-detail-meta { font-size: .85rem; margin-top: 6px; color: rgba(255,255,255,.85); }

.trip-detail-tour-targets {
    display: grid; gap: 10px; margin-bottom: 28px;
    grid-template-columns: 1fr;
}
@media (min-width: 640px) { .trip-detail-tour-targets { grid-template-columns: repeat(3, 1fr); } }
.trip-detail-tour-targets.hidden { display: none; }
.trip-detail-action {
    display: flex; align-items: center; gap: 12px; text-align: left;
    background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
    padding: 14px 16px; border-radius: 14px; color: #fff;
    transition: all .15s; cursor: pointer;
}
.trip-detail-action:hover { background: rgba(255,255,255,.08); border-color: rgba(224,90,43,.4); }
.trip-detail-action span[aria-hidden] { font-size: 1.4rem; flex-shrink: 0; }
.trip-detail-action-title { font-weight: 600; font-size: .92rem; }
.trip-detail-action-sub   { font-size: .75rem; color: rgba(255,255,255,.5); margin-top: 2px; }

.trip-detail-places { margin-top: 18px; }
.trip-detail-empty {
    padding: 40px 20px; text-align: center;
    background: rgba(255,255,255,.03); border: 1px dashed rgba(255,255,255,.1);
    border-radius: 14px; color: rgba(255,255,255,.55); font-size: .9rem;
}

/* ── Overview (editable, no inner scroll — content drives height) ─── */
.trip-overview {
    margin: 18px 0 10px;
}
.trip-overview-header {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 8px;
}
.trip-overview-title {
    font-size: .92rem; font-weight: 700;
    color: rgba(255,255,255,.85);
    margin: 0;
}
.trip-overview-saved {
    font-size: .72rem; color: rgba(34,197,94,.85);
    opacity: 0; transition: opacity .2s;
}
.trip-overview-saved:not(.hidden) { opacity: 1; }
.trip-overview-editor {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    padding: 14px 16px;
    font-size: .95rem; line-height: 1.5;
    color: rgba(255,255,255,.9);
    min-height: 1em;
    outline: none;
    /* CRITICAL: let content grow naturally, never an inner scrollbar */
    overflow: visible !important;
    resize: none;
    word-break: break-word;
    /* AI-imported overview uses plain text with literal newlines + bullets,
       so we need pre-wrap to preserve paragraph breaks the user sees while
       still allowing the contenteditable surface to wrap long lines. */
    white-space: pre-wrap;
    transition: border-color .15s, background .15s;
}
.trip-overview-editor:hover    { background: rgba(255,255,255,.05); }
.trip-overview-editor:focus    { border-color: rgba(224,90,43,.6); background: rgba(255,255,255,.06); }
.trip-overview-editor:empty::before {
    content: attr(data-placeholder);
    color: rgba(255,255,255,.35);
    pointer-events: none;
}

html:not(.dark) .trip-overview-title  { color: #111827; }
html:not(.dark) .trip-overview-editor {
    background: #ffffff; border-color: rgba(0,0,0,.08); color: #111827;
}
html:not(.dark) .trip-overview-editor:hover  { background: #f9fafb; }
html:not(.dark) .trip-overview-editor:focus  { border-color: rgba(224,90,43,.55); background: #fff; }
html:not(.dark) .trip-overview-editor:empty::before { color: rgba(0,0,0,.4); }

/* ── Itinerary card "···" menu ──────────────────────────────────────── */
.trip-card-menu {
    position: absolute; z-index: 80;
    min-width: 200px;
    background: rgba(15,23,42,.98);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 12px 32px rgba(0,0,0,.5);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    animation: tcmFadeIn .12s ease;
}
@keyframes tcmFadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.trip-card-menu button {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    background: transparent; border: 0;
    padding: 8px 12px; border-radius: 8px;
    color: rgba(255,255,255,.9);
    font-size: .85rem; text-align: left;
    cursor: pointer;
}
.trip-card-menu button:hover  { background: rgba(255,255,255,.08); }
.trip-card-menu button[disabled] { opacity: .35; cursor: not-allowed; }
.trip-card-menu .tcm-sep {
    height: 1px; background: rgba(255,255,255,.08);
    margin: 4px 6px;
}
.trip-card-menu .tcm-danger { color: #fca5a5; }
.trip-card-menu .tcm-danger:hover { background: rgba(220,38,38,.12); }

html:not(.dark) .trip-card-menu {
    background: #ffffff; border-color: rgba(0,0,0,.08);
    box-shadow: 0 12px 32px rgba(0,0,0,.18);
}
html:not(.dark) .trip-card-menu button { color: #111827; }
html:not(.dark) .trip-card-menu button:hover { background: #f3f4f6; }
html:not(.dark) .trip-card-menu .tcm-sep { background: rgba(0,0,0,.08); }
html:not(.dark) .trip-card-menu .tcm-danger { color: #b91c1c; }
html:not(.dark) .trip-card-menu .tcm-danger:hover { background: #fef2f2; }

.trip-places-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
}
.trip-place-card {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px; overflow: hidden;
    transition: transform .15s, border-color .15s, background .15s;
}
.trip-place-card:hover { transform: translateY(-2px); border-color: rgba(224,90,43,.4); background: rgba(255,255,255,.06); }
.trip-place-img { position: relative; aspect-ratio: 4/3; background: rgba(255,255,255,.04); overflow: hidden; }
.trip-place-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.trip-place-remove {
    position: absolute; top: 8px; right: 8px;
    width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; border: 1px solid rgba(255,255,255,.15);
    background: rgba(0,0,0,.5); color: #fff; cursor: pointer;
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    transition: background .15s, transform .15s;
}
.trip-place-remove:hover { background: rgba(220,38,38,.85); transform: scale(1.08); }
.trip-place-body { padding: 10px 12px 12px; }
.trip-place-name { font-weight: 600; font-size: .92rem; color: #fff; margin: 0 0 3px; }
.trip-place-meta { font-size: .76rem; color: rgba(255,255,255,.5); margin: 0; }

html:not(.dark) .trip-place-card { background: #fff; border-color: rgba(0,0,0,.08); }
html:not(.dark) .trip-place-card:hover { background: #fff; border-color: rgba(224,90,43,.4); }
html:not(.dark) .trip-place-img { background: rgba(0,0,0,.03); }
html:not(.dark) .trip-place-name { color: #111827; }
html:not(.dark) .trip-place-meta { color: rgba(0,0,0,.55); }

/* ════════════════════════════════════════════════════════════
   LIGHT MODE (html:not(.dark)) — mirrors theme.css conventions.
   ════════════════════════════════════════════════════════════ */
html:not(.dark) .trips-page          { color: #111827; }
html:not(.dark) .trips-title         { color: #111827; }
html:not(.dark) .trips-subtitle      { color: rgba(0,0,0,.5); }
html:not(.dark) .trips-back-link     { color: rgba(0,0,0,.5); }
html:not(.dark) .trips-back-link:hover { color: #111827; }

html:not(.dark) .trips-view-toggle {
    background: rgba(0,0,0,.04); border-color: rgba(0,0,0,.08);
}
html:not(.dark) .trips-view-btn              { color: rgba(0,0,0,.5); }
html:not(.dark) .trips-view-btn:hover        { color: #111827; }
html:not(.dark) .trips-view-btn.is-active    { background: #ffffff; color: #111827; box-shadow: 0 1px 3px rgba(0,0,0,.08); }

html:not(.dark) .trips-bin-link {
    color: rgba(0,0,0,.55); border-color: rgba(0,0,0,.12);
}
html:not(.dark) .trips-bin-link:hover { color: #111827; border-color: rgba(0,0,0,.3); }

html:not(.dark) .trips-state          { color: rgba(0,0,0,.55); }
html:not(.dark) .trips-state h2       { color: #111827; }
html:not(.dark) .trips-spinner        { border-color: rgba(0,0,0,.1); border-top-color: #E05A2B; }

html:not(.dark) .trips-group-header   { color: rgba(0,0,0,.45); }
html:not(.dark) .trips-group-count    { color: rgba(0,0,0,.3); }

/* Cards — light */
html:not(.dark) .trip-card {
    background: rgba(255,255,255,.92);
    border-color: rgba(0,0,0,.08);
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
html:not(.dark) .trip-card:hover {
    border-color: rgba(224,90,43,.5);
    box-shadow: 0 6px 18px rgba(0,0,0,.1);
}

/* Row — light */
html:not(.dark) .trip-row           { color: #111827; }
html:not(.dark) .trip-row:hover     { background: rgba(0,0,0,.04); }
html:not(.dark) .trip-row-name      { color: #1a2535; }
html:not(.dark) .trip-row-meta      { color: rgba(0,0,0,.5); }
html:not(.dark) .trip-row-updated   { color: rgba(0,0,0,.35); }
html:not(.dark) .trip-row-ctx       { color: rgba(0,0,0,.4); }
html:not(.dark) .trip-row-ctx:hover { background: rgba(0,0,0,.06); color: #111827; }

html:not(.dark) .trips-archived-btn {
    color: rgba(0,0,0,.5); border-color: rgba(0,0,0,.15);
}
html:not(.dark) .trips-archived-btn:hover { color: #111827; border-color: rgba(0,0,0,.3); }

/* Context menu — light */
html:not(.dark) .trip-ctx-menu {
    background: #ffffff; border-color: rgba(0,0,0,.1);
    box-shadow: 0 10px 30px rgba(0,0,0,.15);
}
html:not(.dark) .trip-ctx-item       { color: rgba(0,0,0,.75); }
html:not(.dark) .trip-ctx-item:hover { background: rgba(0,0,0,.05); color: #111827; }
html:not(.dark) .trip-ctx-item.is-danger { color: #dc2626; }
html:not(.dark) .trip-ctx-item.is-danger:hover { background: rgba(220,38,38,.08); color: #b91c1c; }
html:not(.dark) .trip-ctx-divider    { background: rgba(0,0,0,.08); }

/* Create modal — light */
html:not(.dark) .trip-modal-overlay  { background: rgba(0,0,0,.45); }
@media (max-width: 639px) {
    html:not(.dark) .trip-modal-overlay { background: #faf9f7; }
}
html:not(.dark) .trip-modal-sheet {
    background: #ffffff; border-color: rgba(0,0,0,.08);
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
}
html:not(.dark) .trip-modal-header   { border-bottom-color: rgba(0,0,0,.07); }
html:not(.dark) .trip-modal-title    { color: #111827; }
html:not(.dark) .trip-modal-close,
html:not(.dark) .trip-modal-back     { color: rgba(0,0,0,.5); }
html:not(.dark) .trip-modal-close:hover,
html:not(.dark) .trip-modal-back:hover { background: rgba(0,0,0,.05); color: #111827; }

html:not(.dark) .trip-field-label    { color: rgba(0,0,0,.7); }
html:not(.dark) .trip-field-opt      { color: rgba(0,0,0,.4); }
html:not(.dark) .trip-field-input {
    background: rgba(0,0,0,.04); color: #111827;
    border-color: rgba(0,0,0,.1);
}
html:not(.dark) .trip-field-input:focus {
    background: #ffffff; border-color: #E05A2B;
}
html:not(.dark) .trip-field-input::placeholder { color: rgba(0,0,0,.35); }
html:not(.dark) .trip-field-counter  { color: rgba(0,0,0,.45); }
html:not(.dark) .trip-field-counter.is-warn { color: #b45309; }
html:not(.dark) .trip-field-error    { color: #dc2626; }
html:not(.dark) .trip-dest-icon      { color: rgba(0,0,0,.45); }
html:not(.dark) .trip-dest-clear     { background: rgba(0,0,0,.07); color: rgba(0,0,0,.6); }
html:not(.dark) .trip-dest-clear:hover { background: rgba(0,0,0,.12); color: #111827; }

html:not(.dark) .trip-dest-results {
    background: #ffffff; border-color: rgba(0,0,0,.1);
    box-shadow: 0 10px 30px rgba(0,0,0,.12);
}
html:not(.dark) .trip-dest-result:hover,
html:not(.dark) .trip-dest-result.is-active { background: rgba(0,0,0,.04); }
html:not(.dark) .trip-dest-result-thumb { background-color: rgba(0,0,0,.06); }
html:not(.dark) .trip-dest-result-name   { color: #111827; }
html:not(.dark) .trip-dest-result-country{ color: rgba(0,0,0,.5); }
html:not(.dark) .trip-dest-results-empty { color: rgba(0,0,0,.45); }

html:not(.dark) .trip-date-sep       { color: rgba(0,0,0,.4); }
html:not(.dark) .trip-dates-later    { color: #c44d22; }

html:not(.dark) .trip-modal-footer   { border-top-color: rgba(0,0,0,.07); }
html:not(.dark) .trip-create-btn {
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.4),
        inset 0 -1px 0 rgba(0,0,0,.06),
        0 4px 12px rgba(224,90,43,.25),
        0 1px 3px rgba(224,90,43,.15);
}
html:not(.dark) .trip-create-btn:hover:not(:disabled) {
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.45),
        inset 0 -1px 0 rgba(0,0,0,.08),
        0 6px 18px rgba(224,90,43,.3),
        0 2px 6px rgba(224,90,43,.18);
}
html:not(.dark) .trip-create-btn:disabled { background-image: none; background: rgba(0,0,0,.06); color: rgba(0,0,0,.4); border-color: rgba(0,0,0,.08); box-shadow: none; }

/* Tour bubble — light */
html:not(.dark) .trip-tour-backdrop  { background: rgba(0,0,0,.4); }
html:not(.dark) .trip-tour-bubble {
    background: #ffffff; color: #111827; border-color: rgba(224,90,43,.4);
    box-shadow: 0 10px 30px rgba(0,0,0,.15);
}
html:not(.dark) .trip-tour-skip      { color: rgba(0,0,0,.5); }
html:not(.dark) .trip-tour-skip:hover{ color: #111827; }

/* Recycle bin — light */
html:not(.dark) .bin-row {
    background: rgba(255,255,255,.9); border-color: rgba(0,0,0,.08);
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
html:not(.dark) .bin-row-name  { color: #111827; }
html:not(.dark) .bin-row-meta  { color: rgba(0,0,0,.5); }
html:not(.dark) .bin-btn-recover { background: rgba(16,185,129,.12); color: #047857; border-color: rgba(16,185,129,.3); }
html:not(.dark) .bin-btn-purge   { background: rgba(220,38,38,.08);  color: #b91c1c; border-color: rgba(220,38,38,.25); }

/* Detail page — light */
html:not(.dark) .trip-detail-hero       { border-color: rgba(0,0,0,.08); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
html:not(.dark) .trip-detail-action {
    background: #ffffff; border-color: rgba(0,0,0,.08); color: #1a2535;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
html:not(.dark) .trip-detail-action:hover { background: #f8fafc; border-color: rgba(224,90,43,.45); }
html:not(.dark) .trip-detail-action-sub { color: rgba(0,0,0,.5); }
html:not(.dark) .trip-detail-empty {
    background: rgba(0,0,0,.025); border-color: rgba(0,0,0,.1); color: rgba(0,0,0,.55);
}


/* ── Highlight-to-ask community (J17) ─────────────────────────── */
.ask-community-floating {
    position: absolute; z-index: 9000;
    padding: 8px 14px; border-radius: 999px; border: none;
    background: #E05A2B; color: #fff;
    font-weight: 600; font-size: 13px; cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    display: inline-flex; align-items: center; gap: 6px;
}
.ask-community-floating:hover { background: #c84d23; }
/* Compound override — Tailwind's `.hidden { display:none }` loses the
   specificity tie because this file is loaded after tailwind.css. */
.ask-community-floating.hidden { display: none; }

.ask-community-sheet { max-height: 80vh; }
.ask-community-dest {
    font-size: 12px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em;
    color: rgba(255,255,255,.55);
}
.ask-community-dest.hidden { display: none; }
.ask-community-textarea { min-height: 140px; resize: vertical; }
.ask-community-footer {
    display: flex; gap: 8px; justify-content: flex-end;
}
.ask-community-submit {
    background: #E05A2B; color: #fff; border-color: #E05A2B;
}
.ask-community-submit:hover { background: #c84d23; border-color: #c84d23; }

/* Light mode */
html:not(.dark) .ask-community-dest { color: rgba(0,0,0,.55); }
