/* TripEasy — Light Premium Design */
/* Palette:
   Phthalo Green     #19350C (25,53,12)   — headers, nav
   Mustard Green     #687D31 (104,125,49) — accents, primary buttons
   Light Gray        #D5D3CC (213,211,204)— main background
   Deep Space Spark. #406768 (64,103,104) — cards/panels
   Moonstone Blue    #6FA9BB (111,169,187)— links, highlights
*/

:root {
    /* Brand */
    --phthalo:        #19350C;
    --phthalo-deep:   #0F2207;
    --phthalo-soft:   #21451A;
    --mustard:        #687D31;
    --mustard-light:  #869F46;
    --mustard-dark:   #4F6122;
    --light-gray:     #D5D3CC;
    --light-gray-2:   #BDBBB4;
    --deep-space:     #406768;
    --deep-space-2:   #2F4F50;
    --moonstone:      #6FA9BB;
    --moonstone-light:#8FC2D2;

    /* Aliases (kept for backward-compat with bundled JS / inline styles) */
    --primary: var(--phthalo);
    --primary-light: var(--phthalo-soft);
    --primary-dark: var(--phthalo-deep);
    --primary-gradient: linear-gradient(135deg, #19350C 0%, #406768 100%);
    --primary-gradient-soft: linear-gradient(135deg, #19350C 0%, #406768 100%);

    --bg:           #D5D3CC;
    --bg-secondary: #C5C3BB;
    --bg-tertiary:  #B5B3AA;
    --text:         #406768;
    --text-secondary: rgba(64, 103, 104, 0.60);
    --text-tertiary:  rgba(64, 103, 104, 0.35);
    --accent:    var(--moonstone);
    --link:      var(--moonstone);
    --danger:    #E07A5F;
    --success:   #9CB544;
    --warning:   #E8B04B;
    --border:    rgba(0,0,0,0.08);
    --border-strong: rgba(0,0,0,0.14);

    --card-bg:        #FFFFFF;
    --card-bg-solid:  #FFFFFF;
    --card-shadow:        0 2px 12px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
    --card-shadow-hover:  0 4px 18px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);

    --radius: 18px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --header-height: 64px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

[data-theme="dark"] {
    --bg:           #1A1C1E;
    --bg-secondary: #252729;
    --bg-tertiary:  #303234;
    --text:         #E8E6E3;
    --text-secondary: rgba(232, 230, 227, 0.65);
    --text-tertiary:  rgba(232, 230, 227, 0.40);
    --border:       rgba(255, 255, 255, 0.08);
    --border-strong:rgba(255, 255, 255, 0.14);
    --card-bg:        #252729;
    --card-bg-solid:  #252729;
    --card-shadow:        0 2px 12px rgba(0,0,0,0.20), 0 1px 2px rgba(0,0,0,0.15);
    --card-shadow-hover:  0 4px 18px rgba(0,0,0,0.30), 0 2px 4px rgba(0,0,0,0.20);
    --primary-gradient: linear-gradient(135deg, #2A4A1F 0%, #2F5A5A 100%);
    --primary-gradient-soft: linear-gradient(135deg, #2A4A1F 0%, #2F5A5A 100%);
    --mustard:        #9CB544;
    --mustard-light:  #B4CD5A;
    --mustard-dark:   #7A942A;
    --moonstone:      #8FC2D2;
    --moonstone-light:#A8D5E3;
    --danger:    #F0907A;
    --success:   #A8C95A;
    --warning:   #E8C060;
}

body, button, input, select, textarea { font-family: 'Inter', sans-serif; }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--bg); }

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg); /* #D5D3CC */
    min-height: 100vh;
    background-attachment: fixed;
    color: var(--text);
    font-size: 16px;
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overscroll-behavior: contain;
}

/* Prevent white gaps during overscroll on all containers */
body::before {
    content: '';
    position: fixed;
    top: -100vh;
    left: 0;
    right: 0;
    height: 200vh;
    background: var(--bg);
    z-index: -1;
    pointer-events: none;
}

.screen {
    display: none;
    padding: 0 16px 24px;
    max-width: 480px;
    margin: 0 auto;
    padding-top: calc(var(--header-height) + 12px);
    overflow-x: hidden;
    word-wrap: break-word;
}
.screen.active {
    display: block;
    animation: tabFadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
}

a { color: var(--moonstone); text-decoration: none; }
a:hover { color: var(--moonstone-light); }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes tabFadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

/* ============ HEADER ============ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 10px;
    height: var(--header-height);
    background:
        linear-gradient(135deg, rgba(15, 34, 7, 0.95) 0%, rgba(25, 53, 12, 0.92) 55%, rgba(64, 103, 104, 0.55) 100%);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 6px 24px rgba(0,0,0,0.35);
}

.header::after { display: none; }

.header-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 36px;
    flex-shrink: 0;
}

.logo-circle,
.header-logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--phthalo) 0%, var(--deep-space) 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.header-logo-img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: contain;
    flex-shrink: 0;
    background: #fff;
    padding: 2px;
}

.header-logo-icon {
    width: 34px;
    height: 34px;
    font-size: 17px;
}

.header-logo h1 {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #D5D3CC 0%, #6FA9BB 60%, #8FC2D2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-back {
    background: rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.08);
    font-size: 16px;
    color: var(--light-gray);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background 0.2s, border-color 0.2s;
    line-height: 1;
    flex-shrink: 0;
}
.btn-back:hover {
    background: rgba(213, 211, 204, 0.16);
    border-color: rgba(213, 211, 204, 0.22);
}

.header-name {
    font-size: 12px;
    color: rgba(213, 211, 204, 0.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90px;
    flex-shrink: 1;
    min-width: 0;
    padding: 2px 10px;
    background: rgba(111, 169, 187, 0.16);
    border: 1px solid rgba(111, 169, 187, 0.22);
    border-radius: 12px;
    line-height: 1.5;
}

.header-spacer { flex: 1; min-width: 4px; }
.user-badge { display: none; }

.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

@media (max-width: 380px) {
    .header { padding: 8px 10px; gap: 4px; }
    .header-logo h1 { font-size: 17px; }
    .header-logo-icon { width: 30px; height: 30px; font-size: 15px; }
    .btn-icon { width: 30px; height: 30px; font-size: 16px; }
    .user-badge { max-width: 70px; font-size: 11px; padding: 2px 8px; }
    .header-name { max-width: 70px; }
}

/* ============ BUTTONS ============ */
.btn-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(0,0,0,0.08);
    color: var(--light-gray);
    border: 1px solid rgba(0,0,0,0.08);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.btn-icon:hover {
    background: rgba(111, 169, 187, 0.22);
    border-color: rgba(111, 169, 187, 0.35);
    transform: scale(1.05);
}
.btn-icon:active { transform: scale(0.95); }

.btn-primary {
    width: 100%;
    padding: 16px;
    background: var(--primary-gradient);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: all 0.2s;
    box-shadow: 0 6px 18px rgba(25, 53, 12, 0.40), inset 0 1px 0 rgba(255,255,255,0.15);
    letter-spacing: 0.3px;
}
.btn-primary:hover {
    box-shadow: 0 10px 26px rgba(25, 53, 12, 0.55), inset 0 1px 0 rgba(255,255,255,0.18);
    transform: translateY(-1px);
}
.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(25, 53, 12, 0.35);
}

.btn-primary-inline {
    background: var(--primary-gradient);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(25, 53, 12, 0.35);
}
.btn-primary-inline:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(25, 53, 12, 0.48);
}
.btn-primary-inline:active { transform: translateY(0); }

/* Floating Action Button (FAB) */
.fab {
    position: fixed;
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--mustard, #687D31);
    color: #fff;
    border: none;
    font-size: 28px;
    line-height: 1;
    padding: 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, box-shadow 0.15s;
    -webkit-user-select: none;
    user-select: none;
}
.fab:active {
    transform: scale(0.9);
}
.fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}

.btn-secondary {
    width: 100%;
    padding: 16px;
    background: transparent;
    color: var(--moonstone);
    border: 2px solid rgba(111, 169, 187, 0.55);
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 12px;
    transition: all 0.2s;
}
.btn-secondary:hover {
    background: rgba(111, 169, 187, 0.12);
    border-color: var(--moonstone);
}

.btn-secondary-inline {
    background: rgba(0,0,0,0.06);
    color: var(--text);
    border: 1px solid rgba(0,0,0,0.10);
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.btn-secondary-inline:hover {
    background: rgba(213, 211, 204, 0.16);
    border-color: rgba(213, 211, 204, 0.22);
}

.btn-danger {
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #c25a3f, #a04832);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(194, 90, 63, 0.35);
}
.btn-danger:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}

/* ============ TRIP LIST ============ */
.trip-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 4px;
}

.trip-card {
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 18px 20px;
    box-shadow: var(--card-shadow);
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.06);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: card-fade-in 0.4s ease-out forwards;
    opacity: 0;
}



.trip-card-pinned {
    border-left: 3px solid #FFD700;
}
.trip-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--phthalo), var(--moonstone));
    border-radius: 0 2px 2px 0;
    opacity: 0;
    transition: opacity 0.25s;
}

.trip-card:hover {
    border-color: rgba(25, 53, 12, 0.25);
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.trip-card:hover::before { opacity: 1; }
.trip-card:active { transform: translateY(0); }

.trip-card-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.08);
    justify-content: flex-end;
}

.btn-action {
    padding: 6px 12px;
    border: 1.5px solid rgba(0,0,0,0.10);
    border-radius: var(--radius-xs);
    background: rgba(213, 211, 204, 0.05);
    color: var(--text);
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    line-height: 1;
}

.btn-action:hover {
    border-color: var(--moonstone);
    background: rgba(111, 169, 187, 0.12);
}

.btn-share {
    padding: 6px 12px;
    border: 1.5px solid rgba(108, 160, 176, 0.25);
    border-radius: var(--radius-xs);
    background: transparent;
    color: var(--moonstone);
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    line-height: 1;
}
.btn-share:hover {
    border-color: var(--moonstone);
    background: rgba(111, 169, 187, 0.14);
    color: var(--moonstone);
}

.btn-edit:hover {
    border-color: var(--mustard-light);
    background: rgba(134, 159, 70, 0.14);
}

.btn-delete:hover {
    border-color: var(--danger);
    background: rgba(224, 122, 95, 0.14);
}

.trip-card .city {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trip-card .dates {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.trip-card .meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    align-items: center;
}

.trip-card .badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(0,0,0,0.08);
    color: var(--text-secondary);
}

.trip-card .badge-active {
    background: rgba(104, 125, 49, 0.14);
    color: var(--mustard);
    border: 1px solid rgba(104, 125, 49, 0.35);
}

.trip-card .badge-past {
    background: rgba(64, 103, 104, 0.08);
    color: var(--text-tertiary);
}

.trip-card .badge-upcoming {
    background: rgba(111, 169, 187, 0.14);
    color: var(--moonstone);
    border: 1px solid rgba(111, 169, 187, 0.35);
}

.trip-card .budget-chip {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trip-card .budget-chip::before {
    content: '💰';
    font-size: 14px;
}

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    animation: slideUp 0.5s ease-out;
}

.empty-state .emoji {
    font-size: 64px;
    margin-bottom: 16px;
    display: block;
}

.empty-state h2 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text);
}

.empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.empty-icon {
    font-size: 72px;
    background: linear-gradient(135deg, rgba(64, 103, 104, 0.35), rgba(104, 125, 49, 0.25));
    width: 110px;
    height: 110px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.25), 0 8px 24px rgba(0,0,0,0.3);
    border: 1px solid rgba(0,0,0,0.08);
}
.empty-title { font-size: 22px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.empty-text { color: var(--text-secondary); margin-bottom: 28px; font-size: 15px; line-height: 1.5; }

/* Small button */
.btn-sm {
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 8px;
    background: rgba(0,0,0,0.08);
    color: var(--text);
    border: 1px solid rgba(0,0,0,0.10);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.btn-sm:hover {
    background: rgba(111, 169, 187, 0.18);
    border-color: rgba(111, 169, 187, 0.30);
}

/* ============ SHARE CARD ============ */
.share-card {
    background:
        linear-gradient(135deg, #F0EFEC 0%, #E6E4E0 45%, #D5D3CC 100%);
    border: 1px solid rgba(111, 169, 187, 0.35);
    border-radius: 18px;
    padding: 24px;
    margin-bottom: 16px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 36px rgba(0,0,0,0.45);
}

.share-card::before {
    content: '✈️';
    position: absolute;
    top: -20px;
    right: -20px;
    font-size: 100px;
    opacity: 0.10;
}

.share-card h2 {
    font-size: 22px;
    margin-bottom: 4px;
    font-weight: 800;
    color: var(--light-gray);
}

.share-card .city {
    font-size: 16px;
    color: rgba(213, 211, 204, 0.75);
    margin-bottom: 16px;
}

.share-card .stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.share-card .stat {
    background: rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}

.share-card .stat .value {
    font-size: 20px;
    font-weight: 700;
    color: var(--moonstone-light);
}

.share-card .stat .label {
    font-size: 12px;
    color: rgba(213, 211, 204, 0.65);
    margin-top: 2px;
}

/* ============ FORM ============ */
.form { display: flex; flex-direction: column; gap: 6px; }
.form label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-top: 14px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.form input, .form select, .form textarea {
    padding: 15px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    background: var(--card-bg);
    color: var(--text);
    width: 100%;
    transition: all 0.2s;
    outline: none;
}
.form input::placeholder, .form textarea::placeholder { color: var(--text-tertiary); }
.form input:focus, .form select:focus, .form textarea:focus {
    border-color: var(--moonstone);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 3px rgba(111, 169, 187, 0.22);
}
/* Screens with fixed headers need scrollable forms */
#create-trip-screen .form,
#edit-trip-screen .form,
#trip-detail-screen .detail-content {
    padding-top: calc(var(--header-height) + 16px);
    padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 100vh;
}

.form-row { display: flex; gap: 12px; }
.form-group { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.form-group .form-label, .form-group label {
    margin-top: 0;
    margin-bottom: 2px;
}
.form input[type="date"] {
    min-height: 44px;
    padding: 12px 14px;
    font-size: 16px;
    -webkit-appearance: none;
    appearance: none;
    color-scheme: dark;
}
.form input[type="date"]::-webkit-date-and-time-value { text-align: left; }
.form input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.85) hue-rotate(45deg);
    cursor: pointer;
}

/* ============ DETAIL CONTENT ============ */
.detail-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: max(80px, env(safe-area-inset-bottom, 80px));
}

.detail-content .value {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* ============ INFO CARD ============ */
.info-card {
    background:
        linear-gradient(135deg, rgba(64, 103, 104, 0.32) 0%, rgba(64, 103, 104, 0.18) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0,0,0,0.08);
    transition: all 0.2s;
    overflow: hidden;
}
.info-card:hover {
    border-color: rgba(111, 169, 187, 0.32);
}
.info-card h3 {
    font-size: 13px;
    font-weight: 700;
    color: var(--deep-space);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.info-item .label { font-size: 11px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.info-item .value { font-size: 18px; font-weight: 700; margin-top: 3px; color: var(--text); letter-spacing: -0.2px; word-break: break-word; overflow-wrap: break-word; }

/* ============ CHECKLIST ============ */
.checklist {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
}
.checklist li.checklist-item {
    display: flex;
    flex-direction: column;
    padding: 14px 14px;
    gap: 6px;
    background: #F5F4F1;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.10);
    animation: fadeIn 0.2s ease-out;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
    min-width: 0;
    overflow: hidden;
}
.checklist li.checklist-item:hover {
    border-color: rgba(111, 169, 187, 0.30);
    background: rgba(64, 103, 104, 0.24);
}
.checklist li.checklist-item.is-done {
    opacity: 0.72;
    background: #F8F7F5;
}
.checklist-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}
.checklist-desc {
    margin: 0 0 0 36px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}
.checklist-subitems {
    list-style: none;
    padding: 0;
    margin: 6px 0 0 26px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.checklist-subitems li.checklist-subitem {
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
    gap: 4px;
    background: #F8F7F5;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 10px;
}
.checkbox {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.14);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(213, 211, 204, 0.04);
}
.checkbox:hover { border-color: var(--moonstone); }
.checkbox.checked {
    background: var(--primary-gradient);
    border-color: var(--phthalo-soft);
    box-shadow: 0 2px 10px rgba(25, 53, 12, 0.4);
}
.checkbox.checked::after { content: '✓'; color: #fff; font-size: 14px; font-weight: bold; }
.checkbox.subitem { width: 22px; height: 22px; }
.checkbox.subitem.checked::after { font-size: 12px; }
.checklist-text { flex: 1; min-width: 0; font-size: 15px; color: var(--text); text-align: left; overflow-wrap: break-word; word-break: break-word; }
.checklist-text.done { text-decoration: line-through; color: var(--text-tertiary); }
.checklist-emoji {
    display: inline-block;
    cursor: pointer;
    padding: 0 2px;
    margin-right: 4px;
    transition: transform 0.15s;
}
.checklist-emoji:hover { transform: scale(1.2); }

/* Action buttons inside checklist items */
.checklist-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.btn-checklist-action {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: rgba(213, 211, 204, 0.06);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    transition: all 0.15s ease;
}
.btn-checklist-action:hover { transform: translateY(-1px); }
.btn-checklist-action.add {
    background: rgba(104, 125, 49, 0.14);
    border-color: rgba(104, 125, 49, 0.35);
    color: var(--mustard);
}
.btn-checklist-action.add:hover {
    background: rgba(104, 125, 49, 0.24);
    border-color: rgba(104, 125, 49, 0.55);
}
.btn-checklist-action.delete {
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.35);
    color: #f87171;
}
.btn-checklist-action.delete:hover {
    background: rgba(239, 68, 68, 0.28);
    border-color: rgba(239, 68, 68, 0.65);
}
.btn-checklist-action.confirm {
    background: var(--primary-gradient);
    color: #fff;
    border-color: transparent;
    width: auto;
    padding: 0 12px;
    font-weight: 600;
    font-size: 14px;
}

/* ============ EXPENSES ============ */
.expense-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}
.expense-item:last-child { border-bottom: none; }
.expense-left { display: flex; flex-direction: column; gap: 2px; }
.expense-category { font-size: 12px; color: var(--text-tertiary); font-weight: 500; }
.expense-amount {
    font-weight: 700;
    font-size: 16px;
    color: var(--moonstone-light);
    background: rgba(111, 169, 187, 0.14);
    border: 1px solid rgba(111, 169, 187, 0.25);
    padding: 4px 10px;
    border-radius: 8px;
}
.expense-group { margin-bottom: 8px; padding-bottom: 12px; border-bottom: 1px solid rgba(0,0,0,0.08); }
.expense-group:last-of-type { border-bottom: none; }
.expense-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0 4px;
    font-weight: 700;
    font-size: 13px;
    color: var(--mustard-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px dashed rgba(213, 211, 204, 0.15);
    margin-bottom: 4px;
}
.expense-group-header span:last-child { font-size: 14px; }
.expense-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0 4px;
    font-weight: 800;
    font-size: 20px;
    border-top: 2px solid var(--phthalo);
    margin-top: 8px;
    color: var(--text);
}
.expense-total span:last-child { color: var(--phthalo-soft); }

/* ============ SUMMARY ============ */
.summary-category {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 14px;
}
.summary-bar-bg {
    height: 8px;
    background: rgba(0,0,0,0.06);
    border-radius: 4px;
    margin: 4px 0 8px;
    overflow: hidden;
}
.summary-bar-fill {
    height: 8px;
    background: linear-gradient(90deg, var(--phthalo) 0%, var(--moonstone) 100%);
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============ MODAL ============ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 34, 7, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 100;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-strong);
    border-radius: 22px;
    padding: 24px 20px;max-width: 360px;
    width: 90%;
    margin: 0 auto;
}
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    margin: 0 auto;
    animation: slideUp 0.3s ease-out;
    box-shadow: 0 -12px 40px rgba(0,0,0,0.45);
}
.modal h3 {
    margin-bottom: 16px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

#login-overlay .modal { max-width: 320px; }
.modal .form label:first-of-type { margin-top: 4px; }
.modal .form select,
.modal .form input[type="text"],
.modal .form input[type="number"] {
    padding: 8px 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--card-bg);
    color: var(--text);
    width: 100%;
    outline: none;
}
.modal .form label {
    margin-top: 10px;
    font-size: 11px;
}


.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
    gap: 6px;
    margin: 14px 0;
    width: 100%;
}

@media (min-width: 420px) {
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
}
.category-btn {
    padding: 12px 4px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    cursor: pointer;
    text-align: center;
    font-size: 12px;
    color: var(--text);
    transition: all 0.2s;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    line-height: 1.2;
}
.category-btn:hover {
    border-color: var(--moonstone);
    background: rgba(111, 169, 187, 0.12);
}
.category-btn.active {
    border-color: var(--phthalo-soft);
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 6px 16px rgba(25, 53, 12, 0.40);
}

/* ============ WEATHER ============ */
.weather-current {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
    padding: 4px 0;
}
.weather-icon-big {
    font-size: 48px;
    line-height: 1;
    background: linear-gradient(135deg, rgba(111,169,187,0.22), rgba(64,103,104,0.30));
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(111, 169, 187, 0.20);
}
.weather-temp-block { display: flex; flex-direction: column; gap: 2px; }
.weather-temp-now {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--light-gray);
}
.weather-range { font-size: 15px; color: var(--text-secondary); font-weight: 500; }
.weather-precip { font-size: 13px; color: var(--moonstone-light); }

.weather-forecast {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(0,0,0,0.08);
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
}

.weather-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    min-width: 70px;
    padding: 8px 4px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}
.weather-day:hover { background: rgba(111, 169, 187, 0.12); }
.weather-day-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.weather-day-emoji { font-size: 30px; line-height: 1; }
.weather-day-temp { font-size: 14px; font-weight: 700; color: var(--text); }
.weather-day-precip { font-size: 11px; color: var(--moonstone); }

/* ============ LOADER ============ */
.loader {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(0,0,0,0.10);
    border-top-color: var(--moonstone);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ ADD CHECKLIST INPUT ============ */
.checklist-add-wrap { margin-bottom: 14px; }
.btn-add-checklist {
    width: 100%;
    padding: 12px 16px;
    background: var(--primary-gradient);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(25, 53, 12, 0.35);
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn-add-checklist:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(25, 53, 12, 0.48);
}
.btn-add-checklist.is-open {
    background: rgba(64, 103, 104, 0.26);
    box-shadow: none;
    color: var(--text-secondary);
}
.checklist-add-panel {
    display: none;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    padding: 14px;
    background: #F5F4F1;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    animation: fadeIn 0.2s ease-out;
    overflow: hidden;
}
.checklist-add-panel.is-open { display: flex; }
.checklist-add-panel input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    border: 1.5px solid rgba(0,0,0,0.10);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: #F5F4F1;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}
.checklist-add-panel input::placeholder { color: rgba(0,0,0,0.25); }
.checklist-add-panel input:focus {
    border-color: var(--moonstone);
    background: #EDEBE8;
}
.checklist-add-panel-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.checklist-add-panel-actions .btn-cancel {
    padding: 9px 14px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
}
.checklist-add-panel-actions .btn-confirm {
    padding: 9px 16px;
    background: var(--primary-gradient);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(25, 53, 12, 0.35);
}

/* Sub-item inline input */
.subitem-input-wrap {
    display: none;
    margin-top: 8px;
    padding-left: 26px;
}
.subitem-input-wrap.is-open { display: block; }
.subitem-input-row {
    display: flex;
    gap: 6px;
    align-items: center;
}
.subitem-input-row input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 8px;
    font-size: 13px;
    background: rgba(64, 103, 104, 0.24);
    color: var(--text);
    outline: none;
}
.subitem-input-row input:focus { border-color: var(--moonstone); }

.add-checklist-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.add-checklist-row input {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    border: 1.5px solid rgba(0,0,0,0.10);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: #F5F4F1;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}
.add-checklist-row input::placeholder { color: rgba(0,0,0,0.25); }
.add-checklist-row input:focus {
    border-color: var(--moonstone);
    background: #EDEBE8;
}
.add-checklist-row button {
    padding: 10px 16px;
    background: var(--primary-gradient);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(25, 53, 12, 0.35);
}
.add-checklist-row button:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}

/* ============ CREATE TRIP HEADER ADJUSTMENT ============ */
#create-trip-screen .btn-back { min-width: 44px; text-align: center; }

/* ============ CARD ANIMATIONS ============ */
@keyframes card-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.trip-card:nth-child(1) { animation-delay: 0.05s; }
.trip-card:nth-child(2) { animation-delay: 0.1s; }
.trip-card:nth-child(3) { animation-delay: 0.15s; }
.trip-card:nth-child(4) { animation-delay: 0.2s; }
.trip-card:nth-child(5) { animation-delay: 0.25s; }

/* ============ TOAST ============ */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--card-bg, linear-gradient(180deg, #FFFFFF, #F5F4F1));
    color: var(--text);
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: 14px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 12px 36px rgba(0,0,0,0.5);
    z-index: 10000;
    max-width: 90%;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.toast-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-success { border-left: 4px solid var(--success); }
.toast-error   { border-left: 4px solid var(--danger); }
.toast-warning { border-left: 4px solid var(--warning); }
.toast-info    { border-left: 4px solid var(--moonstone); }

/* ============ TARIFF ============ */
#tariff-screen .detail-content {
    padding: 16px;
    padding-top: 80px;
}
#tariff-screen .info-card {
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 16px;
}
#tariff-screen .info-card:active { transform: scale(0.98); }

/* Yandex Maps dark theme */
ymaps { --ymaps-bg: #19350C !important; }

/* Search input hint */
#search-input { color-scheme: dark; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(111, 169, 187, 0.22);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(111, 169, 187, 0.42); border: 2px solid transparent; background-clip: padding-box; }

/* Text selection */
::selection { background: rgba(111, 169, 187, 0.45); color: #fff; }

/* ============ BOTTOM TAB BAR ============ */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: var(--card-bg);
    border-top: 1px solid rgba(0,0,0,0.06);
    padding: 8px 0 calc(8px + var(--safe-bottom));
    padding-bottom: max(8px, env(safe-area-inset-bottom, 8px));
    box-shadow: 0 -2px 12px rgba(0,0,0,0.04);
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--deep-space);
    transition: color 0.2s;
    min-width: 64px;
}

.tab-item .tab-icon {
    font-size: 22px;
    line-height: 1;
}

.tab-item.active {
    color: var(--phthalo);
    font-weight: 700;
}

.tab-item.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    width: 20px;
    height: 3px;
    background: var(--phthalo);
    border-radius: 2px;
}

.screen.has-tab-bar {
    padding-bottom: calc(80px + var(--safe-bottom));
}

/* JS Error bar override (so it picks up palette) */
#js-error-bar {
    background: linear-gradient(135deg, #c25a3f, #a04832) !important;
    border-bottom: 1px solid rgba(213, 211, 204, 0.15);
}

/* ============ TAB BUTTONS (trip detail) ============ */
.tab-btn {
    flex: 0 0 auto;
    min-width: 0;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    text-align: center;
}
.tab-btn:hover {
    background: rgba(25, 53, 12, 0.05);
    color: var(--text);
}
.tab-btn.active {
    background: var(--accent, #007aff);
    color: #fff;
    border-color: transparent;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(25, 53, 12, 0.25);
}

.tab-content {
    padding-top: 4px;
    animation: fadeIn 0.25s ease-out;
    overflow-x: hidden;
    max-width: 100%;
}



/* ========================= BOTTOM SHEET ========================= */
.bottom-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
    display: none;
    animation: fadeIn 0.2s ease-out;
}
.bottom-sheet-overlay.visible {
    display: block;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg, #fff);
    border-radius: 20px 20px 0 0;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 -4px 30px rgba(0,0,0,0.15);
}
.bottom-sheet.visible {
    transform: translateY(0);
}

.bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--deep-space);
    opacity: 0.3;
    border-radius: 4px;
    margin: 10px auto;
}

.bottom-sheet-content {
    padding: 0 20px 20px;
}

.bottom-sheet-header {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 12px;
    text-align: center;
}

.bottom-sheet-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 16px;
    background: var(--bg, #f5f5f5);
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text, #1a1a1a);
    cursor: pointer;
    text-align: left;
    margin-bottom: 8px;
    transition: background 0.15s;
}
.bottom-sheet-btn:active {
    background: rgba(0,0,0,0.08);
}

/* ========================= PROGRESS BAR ========================= */
.progress-bar-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 12px 0;
}

.progress-bar-label {
    font-size: 12px;
    color: var(--text-secondary, #888);
    display: flex;
    justify-content: space-between;
}

.progress-bar {
    height: 6px;
    background: rgba(0,0,0,0.08);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--mustard), var(--moonstone));
    border-radius: 6px;
    transition: width 0.5s ease-out;
    min-width: 2px;
}

/* ========================= SKELETON LOADING ========================= */
.skeleton {
    background: linear-gradient(90deg, rgba(64,103,104,0.20) 25%, rgba(111,169,187,0.18) 50%, rgba(64,103,104,0.20) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 12px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card { height: 100px; margin-bottom: 12px; }
.skeleton-line { height: 16px; margin-bottom: 8px; width: 60%; }
.skeleton-line.short { width: 40%; }
.skeleton-title { height: 22px; width: 50%; margin-bottom: 16px; }
.skeleton-block { height: 48px; margin-bottom: 8px; width: 100%; }

/* ========================= Tabs (scrollable row) ========================= */
#detail-tabs-container {
    background: var(--bg);
    z-index: 10;
}
.tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
}
.tab-btn {
  flex: 0 1 auto;
  min-width: 0;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary, #888);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.tab-btn.active {
  background: var(--accent, #007aff);
  color: #fff;
  font-weight: 600;
}
.tab-btn:not(.active):hover {
  background: rgba(0,0,0,0.05);
}

/* Trip detail: header height offset + space for tab bar */
#trip-detail-screen {
  padding-top: calc(var(--header-height) + 46px);
}
#trip-detail-screen .detail-content {
  padding-top: 8px;
}

/* ============ UTILITY CLASSES (replace inline styles in JS) ============ */
.text-center { text-align: center; }
.text-secondary { color: var(--text-secondary); }
.text-sm { font-size: 13px; }
.p-4 { padding: 16px; }
.p-3 { padding: 12px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.flex-wrap { display: flex; flex-wrap: wrap; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.w-full { width: 100%; }

/* Stats grid (2-col card layout) */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.stats-item {
    text-align: center;
    padding: 14px 12px;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.stats-item .stats-emoji { font-size: 28px; }
.stats-item .stats-value { font-size: 24px; font-weight: 800; margin: 4px 0; }
.stats-item .stats-label { font-size: 12px; color: var(--text-secondary); }

/* Country/chip tags */
.chip-tag {
    background: rgba(111,169,187,0.15);
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 12px;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 4px; }

/* Divider */
.divider { border-bottom: 1px solid var(--border); }

/* === Shared page error styles === */
.error {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}
.error h2 {
    font-size: 22px;
    margin-bottom: 8px;
    color: var(--text);
}
.error p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.5;
}
