/* --- CORE VARIABLES --- */
        :root {
            --primary: #cc0000; --primary-hover: #a30000; --primary-light: rgba(204,0,0,0.1);
            --success: #27ae60; --warning: #febb02; --radius: 20px;
            --diia-bg: #D4F4E4; --diia-text: #000; --bankid-bg: #1A3A8F; --bankid-text: #fff;
            --bg-main: #f4f6f9; --bg-card: #ffffff; --bg-modal: #ffffff; --bg-input: #fafafa;
            --text-main: #111111; --text-muted: #666666; --border: #eeeeee;
            --shadow: 0 10px 40px rgba(0,0,0,0.08); --glass-bg: rgba(255,255,255,0.85);
            --ai-grad: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
        }

        [data-theme="dark"] {
            --bg-main: #121212; --bg-card: #1e1e1e; --bg-modal: #1c1c1e; --bg-input: #2a2a2a;
            --text-main: #f5f5f5; --text-muted: #aaaaaa; --border: #333333;
            --shadow: 0 10px 40px rgba(0,0,0,0.5); --glass-bg: rgba(20,20,20,0.85);
            --diia-bg: #1e3a2b; --diia-text: #fff;
        }

        * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
        body { font-family: 'Segoe UI', system-ui, sans-serif; margin: 0; background: var(--bg-main); color: var(--text-main); overflow-x: hidden; padding-bottom: 80px; line-height: 1.5; transition: background-color 0.3s, color 0.3s; overscroll-behavior-y: contain; }
        body.is-tg-app { padding-bottom: 0; }
        button:focus-visible, input:focus-visible, select:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(204,0,0,0.2) !important; }

        /* Skeleton Animation */
        .skeleton { background: linear-gradient(90deg, var(--bg-input) 25%, var(--border) 50%, var(--bg-input) 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; } }

        /* --- GLOBAL PROGRESS & PTR --- */
        #nprogress { position: fixed; top: 0; left: 0; width: 0%; height: 3px; background: var(--primary); z-index: 10000; transition: width 0.2s, opacity 0.4s; box-shadow: 0 0 10px var(--primary); opacity: 0; pointer-events: none; }
        body.is-tg-app #nprogress { display: none; }

        #ptr-indicator { position: absolute; top: -50px; left: 0; width: 100%; height: 50px; display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--text-muted); transition: transform 0.2s; z-index: 999; }
        .ptr-spinner { width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; display: none; }
        @keyframes spin { to { transform: rotate(360deg); } }

        /* --- HEADER & NAV --- */
        header { background: #111; padding: 12px 20px; position: sticky; top: 0; z-index: 1000; border-bottom: 3px solid var(--primary); box-shadow: 0 4px 20px rgba(0,0,0,0.4); }
        body.is-tg-app header { display: none; }
        .top-bar { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
        .logo { height: 38px; cursor: pointer; transition: 0.2s; } .logo:active { transform: scale(0.95); }
        .header-actions { display: flex; align-items: center; gap: 10px; }
        .icon-btn { background: rgba(255,255,255,0.1); border: none; font-size: 16px; padding: 6px 10px; border-radius: 12px; cursor: pointer; transition: 0.3s; color: white; font-weight: bold; }
        .icon-btn:hover { background: rgba(255,255,255,0.2); }

        .desktop-nav { display: flex; gap: 8px; margin-top: 15px; justify-content: center; max-width: 1200px; margin: auto; flex-wrap: wrap;}
        .desktop-nav a { color: #fff; text-decoration: none; font-weight: 700; font-size: 12px; padding: 10px 18px; border-radius: 10px; transition: 0.3s; background: rgba(255,255,255,0.05); text-transform: uppercase; cursor: pointer; }
        .desktop-nav a.active, .desktop-nav a:hover { background: var(--primary); }
        .badge { background: #fff; color: var(--primary); padding: 2px 6px; border-radius: 6px; margin-left: 5px; font-size: 10px; }

        .mobile-nav { display: none; position: fixed; bottom: 0; left: 0; width: 100%; background: var(--glass-bg); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); box-shadow: 0 -5px 20px rgba(0,0,0,0.1); z-index: 1001; padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--border); transition: 0.3s; }
        body.is-tg-app .mobile-nav { display: none !important; }
        .mobile-nav-inner { display: flex; justify-content: space-around; padding: 12px 5px; }
        .mobile-nav a { flex: 1; text-align: center; color: var(--text-muted); text-decoration: none; font-size: 10px; font-weight: bold; display: flex; flex-direction: column; align-items: center; gap: 4px; transition: 0.3s; cursor: pointer; }
        .mobile-nav a.active { color: var(--primary); }
        .mobile-nav a span.icon { font-size: 22px; filter: grayscale(1); opacity: 0.5; transition: 0.3s; }
        .mobile-nav a.active span.icon { filter: grayscale(0); opacity: 1; transform: translateY(-2px); }

        /* --- FABS --- */
        .fab-container { position: fixed; bottom: 90px; right: 20px; display: flex; flex-direction: column; gap: 15px; z-index: 998; }
        body.is-tg-app .fab-container { bottom: 20px; }
        .fab { width: 55px; height: 55px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; box-shadow: 0 5px 20px rgba(0,0,0,0.3); cursor: pointer; transition: 0.3s; border: none; text-decoration: none; }
        .fab-support { background: var(--dark); color: #fff; border: 2px solid var(--border); }
        .fab-ai { background: var(--ai-grad); color: #fff; border: 2px solid #fff; animation: pulse 2s infinite; }
        .fab:hover { transform: scale(1.1); }
        @keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(79, 172, 254, 0.7); } 70% { box-shadow: 0 0 0 15px rgba(79, 172, 254, 0); } 100% { box-shadow: 0 0 0 0 rgba(79, 172, 254, 0); } }

        /* --- LAYOUT & COMPONENTS --- */
        .page { display: none; padding: 20px 15px; max-width: 1200px; margin: 0 auto; min-height: calc(100vh - 150px); animation: fadeScale 0.4s cubic-bezier(0.1, 0.9, 0.2, 1); }
        .page.active { display: block; }
        @keyframes fadeScale { from { opacity: 0; transform: translateY(15px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

        /* Social Proof Toast */
        .sp-toast { position: fixed; bottom: 100px; left: 20px; background: var(--glass-bg); backdrop-filter: blur(10px); border-radius: 16px; padding: 12px 16px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow); z-index: 999; transform: translateX(-150%); transition: 0.5s cubic-bezier(0.1, 0.9, 0.2, 1); border-left: 4px solid var(--primary); color: var(--text-main); font-size: 13px; max-width: 320px; border: 1px solid var(--border); }
        .sp-toast.show { transform: translateX(0); }
        body.is-tg-app .sp-toast { bottom: 20px; }

        /* Compare Bar */
        .compare-bar { position: fixed; bottom: -100px; left: 50%; transform: translateX(-50%); background: var(--dark); color: white; padding: 15px 25px; border-radius: 30px; display: flex; align-items: center; justify-content: space-between; gap: 20px; z-index: 1005; box-shadow: 0 10px 40px rgba(0,0,0,0.4); transition: 0.4s; width: 90%; max-width: 400px; }
        .compare-bar.show { bottom: 90px; }
        body.is-tg-app .compare-bar.show { bottom: 20px; }

        /* Stories */
        .stories-bar { display: flex; gap: 15px; overflow-x: auto; padding: 5px 0 20px; scrollbar-width: none; }
        .stories-bar::-webkit-scrollbar { display: none; }
        .story { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; flex-shrink: 0; transition: 0.2s; }
        .story-img-wrap { width: 68px; height: 68px; border-radius: 50%; padding: 3px; background: linear-gradient(45deg, var(--warning), var(--primary)); display: flex; align-items: center; justify-content: center; }
        .story-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--bg-card); border: 2px solid var(--bg-main); transition: 0.3s; }
        .story:active .story-img { transform: scale(0.9); }
        .story-title { font-size: 11px; font-weight: 700; color: var(--text-main); width: 68px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

        /* Search Box */
        .search-container { position: sticky; top: 10px; z-index: 995; margin-bottom: 25px; transition: 0.3s; }
        .desktop-nav .nav-favs, .desktop-nav .nav-services, .desktop-nav .nav-terms, .desktop-nav .nav-about { display: none; }
        .journey-hero { display: flex; align-items: end; justify-content: space-between; gap: 28px; padding: 30px; margin: 4px 0 22px; border-radius: var(--radius); color: #fff; background: linear-gradient(120deg, #111 0%, #2b1616 58%, #8d0000 135%); box-shadow: var(--shadow); }
        .journey-hero h1 { margin: 4px 0 8px; font-size: clamp(28px, 4vw, 42px); line-height: 1.05; letter-spacing: -1px; }
        .journey-hero p:not(.eyebrow) { max-width: 620px; margin: 0; color: rgba(255,255,255,.78); }
        .eyebrow { margin: 0; color: #ffb2b2; font-size: 11px; font-weight: 900; letter-spacing: .11em; }
        .journey-actions { display: grid; grid-template-columns: repeat(3, minmax(130px, 1fr)); gap: 10px; width: min(100%, 490px); }
        .journey-action { padding: 13px 14px; border: 1px solid rgba(255,255,255,.28); border-radius: 12px; color: #fff; background: rgba(255,255,255,.08); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; transition: transform .2s, background .2s; }
        .journey-action:hover { transform: translateY(-2px); background: rgba(255,255,255,.18); }
        .journey-action.primary { border-color: #fff; color: #111; background: #fff; }
        body.is-tg-app .search-container { top: 10px; }
        header.scrolled ~ main .search-container { top: 75px; }
        .search-box { background: var(--bg-card); padding: 15px; border-radius: var(--radius); display: flex; flex-wrap: wrap; gap: 12px; box-shadow: var(--shadow); border: 1px solid var(--border); transition: 0.3s; align-items: center; }
        .search-container.stuck .search-box { padding: 10px; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); background: var(--glass-bg); backdrop-filter: blur(10px); }

        .floating-group { position: relative; flex: 1; min-width: 150px; display: flex; align-items: center; }
        .floating-input { width: 100%; padding: 20px 15px 10px; border: 1px solid var(--border); border-radius: 12px; font-size: 14px; outline: none; transition: 0.3s; background: var(--bg-input); color: var(--text-main); font-weight: 600; font-family: inherit; }
        .floating-label { position: absolute; left: 15px; top: 16px; color: var(--text-muted); font-size: 14px; transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1); pointer-events: none; }
        .floating-input:focus { border-color: var(--primary); background: var(--bg-card); box-shadow: 0 0 0 4px rgba(204,0,0,0.08); }
        .floating-input:focus ~ .floating-label, .floating-input:not(:placeholder-shown) ~ .floating-label, .floating-input.has-value ~ .floating-label { top: 6px; font-size: 10px; color: var(--primary); font-weight: 800; text-transform: uppercase; }

        .mic-btn { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: transparent; border: none; font-size: 18px; cursor: pointer; color: var(--text-muted); padding: 5px; transition: 0.3s; z-index: 5; }
        .mic-btn:hover { color: var(--primary); transform: translateY(-50%) scale(1.1); }
        .mic-btn.recording { color: var(--primary); animation: pulse 1s infinite; }
        .search-clear-btn { position: absolute; right: 42px; top: 50%; z-index: 5; transform: translateY(-50%); border: 0; color: var(--text-muted); background: transparent; cursor: pointer; font-size: 22px; line-height: 1; }

        .quick-dates { display: flex; gap: 8px; margin-top: -5px; padding-left: 5px; margin-bottom: 5px; overflow-x: auto; scrollbar-width: none; }
        .quick-dates span { font-size: 11px; background: var(--bg-input); border: 1px solid var(--border); padding: 4px 10px; border-radius: 12px; cursor: pointer; font-weight: bold; color: var(--text-muted); transition: 0.3s; white-space: nowrap; }
        .quick-dates span:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

        .btn-icon { position: relative; background: var(--bg-input); border: 1px solid var(--border); border-radius: 12px; padding: 15px; cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; transition: 0.3s; color: var(--text-main); }
        .btn-icon:hover { background: var(--primary); color: white; border-color: var(--primary); }

        .controls-bar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 25px; }
        .filter-btn { background: var(--bg-card); border: 1px solid var(--border); color: var(--text-muted); padding: 10px 18px; border-radius: 20px; cursor: pointer; font-weight: 700; font-size: 13px; transition: 0.3s; box-shadow: 0 2px 5px rgba(0,0,0,0.02); }
        .filter-btn.active, .filter-btn:hover { background: var(--text-main); color: var(--bg-main); border-color: var(--text-main); transform: translateY(-2px); }

        /* Map */
        #map-wrapper { position: relative; margin-bottom: 25px; display: block; }
        #map { height: 250px; width: 100%; border-radius: var(--radius); z-index: 1; border: 1px solid var(--border); box-shadow: var(--shadow); filter: var(--map-filter); transition: 0.3s; }
        [data-theme="dark"] { --map-filter: invert(90%) hue-rotate(180deg) brightness(85%) contrast(85%); }
        .btn-search-area { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); z-index: 1000; background: var(--dark); color: white; border: none; padding: 10px 20px; border-radius: 20px; font-weight: bold; font-size: 13px; cursor: pointer; box-shadow: 0 4px 15px rgba(0,0,0,0.3); display: none; animation: dropDown 0.3s ease; }
        .marker-cluster-custom { background-color: var(--primary-light); border-radius: 50%; }
        .marker-cluster-custom div { background-color: var(--primary); color: white; border-radius: 50%; width: 30px; height: 30px; margin: 5px; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 14px; box-shadow: 0 2px 8px rgba(204,0,0,0.4); }
        .map-price-marker { background: var(--bg-card); border: 2px solid var(--text-main); border-radius: 20px; padding: 4px 10px; font-weight: 800; font-size: 13px; color: var(--text-main); box-shadow: 0 4px 10px rgba(0,0,0,0.3); transition: 0.3s; white-space: nowrap; text-align: center; }
        .map-price-marker::after { content: ''; position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); border-width: 6px 6px 0; border-style: solid; border-color: var(--text-main) transparent transparent transparent; transition: 0.3s; }
        .map-price-marker.active { background: var(--primary); color: white; border-color: var(--primary); transform: scale(1.15); z-index: 1000 !important; }
        .map-price-marker.active::after { border-color: var(--primary) transparent transparent transparent; }

        /* View Toggle */
        .view-toggle { position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%); background: var(--dark); color: white; padding: 12px 24px; border-radius: 30px; font-weight: bold; font-size: 14px; cursor: pointer; z-index: 998; box-shadow: 0 8px 20px rgba(0,0,0,0.3); display: flex; align-items: center; gap: 8px; transition: 0.3s; border: 1px solid rgba(255,255,255,0.1); display: none;}
        .view-toggle:hover { background: #333; transform: translateX(-50%) scale(1.05); }
        body.is-tg-app .view-toggle { bottom: 30px; }
        body.map-view-active { overflow: hidden; }
        body.map-view-active #map-wrapper { display: block; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 800; border-radius: 0; margin: 0; }
        body.map-view-active #map { height: 100%; border-radius: 0; border: none; }
        body.map-view-active .search-container, body.map-view-active .controls-bar { z-index: 900; position: relative; }
        body.map-view-active #stories-bar { display: none; }
        body.map-view-active .cars-grid { position: fixed; bottom: 150px; left: 0; width: 100vw; z-index: 900; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 15px; gap: 15px; pointer-events: auto; scrollbar-width: none; }
        body.map-view-active.is-tg-app .cars-grid { bottom: 80px; }
        body.map-view-active .cars-grid::-webkit-scrollbar { display: none; }
        body.map-view-active .card { flex: 0 0 85%; max-width: 320px; scroll-snap-align: center; margin: 0; box-shadow: 0 15px 30px rgba(0,0,0,0.2); }

        /* Cards */
        .cars-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
        .empty-catalog-hint { margin: 9px 0 14px; font-size: 13px; }
        .empty-catalog-reset { padding: 10px 15px; border: 0; border-radius: 9px; color: #fff; background: var(--primary); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
        .card { background: var(--bg-card); border-radius: var(--radius); padding: 15px; box-shadow: var(--shadow); transition: 0.4s cubic-bezier(0.1, 0.9, 0.2, 1); cursor: pointer; display: flex; flex-direction: column; position: relative; border: 2px solid transparent; }
        .card.reveal { opacity: 0; transform: translateY(30px); } .card.reveal.active { opacity: 1; transform: translateY(0); }
        .card:hover, .card.highlight { transform: translateY(-8px); border-color: var(--primary); }
        .card.card-unavailable { cursor: not-allowed; opacity: .78; }
        .card.card-unavailable:hover { transform: none; border-color: transparent; }

        .card-img-box { position: relative; height: 190px; background: var(--bg-input); border-radius: 12px; overflow: hidden; margin-bottom: 15px; display: flex; align-items: center; justify-content: center; }
        .card-img { width: 100%; height: 100%; object-fit: contain; padding: 10px; transition: transform 0.5s, opacity 0.4s; opacity: 0; }
        .card-img.loaded { opacity: 1; }
        .card:hover .card-img { transform: scale(1.05); }

        .card-actions { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; z-index: 2; }
        .act-btn { background: var(--glass-bg); border: none; border-radius: 50%; width: 35px; height: 35px; font-size: 16px; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.15); color: var(--text-muted); transition: 0.3s; backdrop-filter: blur(4px); }
        .act-btn.active { color: var(--primary); }
        .act-btn.active-cmp { background: var(--dark); color: #fff; }
        .act-btn:active { transform: scale(0.8); }

        .verified-tag { position: absolute; top: 12px; left: 12px; background: var(--success); color: #fff; padding: 5px 10px; border-radius: 8px; font-size: 10px; font-weight: 800; z-index: 2; box-shadow: 0 2px 8px rgba(39,174,96,0.3); }

        .price-total { border-top: 1px solid var(--border); margin-top: auto; padding-top: 15px; display: flex; justify-content: space-between; align-items: center; }
        .card-terms { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 2px 0 12px; font-size: 11px; color: var(--text-muted); }
        .card-terms span { padding: 6px 8px; border-radius: 8px; background: var(--bg-input); line-height: 1.25; }
        .price-total small { display: block; margin-bottom: 3px; color: var(--text-muted); font-size: 11px; font-weight: 700; }
        .card-total-price { display: block; color: var(--primary); font-size: 21px; font-weight: 900; line-height: 1.1; }
        .card-daily-price { color: var(--text-muted); font-size: 11px; font-weight: 600; }
        .card-rating { margin: 0 0 9px; color: #b57900; font-size: 12px; font-weight: 800; }
        .availability-pill { display: flex; align-items: flex-start; gap: 8px; margin: 2px 0 12px; padding: 8px 9px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-input); color: var(--text-muted); font-size: 11px; line-height: 1.25; }
        .availability-pill > span { display: grid; flex: 0 0 auto; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: #8a8a8a; color: #fff; font-weight: 900; }
        .availability-pill b, .availability-pill small { display: block; }
        .availability-pill small { margin-top: 1px; color: inherit; }
        .availability-pill.available { border-color: rgba(39,174,96,.35); background: rgba(39,174,96,.08); color: #19703d; }
        .availability-pill.available > span { background: var(--success); }
        .availability-pill.unavailable { border-color: rgba(204,0,0,.3); background: rgba(204,0,0,.07); color: #a30000; }
        .availability-pill.unavailable > span { background: var(--primary); }
        .card-book-btn { width: 100%; margin-top: 14px; padding: 12px 14px; border: 0; border-radius: 10px; color: #fff; background: var(--primary); cursor: pointer; font: inherit; font-size: 13px; font-weight: 800; transition: background .2s, transform .2s; }
        .price-savings { margin-top: 10px; padding: 7px 9px; border-radius: 8px; color: #17663a; background: rgba(39,174,96,.1); font-size: 11px; font-weight: 800; }
        .catalog-load-error { grid-column: 1/-1; display: grid; gap: 10px; justify-items: center; padding: 56px 20px; color: var(--text-muted); text-align: center; }
        .catalog-load-error strong { color: var(--text-main); font-size: 18px; }
        .catalog-load-error button { padding: 10px 18px; border: 0; border-radius: 9px; color: #fff; background: var(--primary); cursor: pointer; font: inherit; font-weight: 800; }
        #offline-banner { position: fixed; top: 0; left: 50%; z-index: 1200; transform: translateX(-50%); width: min(92vw, 560px); padding: 9px 14px; border-radius: 0 0 10px 10px; color: #7a4b00; background: #fff3cd; box-shadow: var(--shadow); font-size: 12px; font-weight: 800; text-align: center; }
        .card-date-suggestion { width: 100%; margin-top: 10px; padding: 10px 12px; border: 1px solid rgba(204,0,0,.28); border-radius: 10px; color: #9f1d1d; background: #fff7f7; cursor: pointer; font: inherit; font-size: 12px; font-weight: 800; }
        .card-date-suggestion:hover { background: #feeaea; }
        .card-book-btn:hover { background: var(--primary-hover); transform: translateY(-1px); }
        .card-book-btn:disabled { color: var(--text-muted); background: var(--bg-input); cursor: not-allowed; }
        .price-total > div:nth-child(2) { display: none; }
        .price-breakdown { display: grid; gap: 7px; margin: -8px 0 16px; padding: 13px 15px; border: 1px solid var(--border); border-radius: 12px; color: var(--text-muted); font-size: 12px; background: var(--bg-card); }
        .price-breakdown div { display: flex; justify-content: space-between; gap: 14px; }
        .price-breakdown b { color: var(--text-main); white-space: nowrap; }
        .price-breakdown .deposit-note { padding-top: 9px; margin-top: 2px; border-top: 1px solid var(--border); }
        .checkout-assurance { margin: -6px 0 18px; color: var(--text-muted); font-size: 11px; line-height: 1.4; }
        .server-quote { margin: -7px 0 15px; color: var(--text-muted); font-size: 11px; line-height: 1.35; }
        .server-quote.ok { color: var(--success); font-weight: 800; }
        .server-quote.error { color: var(--primary); font-weight: 800; }
        .trust-panel { margin: 0 0 20px; padding: 15px; border: 1px solid rgba(39,174,96,.28); border-radius: 16px; background: linear-gradient(135deg, rgba(39,174,96,.09), var(--bg-card)); }
        .trust-panel-title { display: flex; align-items: center; gap: 9px; color: var(--text-main); }
        .trust-panel-title > span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: rgba(39,174,96,.15); }
        .trust-panel-title small { display: block; margin-top: 1px; color: var(--text-muted); font-size: 11px; }
        .trust-list { display: grid; gap: 10px; margin: 14px 0 0; padding: 0; list-style: none; }
        .trust-list li { display: flex; align-items: flex-start; gap: 9px; font-size: 12px; }
        .trust-list li > span { flex: 0 0 auto; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: #fff; background: var(--success); font-size: 11px; font-weight: 900; }
        .trust-list b { display: block; color: var(--text-main); }
        .trust-list small { display: block; margin-top: 1px; color: var(--text-muted); line-height: 1.3; }
        .partner-bookings { margin: 0 0 20px; padding: 15px; border: 1px solid rgba(204,0,0,.18); border-radius: 14px; background: linear-gradient(135deg, rgba(204,0,0,.06), var(--bg-card)); }
        .partner-bookings-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
        .partner-bookings-title small { display: block; margin-top: 2px; color: var(--text-muted); font-size: 11px; }
        .partner-bookings-title > span { color: var(--text-muted); font-size: 11px; text-align: right; }
        .partner-booking-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
        .partner-booking-row b, .partner-booking-row small { display: block; }
        .partner-booking-row small { margin-top: 2px; color: var(--text-muted); font-size: 11px; }
        .partner-booking-row a { flex: 0 0 auto; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; color: var(--primary); background: var(--bg-card); font-size: 12px; font-weight: 800; text-decoration: none; }

        /* Profile & Dashboards */
        .partner-switch-container { display: flex; background: var(--bg-input); border-radius: 12px; padding: 5px; margin-bottom: 25px; border: 1px solid var(--border); }
        .p-switch { flex: 1; text-align: center; padding: 10px; border-radius: 8px; font-weight: bold; cursor: pointer; color: var(--text-muted); transition: 0.3s; font-size: 14px; }
        .p-switch.active { background: var(--bg-card); color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

        .loyalty-badge { display: inline-flex; align-items: center; gap: 5px; background: rgba(254,187,2,0.15); color: var(--warning); padding: 5px 12px; border-radius: 12px; font-size: 12px; font-weight: 900; border: 1px solid rgba(254,187,2,0.3); margin-top: 5px; }

        .auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 20px; }
        .auth-pending-note { margin: 9px 0 0; color: var(--text-muted); font-size: 11px; line-height: 1.4; }
        .auth-btn { width: 100%; border: none; padding: 15px; border-radius: 12px; font-size: 14px; font-weight: bold; cursor: pointer; transition: 0.3s; display: flex; align-items: center; justify-content: center; gap: 10px; }
        .diia-btn { background: var(--dark); color: #fff; }
        .diia-btn.verified { background: var(--diia-bg); color: var(--diia-text); pointer-events: none; border: 1px solid var(--success); }
        .bankid-btn { background: var(--bankid-bg); color: var(--bankid-text); }

        .referral-card { background: linear-gradient(135deg, var(--primary), #ff4081); padding: 25px; border-radius: var(--radius); color: white; margin-bottom: 25px; position: relative; overflow: hidden; box-shadow: 0 10px 30px rgba(204,0,0,0.3); }
        .btn-qr { background: var(--primary-light); color: var(--primary); padding: 12px; border-radius: 12px; border: none; font-weight: bold; width: 100%; cursor: pointer; margin-top: 15px; transition: 0.3s; display: flex; justify-content: center; align-items: center; gap: 8px; }

        .crm-chart-container { display: flex; align-items: flex-end; gap: 5px; height: 60px; margin-top: 15px; padding-bottom: 5px; border-bottom: 1px solid var(--border); }
        .crm-bar { flex: 1; background: var(--primary-light); border-radius: 4px 4px 0 0; position: relative; transition: 0.3s; }
        .crm-bar:hover { background: var(--primary); }

        /* Modals & Booking */
        .modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 2000; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 15px; }
        .modal-body { background: var(--bg-modal); width: 100%; max-width: 1100px; max-height: 90vh; border-radius: 28px; display: flex; overflow: hidden; position: relative; box-shadow: 0 25px 50px rgba(0,0,0,0.4); transform: translateY(50px) scale(0.98); transition: transform 0.4s cubic-bezier(0.1, 0.9, 0.2, 1); }
        .modal.show { opacity: 1; } .modal.show .modal-body { transform: translateY(0) scale(1); }

        .m-left { flex: 1.4; padding: 40px; overflow-y: auto; border-right: 1px solid var(--border); scroll-behavior: smooth; }
        .m-right { flex: 1; padding: 40px; padding-bottom: 30px; background: var(--bg-input); overflow-y: auto; display: flex; flex-direction: column; position: relative; min-height: 0; }
        .btn-close { position: absolute; top: 15px; right: 20px; font-size: 32px; cursor: pointer; color: var(--text-muted); z-index: 100; transition: 0.3s; line-height: 1; }
        .btn-close:hover { color: var(--primary); }

        .swipe-gallery-wrapper { position: relative; height: 280px; margin-bottom: 20px; background: var(--bg-input); border-radius: 20px; overflow: hidden; border: 1px solid var(--border); }
        .swipe-gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; height: 100%; scroll-behavior: smooth; }
        .swipe-gallery::-webkit-scrollbar { display: none; }
        .swipe-gallery img { flex: 0 0 100%; height: 100%; object-fit: contain; scroll-snap-align: center; padding: 15px; pointer-events: none; opacity: 0; transition: opacity 0.4s; }
        .swipe-gallery img.loaded { opacity: 1; }
        .gallery-dots { display: flex; justify-content: center; gap: 6px; position: absolute; bottom: 15px; width: 100%; z-index: 10; pointer-events: none; }
        .gallery-dot { width: 8px; height: 8px; background: rgba(150,150,150,0.5); border-radius: 50%; transition: 0.3s; }
        .gallery-dot.active { background: var(--primary); width: 20px; border-radius: 4px; }

        .gal-arrow { position: absolute; top: 50%; transform: translateY(-50%); background: var(--glass-bg); border: 1px solid var(--border); color: var(--text-main); width: 35px; height: 35px; border-radius: 50%; cursor: pointer; display: none; align-items: center; justify-content: center; z-index: 20; box-shadow: 0 2px 8px rgba(0,0,0,0.1); font-weight: bold; }
        .gal-arrow:hover { background: var(--text-main); color: var(--bg-main); }
        .gal-arrow.left { left: 10px; } .gal-arrow.right { right: 10px; }
        @media (hover: hover) { .swipe-gallery-wrapper:hover .gal-arrow { display: flex; } }

        .weather-widget { background: var(--bg-card); border: 1px solid var(--border); padding: 10px 15px; border-radius: 12px; display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 15px; box-shadow: 0 2px 8px rgba(0,0,0,0.02); }
        .damage-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
        .damage-tag { background: #ffebee; color: #c0392b; padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: bold; border: 1px solid #fadbd8; }
        [data-theme="dark"] .damage-tag { background: rgba(204,0,0,0.2); border-color: rgba(204,0,0,0.3); color: #ff6b6b; }

        .btn-hold { position: relative; overflow: hidden; width: 100%; background: var(--primary); color: #fff; padding: 18px; border: none; border-radius: 16px; font-size: 16px; font-weight: 800; cursor: pointer; margin-top: 20px; margin-bottom: 20px; box-shadow: 0 8px 25px rgba(204,0,0,0.25); text-transform: uppercase; user-select: none; -webkit-user-select: none; touch-action: manipulation; display: flex; align-items: center; justify-content: center; text-align: center; min-height: 60px; }
        .btn-hold::before { content: ''; position: absolute; top: 0; left: 0; height: 100%; width: 0; background: rgba(0,0,0,0.2); transition: width 0s; z-index: 1; }
        .btn-hold.holding::before { width: 100%; transition: width 1.5s linear; }
        .btn-hold span { position: relative; z-index: 2; }
        .btn-hold:disabled { background: var(--text-muted); cursor: not-allowed; box-shadow: none; transform: none; }

        .btn-primary { width: 100%; background: var(--primary); color: #fff; padding: 18px; border: none; border-radius: 16px; font-size: 16px; font-weight: 800; cursor: pointer; transition: 0.3s; margin-top: auto; box-shadow: 0 8px 25px rgba(204,0,0,0.25); text-transform: uppercase; position: relative; overflow: hidden; }
        .btn-primary:active:not(:disabled) { transform: scale(0.96); }

        .success-overlay { position: absolute; inset: 0; background: var(--bg-modal); z-index: 100; display: none; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
        .checkmark-circle { width: 80px; height: 80px; border-radius: 50%; border: 4px solid var(--success); display: flex; align-items: center; justify-content: center; margin-bottom: 20px; animation: scaleUp 0.5s cubic-bezier(0.1, 0.9, 0.2, 1); }
        .checkmark-circle::after { content: '✓'; font-size: 40px; color: var(--success); }
        .btn-calendar { background: #4285F4; color: white; border: none; padding: 12px 20px; border-radius: 12px; font-weight: bold; cursor: pointer; margin-top: 20px; display: flex; align-items: center; gap: 8px; box-shadow: 0 4px 10px rgba(66, 133, 244, 0.3); }

        /* COMPARE MODAL */
        #compareModal .modal-body { max-width: 800px; padding: 30px; flex-direction: column; }
        .compare-table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 14px; }
        .compare-table th, .compare-table td { padding: 12px; border-bottom: 1px solid var(--border); text-align: center; width: 33%; }
        .compare-table th { color: var(--text-muted); font-weight: normal; text-align: left; width: 34%; }
        .compare-img { width: 100px; height: 60px; object-fit: contain; border-radius: 8px; background: var(--bg-input); }

        /* AI CHAT MODAL */
        #aiModal .modal-body { max-width: 450px; height: 60vh; flex-direction: column; padding: 0; border-radius: 24px; background: var(--bg-card); align-self: center; }
        .ai-header { background: var(--ai-grad); color: white; padding: 20px; font-weight: bold; display: flex; justify-content: space-between; align-items: center; }
        .ai-chat-area { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; background: var(--bg-input); }
        .ai-msg { background: var(--bg-card); color: var(--text-main); padding: 12px 16px; border-radius: 16px 16px 16px 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); max-width: 85%; font-size: 14px; border: 1px solid var(--border); }
        .ai-typing { display: flex; gap: 4px; padding: 5px; }
        .ai-typing span { width: 6px; height: 6px; background: #aaa; border-radius: 50%; animation: bounce 1.4s infinite ease-in-out both; }
        .ai-typing span:nth-child(1) { animation-delay: -0.32s; } .ai-typing span:nth-child(2) { animation-delay: -0.16s; }

        @keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
        .shake { animation: shake 0.3s ease-in-out; border-color: var(--primary) !important; color: var(--primary) !important; }
        @keyframes scaleUp { from { transform: scale(0); } to { transform: scale(1); } }

        #toast-box { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
        .toast { background: var(--text-main); color: var(--bg-main); padding: 14px 28px; border-radius: 30px; font-size: 14px; font-weight: bold; box-shadow: var(--shadow); animation: dropDown 0.3s cubic-bezier(0.1, 0.9, 0.2, 1); }
        @keyframes dropDown { from { transform: translateY(-30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

        .swipe-indicator { display: none; width: 40px; height: 5px; background: var(--border); border-radius: 3px; margin: 10px auto 20px; }

        /* Page Content Stylings */
        .text-content { line-height: 1.8; font-size: 16px; color: var(--text-muted); }
        .text-content h2 { color: var(--text-main); font-size: 28px; margin-bottom: 20px; border-bottom: 2px solid var(--primary); padding-bottom: 10px; display: inline-block;}
        .text-content h3 { color: var(--text-main); font-size: 20px; margin-top: 30px; }

        @media (max-width: 850px) {
            .journey-hero { display: block; padding: 23px 20px; margin-top: 0; }
            .journey-actions { grid-template-columns: 1fr; width: 100%; margin-top: 18px; }
            .journey-action { text-align: left; }
            .desktop-nav { display: none; }
            .mobile-nav { display: block; }
            .modal { align-items: flex-end; padding: 0; }
            .modal-body { flex-direction: column; border-radius: 28px 28px 0 0; max-height: 94vh; transform: translateY(100%); width: 100%; box-shadow: 0 -10px 40px rgba(0,0,0,0.2); }
            .modal.show .modal-body { transform: translateY(0); }
            .swipe-indicator { display: block; }
            .m-left { padding: 0 20px 20px; border-right: none; border-bottom: 1px solid var(--border); }
            .m-right { padding: 20px; background: var(--bg-modal); }
            .btn-close { display: none; }
            .btn-hold { position: sticky; bottom: 0; z-index: 10; margin-top: 20px; }
            #map { height: 300px; }
            .search-box { grid-template-columns: 1fr 1fr; }
            #f-search-group { grid-column: 1 / -1; }
            #filtersModal .modal-body { max-height: 85vh; padding: 25px; }
            #aiModal .modal-body { max-width: 100%; border-radius: 24px 24px 0 0; }
            .compare-bar { width: 95%; font-size: 13px; padding: 12px 20px; }
        }

/* Мобільне розширене меню */
.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}
.mobile-menu-item:last-child { border-bottom: none; }
.mobile-menu-item:active { background: var(--bg-input); }

/* Фіксована панель пошуку - прибираємо position:sticky на мобільному */
@media (max-width: 768px) {
    /* Прибираємо sticky з header та search на мобільному */
    header {
        position: relative !important;
        top: auto !important;
    }
    .search-container {
        position: relative !important;
        top: auto !important;
    }
    .search-filter-bar {
        position: relative !important;
        top: auto !important;
        z-index: auto !important;
    }
    .btn-hold {
        position: relative !important;
        bottom: auto !important;
    }
    
    /* Фільтри категорій - текст на кнопках */
    .filter-btn {
        color: var(--text-main) !important;
        background: var(--bg-card) !important;
    }
    .filter-btn.active {
        color: white !important;
        background: var(--primary) !important;
    }
}

/* Narrow phones: prevent two-column controls and cards from overflowing. */
@media (max-width: 480px) {
    body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
    header { padding-left: 12px; padding-right: 12px; }
    .top-bar { gap: 8px; }
    .header-actions { gap: 4px; min-width: 0; flex-shrink: 1; }
    .header-actions > * { flex-shrink: 1; }
    #user-badge { display: inline-block; max-width: 82px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 8px !important; padding-right: 8px !important; }
    .cars-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .card { min-width: 0; }
    .card-terms, .auth-grid { grid-template-columns: minmax(0, 1fr); }
    .search-box { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 12px; }
    #f-search-group { grid-column: auto; }
    .controls-bar { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
    .filter-btn { flex: 0 0 auto; }
    #m-rental-conditions { grid-template-columns: minmax(0, 1fr) !important; }
    #bookingModal [style*="grid-template-columns:1fr 1fr"],
    #addCarModal [style*="grid-template-columns:1fr 1fr"],
    #filtersModal [style*="grid-template-columns:1fr 1fr"] { grid-template-columns: minmax(0, 1fr) !important; }
    .m-left, .m-right { padding-left: 16px; padding-right: 16px; }
    .modal-body { max-height: 96vh; }
}

/* Telegram Web App can provide a dark text variable with a light form surface. */
body.is-tg-app .story-title {
    color: #1f2937 !important;
    text-shadow: 0 1px 0 rgba(255, 255, 255, .8);
}

body.is-tg-app .floating-input {
    color: #1f2937 !important;
    -webkit-text-fill-color: #1f2937;
    color-scheme: light;
}

body.is-tg-app .floating-input::placeholder {
    color: #6b7280;
}

/* Android WebView renders date/time parts separately from the input itself. */
body.is-tg-app input.floating-input[type="date"],
body.is-tg-app input.floating-input[type="time"] {
    color: #1f2937 !important;
    -webkit-text-fill-color: #1f2937 !important;
}

body.is-tg-app input.floating-input[type="date"]::-webkit-datetime-edit,
body.is-tg-app input.floating-input[type="date"]::-webkit-datetime-edit-fields-wrapper,
body.is-tg-app input.floating-input[type="date"]::-webkit-datetime-edit-text,
body.is-tg-app input.floating-input[type="date"]::-webkit-datetime-edit-month-field,
body.is-tg-app input.floating-input[type="date"]::-webkit-datetime-edit-day-field,
body.is-tg-app input.floating-input[type="date"]::-webkit-datetime-edit-year-field,
body.is-tg-app input.floating-input[type="time"]::-webkit-datetime-edit,
body.is-tg-app input.floating-input[type="time"]::-webkit-datetime-edit-fields-wrapper,
body.is-tg-app input.floating-input[type="time"]::-webkit-datetime-edit-text,
body.is-tg-app input.floating-input[type="time"]::-webkit-datetime-edit-hour-field,
body.is-tg-app input.floating-input[type="time"]::-webkit-datetime-edit-minute-field,
body.is-tg-app input.floating-input[type="time"]::-webkit-datetime-edit-ampm-field {
    color: #1f2937 !important;
    -webkit-text-fill-color: #1f2937 !important;
}

/* Telegram may expose a dark app palette while NextRent is displayed on a
   light surface. Keep all text and native controls readable in that case. */
body.is-tg-app {
    --bg-main: #f4f6f9 !important;
    --bg-card: #ffffff !important;
    --bg-modal: #ffffff !important;
    --bg-input: #f8fafc !important;
    --text-main: #111827 !important;
    --text-muted: #4b5563 !important;
    --border: #dbe1ea !important;
    color: #111827 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

body.is-tg-app input,
body.is-tg-app select,
body.is-tg-app textarea {
    color: #111827 !important;
    background-color: #f8fafc !important;
    -webkit-text-fill-color: #111827 !important;
    color-scheme: light !important;
}

body.is-tg-app .floating-label {
    color: #4b5563 !important;
}

body.is-tg-app .floating-input.has-value ~ .floating-label,
body.is-tg-app .floating-input:focus ~ .floating-label {
    color: #b91c1c !important;
}

body.is-tg-app input[type="date"]::-webkit-calendar-picker-indicator,
body.is-tg-app input[type="time"]::-webkit-calendar-picker-indicator {
    opacity: 1;
    filter: none;
}
