﻿/* MV Agusta Moto Club — Website Styles */
/* Light theme only */

/* ─── Self-hosted fonts (работают без Google Fonts) ─── */
@font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('vendor/fonts/spacegrotesk-var.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0400-04FF;
}
@font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('vendor/fonts/spacegrotesk-latin.woff2') format('woff2');
}
@font-face {
    font-family: 'Space Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('vendor/fonts/spacemono-regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Space Mono';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('vendor/fonts/spacemono-bold.woff2') format('woff2');
}
@font-face {
    font-family: 'Space Mono';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('vendor/fonts/spacemono-italic.woff2') format('woff2');
}

:root {
    --bg-color:      #f2f2f2;
    --card-bg:       #ffffff;
    --secondary-bg:  #e8e8e8;
    --item-bg:       #f7f7f7;

    --text-color:    #111111;
    --hint-color:    #888888;
    --silver:        #666666;

    --accent:        #111111;
    --accent-dim:    #444444;

    --button-color:  #111111;
    --button-text:   #ffffff;

    --danger:        #E53935;
    --success:       #43A047;
    --warning:       #F9A825;

    --border:        #dddddd;
    --border-light:  #cccccc;

    --card-radius:   12px;
    --header-height: 56px;
    --nav-height:    48px;
    --max-width:     1100px;
}

/* Leaflet stays readable */
.leaflet-popup-content-wrapper { background: #ffffff; color: #111111; border-color: #dddddd; }
.leaflet-popup-tip { background: #ffffff; }

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scrollbar-gutter: stable;
    scrollbar-width: none; /* Firefox */
    overscroll-behavior: none;
    scroll-behavior: auto;
}
html::-webkit-scrollbar { width: 0; background: transparent; } /* Chrome/Safari */

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip; /* clip не ломает position:fixed в отличие от hidden */
}

/* ─── Screen transitions ─── */
@keyframes screenFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.screen-enter {
    animation: screenFadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ─── Landing Screen ─── */
.landing-screen {
    background-color: #f7f7f7;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.78' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 200px 200px;
    color: #111;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Hero */
.landing-hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px 24px 48px;
    position: relative;
}

.landing-hero-inner {
    max-width: 480px;
    width: 100%;
    animation: lnd-enter 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes lnd-enter {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.landing-gear {
    position: absolute;
    right: -120px;
    top: -12%;
    transform: translateY(-50%);
    width: 902px;
    height: 902px;
    opacity: 0.15;
    filter: brightness(0);
    animation: logo-float 5s ease-in-out infinite;
    pointer-events: none;
}

.landing-gear img {
    width: 100%;
    height: auto;
    display: block;
}

@media (max-width: 720px) {
    .landing-gear { right: -240px; width: 624px; height: 624px; top: 2%; filter: brightness(0); opacity: 0.15; }
}

@keyframes logo-float {
    0%, 100% {
        transform: translateY(0px);
        filter: brightness(0) drop-shadow(0 0 12px rgba(0,0,0,0.1));
    }
    50% {
        transform: translateY(-8px);
        filter: brightness(0) drop-shadow(0 6px 20px rgba(0,0,0,0.18));
    }
}

.landing-scroll-hint {
    position: absolute;
    bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    cursor: pointer;
    animation: arrow-drop 2s ease-in-out infinite;
    will-change: transform, opacity;
    color: #555;
    transition: color 0.2s, opacity 0.4s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.landing-scroll-hint:hover { color: #aaa; }
.landing-scroll-hint svg { width: 36px; height: 36px; display: block; }
.landing-scroll-hint span {
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #666;
}

@keyframes arrow-drop {
    0%, 100% { transform: translateX(-50%) translateY(0);    opacity: 0.6; }
    50%       { transform: translateX(-50%) translateY(8px);  opacity: 1; }
}

.landing-label {
    font-size: 11px;
    letter-spacing: 4px;
    color: #555;
    text-transform: uppercase;
    margin: 0 0 32px;
}

.landing-title {
    font-size: clamp(48px, 10vw, 80px);
    font-weight: 800;
    letter-spacing: -1px;
    margin: 0 0 20px;
    line-height: 1;
    color: #111;
}

.landing-tagline {
    font-size: 15px;
    color: #555;
    margin: 0 0 16px;
}

.landing-hero-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.landing-btn-primary {
    background: #111111;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 13px 28px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    letter-spacing: 0.2px;
}
.landing-btn-primary:hover { opacity: 0.85; }

/* Hero stats */
.landing-hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 28px;
}
.landing-hero-stats span {
    font-size: 11px;
    color: #999;
    font-family: 'Space Mono', monospace;
    letter-spacing: 0.04em;
}
.lhs-sep { color: #ccc !important; }

/* ── Hero kinetic intro ── */
.landing-label,
.landing-title,
.landing-tagline,
.landing-hero-btns,
.landing-hero-stats {
    opacity: 0;
    transform: translateY(18px);
}
.landing-label     { transition: opacity 0.6s ease 0.05s, transform 0.6s ease 0.05s; }
.landing-title     { transition: opacity 0.7s ease 0.18s, transform 0.7s ease 0.18s; }
.landing-tagline   { transition: opacity 0.6s ease 0.32s, transform 0.6s ease 0.32s; }
.landing-hero-btns { transition: opacity 0.6s ease 0.46s, transform 0.6s ease 0.46s; }
.landing-hero-stats{ transition: opacity 0.6s ease 0.60s, transform 0.6s ease 0.60s; }
.landing-label.hero-in,
.landing-title.hero-in,
.landing-tagline.hero-in,
.landing-hero-btns.hero-in,
.landing-hero-stats.hero-in { opacity: 1; transform: translateY(0); }

/* ── Sticky CTA ── */
.sticky-cta {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 300;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}
.sticky-cta.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.sticky-cta button {
    background: #111111;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 13px 26px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    transition: opacity 0.2s, box-shadow 0.2s;
}
.sticky-cta button:hover  { opacity: 0.85; box-shadow: 0 6px 28px rgba(0,0,0,0.22); }
.sticky-cta button:active { opacity: 0.75; }
@media (max-width: 720px) {
    .sticky-cta { right: 20px; bottom: 28px; }
}



/* Social proof marquee */
.landing-marquee {
    overflow: hidden;
    border-top: 1px solid #e8e8e8;
    border-bottom: 1px solid #e8e8e8;
    padding: 13px 0;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
}
.landing-marquee-track {
    display: inline-flex;
    align-items: center;
    gap: 24px;
    animation: lmq-scroll 48s linear infinite;
    white-space: nowrap;
}
.landing-marquee-track span {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #aaa;
    font-family: 'Space Grotesk', sans-serif;
}
.lmq-sep { color: #ddd !important; font-weight: 400 !important; letter-spacing: 0 !important; }
@keyframes lmq-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-25%); }
}
@media (prefers-reduced-motion: reduce) {
    .landing-marquee-track { animation: none; }
}

.landing-btn-secondary {
    background: transparent;
    color: #111111;
    border: 1px solid #cccccc;
    border-radius: 8px;
    padding: 13px 28px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s;
}
.landing-btn-secondary:hover { border-color: #888; }

/* ─── Bento Grid ─── */
.landing-features {
    padding: 0 24px 80px;
    max-width: 960px;
    margin: 0 auto;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: minmax(200px, auto) 310px;
    gap: 10px;
}

.bento-card {
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 18px;
    padding: 22px;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease, border-color 0.3s;
    will-change: transform;
}
.bento-card.in-view { opacity: 1; transform: translateY(0); }
.bento-card:hover { border-color: #cccccc; }

.bento-num {
    display: block;
    font-size: 10px;
    color: #cccccc;
    letter-spacing: 2px;
    font-weight: 700;
    margin-bottom: 6px;
    font-family: 'Space Mono', monospace;
}
.bento-card h3 {
    font-size: 15px;
    font-weight: 700;
    color: #111111;
    margin: 0 0 6px;
}
.bento-card > p {
    font-size: 12px;
    color: #888888;
    margin: 0;
    line-height: 1.5;
}

/* Grid positions */
.bento-garage { grid-column: 1; grid-row: 1; }
/* collapse delay: content fades first, then card shrinks */
.bento-forum  { grid-column: 2; grid-row: 1; transition: opacity 0.6s ease, transform 0.6s ease, border-color 0.3s, min-height 0.45s ease 0.3s; }
.bento-forum.bforum-expanded  { min-height: 430px; transition: opacity 0.6s ease, transform 0.6s ease, border-color 0.3s, min-height 0.45s ease; }
.bento-market { grid-column: 3; grid-row: 1; transition: opacity 0.6s ease, transform 0.6s ease, border-color 0.3s, min-height 0.45s ease 0.5s; }
.bento-market.bmarket-expanded { min-height: 430px; transition: opacity 0.6s ease, transform 0.6s ease, border-color 0.3s, min-height 0.45s ease; }
.bento-map    { grid-column: 4; grid-row: 1; transition: opacity 0.6s ease, transform 0.6s ease, border-color 0.3s, min-height 0.45s ease 0.5s; }
.bento-map.bmap-expanded    { min-height: 430px; transition: opacity 0.6s ease, transform 0.6s ease, border-color 0.3s, min-height 0.45s ease; }
.bento-ai     { grid-column: 1 / -1; grid-row: 2; }

/* Compact messages in expanded forum feed */
.bfeed-expanded .bfmsg { height: 40px; padding: 4px 10px; }

/* ── 01 Garage ── */
.bento-garage {
    overflow: visible;
}
/* Spacer pushes dropdown to the card's visual bottom.
   height = row_height - padding(44px) - text_content(~60px) */
.garage-spacer {
    height: 96px; /* desktop: 200 - 44 - 60 */
    pointer-events: none;
}
/* Fixed-height layer — bike + ODO stay pinned to card top regardless of expansion */
.garage-static {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 200px; /* matches desktop grid row */
    pointer-events: none;
}
@media (max-width: 720px) { .garage-static { height: 240px; } }
@media (max-width: 480px) { .garage-static { height: 180px; } }

.bento-garage-visual {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 145px;
    pointer-events: none;
}
.bento-garage-bike {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    width: 100%; height: 100%;
    color: #000000;
    opacity: 0.1;
    transition: opacity 0.4s;
}
/* ODO */
.garage-odo {
    position: absolute;
    bottom: 18px; left: 16px;
}
.garage-odo-lbl {
    font-size: 8px;
    letter-spacing: 0.2em;
    color: #aaaaaa;
    font-weight: 700;
    margin-bottom: 5px;
    font-family: 'Space Mono', monospace;
}
.garage-odo-val {
    font-family: 'Space Mono', monospace;
    font-size: 20px;
    font-weight: 600;
    color: #111111;
    letter-spacing: 0.04em;
    display: flex;
    align-items: baseline;
    line-height: 1;
}
.od { display: inline-block; }
.od-unit { font-size: 9px; color: #aaaaaa; letter-spacing: 0.18em; margin-left: 3px; align-self: flex-end; margin-bottom: 2px; }
.od-sep { width: 0.35em; }
@keyframes od-roll {
    0%   { transform: translateY(35%); opacity: 0; }
    100% { transform: translateY(0);   opacity: 1; }
}
.od.od-anim { animation: od-roll 0.18s ease forwards; }

/* Maintenance dropdown — in flex flow, appears below card */
.garage-reglament {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 18px 18px;
    margin: 0 -22px -22px;
    transition: max-height 0.5s ease, opacity 0.35s ease;
}
.garage-reglament-inner {
    padding: 10px 22px 12px;
}
@media (hover: hover) {
    .bento-garage:hover .garage-reglament {
        max-height: 300px;
        opacity: 1;
    }
    .bento-garage:hover .bento-garage-bike { opacity: 0.03; }
}
.bento-garage.garage-open .garage-reglament {
    max-height: 300px;
    opacity: 1;
}
.bento-garage.garage-open .bento-garage-bike { opacity: 0.03; }
.garage-reg-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid #e8e8e8;
    font-size: 11px;
}
.garage-reg-item:last-of-type { border-bottom: none; }
.greg-name { flex: 1; color: #444444; }
.greg-status { font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.greg-s-ok   { color: #2e7d32; }
.greg-s-warn { color: #c47700; }
.greg-s-crit { color: #c62828; }
.greg-s-plan { color: #999999; }

/* Indicator dots */
.greg-dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}
.greg-warn-dot {
    background: #8B6400;
    box-shadow: 0 0 5px rgba(139,100,0,0.7);
    animation: greg-pulse 1.8s ease-in-out infinite;
}
.greg-crit-dot {
    background: #8B1414;
    box-shadow: 0 0 5px rgba(139,20,20,0.7);
    animation: greg-pulse 1.4s ease-in-out infinite;
}
.greg-dim-dot  { background: #cccccc; }
.greg-plan-dot { background: #bbbbbb; }
@keyframes greg-pulse {
    0%, 100% { opacity: 0.55; transform: scale(1); }
    50%       { opacity: 1;    transform: scale(1.5); }
}
.garage-reg-footer {
    font-size: 7px;
    letter-spacing: 0.14em;
    color: #bbbbbb;
    text-align: center;
    padding-top: 8px;
    font-weight: 700;
    font-family: 'Space Mono', monospace;
}

/* ── 03 AI-Mechanic (Dual Core, full-width) ── */
.bento-ai { background: #fafafa; padding: 0; }
.bento-ai-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}

/* Central gradient divider */
.bento-ai-divider {
    position: absolute;
    top: 0; bottom: 88px;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    background: linear-gradient(to bottom,
        transparent,
        rgba(0,0,0,0.08) 15%,
        rgba(0,0,0,0.12) 50%,
        rgba(0,0,0,0.08) 85%,
        transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    pointer-events: none;
}
.bento-ai-node {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #000000;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
    animation: aiNodePulse 2.8s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes aiNodePulse {
    0%, 100% { transform: scale(1);   box-shadow: 0 0 6px rgba(0,0,0,0.35); }
    40%       { transform: scale(2.2); box-shadow: 0 0 20px rgba(0,0,0,1), 0 0 44px rgba(0,0,0,0.45); }
    70%       { transform: scale(1.4); box-shadow: 0 0 12px rgba(0,0,0,0.6), 0 0 26px rgba(0,0,0,0.2); }
}

/* Zone labels */
.bento-ai-desktop-num  { position: absolute; top: 22px; left: 22px; z-index: 3; }
.bento-ai-desktop-title { position: absolute; top: 40px; left: 22px; z-index: 3; margin: 0; }

.bento-ai-zone {
    position: absolute;
    top: 66px;
    z-index: 3;
    max-width: calc(50% - 44px);
}
.bento-ai-left  { left: 24px; }
.bento-ai-right { right: 24px; text-align: right; }

.bento-ai-zone-tag {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: #cccccc;
    text-transform: uppercase;
    margin-bottom: 5px;
    font-family: 'Space Mono', monospace;
}
.bento-ai-zone-desc {
    font-size: 11px;
    color: #cccccc;
    line-height: 1.5;
}

/* Mobile label (hidden on desktop) */
.bento-ai-mobile-label { display: none; }

/* Bottom section */
.bento-ai-bottom {
    position: absolute;
    bottom: 22px;
    left: 24px; right: 24px;
    z-index: 3;
}
.bento-ai-input {
    width: 100%;
    background: rgba(0,0,0,0.03);
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 11px;
    color: #111111;
    outline: none;
    margin-bottom: 10px;
    box-sizing: border-box;
    transition: border-color 0.25s, background 0.25s;
    font-family: 'Space Mono', monospace;
}
.bento-ai-input { cursor: default; user-select: none; }
.bento-ai-input:focus { border-color: #bbbbbb; background: rgba(0,0,0,0.03); outline: none; }
.bento-ai-input::placeholder { color: #cccccc; }

.bento-ai-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.bento-ai-chip {
    background: rgba(0,0,0,0.03);
    border: 1px solid #e8e8e8;
    border-radius: 20px;
    padding: 5px 13px;
    font-size: 11px;
    color: #999999;
    white-space: nowrap;
    overflow: hidden;
    font-family: 'Space Mono', monospace;
    transition: border-color 0.2s, color 0.2s, background 0.2s, opacity 0.4s ease;
    cursor: default;
    user-select: none;
}
.bento-ai-chip:hover { border-color: #aaaaaa; color: #333333; background: rgba(0,0,0,0.05); }

/* ── 04 Market ── */
.bento-market-labels {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s ease;
    z-index: 2;
}
.bento-market-labels span {
    font-size: 13px;
    font-weight: 600;
    color: #111111;
    letter-spacing: 0.04em;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}
.bento-market-labels span::after {
    content: '✓';
    color: #43A047;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    opacity: 0;
    transform: scale(0.4);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.bmarket-expanded .bento-market-labels {
    opacity: 1;
}
.bmarket-expanded .bento-market-labels span {
    opacity: 1;
    transform: translateY(0);
}
/* Text stagger */
.bmarket-expanded .bento-market-labels span:nth-child(1) { transition-delay: 0.1s; }
.bmarket-expanded .bento-market-labels span:nth-child(2) { transition-delay: 0.2s; }
.bmarket-expanded .bento-market-labels span:nth-child(3) { transition-delay: 0.3s; }
.bmarket-expanded .bento-market-labels span:nth-child(4) { transition-delay: 0.4s; }
/* Checkmark appears after its text (text delay + 0.4s transition + 0.15s pause) */
.bmarket-expanded .bento-market-labels span::after { opacity: 1; transform: scale(1); }
.bmarket-expanded .bento-market-labels span:nth-child(1)::after { transition-delay: 0.9s; }
.bmarket-expanded .bento-market-labels span:nth-child(2)::after { transition-delay: 1.2s; }
.bmarket-expanded .bento-market-labels span:nth-child(3)::after { transition-delay: 1.5s; }
.bmarket-expanded .bento-market-labels span:nth-child(4)::after { transition-delay: 1.8s; }

.bmc-label {
    position: absolute;
    bottom: 80px;
    left: 0; right: 0;
    text-align: center;
    font-size: 8px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #bbbbbb;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}
.bmc-label.bmc-visible { opacity: 1; transform: translateY(0); }

.bento-market-conv {
    position: absolute;
    bottom: 46px;
    left: 0; right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    pointer-events: none;
}

@keyframes bmcPulse {
    0%, 100% { opacity: 0.82; }
    50%       { opacity: 1; }
}
@keyframes bmcItemGlowPause {
    0%   { filter: saturate(0) brightness(2.5) drop-shadow(0 0 0px rgba(67,160,71,0));    opacity: 0.82; }
    15%  { filter: saturate(0) brightness(2.5) drop-shadow(0 0 10px rgba(67,160,71,1));   opacity: 1;    }
    70%  { filter: saturate(0) brightness(2.5) drop-shadow(0 0 8px rgba(67,160,71,0.75)); opacity: 1;    }
    100% { filter: saturate(0) brightness(2.5) drop-shadow(0 0 0px rgba(67,160,71,0));    opacity: 0;    }
}
@keyframes bmcItemGlowPauseLight {
    0%   { filter: saturate(0) brightness(0) drop-shadow(0 0 0px rgba(67,160,71,0));    opacity: 0.82; }
    15%  { filter: saturate(0) brightness(0) drop-shadow(0 0 10px rgba(67,160,71,1));   opacity: 1;    }
    70%  { filter: saturate(0) brightness(0) drop-shadow(0 0 8px rgba(67,160,71,0.75)); opacity: 1;    }
    100% { filter: saturate(0) brightness(0) drop-shadow(0 0 0px rgba(67,160,71,0));    opacity: 0;    }
}
.bmc-item.bmc-pause-glow {
    animation: bmcItemGlowPauseLight 3s ease forwards !important;
}
.bmc-item {
    font-size: 20px;
    line-height: 1;
    opacity: 0;
    transform: translateX(14px);
    transition: opacity 0.45s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
    will-change: transform, opacity, filter;
    filter: saturate(0) brightness(0);
    flex-shrink: 0;
}
.bmc-item.bmc-visible { opacity: 0.18; transform: translateX(0); }
.bmc-item.bmc-glow    { animation: bmcPulse 1.8s ease-in-out infinite; }
.bmc-item.bmc-scan    { opacity: 0.85; filter: saturate(0) brightness(0.2) !important; }

.bmc-conn {
    height: 1px;
    width: 0;
    max-width: 22px;
    background: #dddddd;
    flex-shrink: 0;
    align-self: center;
    opacity: 0;
    margin: 0 5px;
    transition: width 0.42s ease, opacity 0.28s ease, background 0.35s ease, box-shadow 0.35s ease;
}
.bmc-conn.bmc-visible { width: 22px; opacity: 1; }
.bmc-conn.bmc-glow {
    background: linear-gradient(to right, #43A047, rgba(67,160,71,0.25));
}

.bento-market-conv.bmc-exiting .bmc-item,
.bento-market-conv.bmc-exiting .bmc-conn {
    opacity: 0 !important;
    transform: translateX(-32px) !important;
    animation: none !important;
    transition: opacity 0.38s ease, transform 0.38s ease !important;
}

.bento-market:hover .bmc-item.bmc-visible { opacity: 1; }


.bmc-dots {
    position: absolute;
    bottom: 10px;
    left: 0; right: 0;
    display: flex;
    justify-content: center;
    gap: 6px;
    pointer-events: none;
}
.bmc-dot {
    width: 4px; height: 4px;
    border-radius: 50%;
    background: #dddddd;
    transition: background 0.35s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.bmc-dot.bmc-dot-active { background: #43A047; transform: scale(1.5); }


.bmc-result {
    position: absolute;
    bottom: 22px;
    left: 0; right: 0;
    text-align: center;
    font-size: 10px;
    color: #2e7d32;
    letter-spacing: 0.04em;
    font-family: 'Space Mono', monospace;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}
.bmc-result.bmc-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 720px) {
    .bmc-label          { bottom: 118px; }
    .bento-market-conv  { bottom: 84px; }
    .bmc-result         { bottom: 48px; }
    .bmc-dots           { bottom: 10px; }
}

/* ── 02 Forum ── */
.bento-forum-avatars {
    position: absolute;
    top: 20px; right: 16px;
    display: flex;
}
.bento-avatar {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: #e8e8e8;
    border: 2px solid #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    color: #666666;
    margin-left: -6px;
    flex-shrink: 0;
    position: relative;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.bento-avatar:first-child { margin-left: 0; }
.bento-av1 { background: #e8f0fa; color: #4a8fd9; }
.bento-av2 { background: #e8f5ee; color: #4a9d6a; }
.bento-av3 { background: #faeaea; color: #c05050; }
.bento-avatar.av-active { transform: scale(1.22); z-index: 10; }

/* Message feed */
.bfeed {
    position: absolute;
    bottom: 14px; left: 14px; right: 14px;
    overflow: hidden;
    transition: opacity 0.25s ease;
}
.bfmsg {
    position: absolute;
    left: 0; right: 0;
    height: 46px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2px;
    background: rgba(0,0,0,0.03);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(0,0,0,0.07);
    border-radius: 8px;
    padding: 5px 10px;
    overflow: hidden;
    box-sizing: border-box;
}
.bfmsg-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}
.bfmsg-reaction {
    font-size: 10px;
    color: #666;
    line-height: 1.2;
}
.bfmsg-time {
    font-size: 9px;
    color: #bbbbbb;
    line-height: 1.2;
}
.bfmsg-text {
    font-size: 11px;
    color: #555;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bfcur { display: inline; animation: bfcurBlink 0.85s step-end infinite; }
@keyframes bfcurBlink { 0%,100%{opacity:1} 50%{opacity:0} }

/* ── 05 Map ── */
.bento-map-visual {
    position: absolute;
    top: 64px; left: 0; right: 0;
    height: 158px;
    overflow: hidden;
}
.map-info {
    position: absolute;
    bottom: 22px; left: 24px; right: 24px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.35s ease 0.2s, transform 0.35s ease 0.2s;
    pointer-events: none;
}
.map-info-stats {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 12px;
}
.map-info-stat {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
}
.map-info-num {
    font-size: 28px;
    font-weight: 700;
    color: #111111;
    line-height: 1;
    font-family: 'Space Mono', monospace;
}
.map-info-lbl {
    font-size: 10px;
    color: #aaaaaa;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.map-info-divider {
    width: 1px;
    height: 32px;
    background: #dddddd;
    margin: 0 16px;
    flex-shrink: 0;
}
.map-info-events {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid #e8e8e8;
    padding-top: 8px;
}
.map-info-event {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid #f0f0f0;
}
.map-info-event:last-child { border-bottom: none; }
.map-info-event-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #E53935;
    flex-shrink: 0;
}
.map-info-event-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.map-info-event-title { font-size: 12px; color: #111111; font-weight: 600; }
.map-info-event-meta  { font-size: 10px; color: #aaaaaa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-info-event-count { font-size: 11px; color: #bbbbbb; flex-shrink: 0; }

@media (hover: hover) {
    .bento-garage:hover ~ .bento-map .map-info {
        opacity: 1;
        transform: translateY(0);
    }
}
.bmap-expanded .map-info {
    opacity: 1;
    transform: translateY(0);
}
.bento-map-svg { width: 100%; height: 100%; }
.bento-map-route {
    animation: bentoMapRoute 1.2s linear infinite;
}
@keyframes bentoMapRoute {
    to { stroke-dashoffset: -26; }
}

@media (max-width: 720px) {
    .bento-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: minmax(240px, auto) 300px minmax(380px, auto);
    }
    .bento-garage { grid-column: 1; grid-row: 1; }
    .bento-forum  { grid-column: 2; grid-row: 1; }
    .bento-ai     { grid-column: 1 / -1; grid-row: 2; }
    .bento-market { grid-column: 1; grid-row: 3; }
    .bento-map    { grid-column: 2; grid-row: 3; }
    .bento-ai-zone-desc { display: none; }
    .garage-spacer { height: 136px; } /* 240 - 44 - 60 */
    /* Map card: always show full content on mobile */
    .bento-map { min-height: 380px; }
    .bento-map .bento-map-visual { height: 118px; }
    .bento-map .map-info { opacity: 1; transform: none; transition: none; pointer-events: auto; }
}

@media (max-width: 480px) {
    .bento-grid {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(180px, auto) minmax(240px, auto) 280px minmax(260px, auto) minmax(420px, auto);
    }
    .bento-garage { grid-column: 1; grid-row: 1; }
    .garage-spacer { height: 76px; } /* 180 - 44 - 60 */
    .bento-forum  { grid-column: 1; grid-row: 2; }
    .bento-ai     { grid-column: 1; grid-row: 3; }
    .bento-market { grid-column: 1; grid-row: 4; }
    .bento-map    { grid-column: 1; grid-row: 5; min-height: 420px; }
    .bento-ai-desktop-num,
    .bento-ai-desktop-title { display: none; }
    .bento-ai-zone { display: none; }
    .bento-ai-divider { display: none; }
    .bento-ai-mobile-label {
        display: block;
        position: absolute;
        top: 22px; left: 24px;
        z-index: 3;
    }
    .bento-ai-mobile-label h3 { color: #111111; margin: 0 0 4px; font-size: 16px; }
    .bento-ai-mobile-label p  { color: #aaaaaa; font-size: 11px; margin: 0; }
}

/* CTA */
.landing-cta {
    text-align: center;
    padding: 80px 24px;
    border-top: 1px solid #e0e0e0;
}

.landing-cta h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 10px;
    color: #111111;
}

.landing-cta p {
    font-size: 14px;
    color: #888888;
    margin: 0 0 32px;
}

/* ─── Landing Legal Footer ─── */
.landing-legal-footer {
    border-top: 1px solid #e0e0e0;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    max-width: 860px;
    margin: 0 auto;
}
.landing-legal-copy { font-size: 12px; color: #bbbbbb; }
.landing-legal-links { display: flex; gap: 20px; }
.landing-legal-links a { font-size: 12px; color: #999999; text-decoration: none; }
.landing-legal-links a:hover { color: #555555; }

/* ─── Auth Legal Footer ─── */
.auth-legal-footer {
    text-align: center;
    padding: 20px 24px 32px;
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}
.auth-legal-footer a { font-size: 12px; color: #bbbbbb; text-decoration: none; }
.auth-legal-footer a:hover { color: #888; }
.auth-legal-footer span { font-size: 12px; color: #cccccc; }

/* ─── Consent Checkbox ─── */
.consent-group { margin: 14px 0 4px; }
.consent-label {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.5;
    color: var(--hint-color);
}
.consent-label input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}
.consent-link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.consent-link:hover { opacity: 0.75; }

/* ─── Cookie Notice ─── */
.cookie-notice {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 9999;
    flex-wrap: wrap;
}
.cookie-text { font-size: 13px; color: var(--hint-color); flex: 1; }
.cookie-text a { color: var(--accent); }
.cookie-accept-btn {
    flex-shrink: 0;
    background: var(--accent);
    color: var(--button-text);
    border: none;
    border-radius: 6px;
    padding: 7px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

/* ─── Auth Screen ─── */
.auth-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    gap: 28px;
    background-color: #f7f7f7;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.78' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 200px 200px;
}

.auth-brand {
    text-align: center;
}
.auth-left-label {
    font-size: 10px;
    letter-spacing: 0.28em;
    color: #999;
    text-transform: uppercase;
    font-family: 'Space Mono', monospace;
    margin: 0 0 12px;
}
.auth-brand-title {
    font-size: 36px;
    font-weight: 800;
    color: #111111;
    letter-spacing: -1px;
    margin: 0 0 10px;
    line-height: 1;
}
.auth-left-tagline {
    font-size: 13px;
    color: #888;
    line-height: 1.5;
}

.whitelist-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.whitelist-logo {
    font-size: 36px;
    margin-bottom: 8px;
}

.whitelist-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.whitelist-sub {
    font-size: 12px;
    color: var(--hint-color);
    margin-top: 4px;
}

.whitelist-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.whitelist-row:last-child { border-bottom: none; }

.whitelist-row-name {
    font-weight: 600;
}

.whitelist-row-date {
    font-size: 11px;
    color: var(--hint-color);
    margin-top: 2px;
}

.auth-card {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--card-radius);
    padding: 32px;
    width: 100%;
    max-width: 400px;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Space Mono labels + spacing */
.auth-card .form-group { margin-bottom: 16px; }
.auth-card .form-group label {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #888;
    font-weight: 400;
    margin-bottom: 7px;
}

@media (max-width: 480px) {
    .auth-screen { padding: 20px 12px; gap: 16px; }
    .auth-brand-title { font-size: 26px; }
    .auth-left-label { margin: 0 0 8px; }
    .auth-left-tagline { font-size: 12px; }
    .auth-card { padding: 18px 16px; }
    .auth-card .form-group { margin-bottom: 10px; }
    .auth-card .form-group label { margin-bottom: 4px; }
    .auth-tabs { margin-bottom: 16px; }
    .auth-tab { padding: 7px; font-size: 13px; }
    .auth-screen .form-input { padding: 8px 10px; font-size: 13px; }
    .auth-screen .btn-primary { padding: 9px; font-size: 13px; }
    .auth-screen .btn-send-code { padding: 0 10px; font-size: 12px; height: 38px; }
    .auth-screen .auth-form-row { gap: 8px; }
    .consent-group { margin: 8px 0 2px; }
    .consent-text { font-size: 11px; }
    .reg-field-hint { font-size: 11px; }
    .forgot-link { font-size: 12px; }
}


.auth-tabs {
    display: flex;
    gap: 4px;
    background: var(--item-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 6px;
    background: none;
    color: var(--hint-color);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.auth-tab.active {
    background: var(--accent);
    color: var(--button-text);
}

.auth-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.reg-email-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.reg-email-row .form-input {
    flex: 1;
}
.btn-send-code {
    background: #f0f0f0;
    border: 1px solid #cccccc;
    color: #111111;
    border-radius: 8px;
    padding: 0 16px;
    height: 44px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.2s, background 0.2s;
    flex-shrink: 0;
}
.btn-send-code:hover:not(:disabled) {
    border-color: #888888;
    background: #e0e0e0;
}
.btn-send-code:disabled {
    opacity: 0.45;
    cursor: default;
}
.email-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #E53935;
    vertical-align: middle;
    margin-left: 4px;
    transition: background 0.3s;
}
.email-status-dot.verified {
    background: #43A047;
}
.login-hint {
    font-size: 12px;
    color: #666;
    margin: 0 0 12px;
    line-height: 1.4;
}
.forgot-link {
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
}
.forgot-link a {
    color: #777;
    text-decoration: none;
}
.forgot-link a:hover {
    color: #111111;
}
.forgot-title {
    font-size: 16px;
    font-weight: 600;
    color: #111111;
    margin: 0 0 16px;
}

.reg-email-hint,
.reg-field-hint {
    font-size: 12px;
    color: #777777;
    margin-top: 6px;
    margin-bottom: 0;
    line-height: 1.4;
}

.auth-error {
    background: rgba(229, 57, 53, 0.12);
    color: #EF5350;
    border: 1px solid #E53935;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    margin-bottom: 12px;
}

.auth-success {
    background: rgba(67, 160, 71, 0.12);
    color: #43A047;
    border: 1px solid #43A047;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 12px;
    font-weight: 500;
}

/* ─── App Screen ─── */
.app-screen {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ─── Site Header ─── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-light);
}

.site-header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: var(--text-color);
}

.site-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.site-user-name {
    font-size: 13px;
    color: var(--silver);
}

.btn-logout {
    padding: 6px 14px;
    background: transparent;
    color: var(--hint-color);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.btn-logout:hover {
    color: var(--danger);
    border-color: var(--danger);
}

/* ─── Site Nav ─── */
.site-nav {
    background: var(--bg-color);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: var(--header-height);
    z-index: 99;
    overflow: hidden;
}

.site-nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 4px;
}

.site-nav-btn {
    padding: 12px 20px;
    border: none;
    background: none;
    color: var(--hint-color);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    letter-spacing: 0.02em;
}

.site-nav-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.site-nav-btn:hover:not(.active) {
    color: var(--silver);
}

/* ─── Content ─── */
.site-content {
    flex: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    width: 100%;
    padding: 24px;
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ─── Two-column content grid ─── */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 720px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    .site-content {
        padding: 16px;
    }
    .site-nav-btn {
        padding: 10px 12px;
        font-size: 12px;
    }
    .auth-form-row {
        grid-template-columns: 1fr;
    }
}

/* ─── Cards ─── */
.card {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.card h3 { font-size: 15px; margin-bottom: 12px; font-weight: 700; }

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.card-header-row h3 { margin-bottom: 0; }

.ba-section-card { padding: 22px 24px; }
.ba-section-card .card-header-row { margin-bottom: 16px; }
.ba-section-card .card-header-row h3 { font-size: 17px; }

/* ─── Forms ─── */
.form-group { margin-bottom: 12px; }

.form-group label {
    display: block;
    font-size: 11px;
    color: var(--silver);
    margin-bottom: 4px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--item-bg);
    color: var(--text-color);
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-input:focus { border-color: var(--border-light); }
.form-input::placeholder { color: var(--hint-color); }

.form-textarea { min-height: 72px; resize: vertical; }

select.form-input {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23777777' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

select.form-input option { background: var(--card-bg); color: var(--text-color); }
select.form-input:disabled { opacity: 0.35; cursor: not-allowed; }

/* ─── Buttons ─── */
.btn-primary {
    width: 100%;
    padding: 11px;
    background: var(--accent);
    color: var(--button-text);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
    letter-spacing: 0.04em;
    font-family: inherit;
}

.btn-primary:hover { opacity: 0.88; }
.btn-primary:disabled { opacity: 0.3; cursor: not-allowed; }

.btn-small {
    padding: 6px 14px;
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    font-family: inherit;
    white-space: nowrap;
}

.btn-small:hover { border-color: var(--accent); }

.btn-danger        { background: var(--danger)  !important; color: #fff !important; border-color: var(--danger)  !important; }
.btn-voted         { background: var(--secondary-bg) !important; color: var(--danger) !important; border-color: var(--danger) !important; }
.btn-outline-danger { background: transparent; color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); border-radius: 6px; padding: 5px 12px; font-size: 12px; font-weight: 600; cursor: pointer; transition: background 0.2s, border-color 0.2s; font-family: inherit; white-space: nowrap; }
.btn-outline-danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); border-color: var(--danger); }

/* ─── Service form grid ─── */
.service-form-grid,
.meeting-form-grid,
.market-form-grid,
.purchase-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 720px) {
    .service-form-grid,
    .meeting-form-grid,
    .market-form-grid,
    .purchase-form-grid { grid-template-columns: 1fr; }
}

/* ─── Forms containers ─── */
.service-form, .meeting-form, .purchase-form, .market-form {
    border-top: 1px solid var(--border);
    padding-top: 14px;
    margin-bottom: 14px;
}

/* ─── Service History ─── */
.service-list { margin-top: 8px; }

.service-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    gap: 10px;
}

.service-item:last-child { border-bottom: none; }
.service-info { flex: 1; min-width: 0; }
.service-type { font-weight: 600; font-size: 13px; }
.service-moto-tag { display: inline-block; font-size: 10px; font-weight: 600; color: var(--hint-color); background: var(--item-bg); border: 1px solid var(--border-light); border-radius: 4px; padding: 1px 6px; margin-top: 3px; letter-spacing: 0.02em; }
.service-desc { color: var(--hint-color); font-size: 12px; margin-top: 2px; }
.service-meta { text-align: right; font-size: 11px; color: var(--hint-color); white-space: nowrap; font-family: 'Space Mono', monospace; }

/* ─── Maintenance Reminders ─── */
.maintenance-drop {
    background: var(--item-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 6px;
    overflow: hidden;
}

.maintenance-drop.overdue { border-left: 3px solid #EF5350; }
.maintenance-drop.soon    { border-left: 3px solid #FFB300; }
.maintenance-drop.ok      { border-left: 3px solid #43A047; }

.maintenance-drop-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.maintenance-drop-summary::-webkit-details-marker { display: none; }
.maintenance-label { font-weight: 600; font-size: 13px; flex: 1; min-width: 0; }

.maintenance-status {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
    white-space: nowrap;
    margin-left: 8px;
    flex-shrink: 0;
}

.maintenance-status.overdue { background: rgba(239,83,80,0.15);  color: #EF5350; }
.maintenance-status.soon    { background: rgba(255,179,0,0.15);   color: #FFB300; }
.maintenance-status.ok      { background: rgba(102,187,106,0.15); color: #66BB6A; }

.maintenance-drop-body {
    padding: 0 12px 10px;
    border-top: 1px solid var(--border);
}

.maintenance-detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    color: var(--hint-color);
}

.maintenance-detail-row:last-child { border-bottom: none; }
.maintenance-detail-row span:last-child { color: var(--text-color); font-weight: 500; }

/* ─── Motorcycles ─── */
.moto-card {
    display: flex;
    flex-direction: column;
    background: var(--item-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 3px solid transparent;
    transition: border-color 0.2s;
    overflow: hidden;
}

.moto-card .moto-cover {
    border-radius: 0;
    margin-bottom: 0;
    border: none;
    border-bottom: 1px solid var(--border);
}

.moto-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
}

.moto-silhouette {
    position: absolute;
    right: 52px;
    top: 50%;
    transform: translateY(-50%);
    width: 88px;
    height: 44px;
    opacity: 0.09;
    pointer-events: none;
    flex-shrink: 0;
}

.moto-card.primary .moto-silhouette { opacity: 0.14; }

.moto-card.primary { border-left-color: var(--accent); }
.moto-card:hover { border-color: var(--border-light); }

.moto-info { flex: 1; min-width: 0; }
.moto-model { font-weight: 600; font-size: 14px; }
.moto-detail { font-size: 11px; color: var(--hint-color); margin-top: 2px; }

.moto-actions { display: flex; gap: 4px; flex-shrink: 0; margin-left: 8px; }

.moto-actions button {
    padding: 5px 8px;
    border: none;
    background: none;
    font-size: 15px;
    cursor: pointer;
    border-radius: 6px;
    color: var(--silver);
    transition: background 0.2s;
}

.moto-actions button:hover { background: var(--secondary-bg); }

/* ─── Meetings + Map split layout ─── */
.meetings-split {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 16px;
    align-items: start;
    width: 100%;
}

.meetings-map-col { min-width: 0; }
.meetings-list-col { min-width: 0; }

.meetings-map-col .main-map-container { height: 460px; }

.meetings-list-scroll {
    max-height: 560px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 2px;
}

.meetings-list-scroll::-webkit-scrollbar { width: 4px; }
.meetings-list-scroll::-webkit-scrollbar-track { background: transparent; }
.meetings-list-scroll::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 2px; }

@media (max-width: 768px) {
    .meetings-split { grid-template-columns: 1fr; }
    .meetings-map-col .main-map-container { height: 300px; }
    .meetings-list-scroll { max-height: none; }
}

/* ─── Meetings grid (legacy, items inside scroll) ─── */
.meetings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.meeting-item {
    background: var(--item-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
}

.meeting-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
    gap: 8px;
}

.meeting-title { font-weight: 600; font-size: 14px; flex: 1; }

.meeting-participants-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--secondary-bg);
    color: var(--silver);
    font-weight: 600;
    border: 1px solid var(--border-light);
    white-space: nowrap;
    flex-shrink: 0;
}

.meeting-desc { font-size: 12px; color: var(--hint-color); margin-bottom: 6px; line-height: 1.4; }
.meeting-details { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--hint-color); margin-bottom: 8px; }
.meeting-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.meeting-author { font-size: 11px; color: var(--hint-color); }

@media (max-width: 720px) {
    .meetings-grid { grid-template-columns: 1fr; }
}

/* ─── Map ─── */
.meeting-map {
    width: 100%; height: 240px;
    border-radius: 8px; margin: 8px 0;
    z-index: 1; border: 1px solid var(--border);
}

.map-search-row { display: flex; gap: 8px; margin-bottom: 8px; }
.map-search-row .form-input { flex: 1; }

.meeting-minimap {
    width: 100%; height: 130px;
    border-radius: 8px; margin: 8px 0;
    z-index: 1; border: 1px solid var(--border);
}

/* ─── Purchases grid ─── */
.purchases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.purchase-item {
    background: var(--item-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
}

.purchase-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }

.purchase-category {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--secondary-bg);
    color: var(--silver);
    font-weight: 600;
    border: 1px solid var(--border-light);
}

.purchase-votes { font-size: 11px; color: var(--hint-color); font-weight: 600; }
.purchase-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.purchase-desc { font-size: 12px; color: var(--hint-color); margin-bottom: 6px; line-height: 1.4; }
.purchase-details { display: flex; gap: 12px; font-size: 12px; color: var(--hint-color); margin-bottom: 8px; }
.purchase-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.purchase-author { font-size: 11px; color: var(--hint-color); }
@media (max-width: 720px) {
    .purchases-grid { grid-template-columns: 1fr; }
}

/* ─── Market ─── */
.market-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.market-mode-switch {
    display: flex;
    background: var(--item-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
    gap: 3px;
    flex-shrink: 0;
}

.mode-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 6px;
    background: none;
    color: var(--hint-color);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-family: inherit;
}

.mode-btn.active { background: var(--accent); color: var(--button-text); }

.market-filters { display: flex; flex-wrap: wrap; gap: 6px; }

.filter-chip {
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--border-light);
    background: var(--item-bg);
    color: var(--silver);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.filter-chip.active { background: var(--accent); color: var(--button-text); border-color: var(--accent); }
.filter-chip:hover:not(.active) { border-color: var(--silver); }

.market-subscriptions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    align-items: center;
}

.sub-chip {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    border: 1px dashed var(--border-light);
    background: none;
    color: var(--hint-color);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.sub-chip.subscribed { border-style: solid; border-color: var(--success); background: rgba(67,160,71,0.15); color: #43A047; }

/* ─── Market grid ─── */
.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.market-item {
    background: var(--item-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    display: flex;
    flex-direction: column;
}

.market-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }

.market-item-category {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--secondary-bg);
    color: var(--silver);
    font-weight: 600;
    border: 1px solid var(--border-light);
}

.market-item-badge-buy {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--secondary-bg);
    color: var(--accent);
    font-weight: 600;
    border: 1px solid var(--border-light);
}

.market-item-condition { font-size: 11px; color: var(--hint-color); font-weight: 500; }
.market-item-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.market-item-price { font-weight: 700; font-size: 15px; color: var(--accent); margin-bottom: 4px; font-family: 'Space Mono', monospace; }
.market-item-desc { font-size: 12px; color: var(--hint-color); margin-bottom: 6px; line-height: 1.4; flex: 1; }
.market-item-details { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--hint-color); margin-bottom: 8px; }
.market-item-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.market-item-author { font-size: 11px; color: var(--hint-color); }

/* ─── Photo preview ─── */
.photo-preview { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

.photo-preview-item {
    width: 80px; height: 80px;
    border-radius: 8px; overflow: hidden;
    flex-shrink: 0; border: 1px solid var(--border);
}

.photo-preview-item img { width: 100%; height: 100%; object-fit: cover; }

.market-item-photos { position: relative; margin-bottom: 8px; cursor: zoom-in; }
.market-item-photo { width: 100%; height: 200px; object-fit: cover; border-radius: 8px; display: block; transition: opacity 0.15s; }
.market-item-photos:hover .market-item-photo { opacity: 0.88; }
.market-photo-count {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
    pointer-events: none;
}

input[type="file"].form-input { padding: 8px; font-size: 13px; }
input[type="date"].form-input { text-align: left; }

/* ─── Mechanic Soon tab ─── */
.mechanic-soon {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
}

.mechanic-soon-label {
    font-size: 52px;
    font-weight: 800;
    letter-spacing: 0.2em;
    color: var(--text-color);
    text-transform: uppercase;
}

#tab-mechanic.tab-pane.active {
    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    grid-template-rows: 1fr auto auto auto 1fr;
    min-height: calc(100vh - 130px);
}

/* Каждая половина прозрачна — дети участвуют в общей сетке */
.mechanic-half { display: contents; }

/* Строка 2: заголовки LLM / RAG */
.mechanic-half-title {
    font-size: 52px;
    font-weight: 800;
    letter-spacing: 0.15em;
    color: var(--text-color);
    text-transform: uppercase;
}
#tab-mechanic .mechanic-half-title {
    grid-row: 2;
    align-self: end;
    text-align: center;
    padding: 0 24px 12px;
}

/* Строка 3: описания (только внутри mechanic-half) */
.mechanic-half-desc {
    font-size: 14px;
    color: var(--hint-color);
    line-height: 1.5;
    max-width: 320px;
    margin: 0 auto;
}
#tab-mechanic .mechanic-half-desc {
    grid-row: 3;
    align-self: start;
    text-align: center;
    padding: 0 24px;
}

/* Строка 4: soon-метки */
.mechanic-half .mechanic-soon-label {
    grid-row: 4;
    align-self: center;
    text-align: center;
    padding: 6px 24px 0;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.25em;
}

/* Колонки: первая половина = col 1, вторая = col 3 */
.mechanic-half:first-child .mechanic-half-title,
.mechanic-half:first-child .mechanic-half-desc,
.mechanic-half:first-child .mechanic-soon-label { grid-column: 1; }

.mechanic-half:last-child .mechanic-half-title,
.mechanic-half:last-child .mechanic-half-desc,
.mechanic-half:last-child .mechanic-soon-label { grid-column: 3; }

/* Разделитель занимает все строки */
.mechanic-split-divider {
    grid-column: 2;
    grid-row: 1 / -1;
    width: 1px;
    background: #222;
    margin: 48px 0;
}

@media (max-width: 720px) {
    .mechanic-half-title { font-size: 28px; letter-spacing: 0.1em; padding: 0 12px 10px; }
    .mechanic-half-desc { font-size: 11px; padding: 0 12px; }
    .mechanic-half .mechanic-soon-label { font-size: 13px; padding: 10px 12px 0; }
    .mechanic-split-divider { margin: 24px 0; }
}

/* ─── Forum ─── */
.forum-post-form {
    border-top: 1px solid var(--border);
    padding-top: 14px;
    margin-bottom: 14px;
}

.forum-feed {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 760px;
    margin: 0 auto;
    margin-top: 8px;
}

.forum-post {
    background: var(--item-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}

.forum-post-photos {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    overflow-x: auto;
}

.forum-post-photos img {
    height: 200px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.forum-post-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 4px;
}

.forum-post-meta {
    font-size: 11px;
    color: var(--hint-color);
    margin-bottom: 8px;
}

.forum-author-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.forum-author-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--item-bg);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s;
}

.forum-author-avatar:hover { border-color: var(--accent); }

.forum-author-name {
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.forum-author-name:hover { text-decoration: underline; text-decoration-style: dotted; }

.forum-author-date {
    font-size: 11px;
    color: var(--hint-color);
    font-family: 'Space Mono', monospace;
}

.forum-post-content {
    font-size: 13px;
    line-height: 1.6;
    margin: 8px 0;
    white-space: pre-wrap;
}

.forum-post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    gap: 8px;
}

.forum-comments {
    margin-top: 10px;
    padding-left: 12px;
    border-left: 2px solid var(--border);
}

.forum-comment {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.forum-comment:last-child {
    border-bottom: none;
}

.forum-comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.forum-comment-author {
    font-weight: 600;
    font-size: 12px;
}

.forum-comment-meta {
    font-size: 11px;
    color: var(--hint-color);
}

.forum-comment-text {
    font-size: 13px;
    line-height: 1.5;
}

.forum-comment-form {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    align-items: flex-start;
}

.forum-comment-form textarea {
    flex: 1;
    min-height: 40px;
    resize: vertical;
}

.forum-comment-form button {
    flex-shrink: 0;
}

/* ─── Empty state ─── */
.empty-state {
    text-align: center;
    color: var(--hint-color);
    font-size: 13px;
    padding: 24px 0;
}

/* ─── Toast ─── */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--secondary-bg);
    color: var(--text-color);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    border: 1px solid var(--border-light);
    white-space: nowrap;
}

.toast.show { opacity: 1; }

/* ─── Chat ─── */

.chat-room-list {
    display: flex;
    flex-direction: column;
}

.chat-room-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 4px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.12s;
    border-radius: 8px;
}

.chat-room-item:last-child { border-bottom: none; }

.chat-room-item:hover { background: var(--item-bg); padding-left: 10px; }

.chat-room-icon {
    width: 48px;
    height: 48px;
    background: var(--item-bg);
    border: 1px solid var(--border-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.chat-room-info { flex: 1; min-width: 0; }

.chat-room-brand {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-room-meta {
    font-size: 12px;
    color: var(--hint-color);
    margin-top: 3px;
}

.chat-room-arrow {
    color: var(--hint-color);
    font-size: 18px;
    flex-shrink: 0;
}

.chat-room-unread {
    background: #E53935;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    padding: 2px 7px;
    min-width: 20px;
    text-align: center;
    line-height: 16px;
    flex-shrink: 0;
}

/* ─── Reply quotes ─── */

.reply-quote {
    display: flex;
    flex-direction: column;
    border-left: 3px solid var(--accent);
    background: rgba(255,255,255,0.06);
    border-radius: 0 6px 6px 0;
    padding: 4px 8px;
    margin-bottom: 6px;
    cursor: pointer;
}

.reply-quote-author {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 2px;
}

.reply-quote-text {
    font-size: 12px;
    color: var(--hint-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reply-preview-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--item-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    color: var(--hint-color);
}

.reply-preview-bar span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reply-preview-bar button {
    background: none;
    border: none;
    color: var(--hint-color);
    cursor: pointer;
    font-size: 14px;
    padding: 0 4px;
    flex-shrink: 0;
}

.reply-btn {
    background: none;
    border: none;
    color: var(--hint-color);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 6px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s;
}

.chat-message:hover .reply-btn { opacity: 1; }

.chat-message.own .reply-btn { order: -1; }

.chat-area {
    height: 480px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: var(--item-bg);
    border-radius: 8px;
    border: 1px solid var(--border);
    margin: 12px 0;
    scrollbar-width: thin;
}

.chat-message {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 8px;
    max-width: 80%;
}

.chat-message.own {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-message.other {
    align-self: flex-start;
}

.chat-msg-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--item-bg);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s;
}

.chat-msg-avatar:hover { border-color: var(--accent); }

.chat-msg-body {
    display: flex;
    flex-direction: column;
}

.chat-message.own .chat-msg-body { align-items: flex-end; }
.chat-message.other .chat-msg-body { align-items: flex-start; }

.chat-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
}

.chat-message.own .chat-bubble {
    background: var(--accent);
    color: var(--button-text);
}

.chat-message.other .chat-bubble {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-color);
}

.chat-message-meta {
    font-size: 10px;
    color: var(--hint-color);
    margin: 3px 4px;
}

.chat-input-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 8px;
}


.chat-input-row button {
    align-self: flex-end;
}

.chat-author-link {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
}
.chat-author-link:hover { opacity: 0.7; }

/* ─── User Profile Modal ─── */

/* ─── Profile Tab ─── */
.profile-back-bar {
    margin-bottom: 14px;
}

.profile-back-btn {
    background: none;
    border: none;
    color: var(--hint-color);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    letter-spacing: 0.02em;
}
.profile-back-btn:hover { color: var(--text-color); }

.profile-settings-toggle {
    background: none;
    border: none;
    color: var(--hint-color);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 0;
    font-family: inherit;
    letter-spacing: 0.02em;
}
.profile-settings-toggle:hover { color: var(--text-color); }

.profile-header {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 20px;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--item-bg);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    flex-shrink: 0;
}

.profile-info { flex: 1; min-width: 0; }

.profile-name {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.profile-username {
    font-size: 13px;
    color: var(--hint-color);
    margin-top: 3px;
}

.profile-user-id {
    font-size: 11px;
    color: var(--hint-color);
    opacity: 0.6;
    margin-top: 2px;
    font-family: 'Space Mono', monospace;
    letter-spacing: 0.3px;
}

.profile-follow-btn {
    margin-top: 10px;
    padding: 6px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid var(--text-color);
    background: var(--text-color);
    color: var(--bg-color);
    transition: background 0.15s, color 0.15s;
}
.profile-follow-btn.following {
    background: transparent;
    color: var(--text-color);
}

.profile-stats-row {
    display: flex;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.profile-stat {
    flex: 1;
    text-align: center;
    padding: 12px 8px;
    border-right: 1px solid var(--border);
}
.profile-stat:last-child { border-right: none; }

.profile-stat-value { font-size: 18px; font-weight: 700; line-height: 1; font-family: 'Space Mono', monospace; }
.profile-stat-label { font-size: 11px; color: var(--hint-color); margin-top: 3px; text-transform: uppercase; letter-spacing: 0.04em; font-family: 'Space Mono', monospace; }

.profile-garage-title {
    font-size: 11px;
    color: var(--hint-color);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}

.user-profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.user-profile-stat {
    background: var(--item-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 8px;
    text-align: center;
}

.user-profile-stat-value {
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
    font-family: 'Space Mono', monospace;
}

.user-profile-stat-label {
    font-size: 10px;
    color: var(--hint-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-family: 'Space Mono', monospace;
}

.user-profile-meta-row {
    font-size: 11px;
    color: var(--hint-color);
    margin-bottom: 14px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.user-profile-section-title {
    font-size: 11px;
    color: var(--hint-color);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}

.profile-garage-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.user-profile-moto {
    background: var(--item-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 8px;
    position: relative;
}

.user-profile-moto-model { font-size: 11px; font-weight: 600; }
.user-profile-moto-sub { font-size: 10px; color: var(--hint-color); margin-top: 2px; }

.user-profile-moto-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

.moto-open-btn {
    flex-shrink: 0;
    background: var(--secondary-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--hint-color);
    font-size: 11px;
    line-height: 1;
    padding: 3px 6px;
    cursor: pointer;
    font-family: inherit;
    align-self: flex-end;
    margin-right: 4px;
    transition: color 0.15s, border-color 0.15s;
}
.moto-open-btn:hover { color: var(--text-color); border-color: var(--accent); }

/* ─── Nav Badge (unread chat) ─── */
.site-nav-btn { position: relative; }

.nav-badge {
    position: absolute;
    top: 6px;
    right: 2px;
    background: var(--danger);
    color: #ffffff;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    pointer-events: none;
}

/* ─── Forum Likes ─── */
.btn-liked {
    background: rgba(229,57,53,0.15) !important;
    color: #E53935 !important;
    border-color: #E53935 !important;
}

/* ─── Bookmarks ─── */
.btn-bookmarked {
    background: rgba(249,168,37,0.15) !important;
    color: #F9A825 !important;
    border-color: #F9A825 !important;
}

/* ─── Search / Bookmarks Modal ─── */
.btn-icon-header {
    padding: 6px 10px;
    background: transparent;
    color: var(--hint-color);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    line-height: 1;
    font-family: inherit;
}

.btn-icon-header:hover { color: var(--accent); border-color: var(--accent); }

.btn-notif {
    position: relative;
    padding: 6px 8px;
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger-color);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 50%;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    pointer-events: none;
    line-height: 1;
}

.notif-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px;
    background: var(--item-bg);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: border-color 0.15s;
}
.notif-item:hover { border-color: var(--border-light); }
.notif-item.notif-new { border-color: var(--accent); }

.notif-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-item-meta {
    font-size: 11px;
    color: var(--hint-color);
    display: flex;
    gap: 8px;
    align-items: center;
}

.notif-new-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

.notif-cat-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--hint-color);
    margin: 12px 0 6px;
}

.confirm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.confirm-modal-card {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--card-radius);
    padding: 24px;
    width: 100%;
    max-width: 340px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}

.confirm-modal-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 20px;
    line-height: 1.4;
}

.confirm-modal-btns {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.confirm-cancel-btn {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--hint-color);
    padding: 7px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s, color 0.15s;
}
.confirm-cancel-btn:hover { border-color: var(--text-color); color: var(--text-color); }

.confirm-ok-btn {
    padding: 7px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 60px 16px 16px;
}

.modal-card {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--card-radius);
    padding: 24px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.search-group-title {
    font-size: 11px;
    color: var(--hint-color);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 14px 0 6px;
    font-weight: 600;
}

.search-result-item {
    padding: 10px 12px;
    background: var(--item-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: border-color 0.15s;
}

.search-result-item:hover { border-color: var(--border-light); }
.search-result-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.search-result-meta { font-size: 11px; color: var(--hint-color); }

/* ─── Chat Reactions ─── */
.chat-bubble-wrap {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 4px;
}

.reaction-add-btn {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--hint-color);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 14px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
    transition: border-color 0.15s, color 0.15s;
    font-family: inherit;
}

.reaction-add-btn:hover { border-color: var(--accent); color: var(--accent); }

.chat-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.reaction-chip {
    background: var(--item-bg);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    font-family: inherit;
    color: var(--text-color);
}

.reaction-chip:hover { border-color: var(--accent); }
.reaction-mine { background: rgba(68,68,170,0.15) !important; border-color: #4444aa !important; color: #4444aa !important; }

.reaction-picker {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 6px 8px;
    display: flex;
    gap: 4px;
    z-index: 200;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

.reaction-picker-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    border-radius: 6px;
    padding: 4px 6px;
    transition: background 0.15s;
    font-family: inherit;
}

.reaction-picker-btn:hover { background: var(--secondary-bg); }

/* ─── Map Tab ─── */
.map-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.map-filter-chip {
    background: var(--item-bg);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 12px;
    cursor: pointer;
    color: var(--hint-color);
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.map-filter-chip.active {
    background: var(--accent);
    color: var(--button-text);
    border-color: var(--accent);
    font-weight: 600;
}

.main-map-container {
    width: 100%;
    height: 520px;
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.main-map-container.map-add-mode { cursor: crosshair; }

.map-add-panel {
    margin-top: 14px;
    background: var(--item-bg);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 14px 16px;
}

.map-add-panel-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.map-add-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}

@media (max-width: 600px) {
    .map-add-fields { grid-template-columns: 1fr; }
}

/* Leaflet popup overrides for dark theme */
.leaflet-popup-content-wrapper {
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.6);
}

.leaflet-popup-tip {
    background: var(--card-bg);
}

.leaflet-popup-content {
    margin: 10px 14px;
    font-size: 13px;
    line-height: 1.5;
}

/* ─── Admin Dashboard ─── */

.ba-user-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: var(--item-bg);
    border-radius: 8px;
    margin-bottom: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s;
}
.ba-user-result:hover { background: var(--secondary-bg); }

.admin-collapse-header {
    cursor: pointer;
    user-select: none;
}
.admin-collapse-header:hover h3 { opacity: 0.8; }

.admin-collapse-chevron {
    width: 18px;
    height: 18px;
    color: var(--hint-color);
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.admin-collapse-body {
    padding-top: 4px;
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.admin-stat-card {
    background: var(--item-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 12px;
    text-align: center;
}

.admin-stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    font-family: 'Space Mono', monospace;
}

.admin-stat-label {
    font-size: 11px;
    color: var(--hint-color);
    margin-top: 4px;
    font-family: 'Space Mono', monospace;
}

.admin-chart-tabs {
    display: flex;
    gap: 6px;
}

.admin-chart-wrap {
    position: relative;
    height: 220px;
    margin-top: 16px;
}

.admin-log-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.admin-log-item:last-child { border-bottom: none; }

.admin-log-icon {
    font-size: 15px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--item-bg);
    border-radius: 8px;
    flex-shrink: 0;
}

.admin-log-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.admin-log-action {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
}

.admin-log-details {
    font-size: 12px;
    color: var(--hint-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-log-time {
    font-size: 11px;
    color: var(--hint-color);
    flex-shrink: 0;
    font-family: 'Space Mono', monospace;
}

.admin-logs-toggle-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 7px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--hint-color);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    text-align: center;
}
.admin-logs-toggle-btn:hover { border-color: var(--accent); color: var(--accent); }

.admin-content-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.admin-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    background: var(--item-bg);
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 6px;
}

.admin-row-info {
    flex: 1;
    min-width: 0;
}

.admin-row-title {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-row-meta {
    font-size: 11px;
    color: var(--hint-color);
    margin-top: 2px;
}

.admin-row-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.btn-mute {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--hint-color);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    padding: 0;
}
.btn-mute svg { width: 13px; height: 13px; }
.btn-mute:hover { border-color: var(--warning, #F9A825); color: var(--warning, #F9A825); }
.btn-mute-active { border-color: var(--warning, #F9A825) !important; color: var(--warning, #F9A825) !important; background: color-mix(in srgb, #F9A825 12%, transparent) !important; }

#adminUserSearch {
    margin: 12px 0 10px;
}

.badge-admin {
    display: inline-block;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(249, 168, 37, 0.18);
    color: var(--warning);
    font-weight: 600;
    margin-left: 6px;
}

/* ─── Chat Participants Button & Modal ─── */

.chat-participants-btn {
    margin-left: auto;
    flex-shrink: 0;
}

.chat-participant-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.1s;
}

.chat-participant-row:last-child {
    border-bottom: none;
}

.chat-participant-row:hover {
    background: var(--item-bg);
    border-radius: 8px;
    padding-left: 8px;
    padding-right: 8px;
    margin: 0 -8px;
}

.chat-participant-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--secondary-bg);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    flex-shrink: 0;
}

.chat-participant-name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 1px;
}

.chat-participant-username {
    font-size: 11px;
    color: var(--hint-color);
    margin-bottom: 6px;
}

.chat-participant-motos {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.chat-participant-moto-tag {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 4px;
    background: var(--item-bg);
    border: 1px solid var(--border);
    color: var(--hint-color);
    white-space: nowrap;
}

/* --- Forum topics --- */
.forum-filter-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.forum-topic-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
    text-transform: uppercase;
}

/* --- Motorcycle cover photo (16:9) --- */
.moto-cover {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    background-size: cover;
    background-position: center;
    background-color: var(--item-bg);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    margin-bottom: 10px;
}
.moto-cover--empty {
    display: flex;
    align-items: center;
    justify-content: center;
}
.moto-cover-hint {
    font-size: 12px;
    color: var(--hint-color);
    letter-spacing: 0.04em;
}
.moto-cover-upload-btn {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 5px;
    padding: 2px 6px;
    font-size: 12px;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s;
}
.moto-cover-upload-btn:hover {
    background: rgba(0,0,0,0.85);
}

.forum-badges-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.forum-moto-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255,255,254,0.06);
    color: var(--hint-color);
    border: 1px solid var(--border);
}

.profile-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

/* --- Motorcycle inline page --- */

.moto-page-cover {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--item-bg);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.moto-page-info {
    padding: 16px 16px 0;
}

.moto-page-model {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.moto-page-details {
    font-size: 13px;
    color: var(--hint-color);
    margin-top: 4px;
}

.moto-page-posts {
    padding: 16px;
}

.moto-page-posts-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--hint-color);
    margin-bottom: 14px;
}

.moto-page-section {
    margin-bottom: 20px;
}

.moto-page-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
    padding-left: 2px;
}

/* --- Lightbox --- */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0,0,0,0.96);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    max-width: 90vw;
    max-height: 90vh;
}

.lightbox-content img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}

.lightbox-counter {
    font-size: 13px;
    color: rgba(255,255,255,0.45);
    letter-spacing: 0.05em;
}

.lightbox-close {
    position: fixed;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    z-index: 1;
}
.lightbox-close:hover { color: #fff; }

.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    color: #fff;
    font-size: 40px;
    line-height: 1;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s;
    z-index: 1;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.18); }
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

/* --- Chat layout --- */

#tab-chat.tab-pane.active { display: flex; flex-direction: column; padding: 0; height: calc(100vh - 108px); }

.chat-locked {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--hint-color);
    text-align: center;
}

.chat-layout {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

.chat-sidebar-backdrop {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 49;
    background: rgba(0, 0, 0, 0.55);
}
.chat-sidebar-backdrop.open { display: block; }

.chat-sidebar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 220px;
    z-index: 50;
    background: var(--card-bg);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 12px 20px 16px;
    scrollbar-width: none;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
}
.chat-sidebar::-webkit-scrollbar { display: none; }
.chat-sidebar.open { transform: translateX(0); }
.chat-sidebar-header {
    font-size: 11px;
    font-weight: 700;
    color: var(--hint-color);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 10px;
}
.chat-room-item {
    padding: 9px 10px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 2px;
    transition: background 0.12s;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.room-unread-badge {
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    flex-shrink: 0;
    line-height: 1;
}
.chat-brand-badge {
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    flex-shrink: 0;
    line-height: 1;
    margin-left: auto;
}
.chat-room-item:hover { background: var(--item-bg); }
.chat-room-item.active { background: var(--item-bg); border-color: var(--border); }
.chat-room-brand { font-size: 13px; font-weight: 600; }
.chat-room-meta { font-size: 10px; color: var(--hint-color); margin-top: 2px; }

.chat-brand-group { margin-bottom: 4px; }

.chat-brand-header {
    padding: 12px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    transition: background 0.12s;
    border: 1px solid transparent;
}
.chat-brand-header:hover { background: var(--item-bg); }
.chat-brand-header.active { background: var(--item-bg); border-color: var(--border); }

.chat-brand-threads { padding-left: 0; }

.chat-room-item.chat-room-thread { padding: 10px 10px 10px 22px; border-radius: 6px; }
.chat-room-item.chat-room-thread .chat-room-brand { font-size: 14px; font-weight: 500; color: var(--hint-color); }
.chat-room-item.chat-room-thread.active .chat-room-brand { color: var(--text-color); font-weight: 600; }
.chat-room-item.chat-room-osnovnoy .chat-room-brand { color: var(--text-color); font-weight: 600; }
.chat-room-item.chat-room-osnovnoy.active .chat-room-brand { color: var(--text-color); }
.chat-room-last { font-size: 10px; color: var(--hint-color); margin-top: 2px; }

.chat-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 20px 24px 16px 20px;
    overflow: hidden;
}
.chat-panel-header {
    font-size: 15px;
    font-weight: 700;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.btn-chat-users {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background: transparent;
    color: var(--hint-color);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.btn-chat-users:hover { color: var(--accent); border-color: var(--accent); }

/* Гамбургер */
.chat-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    cursor: pointer;
    color: var(--hint-color);
    transition: color 0.15s, border-color 0.15s;
}
.chat-sidebar-toggle:hover,
.chat-sidebar-toggle.open { color: var(--accent); border-color: var(--accent); }

.chat-header-actions { display: flex; align-items: center; gap: 8px; }

.chat-user-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.chat-user-item:last-child { border-bottom: none; }
.chat-user-item:hover .chat-user-name { color: var(--accent); }
.chat-user-av {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--item-bg);
    border: 1px solid var(--border-light);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
    flex-shrink: 0;
}
.chat-user-info { flex: 1; min-width: 0; }
.chat-user-name { font-size: 13px; font-weight: 600; }
.chat-user-moto { font-size: 11px; color: var(--hint-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chat-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px 0 8px;
    scrollbar-width: none;
}
.chat-messages::-webkit-scrollbar { display: none; }
.chat-msg { display: flex; align-items: flex-end; gap: 7px; }
.chat-msg.mine { justify-content: flex-end; }
.chat-msg-av {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--border-light);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700;
    flex-shrink: 0;
    cursor: pointer;
    user-select: none;
}
.chat-msg.mine .chat-msg-av { display: none; }
.chat-msg-inner {
    max-width: 74%;
    background: var(--item-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 10px;
}
.chat-msg.mine .chat-msg-inner { background: var(--secondary-bg); border-color: var(--border-light); }
.chat-msg-author { font-size: 11px; font-weight: 600; color: var(--hint-color); margin-bottom: 3px; }
.chat-msg-text { font-size: 13px; white-space: pre-wrap; word-break: break-word; line-height: 1.4; }
.chat-msg-footer { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.chat-msg-time { font-size: 10px; color: var(--hint-color); font-family: 'Space Mono', monospace; }
.chat-reply-btn { font-size: 11px; padding: 1px 5px; opacity: 0; transition: opacity 0.15s; }
.chat-msg:hover .chat-reply-btn { opacity: 0.55; }
.chat-msg:hover .chat-reply-btn:hover { opacity: 1; }

.chat-pin-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; padding: 0;
    background: transparent; border: none; cursor: pointer;
    color: var(--hint-color); opacity: 0; transition: opacity 0.15s, color 0.15s;
    flex-shrink: 0;
}
.chat-pin-btn svg { width: 12px; height: 12px; }
.chat-msg:hover .chat-pin-btn { opacity: 0.55; }
.chat-msg:hover .chat-pin-btn:hover { opacity: 1; color: var(--accent); }
.chat-pin-btn.active { opacity: 1 !important; color: var(--accent); }

.chat-pin-mark { font-size: 11px; margin-right: 3px; opacity: 0.7; }

.chat-pinned-bar {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 14px;
    background: var(--item-bg);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    font-size: 12px; color: var(--hint-color);
    transition: background 0.15s;
}
.chat-pinned-bar:hover { background: var(--secondary-bg); }
.chat-msg-reply {
    background: rgba(255,255,255,0.04);
    border-left: 2px solid var(--hint-color);
    padding: 4px 7px;
    border-radius: 0 6px 6px 0;
    margin-bottom: 6px;
    font-size: 11px;
    overflow: hidden;
}
.chat-msg-reply-author { font-weight: 600; margin-right: 5px; }
.chat-msg-reply-text { color: var(--hint-color); }
.chat-reactions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
    align-items: center;
}
.chat-reaction-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
    color: var(--text-color);
    transition: background 0.1s;
}
.chat-reaction-btn.mine { background: rgba(255,255,255,0.14); border-color: #555; }
.chat-reaction-btn:hover { background: rgba(255,255,255,0.12); }
.chat-reaction-add { display: flex; gap: 2px; margin-left: 2px; opacity: 0; transition: opacity 0.15s; }
.chat-msg:hover .chat-reaction-add { opacity: 1; }
.chat-emoji-pick {
    background: none; border: none; cursor: pointer;
    font-size: 14px; padding: 1px 2px;
    opacity: 0.45; transition: opacity 0.1s;
}
.chat-emoji-pick:hover { opacity: 1; }
.chat-input-area {
    display: flex;
    flex-shrink: 0;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.chat-input-area .chat-send-btn {
    align-self: flex-end;
}
.chat-textarea {
    flex: 1;
    resize: none;
    min-height: 38px;
    max-height: 100px;
    padding: 9px 12px;
    background: var(--item-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    overflow-y: auto;
    line-height: 1.4;
}
.chat-textarea:focus { border-color: #555; }
.chat-send-btn { height: 38px; padding: 0 14px; flex-shrink: 0; }
.chat-reply-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: rgba(255,255,255,0.04);
    border-left: 2px solid var(--hint-color);
    border-radius: 0 6px 6px 0;
    padding: 6px 10px;
    margin-top: 8px;
    font-size: 12px;
}

/* ─── DM Section ─── */
.chat-dm-divider {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--hint-color);
    padding: 14px 10px 6px;
}
.chat-dm-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}
.chat-dm-item:hover, .chat-dm-item.active {
    background: var(--item-bg);
    border: 1px solid var(--border);
}
.chat-dm-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--border-light);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
    flex-shrink: 0;
}
.chat-dm-info { flex: 1; min-width: 0; }
.chat-dm-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-dm-preview { font-size: 11px; color: var(--hint-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.chat-dm-unread {
    background: var(--text-color);
    color: var(--bg-color);
    font-size: 10px; font-weight: 700;
    border-radius: 10px;
    padding: 1px 6px;
    flex-shrink: 0;
}
.chat-dm-empty {
    font-size: 12px;
    color: var(--hint-color);
    padding: 6px 10px;
}

/* ─── Mobile: 720px additions ─── */
@media (max-width: 720px) {
    /* Header */
    .site-header-inner { padding: 0 12px; }
    .site-logo { font-size: 11px; letter-spacing: 0.08em; }
    .site-header-right { gap: 8px; }
    .site-user-name { display: none; }

    /* Navigation — горизонтальный скролл */
    .site-nav-inner { padding: 0 12px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .site-nav-inner::-webkit-scrollbar { display: none; }
    .site-nav-btn { padding: 10px 12px; font-size: 12px; white-space: nowrap; flex-shrink: 0; }

    /* Профиль: 3→2 колонки */
    .user-profile-stats { grid-template-columns: repeat(2, 1fr); }

    /* Маркет: 1 колонка */
    .market-grid { grid-template-columns: 1fr; }

    /* Чат: меньше высота */
    .chat-area { height: 320px; }

    /* ── Чат: мобильные правки ── */
    .chat-panel {
        flex: 1;
        min-height: 0;
        padding: 10px 14px 8px;
        overflow: hidden;
    }
    .chat-panel-header { padding-bottom: 8px; margin-bottom: 6px; }
}

/* ─── Mobile: 480px ─── */
@media (max-width: 480px) {
    /* Header */
    .site-logo { font-size: 10px; letter-spacing: 0.05em; }
    .btn-logout { font-size: 11px; padding: 5px 8px; }

    /* Navigation */
    .site-nav-btn { padding: 8px 10px; font-size: 11px; }

    /* Content */
    .site-content { padding: 12px; }
    .card { padding: 14px; }

    /* Профиль: garage 2→1, stats 2→1 */
    .profile-garage-grid { grid-template-columns: 1fr; }
    .user-profile-stats { grid-template-columns: 1fr; }

    /* Форум */
    .forum-post { padding: 12px; }

    /* Модальные окна */
    .modal-overlay { padding: 40px 12px 12px; }
}

/* ─── iOS Safari: предотвращаем авто-зум при фокусе на инпут ─── */
@media (max-width: 720px) {
    input, select, textarea, .form-input {
        font-size: 16px !important;
    }
}
