:root {
    --bg-deep: #0a0e17;
    --bg-card: #121820;
    --text: #f0f4ff;
    --text-muted: #7b8ba8;
    --neon-blue: #3b82f6;
    --neon-cyan: #22d3ee;
    --neon-glow: rgba(59, 130, 246, 0.45);
    --surface: rgba(18, 24, 32, 0.88);
    --surface-border: rgba(59, 130, 246, 0.22);
    --surface-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    --input-bg: rgba(18, 24, 32, 0.92);
    --input-border: rgba(59, 130, 246, 0.28);
    --tg-bg: var(--tg-theme-bg-color, var(--bg-deep));
    --tg-text: var(--tg-theme-text-color, var(--text));
    --tg-hint: var(--tg-theme-hint-color, var(--text-muted));
    --tg-link: var(--tg-theme-link-color, var(--neon-blue));
    --tg-btn: var(--tg-theme-button-color, #2563eb);
    --tg-btn-text: var(--tg-theme-button-text-color, #ffffff);
    --tg-secondary: var(--tg-theme-secondary-bg-color, var(--bg-card));
    --radius: 20px;
    --radius-sm: 14px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html[data-theme="light"] {
    --surface: #ffffff;
    --surface-border: rgba(15, 23, 42, 0.08);
    --surface-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --input-bg: #f8fafc;
    --input-border: rgba(15, 23, 42, 0.12);
    --neon-glow: rgba(37, 99, 235, 0.25);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    min-height: 100dvh;
    font-family: var(--font);
    background-color: #0a0e17;
    background: var(--tg-bg, #0a0e17);
    color: var(--tg-text);
    -webkit-font-smoothing: antialiased;
    overscroll-behavior: none;
    overscroll-behavior-y: none;
}

html.car-page,
body.car-page,
body.car-page.theme-light,
html.car-page[data-theme="light"] {
    background-color: #0a0e17 !important;
    background: #0a0e17 !important;
    color-scheme: dark;
}

#app[data-page="car"],
#app[data-page="car"] #state-car {
    min-height: 100dvh;
    background-color: #0a0e17;
    background:
        radial-gradient(circle at 15% 0%, rgba(59,130,246,0.16), transparent 42%),
        radial-gradient(circle at 85% 100%, rgba(34,211,238,0.1), transparent 38%),
        #0a0e17;
}

#app[data-page="car"] .logistics-sheet,
#app[data-page="car"] .notes-block,
#app[data-page="car"] .surface-card {
    background: linear-gradient(180deg, rgba(18,24,32,0.96), rgba(15,20,28,0.92));
    border-color: rgba(59, 130, 246, 0.22);
    color: #f0f4ff;
}

#app[data-page="car"] .sheet-label,
#app[data-page="car"] .car-eyebrow {
    color: #7b8ba8;
}

#app[data-page="car"] .sheet-value,
#app[data-page="car"] .logistics-sheet strong,
#app[data-page="car"] .vin-chip {
    color: #f0f4ff;
}

html[data-theme="dark"],
body.browser-mode {
    color-scheme: dark;
}

html[data-theme="light"],
body.theme-light {
    color-scheme: light;
}

body {
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

body.theme-dark,
body.browser-mode {
    background:
        radial-gradient(circle at 15% 0%, rgba(59,130,246,0.18), transparent 42%),
        radial-gradient(circle at 85% 100%, rgba(34,211,238,0.12), transparent 38%),
        var(--tg-bg);
}

body.theme-light {
    background:
        radial-gradient(circle at 10% -10%, rgba(59,130,246,0.08), transparent 40%),
        radial-gradient(circle at 90% 110%, rgba(14,165,233,0.08), transparent 35%),
        var(--tg-bg);
}

.hidden { display: none !important; }

#app { min-height: 100vh; position: relative; z-index: 1; }

.screen, .state-screen {
    min-height: 100vh;
    animation: fadeIn 0.45s ease;
}

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

.state-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    text-align: center;
    gap: 14px;
}

.surface-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    box-shadow: var(--surface-shadow);
}

.neon-card,
.surface-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    box-shadow: var(--surface-shadow);
}

html[data-theme="dark"] .neon-card,
html[data-theme="dark"] .surface-card,
body.browser-mode .neon-card,
body.browser-mode .surface-card {
    backdrop-filter: blur(14px);
}

.neon-frame {
    border-bottom: 1px solid var(--surface-border);
    box-shadow: var(--surface-shadow);
}

.neon-badge,
.status-badge {
    flex-shrink: 0;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.status-available {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-reserved {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.status-sold {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.status-archived {
    background: rgba(100, 116, 139, 0.15);
    color: #64748b;
    border: 1px solid rgba(100, 116, 139, 0.25);
}

html[data-theme="dark"] .status-available { color: #34d399; }
html[data-theme="dark"] .status-reserved { color: #fbbf24; }
html[data-theme="dark"] .status-sold { color: #f87171; }
html[data-theme="dark"] .status-archived { color: #94a3b8; }

.neon-btn {
    box-shadow: 0 12px 28px var(--neon-glow);
}

.neon-hero {
    padding: 36px 24px 18px;
    text-align: center;
}

.neon-hero h1 {
    margin: 0 0 8px;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

html[data-theme="dark"] .neon-hero h1,
body.browser-mode .neon-hero h1 {
    text-shadow: 0 0 24px rgba(59, 130, 246, 0.35);
}

.neon-hero p {
    margin: 0;
    color: var(--tg-hint);
    line-height: 1.5;
}

.preview-card {
    padding: 28px 24px;
    max-width: 360px;
    width: 100%;
}

.preview-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 16px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    font-size: 1.8rem;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-cyan));
    box-shadow: 0 16px 40px var(--neon-glow);
    color: #fff;
}

.preview-vin {
    display: block;
    margin: 16px 0;
}

.state-icon {
    width: 68px;
    height: 68px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    font-size: 1.6rem;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    box-shadow: var(--surface-shadow);
}

.state-icon.error {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    font-weight: 700;
}

.loader {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 3px solid rgba(59, 130, 246, 0.15);
    border-top-color: var(--neon-cyan);
    box-shadow: 0 0 20px var(--neon-glow);
    animation: spin 0.8s linear infinite;
}

.loader-stage {
    display: grid;
    place-items: center;
    gap: 18px;
    width: min(100%, 280px);
    padding: 28px 20px;
    text-align: center;
}

@property --progress {
    syntax: '<number>';
    inherits: false;
    initial-value: 12;
}

.loader-ring {
    --progress: 12;
    position: relative;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%, rgba(34, 211, 238, 0.18), transparent 58%),
        conic-gradient(from -90deg, #22d3ee calc(var(--progress) * 1%), rgba(59, 130, 246, 0.18) 0);
    box-shadow: 0 0 32px rgba(34, 211, 238, 0.28);
    animation: loaderPulse 1.1s ease-in-out infinite, loaderFill 1.6s ease-out forwards;
}

.loader-ring::before {
    content: '';
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    background: #0a0e17;
    border: 1px solid rgba(59, 130, 246, 0.22);
}

.loader-ring::after {
    content: '';
    position: absolute;
    inset: 28px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #3b82f6;
    border-right-color: #22d3ee;
    animation: spin 0.75s linear infinite;
}

.loader-label {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #e2e8f0;
    letter-spacing: 0.01em;
}

.loader-sub {
    margin: 0;
    font-size: 0.82rem;
    color: #7b8ba8;
}

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes loaderPulse {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.05);
        filter: brightness(1.14);
    }
}

@keyframes loaderFill {
    0% { --progress: 10; }
    35% { --progress: 48; }
    70% { --progress: 78; }
    100% { --progress: 92; }
}

#state-loading.state-screen {
    background:
        radial-gradient(circle at 50% 35%, rgba(59, 130, 246, 0.16), transparent 46%),
        #0a0e17;
    min-height: 100dvh;
}

.search-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 2px 0 6px;
}

.search-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, 0.28);
    background: rgba(59, 130, 246, 0.1);
    color: #93c5fd;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    background: linear-gradient(135deg, var(--tg-btn), #0ea5e9);
    color: var(--tg-btn-text);
    padding: 15px 24px;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 12px 28px var(--neon-glow);
}

.btn-primary:active {
    transform: scale(0.98);
}

.company-logo {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    object-fit: cover;
    margin-bottom: 12px;
    box-shadow: var(--surface-shadow);
    border: 1px solid var(--surface-border);
}

.search-form {
    padding: 0;
    display: grid;
    gap: 12px;
}

.search-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(env(safe-area-inset-top) + 18px) 18px calc(env(safe-area-inset-bottom) + 24px);
    background:
        radial-gradient(circle at 18% 12%, rgba(34, 211, 238, 0.14), transparent 34%),
        radial-gradient(circle at 86% 78%, rgba(59, 130, 246, 0.18), transparent 40%),
        linear-gradient(165deg, #070b14 0%, #0a0e17 48%, #0d1524 100%);
}

.search-shell {
    width: min(100%, 420px);
}

.search-card {
    position: relative;
    overflow: hidden;
    padding: 22px 20px 24px;
    border-radius: 28px;
    border: 1px solid var(--surface-border);
    background: var(--surface);
    box-shadow: var(--surface-shadow);
}

.search-card-brand {
    animation: searchCardIn 0.55s ease-out both;
}

.search-card-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    pointer-events: none;
    opacity: 0.7;
}

.search-card-orb-a {
    width: 140px;
    height: 140px;
    top: -48px;
    right: -36px;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.28), transparent 70%);
    animation: orbFloat 5.5s ease-in-out infinite;
}

.search-card-orb-b {
    width: 120px;
    height: 120px;
    left: -40px;
    bottom: -50px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.26), transparent 70%);
    animation: orbFloat 6.5s ease-in-out infinite reverse;
}

@keyframes searchCardIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes orbFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.search-card-glow {
    position: absolute;
    inset: -40% auto auto 50%;
    width: 280px;
    height: 280px;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(59,130,246,0.22), transparent 68%);
    pointer-events: none;
}

.search-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    position: relative;
    z-index: 1;
}

.search-brand-mark {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    background: linear-gradient(145deg, #2563eb, #0ea5e9);
    border: 1px solid rgba(29, 78, 216, 0.55);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
}

.search-brand-mark-text {
    font-family: "Outfit", var(--font);
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 0.04em;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
}

.search-kicker {
    margin: 0 0 8px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #67e8f9;
}

.search-card-body {
    position: relative;
    z-index: 1;
}

.search-card-body h1,
.brand-title {
    margin: 0 0 8px;
    font-family: "Outfit", var(--font);
    font-size: clamp(1.85rem, 7vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.08;
    color: #f8fafc;
    background: linear-gradient(120deg, #f8fafc 10%, #67e8f9 55%, #60a5fa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.search-subtitle {
    margin: 0 0 20px;
    color: #cbd5e1;
    line-height: 1.55;
    font-size: 0.95rem;
    font-weight: 500;
}

.search-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    min-height: 56px;
    border-radius: 18px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input-wrap:focus-within {
    border-color: rgba(59, 130, 246, 0.55);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.search-input-icon {
    font-size: 1.05rem;
    opacity: 0.85;
    flex-shrink: 0;
}

.search-form input {
    width: 100%;
    padding: 16px 0;
    border: 0;
    background: transparent;
    color: var(--tg-text);
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    box-shadow: none;
}

.search-form input:focus {
    outline: none;
    box-shadow: none;
}

.search-form input::placeholder {
    color: var(--tg-hint);
    text-transform: none;
    letter-spacing: normal;
}

.search-tip {
    margin: 0;
    text-align: center;
    color: var(--tg-hint);
    font-size: 0.82rem;
}

.search-submit-btn {
    width: 100%;
}

body.telegram-mode .search-submit-btn,
body.telegram-mode .admin-login-submit {
    display: none !important;
}

body.telegram-mode .search-screen {
    padding-bottom: calc(env(safe-area-inset-bottom) + 12px);
}

html[data-theme="light"] .search-card {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.1);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .search-card-glow,
html[data-theme="light"] .search-card-orb {
    opacity: 0.35;
}

html[data-theme="light"] .search-brand-mark {
    background: linear-gradient(145deg, #1d4ed8, #2563eb);
    border-color: #1e40af;
}

html[data-theme="light"] .search-brand-mark-text {
    color: #ffffff;
    text-shadow: none;
}

html[data-theme="light"] .search-kicker {
    color: #1d4ed8;
}

html[data-theme="light"] .search-card-body h1,
html[data-theme="light"] .brand-title {
    color: #0f172a;
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    -webkit-text-fill-color: #0f172a;
}

html[data-theme="light"] .search-subtitle {
    color: #334155;
}

html[data-theme="light"] .search-input-wrap {
    background: #f8fafc;
    border-color: rgba(15, 23, 42, 0.16);
}

html[data-theme="light"] .search-form input {
    color: #0f172a;
}

html[data-theme="light"] .search-form input::placeholder {
    color: #64748b;
}

html[data-theme="dark"] .search-card-body h1,
html[data-theme="dark"] .brand-title,
body.browser-mode .search-card-body h1,
body.browser-mode .brand-title {
    filter: drop-shadow(0 0 18px rgba(59, 130, 246, 0.25));
}

html[data-theme="dark"] .search-subtitle,
body.browser-mode .search-subtitle {
    color: #cbd5e1;
}

/* Car detail page */
.car-hero {
    position: relative;
}

.page-back-btn {
    position: absolute;
    top: max(12px, env(safe-area-inset-top));
    left: 12px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 40px;
    padding: 8px 14px;
    border: 0;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.page-back-btn:active {
    transform: scale(0.98);
    opacity: 0.92;
}

.gallery-wrap {
    position: relative;
    background: #121820;
    overflow: hidden;
    border-radius: 0 0 32px 32px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.gallery-wrap::after {
    content: '';
    position: absolute;
    inset: auto 0 0;
    height: 42%;
    background: linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.55));
    pointer-events: none;
    z-index: 1;
}

.gallery-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    background: #121820;
}

.gallery-track::-webkit-scrollbar { display: none; }

.gallery-slide {
    flex: 0 0 100%;
    scroll-snap-align: center;
    aspect-ratio: 16 / 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(110deg, #121820 25%, #1a2332 40%, #121820 55%);
    background-size: 200% 100%;
}

.gallery-slide.is-loading {
    animation: galleryPulse 1.1s ease infinite;
}

.gallery-slide.is-ready {
    animation: none;
    background: #0f172a;
}

@keyframes galleryPulse {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    opacity: 1;
    background: #0f172a;
}

.gallery-slide.is-loading img[src^="data:"] {
    opacity: 0;
}

.gallery-empty {
    aspect-ratio: 16 / 10;
    display: grid;
    place-items: center;
    color: var(--tg-hint);
    font-size: 1rem;
    background: #121820;
}

.gallery-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 14px 0 6px;
}

.gallery-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--tg-hint);
    opacity: 0.35;
    transition: 0.25s;
}

.gallery-dot.active {
    width: 24px;
    border-radius: 999px;
    opacity: 1;
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-cyan));
    box-shadow: 0 0 12px var(--neon-glow);
}

.gallery-counter {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 7px 13px;
    border-radius: 999px;
    background: rgba(0,0,0,0.58);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.12);
}

.car-content {
    padding: 20px 18px 32px;
    display: grid;
    gap: 16px;
    max-width: 640px;
    margin: 0 auto;
}

.car-hero-meta {
    display: grid;
    gap: 10px;
    padding: 4px 2px 2px;
    animation: fadeIn 0.5s ease;
}

.car-eyebrow {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--tg-hint);
}

.car-hero-meta h1 {
    margin: 0;
    font-size: 1.85rem;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--tg-text), var(--neon-blue));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

html[data-theme="light"] .car-hero-meta h1 {
    background: linear-gradient(135deg, #0f172a, #2563eb);
    -webkit-background-clip: text;
    background-clip: text;
}

.vin-chip {
    width: fit-content;
    max-width: 100%;
    box-shadow: 0 10px 24px rgba(59, 130, 246, 0.14);
}

.wow-card {
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.55s ease;
}

.wow-card::before {
    content: '';
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-cyan));
}

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

.car-head h1 {
    margin: 0;
    font-size: 1.55rem;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.vin-code {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: 14px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.18);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--tg-link);
    letter-spacing: 0.08em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

html[data-theme="dark"] .vin-code,
body.browser-mode .vin-code {
    color: var(--neon-cyan);
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.info-item {
    padding: 16px;
    display: grid;
    gap: 8px;
    min-width: 0;
}

.info-item span {
    display: block;
    font-size: 0.74rem;
    color: var(--tg-hint);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.info-item strong {
    font-size: 0.98rem;
    font-weight: 700;
    word-break: break-word;
    color: var(--tg-text);
    line-height: 1.35;
}

.info-item.phone-item strong {
    color: var(--tg-link);
}

.notes-block {
    padding: 18px;
}

.notes-block h3 {
    margin: 0 0 10px;
    font-size: 0.78rem;
    color: var(--tg-hint);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}

.notes-block p {
    margin: 0;
    line-height: 1.6;
    white-space: pre-wrap;
    color: var(--tg-text);
}

.contact-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
}

.contact-card .contact-label {
    font-size: 0.74rem;
    color: var(--tg-hint);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.contact-card .contact-value {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--tg-link);
}

@media (max-width: 380px) {
    .info-grid { grid-template-columns: 1fr; }
    .car-head h1 { font-size: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
    .screen, .state-screen { animation: none; }
}

.logistics-sheet {
    padding: 20px 18px 16px;
    display: grid;
    gap: 0;
    content-visibility: auto;
}

.sheet-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--surface-border);
    animation: fadeIn 0.45s ease backwards;
}

.sheet-row:nth-child(1) { animation-delay: 0.05s; }
.sheet-row:nth-child(2) { animation-delay: 0.12s; }
.sheet-row:nth-child(3) { animation-delay: 0.18s; }

.sheet-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.84rem;
    color: var(--tg-hint);
    flex-shrink: 0;
    font-weight: 600;
}

.sheet-icon {
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.1);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.sheet-row strong,
.sheet-value {
    font-size: 1rem;
    font-weight: 800;
    text-align: right;
    word-break: break-word;
    color: var(--tg-text);
}

.upload-type-value {
    padding: 6px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(34, 211, 238, 0.12));
    border: 1px solid rgba(59, 130, 246, 0.18);
    color: var(--tg-link);
}

.upload-display {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
    max-width: 100%;
}

.sheet-row-upload {
    align-items: flex-start;
}

.sheet-icon-upload {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.16), rgba(59, 130, 246, 0.14));
}

.upload-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    animation: fadeIn 0.45s ease backwards;
}

.upload-chip-type {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(34, 211, 238, 0.16));
    border: 1px solid rgba(59, 130, 246, 0.22);
    color: var(--tg-link);
}

.upload-chip-number {
    background: rgba(15, 23, 42, 0.04);
    border: 1px dashed rgba(59, 130, 246, 0.28);
    color: var(--tg-text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 0.04em;
}

.upload-chip-date {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.14), rgba(16, 185, 129, 0.12));
    border: 1px solid rgba(34, 197, 94, 0.22);
    color: #15803d;
}

html[data-theme="dark"] .upload-chip-type,
body.browser-mode .upload-chip-type {
    color: var(--neon-cyan);
}

html[data-theme="dark"] .upload-chip-number,
body.browser-mode .upload-chip-number {
    background: rgba(255, 255, 255, 0.05);
    color: var(--tg-text);
}

html[data-theme="dark"] .upload-chip-date,
body.browser-mode .upload-chip-date {
    color: #6ee7b7;
}

html[data-theme="dark"] .upload-type-value,
body.browser-mode .upload-type-value {
    color: var(--neon-cyan);
}

.notes-block.wow-card {
    padding: 18px;
}

.sheet-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

html[data-theme="light"] .logistics-sheet {
    background: linear-gradient(180deg, #ffffff, #f8fafc);
}

html[data-theme="dark"] .logistics-sheet,
body.browser-mode .logistics-sheet {
    background: linear-gradient(180deg, rgba(18,24,32,0.95), rgba(15,20,28,0.88));
}

/* Admin entry + login + mobile panel */
.admin-entry-btn {
    position: relative;
    isolation: isolate;
    min-width: 88px;
    min-height: 64px;
    padding: 8px 12px 9px;
    border: 1px solid rgba(59, 130, 246, 0.42);
    border-radius: 18px;
    background:
        linear-gradient(155deg, rgba(37, 99, 235, 0.34) 0%, rgba(14, 165, 233, 0.16) 55%, rgba(15, 23, 42, 0.35) 100%);
    box-shadow:
        0 12px 28px rgba(37, 99, 235, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 6px;
    cursor: pointer;
    color: #bfdbfe;
    flex-shrink: 0;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.admin-entry-btn::before {
    content: '';
    position: absolute;
    inset: -40% auto auto -30%;
    width: 70%;
    height: 90%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 70%);
    transform: rotate(18deg);
    pointer-events: none;
    z-index: 0;
    animation: adminShine 3.2s ease-in-out infinite;
}

.admin-entry-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.35);
    animation: adminPulse 2.4s ease-out infinite;
    pointer-events: none;
    z-index: 0;
}

.admin-entry-btn:active {
    transform: scale(0.95);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.22);
}

.admin-entry-icon {
    position: relative;
    z-index: 1;
    width: 30px;
    height: 30px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(59, 130, 246, 0.2));
    border: 1px solid rgba(191, 219, 254, 0.35);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

.admin-entry-btn svg {
    width: 18px;
    height: 18px;
    fill: #e0f2fe;
}

.admin-entry-label {
    position: relative;
    z-index: 1;
    font-family: "Outfit", var(--font);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: none;
    color: #f8fafc;
    line-height: 1;
    text-shadow: 0 1px 8px rgba(37, 99, 235, 0.45);
}

@keyframes adminPulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.35); }
    70% { box-shadow: 0 0 0 10px rgba(34, 211, 238, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); }
}

@keyframes adminShine {
    0%, 100% { opacity: 0.45; transform: translateX(0) rotate(18deg); }
    50% { opacity: 0.85; transform: translateX(18px) rotate(18deg); }
}

html[data-theme="light"] .admin-entry-btn {
    background: linear-gradient(155deg, #dbeafe 0%, #eff6ff 55%, #f8fafc 100%);
    border-color: rgba(37, 99, 235, 0.28);
    color: #1d4ed8;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.16);
}

html[data-theme="light"] .admin-entry-icon {
    background: linear-gradient(145deg, #ffffff, #dbeafe);
    border-color: rgba(37, 99, 235, 0.22);
}

html[data-theme="light"] .admin-entry-btn svg {
    fill: #2563eb;
}

html[data-theme="light"] .admin-entry-label {
    color: #1e3a8a;
    text-shadow: none;
}

.admin-login-shell {
    min-height: 100vh;
    padding: calc(env(safe-area-inset-top) + 20px) 20px 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-login-back {
    align-self: flex-start;
    border: 0;
    background: transparent;
    color: var(--tg-link);
    font-weight: 700;
    padding: 8px 0;
}

.admin-login-card {
    margin-top: 8px;
    padding: 24px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--surface-border);
    background: var(--surface);
    box-shadow: var(--surface-shadow);
}

.admin-login-brand {
    text-align: center;
    margin-bottom: 22px;
}

.admin-login-glow {
    width: 72px;
    height: 72px;
    margin: 0 auto 14px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    font-size: 2rem;
    background: linear-gradient(135deg, rgba(59,130,246,0.25), rgba(34,211,238,0.18));
    box-shadow: 0 0 30px rgba(59,130,246,0.25);
}

.admin-login-brand h2 {
    margin: 0 0 8px;
    font-size: 1.45rem;
}

.admin-login-brand p {
    margin: 0;
    color: var(--tg-hint);
}

.admin-login-form {
    display: grid;
    gap: 14px;
}

.admin-field {
    display: grid;
    gap: 8px;
}

.admin-field span {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--tg-hint);
}

.admin-field input {
    width: 100%;
    min-height: 48px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--tg-text);
    padding: 0 14px;
    font-size: 1rem;
}

.admin-remember {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--tg-hint);
    font-size: 0.9rem;
}

.admin-login-error {
    margin: 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.28);
    color: #fecaca;
    font-size: 0.88rem;
}

.admin-login-form.is-loading .admin-login-submit {
    opacity: 0.7;
    pointer-events: none;
}

.admin-mobile-app {
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
    padding: calc(env(safe-area-inset-top) + 12px) 16px calc(env(safe-area-inset-bottom) + 20px);
    display: grid;
    gap: 16px;
    box-sizing: border-box;
}

.admin-mobile-app *,
.admin-mobile-app *::before,
.admin-mobile-app *::after {
    box-sizing: border-box;
}

.admin-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--surface-border);
    background: var(--surface);
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.admin-mobile-user {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.admin-mobile-header h1 {
    margin: 0;
    font-size: clamp(1rem, 4.5vw, 1.15rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-mobile-avatar {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #3b82f6);
}

.admin-mobile-kicker {
    margin: 0 0 4px;
    font-size: 0.78rem;
    color: var(--tg-hint);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.admin-logout-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(239, 68, 68, 0.28);
    background: rgba(239, 68, 68, 0.12);
    color: #fecaca;
    font-size: 1.1rem;
}

.admin-mobile-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    max-width: 100%;
}

.admin-stat-card {
    padding: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--surface-border);
    background: var(--surface);
    display: grid;
    gap: 4px;
    text-align: center;
    min-width: 0;
}

.admin-stat-card span {
    font-size: 1.2rem;
}

.admin-stat-card strong {
    font-size: clamp(1.25rem, 5vw, 1.5rem);
}

.admin-stat-card small {
    color: var(--tg-hint);
    font-size: 0.82rem;
}

.admin-mobile-menu {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    max-width: 100%;
}

.admin-menu-tile {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: start;
    align-content: start;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 108px;
    padding: 16px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--surface-border);
    background: var(--surface);
    color: var(--tg-text);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-menu-tile:active {
    transform: scale(0.98);
}

.admin-menu-tile-accent {
    border-color: rgba(59, 130, 246, 0.35);
    background: linear-gradient(135deg, rgba(59,130,246,0.16), rgba(34,211,238,0.1));
}

.admin-menu-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(59, 130, 246, 0.12);
    font-size: 1.2rem;
}

.admin-menu-label {
    font-weight: 800;
    font-size: clamp(0.9rem, 3.8vw, 1rem);
    line-height: 1.25;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
}

.admin-menu-arrow {
    display: none;
}

.admin-mobile-footer {
    margin-top: 4px;
    width: 100%;
}

.admin-mobile-footer .btn-ghost {
    width: 100%;
    min-height: 48px;
}

@media (max-width: 430px) {
    .admin-mobile-app {
        padding-left: 12px;
        padding-right: 12px;
    }

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

    .admin-login-shell {
        padding-left: 14px;
        padding-right: 14px;
    }

    .admin-login-card {
        padding: 20px 16px;
    }

    .admin-login-form .field input,
    .admin-login-form .field textarea {
        font-size: 16px;
        width: 100%;
    }

    .admin-login-submit {
        width: 100%;
        min-height: 48px;
    }
}

@media (max-width: 360px) {
    .admin-mobile-header {
        padding: 14px;
    }

    .admin-mobile-avatar {
        width: 46px;
        height: 46px;
    }
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--surface-border);
    color: var(--tg-link);
    text-decoration: none;
    font-weight: 700;
    width: 100%;
}
