﻿/* MV Agusta Moto Club — Website Styles */
/* Light theme only */

/* ─── Pull to refresh ─── */
.pull-refresh-indicator {
    position: fixed;
    top: -44px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--card-bg, #fff);
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: top 0.2s ease;
    color: var(--hint-color, #999);
}
.pull-refresh-indicator.visible {
    top: 60px;
}
.pull-refresh-indicator.refreshing svg {
    animation: ptr-spin 0.6s linear infinite;
}
@keyframes ptr-spin {
    to { transform: rotate(360deg); }
}
.btn-refresh svg {
    transition: transform 0.3s;
}
.btn-refresh.refreshing svg {
    animation: ptr-spin 0.6s linear infinite;
}

/* ─── 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;
    overflow: hidden;
    height: 100%;
    height: 100dvh;
}
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;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    position: fixed;
    width: 100%;
    overscroll-behavior: none;
}

/* ─── 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;
    height: 100vh;
    height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* 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(36px, 8vw, 80px);
    font-weight: 800;
    letter-spacing: -1px;
    margin: 0 0 20px;
    line-height: 1;
    white-space: nowrap;
    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;
    margin-top: 32px;
}
.landing-cta-btn {
    padding: 14px 36px;
    border: 1.5px solid rgba(150,150,150,0.4);
    border-radius: 10px;
    background: transparent;
    color: #777;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    z-index: 10;
}
.landing-cta-btn:hover { border-color: rgba(150,150,150,0.7); color: #444; }
.landing-cta-secondary {
    background: transparent;
    border: 1.5px solid #ccc;
    color: #333;
}
.landing-cta-secondary:hover { border-color: #999; }

.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: transparent;
    color: #777;
    border: 1.5px solid rgba(150,150,150,0.4);
    border-radius: 10px;
    padding: 13px 26px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: 0.3px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.2s;
}
.sticky-cta button:hover  { border-color: rgba(150,150,150,0.7); color: #444; box-shadow: 0 6px 28px rgba(0,0,0,0.12); }
.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 {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    gap: 28px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    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; justify-content: flex-start; padding-top: 40px; }
    .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;
}

.pass-toggle-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    opacity: 0.6;
}
.pass-toggle-btn:hover { opacity: 1; }

.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;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    position: fixed;
    inset: 0;
    width: 100%;
}

/* ─── 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);
    position: sticky;
    top: var(--header-height);
    z-index: 101;
    overflow: visible;
}

/* clip the border-bottom line but let icons overflow downward */
.site-nav::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1px;
    background: var(--border);
    pointer-events: none;
}

.site-nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 4px;
    position: relative;
}

.nav-indicator {
    position: absolute;
    bottom: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 2px 2px 0 0;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    left: 0;
    width: 0;
}

.site-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 7px 10px;
    border: none;
    background: none;
    color: var(--hint-color);
    cursor: pointer;
    transition: color 0.2s;
    letter-spacing: 0.02em;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-btn-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 28px;
    border-radius: 8px;
    transition: background 0.2s, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center center;
    will-change: transform;
    overflow: visible;
    z-index: 102;
}

.nav-btn-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.site-nav-btn.active {
    color: var(--accent);
}

.site-nav-btn.active .nav-btn-icon {
    background: var(--secondary-bg);
}

.site-nav-btn:hover:not(.active) {
    color: var(--silver);
}

.site-nav-btn:hover:not(.active) .nav-btn-icon {
    background: var(--item-bg);
}

/* ─── Content ─── */
.site-content {
    flex: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    width: 100%;
    padding: 24px;
    min-height: 0;
    overflow-y: auto;
}

/* Чат — убрать паддинг и overflow с контейнера */
.site-content:has(#tab-chat.tab-pane.active) {
    overflow: hidden;
    padding: 0;
}
/* Механик — убрать скролл */
.site-content:has(#tab-mechanic.tab-pane.active) {
    overflow: hidden;
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ─── Two-column content grid ─── */
/* Garage subtabs — mobile only */
.garage-subtabs {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 0;
}
.garage-subtabs::-webkit-scrollbar { display: none; }
.garage-subtab {
    flex-shrink: 0;
    padding: 7px 16px;
    border-radius: 20px;
    border: 1px solid var(--border, #e0e0e0);
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.15s;
}
.garage-subtab.active {
    background: var(--accent);
    color: var(--button-text);
    border-color: var(--accent);
}
[class*="garage-group-"] { display: none; }
[class*="garage-group-"].garage-visible { display: block; }
/* On desktop: subtabs hidden, everything visible */
#meetingsSubtabs { display: none; }
/* On mobile: subtabs visible, toggle map/list columns and groups */
@media (max-width: 768px) {
    #meetingsSubtabs { display: flex; }
    .meetings-map-col { display: none; }
    .meetings-map-col.meetings-visible { display: block; }
    .meetings-list-col { display: none; }
    .meetings-list-col.meetings-visible { display: block; }
    .meetings-list-col [class*="meetings-group-"] { display: none; }
    .meetings-list-col [class*="meetings-group-"].meetings-visible { display: block; }

    /* Встречи subtab: hide map/weather, show only meetings list */
    .meetings-map-col.meetings-list-only #weatherCardMap,
    .meetings-map-col.meetings-list-only .main-map-container,
    .meetings-map-col.meetings-list-only .map-search-row,
    .meetings-map-col.meetings-list-only #meetingMap { display: none !important; }
}
.garage-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 640px;
    margin: 0 auto;
}

@media (max-width: 720px) {
    .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);
    overflow: hidden;
}

.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%;
    box-sizing: border-box;
    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; }

/* ─── Insurance ─── */
.ins-phone-wrap { position: relative; display: flex; align-items: center; }
.ins-phone-wrap .form-input { flex: 1; padding-right: 40px; }
.ins-phone-copy {
    position: absolute; right: 8px;
    background: none; border: none; cursor: pointer;
    color: var(--hint-color); padding: 4px; border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    transition: color 0.15s, background 0.15s;
}
.ins-phone-copy:hover { color: var(--text-color); background: var(--secondary-bg); }

.ins-warning-item {
    font-size: 12px; color: #F9A825;
    padding: 6px 10px; margin-bottom: 10px;
    background: rgba(249,168,37,0.08);
    border: 1px solid rgba(249,168,37,0.2);
    border-radius: 6px;
}

.ins-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 10px; margin-bottom: 14px;
}
@media (max-width: 560px) { .ins-grid { grid-template-columns: 1fr; } }

.ins-card {
    background: var(--item-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    min-width: 0;
    overflow: hidden;
}
.ins-card .form-group { margin-bottom: 8px; }

.ins-card-header {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 10px;
}
.ins-badge {
    font-size: 11px; font-weight: 800;
    padding: 3px 8px; border-radius: 6px;
    letter-spacing: 0.05em;
}
.ins-badge.osago { background: rgba(2,136,209,0.12); color: #0288D1; }
.ins-badge.kasko { background: rgba(67,160,71,0.12);  color: #43A047; }

.ins-days-badge {
    font-size: 11px; font-weight: 600;
    padding: 2px 7px; border-radius: 10px;
}
.ins-days-badge.ok      { background: rgba(67,160,71,0.12);  color: #43A047; }
.ins-days-badge.soon    { background: rgba(249,168,37,0.12); color: #F9A825; }
.ins-days-badge.expired { background: rgba(229,57,53,0.12);  color: #E53935; }

/* ─── Maintenance Reminders ─── */
.maint-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.maint-item:last-child { border-bottom: none; }
.maint-icon {
    width: 34px; height: 34px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    background: var(--item-bg);
    color: var(--hint-color);
    margin-top: 1px;
}
.maint-icon.overdue { background: rgba(210,120,120,0.15); color: #D07878; }
.maint-icon.soon    { background: rgba(200,165,80,0.15);  color: #C8A450; }
.maint-icon.ok      { background: rgba(110,175,115,0.15); color: #6EAF72; }
.maint-body { flex: 1; min-width: 0; }
.maint-header-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.maint-label { font-weight: 600; font-size: 13px; }
.maint-status {
    font-size: 11px; font-weight: 700;
    padding: 2px 7px; border-radius: 10px;
    white-space: nowrap; flex-shrink: 0;
}
.maint-status.overdue { background: rgba(210,120,120,0.15); color: #D07878; }
.maint-status.soon    { background: rgba(200,165,80,0.15);  color: #C8A450; }
.maint-status.ok      { background: rgba(110,175,115,0.15); color: #6EAF72; }
.maint-progress-track {
    height: 4px; border-radius: 2px;
    background: var(--border);
    overflow: hidden; margin-bottom: 5px;
}
.maint-progress-fill { height: 100%; border-radius: 2px; transition: width 0.5s ease; }
.maint-sub { font-size: 11px; color: var(--hint-color); }
.maint-expand-btn {
    width: 100%; margin-top: 6px;
    background: none; border: 1px solid var(--border);
    border-radius: 8px; padding: 7px;
    color: var(--hint-color); font-size: 12px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 5px;
    transition: border-color 0.15s, color 0.15s;
}
.maint-expand-btn:hover { border-color: var(--border-light); color: var(--text-color); }

/* ─── Service History Timeline ─── */
.service-tl-list { margin-top: 4px; }
.service-tl-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 6px 0 4px;
}
.service-tl-dot-col {
    display: flex; flex-direction: column; align-items: center;
    width: 26px; flex-shrink: 0; padding-top: 2px;
}
.service-tl-dot-col::after {
    content: ''; width: 1px; flex: 1; min-height: 16px;
    background: var(--border); margin-top: 5px;
}
.service-tl-dot-col.last::after { display: none; }
.service-tl-icon {
    width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
    background: var(--item-bg);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--hint-color);
}
.service-tl-content { flex: 1; min-width: 0; padding-bottom: 14px; }
.service-tl-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 3px; }
.service-type-pill {
    font-size: 11px; font-weight: 700;
    padding: 2px 8px; border-radius: 10px;
    letter-spacing: 0.02em;
    background: var(--item-bg);
    border: 1px solid var(--border);
    color: var(--text-color);
}
.service-tl-km { font-size: 11px; color: var(--hint-color); font-family: 'Space Mono', monospace; }
.service-tl-del {
    margin-left: auto; flex-shrink: 0;
    background: none; border: none; cursor: pointer;
    color: var(--hint-color); padding: 3px 5px; border-radius: 5px;
    display: flex; align-items: center;
    transition: color 0.15s, background 0.15s;
}
.service-tl-del:hover { color: var(--danger); background: rgba(229,57,53,0.10); }
.service-tl-sub { font-size: 12px; color: var(--hint-color); margin-bottom: 2px; }
.service-tl-date { font-size: 11px; color: var(--hint-color); opacity: 0.7; }

/* ─── 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;
    aspect-ratio: 2 / 1;
    background-size: cover;
    background-repeat: no-repeat;
    background-color: transparent;
}

.moto-card-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.90) 0%, rgba(0,0,0,0.55) 55%, transparent 100%);
    padding: 30px 12px 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    cursor: pointer;
    z-index: 1;
}
.moto-card-overlay .moto-model { color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,0.6); }
.moto-card-overlay .moto-detail { color: rgba(255,255,255,0.72); }
.moto-card-overlay .moto-actions button { color: rgba(255,255,255,0.72); }
.moto-card-overlay .moto-actions button:hover { background: rgba(255,255,255,0.12); color: #fff; }

.moto-primary-badge {
    position: absolute;
    top: 8px; left: 10px;
    transition: background .25s, color .25s;
    background: var(--accent);
    color: var(--bg-color);
    font-size: 11px;
    width: 22px; height: 22px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    z-index: 2;
    pointer-events: none;
}
.moto-primary-badge.inactive {
    background: rgba(0,0,0,0.25);
    color: rgba(255,255,255,0.5);
    pointer-events: auto;
    cursor: pointer;
}
.moto-primary-badge.inactive:active {
    background: var(--accent);
    color: var(--bg-color);
}

.moto-km { cursor: pointer; border-bottom: 1px dashed rgba(255,255,255,0.35); transition: border-color 0.15s; }
.moto-km:hover { border-bottom-color: rgba(255,255,255,0.8); }
.moto-km-input {
    width: 64px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 4px;
    padding: 1px 5px;
    color: #fff;
    font-size: 11px;
    outline: none;
}

.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 { transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s; }
.moto-card:hover { border-color: var(--border-light); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.08); }

.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: 8px 10px;
    border: none;
    background: none;
    font-size: 15px;
    cursor: pointer;
    border-radius: 6px;
    color: var(--silver);
    transition: background 0.2s;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.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: 10px 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.meeting-item:hover { transform: translateY(-1px); box-shadow: 0 2px 12px rgba(0,0,0,0.07); }

.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: 3px; font-size: 12px; color: var(--hint-color); margin-bottom: 8px; }
.meet-detail-row { display: flex; align-items: center; gap: 5px; }
.meet-detail-row svg { flex-shrink: 0; }
.meeting-footer { display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin-top: 6px; }
.meeting-author { font-size: 11px; color: var(--hint-color); }

/* Status badges */
.meet-status-badge {
    font-size: 10px; font-weight: 600; letter-spacing: 0.03em;
    padding: 2px 8px; border-radius: 10px; white-space: nowrap; flex-shrink: 0;
}
.meet-status-today { background: rgba(67,160,71,0.15); color: #43A047; border: 1px solid rgba(67,160,71,0.25); }
.meet-status-soon  { background: rgba(249,168,37,0.15); color: #F9A825; border: 1px solid rgba(249,168,37,0.25); }
.meet-status-past  { background: rgba(120,120,120,0.12); color: var(--hint-color); border: 1px solid var(--border); }

/* Participant progress */
.meet-participants-row {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 5px;
}
.meet-count-label { font-size: 11px; color: var(--hint-color); }
.meet-count-clickable { cursor: pointer; user-select: none; }
.meet-count-clickable:hover { color: var(--text-color); }
.meet-participants-list { margin-bottom: 6px; }
.meet-part-item {
    display: flex; align-items: center; gap: 8px; padding: 6px 8px;
    font-size: 13px; cursor: pointer; border-radius: 6px; transition: background 0.15s;
}
.meet-part-item:hover { background: var(--hover-bg, rgba(128,128,128,0.1)); }
.meet-part-name { color: var(--text-color); font-weight: 500; }
.meet-part-moto { font-size: 11px; color: var(--hint-color); margin-left: auto; }
.meet-progress-wrap {
    height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; margin-bottom: 8px;
}
.meet-progress-bar { height: 100%; background: var(--text-color); border-radius: 2px; transition: width 0.3s; }

/* Join button compact */
.meeting-join-btn { font-size: 12px; padding: 6px 14px; }

@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 {
    display: none;
}

/* ─── 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-search-sort {
    display: flex; flex-direction: column; gap: 8px;
    margin-bottom: 12px;
}
.market-search {
    width: 100%; box-sizing: border-box;
    padding: 9px 14px;
    border: 1px solid var(--border); border-radius: 10px;
    background: var(--item-bg); color: var(--text-color);
    font-size: 14px; font-family: inherit; outline: none;
    transition: border-color 0.2s;
}
.market-search:focus { border-color: var(--border-light); }
.market-search::placeholder { color: var(--hint-color); }
.market-sort-row { display: flex; gap: 6px; flex-wrap: wrap; }
.market-sort-btn {
    padding: 4px 12px; border-radius: 20px;
    font-size: 12px; font-weight: 600;
    border: 1px solid var(--border);
    background: var(--item-bg); color: var(--hint-color);
    cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.market-sort-btn.active { background: var(--text-color); color: var(--bg-color); border-color: var(--text-color); }

.market-contact-btn {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11px; font-weight: 600;
}
.market-contact-val {
    font-size: 11px; font-weight: 600;
    color: var(--text-color);
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 8px; border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--item-bg);
}
.market-icon-btn { display: inline-flex; align-items: center; justify-content: center; padding: 5px 7px; }

.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;
}
#marketListInner { display: contents; }
.market-grid > .empty-state { grid-column: 1 / -1; }

.market-item {
    background: var(--item-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.market-item:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.08); }

.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-closed {
    opacity: 0.55;
}

.market-item-badge-sold {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(229,57,53,0.12);
    color: #e53935;
    font-weight: 600;
}

.market-item-condition {
    font-size: 10px; font-weight: 700;
    padding: 2px 8px; border-radius: 10px;
    letter-spacing: 0.03em;
}
.cond-new       { background: rgba(110,175,115,0.15); color: #6EAF72; }
.cond-like_new  { background: rgba(2,136,209,0.13);   color: #5BA8D0; }
.cond-used      { background: var(--border); color: var(--hint-color); }
.cond-for_parts { background: rgba(210,120,120,0.15); color: #D07878; }
.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; }
.photo-preview-remove {
    position: absolute; top: 2px; right: 2px;
    width: 22px; height: 22px; border-radius: 50%;
    background: rgba(0,0,0,0.6); color: #fff;
    border: none; font-size: 14px; line-height: 22px;
    text-align: center; cursor: pointer; padding: 0;
}

.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;
    max-width: 100%;
    -webkit-appearance: none;
    appearance: none;
    font-size: 11px;
}

/* ─── Mechanic Tab (AI Dual Core) ─── */
#tab-mechanic.tab-pane.active {
    display: flex;
    flex-direction: column;
    position: relative;
    height: calc(100vh - var(--header-height) - var(--nav-height) - 48px);
    height: calc(100dvh - var(--header-height) - var(--nav-height) - 48px);
    overflow: hidden;
    padding: 0;
}


/* Central divider */
.mechanic-divider {
    transition: opacity 0.4s ease;
    position: absolute;
    top: 44px; bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    background: linear-gradient(to bottom,
        transparent,
        rgba(255,255,254,0.06) 15%,
        rgba(255,255,254,0.14) 50%,
        rgba(255,255,254,0.06) 85%,
        transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    pointer-events: none;
}
.mechanic-node {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--text-color);
    box-shadow: 0 0 10px rgba(255,255,254,0.5);
    animation: mechanicNodePulse 2.8s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes mechanicNodePulse {
    0%, 100% { transform: scale(1);   box-shadow: 0 0 6px rgba(255,255,254,0.4); }
    40%       { transform: scale(2.2); box-shadow: 0 0 20px rgba(255,255,254,0.9), 0 0 44px rgba(255,255,254,0.3); }
    70%       { transform: scale(1.4); box-shadow: 0 0 12px rgba(255,255,254,0.6), 0 0 26px rgba(255,255,254,0.15); }
}

/* Header — centered at top */
.mechanic-unified-desc {
    text-align: center;
    padding: 8px 20px 16px;
    color: var(--hint-color);
    font-size: 13px;
    line-height: 1.5;
}
.mechanic-header {
    position: relative;
    text-align: center;
    padding: 16px 0 4px;
    z-index: 3;
    white-space: nowrap;
}
.mechanic-header-tag {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.25em;
    color: var(--hint-color);
    text-transform: uppercase;
    font-family: 'Space Mono', monospace;
    margin-bottom: 4px;
}
.mechanic-header-title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin: 0;
    color: var(--text-color);
}

/* Zones */
.mechanic-zone {
    position: absolute;
    top: 52px;
    z-index: 3;
    max-width: calc(50% - 48px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.mechanic-zone.mech-fade { opacity: 0; transform: translateY(-8px); pointer-events: none; }

/* Processing indicator */
.mechanic-processing {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -54%);
    text-align: center;
    z-index: 5;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    width: 80%; max-width: 300px;
}
.mechanic-processing.mech-visible { opacity: 1; }
.mechanic-processing-question {
    font-size: 12px;
    color: var(--hint-color);
    font-family: 'Space Mono', monospace;
    line-height: 1.6;
    margin-bottom: 28px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.mechanic-processing-dots {
    display: flex; gap: 10px;
    justify-content: center;
    margin-bottom: 18px;
}
.mechanic-processing-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--text-color);
    animation: mechDotPulse 1.4s ease-in-out infinite;
}
.mechanic-processing-dot:nth-child(2) { animation-delay: 0.18s; }
.mechanic-processing-dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes mechDotPulse {
    0%, 60%, 100% { transform: scale(0.7); opacity: 0.2; }
    30%           { transform: scale(1.6); opacity: 1; }
}

/* Response fade-in */
.mechanic-response {
    transition: opacity 0.35s ease;
}
.mechanic-response.mech-visible { opacity: 1; }
.mechanic-zone-left  { left: 32px; }
.mechanic-zone-right { right: 32px; text-align: right; }

.mechanic-zone-tag {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--hint-color);
    text-transform: uppercase;
    font-family: 'Space Mono', monospace;
    margin-bottom: 8px;
}
.mechanic-zone-name {
    font-size: 56px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-color);
    line-height: 1;
    margin-bottom: 12px;
}
.mechanic-zone-desc {
    font-size: 12px;
    color: var(--hint-color);
    line-height: 1.55;
    margin: 0 0 14px;
    max-width: 260px;
}
.mechanic-zone-right .mechanic-zone-desc { margin-left: auto; }

.mechanic-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-family: 'Space Mono', monospace;
    color: var(--hint-color);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 14px;
}
.mechanic-badge-active {
    color: #43A047;
    border-color: #43A047;
}

/* Selectable zones */
.mechanic-zone { cursor: pointer; transition: opacity 0.4s ease, transform 0.4s ease, box-shadow 0.25s ease; }
.mechanic-zone-selected { outline: 1.5px solid #43A047; outline-offset: 8px; border-radius: 14px; filter: drop-shadow(0 0 8px rgba(67,160,71,0.12)); }
.mechanic-zone:not(.mechanic-zone-selected) { opacity: 0.5; }
.mechanic-zone:not(.mechanic-zone-selected):hover { opacity: 0.75; }

/* Bottom input + chips */
.mechanic-bottom {
    position: absolute;
    bottom: 0;
    left: 24px; right: 24px;
    padding-bottom: 16px;
    z-index: 3;
}
.mechanic-input {
    width: 100%;
    background: var(--item-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text-color);
    outline: none;
    margin-bottom: 10px;
    box-sizing: border-box;
    cursor: default;
    user-select: none;
    font-family: 'Space Mono', monospace;
    transition: border-color 0.25s;
}
.mechanic-input::placeholder { color: var(--hint-color); }
.mechanic-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}
.mechanic-chip {
    background: var(--item-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 11px;
    color: var(--hint-color);
    font-family: 'Space Mono', monospace;
    cursor: default;
    user-select: none;
    transition: border-color 0.2s, color 0.2s;
    white-space: nowrap;
}
.mechanic-chip:hover { border-color: #444; color: var(--text-color); }

/* Chat layout */
.mech-chat-layout {
    display: flex;
    flex: 1;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    position: relative;
}
.mech-sidebar {
    width: 220px;
    min-width: 220px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 12px;
    gap: 8px;
    overflow-y: auto;
}
.mech-new-chat-btn {
    background: var(--item-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-color);
    cursor: pointer;
    font-family: 'Space Mono', monospace;
    transition: background 0.15s, border-color 0.15s;
    text-align: left;
}
.mech-new-chat-btn:hover { border-color: #444; background: var(--secondary-bg); }
.mech-chat-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}
.mech-chat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 11px;
    color: var(--hint-color);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    gap: 4px;
}
@media (hover: hover) {
    .mech-chat-item:hover { background: var(--secondary-bg); color: var(--text-color); }
}
.mech-chat-item:active { background: var(--secondary-bg); color: var(--text-color); }
.mech-chat-item.active { background: var(--secondary-bg); color: var(--text-color); font-weight: 600; }
.mech-chat-item-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mech-chat-item-del {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--hint-color);
    cursor: pointer;
    font-size: 14px;
    padding: 0 2px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
}
@media (hover: hover) {
    .mech-chat-item:hover .mech-chat-item-del { opacity: 1; }
}
@media (hover: none) {
    .mech-chat-item-del { opacity: 0.5; }
}
.mech-chat-item-del:hover { color: #e53935; }

.mech-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
}
.mech-welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px;
}
.mech-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: none;
}
.mech-messages::-webkit-scrollbar { display: none; }
.mech-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.6;
    word-break: break-word;
}
.mech-msg-user {
    align-self: flex-end;
    background: var(--text-color);
    color: var(--bg-color);
    border-bottom-right-radius: 4px;
}
.mech-msg-assistant {
    align-self: flex-start;
    background: var(--item-bg);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}
.mech-msg-assistant p { margin: 0 0 6px; }
.mech-msg-assistant p:last-child { margin: 0; }
.mech-msg-assistant ul,
.mech-msg-assistant ol { padding-left: 16px; margin: 4px 0 8px; }
.mech-msg-assistant li { margin-bottom: 2px; }
.mech-msg-assistant strong { font-weight: 700; }

.mech-manual-links {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
}
.mech-manual-links > span {
    font-weight: 600;
    color: var(--hint-color);
    margin-bottom: 4px;
}
.mech-manual-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 8px;
    background: var(--item-bg);
    text-decoration: none;
    color: var(--text-color);
    transition: background 0.15s;
}
.mech-manual-card:hover { background: var(--border); }
.mech-manual-card .manual-item-icon {
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; color: var(--accent-color, #4fc3f7);
}
.mech-manual-card-name { font-size: 13px; font-weight: 500; flex: 1; }

.mech-input-area {
    padding: 12px 24px 16px;
    border-top: 1px solid var(--border);
}
.mech-sidebar-toggle {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--hint-color);
    cursor: pointer;
    padding: 4px;
    display: none;
}

.mechanic-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.mechanic-input-row .mechanic-input { flex: 1; margin-bottom: 0; }
.mechanic-send {
    flex-shrink: 0;
    background: var(--text-color); color: var(--bg-color);
    border: none; border-radius: 8px;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: opacity 0.2s;
}
.mechanic-send:hover { opacity: 0.8; }
.mechanic-send:disabled { opacity: 0.35; cursor: default; }

.mechanic-response {
    position: absolute;
    top: 52px; left: 24px; right: 24px; bottom: 148px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: none;
    z-index: 4;
    opacity: 0;
}
.mechanic-response::-webkit-scrollbar { display: none; }
/* Response toolbar */
.mechanic-response-toolbar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px; padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.mechanic-resp-label {
    font-size: 10px; color: var(--hint-color);
    text-transform: uppercase; letter-spacing: 0.07em; font-weight: 600;
}
.mechanic-resp-actions { display: flex; gap: 4px; }
.mech-act-btn {
    background: none; border: 1px solid var(--border);
    border-radius: 6px; width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    color: var(--hint-color); cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.mech-act-btn:hover { color: var(--text-color); border-color: #444; background: var(--secondary-bg); }
.mech-act-btn.copied { color: #43A047; border-color: #43A047; }

/* Streaming cursor */
.mechanic-response-text.streaming::after {
    content: '';
    display: inline-block; width: 2px; height: 1em;
    background: var(--text-color); margin-left: 2px;
    vertical-align: text-bottom;
    animation: mechCursorBlink 0.85s step-end infinite;
}
@keyframes mechCursorBlink { 50% { opacity: 0; } }

/* Markdown content */
.mechanic-response-text {
    font-size: 14px; line-height: 1.7; color: var(--text-color);
}
.mechanic-response-text p { margin: 0 0 8px; }
.mechanic-response-text h3 { font-size: 15px; font-weight: 700; margin: 14px 0 5px; }
.mechanic-response-text h4 { font-size: 14px; font-weight: 700; margin: 10px 0 4px; }
.mechanic-response-text h5 { font-size: 13px; font-weight: 600; margin: 8px 0 4px; }
.mechanic-response-text ul,
.mechanic-response-text ol { padding-left: 18px; margin: 4px 0 10px; }
.mechanic-response-text li { margin-bottom: 3px; }
.mechanic-response-text strong { font-weight: 700; }
.mechanic-response-text em { font-style: italic; }
.mech-inline-code {
    font-family: 'Space Mono', monospace; font-size: 12px;
    background: var(--secondary-bg); padding: 1px 6px;
    border-radius: 4px; border: 1px solid var(--border);
}
.mech-code-block {
    background: var(--secondary-bg); border: 1px solid var(--border);
    border-radius: 8px; padding: 10px 14px;
    overflow-x: auto; margin: 8px 0;
    font-family: 'Space Mono', monospace; font-size: 12px;
    line-height: 1.6; white-space: pre;
}
/* RAG zone hover hint */
.mechanic-zone:hover .mechanic-badge { opacity: 0.8; }

/* Mechanic chat history */
.mechanic-chat-history {
    display: none;
    max-height: 400px;
    overflow-y: auto;
    padding: 8px 0;
    margin-bottom: 8px;
}
.mech-chat-msg {
    padding: 10px 14px;
    border-radius: 12px;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.6;
    max-width: 85%;
}
.mech-chat-user {
    background: var(--accent, #E53935);
    color: #fff;
    margin-left: auto;
    border-bottom-right-radius: 4px;
    text-align: right;
}
.mech-chat-bot {
    background: var(--item-bg);
    color: var(--text-color);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}
.mech-chat-bot p { margin: 0 0 6px; }
.mech-chat-bot p:last-child { margin: 0; }
.mech-chat-bot ul, .mech-chat-bot ol { padding-left: 18px; margin: 4px 0 8px; }
.mech-chat-bot li { margin-bottom: 2px; }
.mech-chat-bot strong { font-weight: 700; }

@media (max-width: 720px) {
    .mechanic-zone-name { font-size: 40px; }
    .mechanic-zone-desc { font-size: 11px; max-width: 180px; height: 66px; overflow: hidden; }
    .mechanic-zone-left  { left: 16px; }
    .mechanic-zone-right { right: 16px; }
    .mechanic-zone { max-width: calc(50% - 28px); }

    #tab-mechanic.tab-pane.active {
        height: calc(100vh - var(--header-height) - var(--nav-height) - 32px);
        height: calc(100dvh - var(--header-height) - var(--nav-height) - 32px);
    }

    /* Chat layout mobile */
    .mech-chat-layout { flex-direction: row; }

    .mech-chat-layout { position: relative; overflow: hidden; }

    .mech-sidebar {
        position: absolute;
        left: 0; top: 0; bottom: 0;
        width: 55vw;
        max-width: 200px;
        min-width: 0;
        z-index: 10;
        background: var(--bg-color);
        border-right: 1px solid var(--border);
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        padding: 16px 12px;
        overflow-y: auto;
        box-sizing: border-box;
    }
    .mech-sidebar.open { transform: translateX(0); }
    .mech-sidebar-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 9;
        display: none;
    }
    .mech-sidebar-backdrop.open { display: block; }

    .mech-sidebar-toggle { display: flex !important; }

    .mech-main { flex: 1; min-height: 0; width: 100%; }
    .mech-messages { padding: 12px 12px; }
    .mech-msg { max-width: 90%; font-size: 13px; }
    .mech-input-area { padding: 8px 12px 12px; }
    .mech-welcome { padding: 16px 12px; }
    .mechanic-chips { flex-wrap: wrap; gap: 6px; justify-content: center; display: flex; }
    .mechanic-chip { font-size: 10px; padding: 4px 10px; }

    .mechanic-header { padding: 10px 12px 0; }
    .mechanic-header-title { font-size: 16px; }
}

/* ─── Manuals ─── */
.manuals-header { margin-bottom: 16px; }
.manuals-title { font-size: 18px; font-weight: 700; margin: 0 0 6px; }
.manuals-subtitle { font-size: 13px; color: var(--hint-color); margin: 0; }

/* Controls */
.manuals-controls { margin-bottom: 20px; display: flex; flex-direction: column; gap: 10px; }
.manuals-search {
    width: 100%; box-sizing: border-box;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--item-bg);
    color: var(--text-color);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}
.manuals-search:focus { border-color: var(--border-light); }
.manuals-search::placeholder { color: var(--hint-color); }

.manuals-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.manuals-chip, .manuals-type-chip {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px; font-weight: 600;
    border: 1px solid var(--border);
    background: var(--item-bg);
    color: var(--hint-color);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.manuals-chip.active {
    background: var(--text-color);
    color: var(--bg-color);
    border-color: var(--text-color);
}
.manuals-expand-chip {
    border-style: dashed !important;
    color: var(--hint-color) !important;
}
.manuals-type-chip.active {
    background: var(--text-color);
    color: var(--bg-color);
    border-color: var(--text-color);
}
.manuals-no-results { font-size: 13px; color: var(--hint-color); text-align: center; padding: 20px 0; }

/* Groups */
.manuals-group { margin-bottom: 20px; }
.manuals-group-title {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--hint-color);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.manuals-group-count {
    font-size: 10px; font-weight: 700;
    background: var(--border); color: var(--hint-color);
    padding: 1px 7px; border-radius: 10px;
    letter-spacing: 0;
}
.manuals-list { display: flex; flex-direction: column; gap: 2px; }
.manual-item {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
    padding: 9px 12px;
    border-radius: 8px;
    background: var(--item-bg);
    text-decoration: none;
    color: var(--text-color);
    transition: background 0.15s;
}
.manual-item:hover { background: var(--border); }
.manual-item-icon {
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; opacity: 0.75;
}
.manual-item-name { font-size: 13px; font-weight: 500; flex: 1; }

/* Type colors */
.manual-type-workshop   { color: #5C6BC0; }
.manual-type-parts      { color: #F57C00; }
.manual-type-owners     { color: #43A047; }
.manual-type-engine     { color: #AB47BC; }
.manual-type-manualslib { color: var(--hint-color); }
.manual-type-guide      { color: #0288D1; }

/* Colored badges */
.manual-item-badge {
    font-size: 10px; font-weight: 700;
    padding: 2px 8px; border-radius: 20px;
    white-space: nowrap; letter-spacing: 0.03em;
}
.manual-badge-workshop   { background: rgba(92,107,192,0.13);  color: #5C6BC0; }
.manual-badge-parts      { background: rgba(245,124,0,0.13);   color: #F57C00; }
.manual-badge-owners     { background: rgba(67,160,71,0.13);   color: #43A047; }
.manual-badge-engine     { background: rgba(171,71,188,0.13);  color: #AB47BC; }
.manual-badge-manualslib { background: var(--border); color: var(--hint-color); }
.manual-badge-guide      { background: rgba(2,136,209,0.13);   color: #0288D1; }
.manual-badge-pdf        { background: rgba(229,57,53,0.13);   color: #E53935; }
.manual-source-tag { font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 20px; background: var(--border); color: var(--hint-color); white-space: nowrap; letter-spacing: 0.04em; margin-left: 2px; }
.manuals-divider {
    margin: 28px 0 16px;
    padding: 8px 14px;
    background: var(--item-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--hint-color);
}
.manuals-source {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--hint-color);
    text-align: center;
}
.manuals-source a { color: var(--hint-color); text-decoration: underline; }
.manuals-source a:hover { color: var(--text-color); }

/* ─── 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;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.forum-post:hover { transform: translateY(-1px); box-shadow: 0 2px 12px rgba(0,0,0,0.07); }

.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-sort-row {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 12px; flex-wrap: wrap;
}
.forum-sort-label { font-size: 11px; color: var(--hint-color); font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.forum-sort-btn {
    font-size: 12px; font-weight: 600;
    padding: 4px 12px; border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--item-bg); color: var(--hint-color);
    cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.forum-sort-btn.active { background: var(--text-color); color: var(--bg-color); border-color: var(--text-color); }

.forum-author-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.forum-author-meta { display: flex; flex-direction: column; gap: 3px; }
.forum-author-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.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: center;
}

.forum-comment-form input {
    flex: 1;
    min-width: 0;
}

.forum-comment-form button {
    flex-shrink: 0;
    display: flex; align-items: center; gap: 4px;
}

.forum-action-btn {
    display: inline-flex; align-items: center; gap: 5px;
}

.forum-read-more {
    background: none; border: none; padding: 0;
    font-size: 12px; color: var(--hint-color);
    cursor: pointer; margin-left: 4px;
    text-decoration: underline; text-decoration-style: dotted;
}
.forum-read-more:hover { color: var(--text-color); }

/* ─── Skeleton loader ─── */
@keyframes skeleton-shine {
    from { background-position: -400px 0; }
    to   { background-position: calc(400px + 100%) 0; }
}
.skel {
    display: block;
    background: linear-gradient(90deg, var(--secondary-bg) 25%, var(--item-bg) 50%, var(--secondary-bg) 75%);
    background-size: 800px 100%;
    animation: skeleton-shine 1.4s ease infinite;
    border-radius: 6px;
}
.skel-line { height: 12px; margin-bottom: 8px; }
.skel-circle { border-radius: 50%; }
.skel-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.skel-item:last-child { border-bottom: none; }
.skel-body { flex: 1; min-width: 0; }

/* Chat skeleton loaders */
.chat-skel-room { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.chat-skel-room .skel-circle { width: 36px; height: 36px; flex-shrink: 0; }
.chat-skel-room .skel-body .skel-line:first-child { width: 60%; }
.chat-skel-room .skel-body .skel-line:last-child { width: 40%; height: 10px; }
.chat-skel-msg { display: flex; align-items: flex-start; gap: 8px; padding: 8px 16px; }
.chat-skel-msg .skel-circle { width: 28px; height: 28px; flex-shrink: 0; }
.chat-skel-msg .skel-body .skel-line:first-child { width: 30%; height: 10px; }
.chat-skel-msg .skel-body .skel-line:nth-child(2) { width: 80%; }
.chat-skel-msg .skel-body .skel-line:last-child { width: 55%; }
.chat-skel-msg-right { justify-content: flex-end; }
.chat-skel-msg-right .skel-body { text-align: right; }
.chat-skel-msg-right .skel-body .skel-line { margin-left: auto; }

/* ─── Input error ─── */
@keyframes input-shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-5px); }
    60%       { transform: translateX(5px); }
}
.input-error {
    border-color: var(--danger) !important;
    animation: input-shake 0.3s ease;
}

/* ─── Empty state ─── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: var(--hint-color);
    font-size: 13px;
    padding: 32px 16px;
    gap: 4px;
}
.empty-state-icon {
    font-size: 34px;
    line-height: 1;
    margin-bottom: 6px;
    opacity: 0.7;
}
.empty-state-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 2px;
}
.empty-state-sub {
    font-size: 12px;
    color: var(--hint-color);
}
.empty-state-cta {
    margin-top: 14px;
}

/* ─── Toast ─── */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background: var(--secondary-bg);
    color: var(--text-color);
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: none;
    border: 1px solid var(--border-light);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.toast.show { opacity: 1; }
.toast-icon {
    font-size: 15px;
    line-height: 1;
    flex-shrink: 0;
}
.toast.toast-success { border-left: 3px solid var(--success); }
.toast.toast-error   { border-left: 3px solid var(--danger); }
.toast.toast-info    { border-left: 3px solid var(--accent); }
.toast.toast-success .toast-icon { color: var(--success); }
.toast.toast-error   .toast-icon { color: var(--danger); }
.toast.toast-info    .toast-icon { color: var(--accent); }

/* ─── 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-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-qr-inline {
    margin-left: auto;
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border, #e5e5e5);
    cursor: pointer;
}
.profile-qr-inline img {
    width: 100%;
    height: 100%;
    display: block;
}

.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;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}
.profile-avatar.has-photo { color: transparent; }
.profile-avatar.editable { cursor: pointer; }
.profile-avatar-edit {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}
.profile-avatar.editable:hover .profile-avatar-edit { opacity: 1; }

.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-stat-clickable { cursor: pointer; user-select: none; border-radius: 8px; transition: background 0.15s; }
.profile-stat-clickable:hover { background: var(--hover-bg, rgba(128,128,128,0.08)); }
.follow-list-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 4px;
    cursor: pointer; border-radius: 8px; transition: background 0.15s;
}
.follow-list-item:not(:last-child) { border-bottom: 1px solid var(--border); }
.follow-list-item:hover { background: var(--hover-bg, rgba(128,128,128,0.08)); }
.follow-list-name { font-size: 14px; font-weight: 500; }
.follow-list-uname { font-size: 12px; color: var(--hint-color); margin-left: auto; }

.profile-garage-title {
    font-size: 11px;
    color: var(--hint-color);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}

/* ─── Activity heatmap ─── */
.heatmap-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 12px;
}
.heatmap-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
}
.heatmap-meta {
    font-size: 12px;
    color: var(--hint-color);
    display: flex;
    gap: 14px;
}
.heatmap-meta span b {
    color: var(--text-color);
}
.heatmap-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.heatmap-months {
    display: flex;
    padding-left: 22px;
    margin-bottom: 4px;
}
.heatmap-month-label {
    font-size: 10px;
    color: var(--hint-color);
    flex-shrink: 0;
    line-height: 1;
}
.heatmap-grid {
    display: flex;
    gap: 3px;
    align-items: flex-start;
}
.heatmap-days-col {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-right: 4px;
    flex-shrink: 0;
}
.heatmap-day-label {
    font-size: 9px;
    color: var(--hint-color);
    height: 11px;
    line-height: 11px;
    width: 16px;
    text-align: right;
}
.heatmap-col {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex-shrink: 0;
}
.heatmap-cell {
    width: 11px;
    height: 11px;
    border-radius: 2px;
    background: var(--item-bg);
    cursor: default;
    transition: opacity 0.1s;
    flex-shrink: 0;
}
.heatmap-cell:hover { opacity: 0.75; }
.heatmap-cell[data-l="1"] { background: #0e4429; }
.heatmap-cell[data-l="2"] { background: #006d32; }
.heatmap-cell[data-l="3"] { background: #26a641; }
.heatmap-cell[data-l="4"] { background: #39d353; }
.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    justify-content: flex-end;
}
.heatmap-legend-label {
    font-size: 10px;
    color: var(--hint-color);
}

/* ─── Profile inline edit ─── */
.profile-edit-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px 10px;
    font-size: 12px;
    color: var(--hint-color);
    cursor: pointer;
    line-height: 1.5;
    transition: border-color 0.15s, color 0.15s;
    flex-shrink: 0;
    white-space: nowrap;
}
.profile-edit-btn:hover { border-color: var(--accent); color: var(--accent); }
.profile-edit-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(255,255,254,0.06); }


/* ─── Profile city / last-seen / bio / mutual ─── */
.profile-city-row {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--hint-color);
    margin-top: 2px;
}
.profile-city-row::before { content: '📍'; font-size: 11px; }

.profile-last-seen {
    font-size: 11px;
    color: var(--hint-color);
    margin-top: 2px;
}

.profile-bio {
    font-size: 13px;
    line-height: 1.55;
    color: var(--hint-color);
    margin: 10px 0 6px;
    white-space: pre-wrap;
    word-break: break-word;
}

.profile-mutual {
    font-size: 12px;
    color: var(--hint-color);
    margin: 4px 0 8px;
}
.profile-mutual::before { content: '👥 '; }

/* ─── Profile QR button ─── */
.profile-qr-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px 7px;
    font-size: 14px;
    cursor: pointer;
    color: var(--hint-color);
    line-height: 1;
    transition: border-color 0.15s, color 0.15s;
    flex-shrink: 0;
}
.profile-qr-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ─── Profile badges ─── */
.profile-badges-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}
.profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px 4px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid;
    cursor: default;
    transition: transform 0.15s;
    white-space: nowrap;
}
.profile-badge:hover { transform: translateY(-1px); }
.profile-badge-icon { display: inline-flex; align-items: center; line-height: 1; }
.profile-badge-tier {
    font-size: 9px;
    font-weight: 700;
    opacity: 0.55;
    letter-spacing: 0.03em;
    margin-left: 1px;
}

.profile-badge.tier-bronze {
    background: rgba(180,110,40,0.10);
    color: #b87333;
    border-color: rgba(184,115,51,0.35);
}
.profile-badge.tier-silver {
    background: rgba(160,165,185,0.10);
    color: #8890aa;
    border-color: rgba(160,165,185,0.4);
}
.profile-badge.tier-gold {
    background: rgba(210,160,0,0.10);
    color: #c89600;
    border-color: rgba(210,160,0,0.4);
}
.profile-badge.tier-gold .profile-badge-icon svg {
    filter: drop-shadow(0 0 4px rgba(210,160,0,0.5));
}
.profile-badge.tier-diamond {
    background: rgba(91,191,222,0.10);
    color: #5bbfde;
    border-color: rgba(91,191,222,0.4);
}
.profile-badge.tier-diamond .profile-badge-icon svg {
    filter: drop-shadow(0 0 4px rgba(91,191,222,0.6));
}

/* ─── QR modal ─── */
.qr-modal-card { padding-bottom: 20px; }
.qr-avatar {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: var(--item-bg);
    border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; font-weight: 700;
    margin: 0 auto 10px;
    background-size: cover; background-position: center;
}
.qr-name { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.qr-uid {
    font-size: 11px; color: var(--hint-color);
    font-family: 'Space Mono', monospace;
    margin-bottom: 16px;
}
.qr-code-wrap {
    width: 200px; height: 200px;
    margin: 0 auto 12px;
    background: var(--item-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.qr-code-img { width: 180px; height: 180px; display: block; }
.qr-hint { font-size: 12px; color: var(--hint-color); margin-bottom: 16px; }

.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 indicators) ─── */
.nav-indicator { display: none; }

.nav-badge {
    position: absolute;
    top: -4px;
    right: -5px;
    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;
    z-index: 102;
    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 {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    color: var(--hint-color);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    flex-shrink: 0;
}

.btn-icon-header:hover { color: var(--accent); border-color: var(--accent); }

.btn-notif {
    position: relative;
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger, #E53935);
    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;
}
.modal-close-btn {
    width: 28px; height: 28px; border-radius: 6px;
    background: none; border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--hint-color); cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.modal-close-btn:hover { color: var(--text-color); border-color: #444; }

/* ─── Search Modal ─── */
.search-modal-card { padding: 0 !important; overflow: hidden; }
.search-modal-input-row {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.search-modal-icon { flex-shrink: 0; color: var(--hint-color); }
.search-modal-input {
    flex: 1; background: none; border: none; outline: none;
    font-size: 15px; color: var(--text-color); font-family: inherit;
}
.search-modal-input::placeholder { color: var(--hint-color); }
.search-modal-kbd {
    background: var(--item-bg); border: 1px solid var(--border);
    border-radius: 4px; font-size: 10px; padding: 2px 6px;
    color: var(--hint-color); font-family: 'Space Mono', monospace;
    white-space: nowrap; flex-shrink: 0;
}
#searchResults { padding: 12px 20px 20px; max-height: 60vh; overflow-y: auto; }
.search-hint { text-align: center; padding: 24px 0 8px; }
.search-hint-cats {
    display: flex; justify-content: center; gap: 20px;
    margin-bottom: 12px;
}
.search-hint-cats span {
    display: flex; align-items: center; gap: 5px;
    font-size: 12px; color: var(--hint-color);
}
.search-hint-tip { font-size: 11px; color: var(--hint-color); opacity: 0.6; }
.search-hint-tip kbd {
    background: var(--item-bg); border: 1px solid var(--border);
    border-radius: 3px; padding: 1px 5px; font-size: 10px;
    font-family: 'Space Mono', monospace;
}
.search-group-title {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; color: var(--hint-color);
    text-transform: uppercase; letter-spacing: 0.06em;
    margin: 14px 0 6px; font-weight: 600;
}
.search-result-item {
    display: flex; align-items: center; gap: 10px;
    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, background 0.15s;
}
.search-result-item:hover { border-color: var(--border-light); background: var(--secondary-bg); }
.sri-icon {
    width: 34px; height: 34px; border-radius: 8px;
    background: var(--secondary-bg); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; color: var(--hint-color);
}
.sri-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--border-light);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 13px; font-weight: 700;
}
.sri-body { flex: 1; min-width: 0; }
.search-result-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-meta { font-size: 11px; color: var(--hint-color); display: flex; align-items: center; gap: 6px; }
.sri-arrow { color: var(--hint-color); flex-shrink: 0; }
.sri-price {
    font-size: 11px; font-weight: 600; flex-shrink: 0;
    background: var(--secondary-bg); border: 1px solid var(--border);
    padding: 2px 8px; border-radius: 10px;
}
.sri-topic-pill {
    font-size: 10px; padding: 1px 7px; border-radius: 10px;
    font-weight: 600; flex-shrink: 0;
}

/* ─── Notifications improvements ─── */
.notif-item {
    display: flex; align-items: flex-start; gap: 10px;
    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;
}
.notif-item:hover { border-color: var(--border-light); }
.notif-item.notif-new { border-color: rgba(67,160,71,0.4); }
.notif-item-icon {
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--secondary-bg); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 14px;
}
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.notif-item-meta {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; color: var(--hint-color); flex-wrap: wrap;
}
.notif-new-pill {
    font-size: 9px; font-weight: 700; padding: 1px 6px;
    border-radius: 8px; background: rgba(67,160,71,0.15);
    color: #43A047; border: 1px solid rgba(67,160,71,0.3);
    flex-shrink: 0;
}

/* ─── Notification Settings ─── */
.notif-settings-list {
    padding: 8px 16px 16px;
}
.notif-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color, #f0f0f0);
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}
.notif-setting-row:last-child { border-bottom: none; }
.notif-setting-row input[type="checkbox"] { display: none; }
.notif-toggle {
    position: relative;
    width: 40px; height: 22px;
    background: var(--border, #ddd);
    border-radius: 11px;
    flex-shrink: 0;
    transition: background 0.2s;
}
.notif-toggle::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 18px; height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.notif-setting-row input:checked + .notif-toggle {
    background: var(--accent, #43A047);
}
.notif-setting-row input:checked + .notif-toggle::after {
    transform: translateX(18px);
}

/* ─── Bookmarks tabs ─── */
.bkm-modal-card { overflow: hidden; }
.bkm-tabs {
    display: flex; border-bottom: 1px solid var(--border);
    margin: -24px -24px 16px;
}
.bkm-tab {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 12px 16px; font-size: 13px; cursor: pointer;
    background: none; border: none; border-bottom: 2px solid transparent;
    color: var(--hint-color); font-family: inherit;
    transition: color 0.15s, border-color 0.15s;
}
.bkm-tab:hover { color: var(--text-color); }
.bkm-tab.active { color: var(--text-color); border-bottom-color: var(--text-color); font-weight: 600; }
.bkm-item {
    display: flex; align-items: center; gap: 10px;
    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;
}
.bkm-item:hover { border-color: var(--border-light); }
.bkm-item-body { flex: 1; min-width: 0; }
.bkm-item-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bkm-item-meta { font-size: 11px; color: var(--hint-color); }
.bkm-remove-btn {
    width: 26px; height: 26px; border-radius: 6px; flex-shrink: 0;
    background: none; border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--hint-color); cursor: pointer; transition: color 0.15s, border-color 0.15s;
}
.bkm-remove-btn:hover { color: #E53935; border-color: #E53935; }

/* ─── 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 {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--item-bg);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 5px 12px;
    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: rgba(160,160,160,0.1);
    color: var(--text-color);
    border-color: rgba(160,160,160,0.4);
    font-weight: 500;
}
.map-filter-chip.active svg { opacity: 1; }

.address-suggestions {
    position: absolute;
    left: 0; right: 0; top: 100%;
    z-index: 1000;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #eee);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    max-height: 200px;
    overflow-y: auto;
    margin-top: 2px;
}
.address-suggestion-item {
    padding: 10px 12px;
    font-size: 13px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color, #f0f0f0);
    transition: background 0.15s;
}
.address-suggestion-item:last-child { border-bottom: none; }
.address-suggestion-item:hover { background: var(--secondary-bg, #f5f5f5); }

.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-repeat: no-repeat;
    background-color: transparent;
    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;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    padding: 5px 7px;
    cursor: pointer;
    line-height: 1;
    opacity: 0;
    transition: background 0.15s, opacity 0.2s;
    z-index: 3;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
}
.moto-cover:hover .moto-cover-upload-btn,
.moto-cover.upload-active .moto-cover-upload-btn { opacity: 1; }
.moto-cover--empty .moto-cover-upload-btn { opacity: 0.55; }
.moto-cover-upload-btn:hover { background: rgba(0,0,0,0.88); }

.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: transparent;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    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-specs-section {
    margin: 12px 16px 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.moto-specs-toggle {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 14px; cursor: pointer; font-size: 14px; font-weight: 600;
    user-select: none; transition: background 0.15s;
}
.moto-specs-toggle:hover { background: var(--hover-bg, rgba(128,128,128,0.08)); }
.moto-specs-arrow { font-size: 12px; color: var(--hint-color); }
.moto-specs-body { padding: 0 14px 12px; }
.moto-specs-table { width: 100%; border-collapse: collapse; }
.moto-specs-table tr:not(:last-child) { border-bottom: 1px solid var(--border); }
.moto-specs-key { color: var(--hint-color); padding: 6px 10px 6px 0; white-space: nowrap; vertical-align: top; font-size: 12px; }
.moto-specs-val { padding: 6px 0; word-break: break-word; font-size: 13px; }

.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: 100%; }

.chat-locked {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 24px;
    gap: 12px;
}
.chat-locked-icon {
    color: var(--hint-color);
    opacity: 0.35;
    margin-bottom: 8px;
}
.chat-locked-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-color);
}
.chat-locked-text {
    font-size: 15px;
    color: var(--hint-color);
    line-height: 1.5;
    max-width: 320px;
}
.chat-locked-btn {
    margin-top: 12px;
    padding: 12px 32px;
    border: none;
    border-radius: 12px;
    background: var(--accent-color, #4fc3f7);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.chat-locked-btn:hover { opacity: 0.85; }

.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; flex: 1; min-width: 0; word-break: break-word; white-space: normal; }
.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;
    position: relative;
}
.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;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 4px 0 8px;
    scrollbar-width: none;
}
.chat-messages::-webkit-scrollbar { display: none; }
.brand-stub-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: var(--card-bg, #1e1e1e);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 20px;
    max-width: 300px;
    width: calc(100% - 48px);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.55;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,.4);
    z-index: 9999;
    opacity: 0;
    transition: opacity .25s, transform .25s;
    pointer-events: none;
}
.brand-stub-popup.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
/* Date separator */
.chat-date-sep {
    display: flex; align-items: center; gap: 8px;
    margin: 10px 0 6px; font-size: 11px; color: var(--hint-color);
}
.chat-date-sep::before, .chat-date-sep::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}
.chat-date-sep span { white-space: nowrap; }

/* Messages */
.chat-msg { display: flex; align-items: flex-end; gap: 6px; margin-top: 1px; width: 100%; }
.chat-msg.grouped { margin-top: 0; }
.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;
    overflow: hidden;
}
.chat-msg-av-img {
    width: 100%; height: 100%;
    object-fit: cover; border-radius: 50%;
}
.chat-msg-av-ghost { visibility: hidden; flex-shrink: 0; width: 28px; height: 28px; }
.chat-msg.mine .chat-msg-av { display: none; }

/* Group: bubble + below row */
.chat-msg-group { display: flex; flex-direction: column; max-width: 72%; min-width: 0; }
.chat-msg.mine .chat-msg-group { align-items: flex-end; }

.chat-msg-inner {
    background: var(--item-bg);
    border: 1px solid var(--border);
    border-radius: 16px 16px 16px 4px;
    padding: 7px 10px 6px;
}
.chat-msg.mine .chat-msg-inner {
    background: #ffffff !important;
    border: 2px solid #111111 !important;
    border-radius: 16px 16px 4px 16px;
    color: #111111 !important;
}
.chat-msg.mine .chat-msg-text { color: #111111; }
.chat-msg-author { font-size: 11px; font-weight: 600; color: var(--hint-color); margin-bottom: 1px; }
.chat-msg-text { font-size: 13px; white-space: pre-wrap; word-break: break-word; line-height: 1.5; }
.chat-msg-meta {
    float: right;
    font-size: 10px; color: var(--hint-color);
    font-family: 'Space Mono', monospace;
    opacity: 0.65; margin-left: 8px; margin-top: 2px;
    line-height: 1.4;
}

/* Below bubble: reactions + toolbar — hidden until hover or has reactions */
.chat-msg-below {
    display: none; align-items: center; gap: 4px;
    margin-top: 1px; flex-wrap: wrap;
}
.chat-msg:hover .chat-msg-below,
.chat-msg.tapped .chat-msg-below,
.chat-msg-below.has-reactions { display: flex; }
.chat-msg.mine .chat-msg-below { justify-content: flex-end; }
.chat-msg.mine .chat-msg-toolbar { order: -1; }

/* Hover action toolbar */
.chat-msg-toolbar {
    display: flex; gap: 3px;
    max-width: 0; overflow: hidden; opacity: 0;
    transition: opacity 0.15s, max-width 0.15s;
    flex-shrink: 0;
}
.chat-msg:hover .chat-msg-toolbar { max-width: 120px; opacity: 1; }
.chat-tool-btn {
    width: 26px; height: 26px; border-radius: 6px;
    background: var(--item-bg); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--hint-color); cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.chat-tool-btn:hover { color: var(--text-color); border-color: #444; }
.chat-tool-btn.active { color: var(--accent); border-color: var(--accent); }
.chat-tool-btn.danger:hover { color: var(--danger); border-color: var(--danger); }
@media (max-width: 720px) { .chat-msg.tapped .chat-msg-toolbar { opacity: 1; } }

/* Scroll to bottom button */
.chat-scroll-btn {
    position: absolute; bottom: 74px; right: 16px;
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--card-bg); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.35);
    color: var(--text-color); z-index: 10;
    transition: background 0.15s;
}
.chat-scroll-btn:hover { background: var(--secondary-bg); }

/* Room guide banner */
.chat-room-guide {
    background: var(--item-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    margin: 8px 12px 12px;
}
.chat-room-guide-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 6px;
}
.chat-room-guide-text {
    font-size: 12px;
    color: var(--hint-color);
    line-height: 1.5;
}

/* Room preview */
.chat-room-main-row { display: flex; justify-content: space-between; align-items: center; gap: 4px; min-width: 0; }
.chat-room-preview {
    font-size: 11px; color: var(--hint-color);
    margin-top: 2px; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.chat-room-time-label { font-size: 10px; color: var(--hint-color); flex-shrink: 0; font-family: 'Space Mono', monospace; }

.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-search-bar {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 0; border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.chat-msg.search-hit > .chat-msg-group > .chat-msg-inner {
    background: rgba(255, 200, 50, 0.15);
    border-color: rgba(255, 200, 50, 0.4);
}
.chat-search-hl {
    background: rgba(255, 200, 50, 0.45);
    color: inherit;
    border-radius: 2px;
    padding: 0 1px;
}
.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;
    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-msg.mine .chat-reaction-btn { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.25); color: var(--bg-color); }
.chat-msg.mine .chat-reaction-btn.mine { background: rgba(255,255,255,0.3); }
.chat-reaction-btn:hover { background: rgba(255,255,255,0.12); }
.chat-reaction-add { display: flex; gap: 2px; margin-left: 2px; max-width: 0; overflow: hidden; opacity: 0; transition: opacity 0.15s, max-width 0.15s; }
.chat-msg:hover .chat-reaction-add { max-width: 200px; 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-photo-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 16px;
    border-top: 1px solid var(--border);
    background: var(--card-bg);
}
.chat-photo-thumb {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    flex-shrink: 0;
}
.chat-photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-photo-thumb-rm {
    position: absolute;
    top: 3px; right: 3px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 18px; height: 18px;
    font-size: 9px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
}
.chat-attach-btn {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; flex-shrink: 0;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--hint-color);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    align-self: flex-end;
}
.chat-attach-btn:hover { color: var(--accent); border-color: var(--accent); }

.chat-input-area {
    display: flex;
    flex-shrink: 0;
    flex-direction: column;
    gap: 6px;
    margin-top: 0;
    padding: 8px 0 env(safe-area-inset-bottom, 0);
    border-top: 1px solid var(--border);
}
.chat-input-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    width: 100%;
}
.chat-input-row .chat-textarea { flex: 1; min-width: 0; }
.chat-send-btn { width: 100%; }
.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: 36px; padding: 0 14px; }

/* @Mention autocomplete dropdown */
.mention-dropdown {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0; right: 0;
    max-height: 220px;
    overflow-y: auto;
    background: var(--bg-card, #1e1e1e);
    border: 1px solid var(--border, #333);
    border-radius: 8px;
    margin-bottom: 4px;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.3);
    z-index: 100;
}
.mention-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text, #eee);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.mention-item:hover, .mention-item.selected {
    background: var(--accent, #c0392b);
    color: #fff;
}
.mention-id {
    font-size: 11px;
    opacity: 0.5;
}
.mention-item.selected .mention-id,
.mention-item:hover .mention-id { opacity: 0.8; }

/* Mention highlight in messages */
.chat-mention {
    color: var(--accent, #c0392b);
    font-weight: 600;
    cursor: pointer;
    border-radius: 3px;
    padding: 0 2px;
}
.chat-mention:hover {
    text-decoration: underline;
}

.chat-link {
    color: var(--accent);
    text-decoration: underline;
    word-break: break-all;
}

.chat-link:hover {
    opacity: 0.8;
}

.mine .chat-link {
    color: inherit;
    opacity: 0.9;
}

.chat-msg-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
    max-width: 280px;
}
.chat-msg-photo {
    width: 132px;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    display: block;
    transition: opacity 0.15s;
}
.chat-msg-photo:hover { opacity: 0.85; }
.chat-photo-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    cursor: zoom-out;
}
.chat-photo-overlay img {
    max-width: 92vw;
    max-height: 92vh;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.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; word-break: break-word; white-space: normal; }
.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: 6px 8px; }
    .nav-btn-label { font-size: 9px; }

    /* Профиль: 3→2 колонки */
    .user-profile-stats { grid-template-columns: repeat(2, 1fr); }

    /* Маркет: 1 колонка */
    .market-grid { grid-template-columns: 1fr; }

    /* Cards — reduced padding */
    .card { padding: 16px; margin-bottom: 14px; }

    /* Buttons — touch targets */
    .btn-primary { min-height: 42px; }
    .btn-small { min-height: 34px; }

    /* Spacing */
    .site-content { padding: 14px; }

    /* Чат: меньше высота */
    .chat-area { height: 320px; }

    /* ── Чат: мобильные правки ── */
    .chat-panel {
        flex: 1;
        min-height: 0;
        padding: 8px 10px 6px;
        overflow: hidden;
    }
    .chat-panel-header { padding-bottom: 6px; margin-bottom: 4px; }
    .chat-messages { padding: 2px 0 4px; }
    .chat-msg-inner { padding: 5px 8px 4px; }
    .chat-msg-group { max-width: 82%; }
}

/* ─── Mobile: 480px ─── */
@media (max-width: 480px) {
    /* Header */
    .site-logo { font-size: 10px; letter-spacing: 0.05em; }

    /* Navigation */
    .site-nav-btn { padding: 5px 7px; }

    /* Content — compact padding */
    .site-content { padding: 10px; }
    .card { padding: 12px; margin-bottom: 10px; }
    .card h3 { font-size: 14px; margin-bottom: 8px; }
    .card-header-row { margin-bottom: 8px; }

    /* Buttons — touch-friendly min height */
    .btn-primary { min-height: 44px; font-size: 14px; }
    .btn-small { min-height: 36px; padding: 6px 12px; }

    /* Form inputs — touch-friendly */
    .form-input { min-height: 44px; padding: 10px 12px; }
    select.form-input { padding-right: 30px; }

    /* Профиль: 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 10px 10px; }

    /* Ride stats — compact */
    .ride-stats-row { gap: 4px; }
    .ride-stat-val { font-size: 16px; }
    .ride-stat-label { font-size: 10px; }

    /* Garage subtabs tighter */
    .garage-subtab { padding: 6px 14px; font-size: 12px; }

    /* Meetings — compact */
    .meeting-item { padding: 10px; }
    .meeting-form-grid { gap: 8px; }

    /* News — compact */
    .news-item { padding: 12px; }
    .news-item-photo { margin: -12px -12px 10px -12px; }
}

/* ─── iOS Safari: предотвращаем авто-зум при фокусе на инпут ─── */
@media (max-width: 720px) {
    input, select, textarea, .form-input {
        font-size: 16px !important;
    }
}

/* ─── Touch devices: chat reactions & reply always visible ─── */
@media (hover: none) {
    .chat-msg.tapped .chat-msg-toolbar { max-width: 120px !important; opacity: 1 !important; }
    .chat-msg.tapped .chat-reaction-add { max-width: 200px !important; opacity: 1 !important; }
}

/* ─── Tab enter animation ─── */
@keyframes tab-enter {
    from { opacity: 0; transform: translateY(7px); }
    to   { opacity: 1; transform: translateY(0); }
}
.tab-pane.active { animation: tab-enter 0.22s ease; }

/* ─── Like bounce micro-interaction ─── */
@keyframes like-pop {
    0%   { transform: scale(1); }
    35%  { transform: scale(1.45); }
    65%  { transform: scale(0.88); }
    85%  { transform: scale(1.1); }
    100% { transform: scale(1); }
}
.btn-like-pop { animation: like-pop 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97) !important; }

/* ─── Swipe-to-delete ─── */
.swipe-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 8px;
}
.swipe-content { transition: transform 0.22s ease; will-change: transform; }
.swipe-delete-zone {
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 72px;
    background: var(--danger);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transform: translateX(100%);
    transition: transform 0.22s ease;
}
.swipe-wrapper.is-swiped .swipe-delete-zone { transform: translateX(0); }
.swipe-wrapper.is-swiped .swipe-content { transform: translateX(-72px); }

/* ─── Pull-to-refresh ─── */
.ptr-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 0;
    overflow: hidden;
    transition: height 0.2s ease;
    color: var(--hint-color);
    font-size: 12px;
}
.ptr-indicator.ptr-active { height: 44px; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }
.ptr-spinner {
    width: 16px; height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: ptr-spin 0.8s linear infinite;
}

/* ─── Stacked avatars (meetings) ─── */
.avatar-stack {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.avatar-bubble {
    width: 22px; height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: 700;
    color: #fff;
    border: 2px solid var(--card-bg);
    margin-left: -6px;
    flex-shrink: 0;
}
.avatar-stack .avatar-bubble:first-child { margin-left: 0; }
.avatar-bubble-count {
    background: var(--secondary-bg);
    color: var(--silver);
    font-size: 8px;
}

/* ─── Load more button (infinite scroll) ─── */
.load-more-wrap {
    display: flex;
    justify-content: center;
    padding: 16px 0 8px;
}
.load-more-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--hint-color);
    font-size: 12px;
    padding: 7px 24px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    font-family: inherit;
}
.load-more-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ─── Bottom sheet на мобильных ─── */
@media (max-width: 720px) {
    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
    .modal-card {
        border-radius: 20px 20px 0 0;
        max-height: 92vh;
        animation: sheet-up 0.3s cubic-bezier(0.32, 0.72, 0, 1);
        border-left: none;
        border-right: none;
        border-bottom: none;
    }
    @keyframes sheet-up {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }
}

/* ─── News Feed ─── */

.news-feed {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.news-item {
    background: var(--item-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.news-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}

.news-item-photo {
    margin: -16px -16px 12px -16px;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    max-height: 280px;
}
.news-item-photo img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 280px;
    cursor: pointer;
}

.news-item-title {
    font-weight: 700;
    font-size: 16px;
    line-height: 1.35;
    margin-bottom: 4px;
}

.news-item-date {
    font-size: 12px;
    color: var(--hint-color);
    margin-bottom: 8px;
}

.news-item-content {
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    color: var(--text-color);
}

.news-content-full { white-space: pre-wrap; }

.news-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    gap: 8px;
}

.news-item-source {
    font-size: 12px;
    color: var(--accent);
    text-decoration: none;
}
.news-item-source:hover { text-decoration: underline; }

.news-delete-btn {
    font-size: 11px !important;
    padding: 3px 10px !important;
    opacity: 0.5;
}
.news-delete-btn:hover { opacity: 1; }

/* ─── Admin pending badge ─── */

/* ─── Insurance Calculator ─── */

.ins-result-card {
    background: var(--item-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
}

.ins-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--border-light, #eee);
}
.ins-result-row:last-of-type { border-bottom: none; }
.ins-result-row span { color: var(--hint-color); }

.ins-result-premium {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0 4px;
    font-size: 15px;
    margin-top: 4px;
    border-top: 2px solid var(--accent, #E53935);
}
.ins-result-premium span { color: var(--text-color); font-weight: 600; }
.ins-result-premium strong { color: var(--accent, #E53935); font-size: 18px; }

.ins-result-note {
    font-size: 12px;
    color: var(--hint-color);
    margin-top: 8px;
    line-height: 1.4;
}

.admin-pending-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #E53935;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    margin-left: 6px;
    vertical-align: middle;
}

/* ═══════════════════════════════════════════════════════════
   RIDES TAB — Tracker, Weather, Fuel, History
   ═══════════════════════════════════════════════════════════ */

/* ─── Ride Stats Row ─── */
.ride-stats-row {
    display: flex;
    gap: 4px;
}

.ride-stat {
    flex: 1;
    background: var(--item-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 6px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ride-stat-val {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-color);
    font-family: 'Space Mono', monospace;
}

.ride-stat-label {
    font-size: 10px;
    color: var(--hint-color);
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ─── Ride History Items ─── */
.ride-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--item-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: border-color 0.2s;
    position: relative;
}

.ride-item:hover {
    border-color: var(--border-light);
}

.ride-item-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ride-item-date {
    font-size: 10px;
    color: var(--hint-color);
    font-weight: 600;
}

.ride-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ride-item-stats {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: var(--hint-color);
    flex-shrink: 0;
}

.ride-item-del {
    border: none;
    background: none;
    color: var(--hint-color);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.ride-item:hover .ride-item-del {
    opacity: 1;
}

.ride-item-del:hover {
    color: var(--danger);
}

/* ─── Weather Widget ─── */
.weather-widget {
    min-height: 60px;
}

.weather-loading {
    text-align: center;
    color: var(--hint-color);
    font-size: 12px;
    padding: 16px 0;
}

.weather-main {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.weather-icon {
    font-size: 32px;
    line-height: 1;
}

.weather-temp {
    font-size: 28px;
    font-weight: 700;
    font-family: 'Space Mono', monospace;
}

.weather-desc {
    font-size: 13px;
    color: var(--hint-color);
    text-transform: capitalize;
}

.weather-details {
    display: flex;
    gap: 14px;
    font-size: 11px;
    color: var(--hint-color);
    margin-bottom: 10px;
}

.weather-ride-score {
    display: flex;
    align-items: center;
    gap: 10px;
}

.weather-score-bar {
    flex: 1;
    height: 6px;
    background: var(--secondary-bg);
    border-radius: 3px;
    overflow: hidden;
}

.weather-score-bar span {
    display: block;
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.weather-ride-score.good .weather-score-bar span { background: #43A047; }
.weather-ride-score.ok .weather-score-bar span   { background: #F9A825; }
.weather-ride-score.bad .weather-score-bar span  { background: #E53935; }

.weather-score-label {
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.weather-ride-score.good .weather-score-label { color: #43A047; }
.weather-ride-score.ok .weather-score-label   { color: #F9A825; }
.weather-ride-score.bad .weather-score-label  { color: #E53935; }

/* ═══════════════════════════════════════════════════════════
   PARTS CATALOG TAB
   ═══════════════════════════════════════════════════════════ */

.part-item {
    position: relative;
    padding: 12px;
    background: var(--item-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 6px;
    transition: border-color 0.2s;
}

.part-item:hover {
    border-color: var(--border-light);
}

.part-item-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}

.part-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
}

.part-item-num {
    font-size: 11px;
    color: var(--hint-color);
    font-family: 'Space Mono', monospace;
}

.part-item-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--hint-color);
    margin-bottom: 4px;
}

.part-cat-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--secondary-bg);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-color);
}

.part-price {
    font-weight: 700;
    color: var(--accent);
}

.part-link {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}

.part-link:hover {
    text-decoration: underline;
}

.part-desc {
    font-size: 12px;
    color: var(--hint-color);
    margin-top: 4px;
    line-height: 1.4;
}

.part-author {
    font-size: 10px;
    color: var(--hint-color);
    margin-top: 6px;
}

.part-item--ext {
    border-left: 3px solid var(--border-light);
}

.part-source {
    font-size: 10px;
    color: var(--hint-color);
    font-style: italic;
}

.part-search-btn {
    border: 1px solid var(--border-light);
    background: none;
    color: var(--accent);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.part-search-btn:hover {
    background: var(--secondary-bg);
}

.parts-section-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--hint-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

/* ─── Responsive: Rides ─── */
@media (max-width: 600px) {
    .ride-stats-row {
        gap: 3px;
    }
    .ride-stat {
        padding: 8px 4px;
    }
    .ride-stat-val {
        font-size: 16px;
    }
    .ride-item-stats {
        display: none;
    }
    .ride-item-del {
        opacity: 1;
    }
    .weather-main {
        gap: 8px;
    }
    .weather-temp {
        font-size: 22px;
    }
    .weather-icon {
        font-size: 26px;
    }
}

/* ─── Club Discount Card ─── */
.club-card {
    perspective: 800px;
}
.club-card-inner {
    background: #fff;
    border-radius: 14px;
    padding: 22px 24px;
    color: #1a1a1a;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,0.10), 0 0 0 1px rgba(0,0,0,0.06);
    aspect-ratio: 1.7 / 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.club-card-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1a1a1a 0%, #444 50%, #1a1a1a 100%);
    pointer-events: none;
}
.club-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
}
.club-card-qr {
    margin-left: auto;
    width: 52px;
    height: 52px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}
.club-card-qr img {
    width: 100%;
    height: 100%;
    display: block;
}
.club-card-logo {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.club-card-brand {
    display: flex;
    flex-direction: column;
}
.club-card-title {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.10em;
    color: #1a1a1a;
}
.club-card-subtitle {
    font-size: 9px;
    letter-spacing: 0.22em;
    color: #555;
    font-weight: 700;
    margin-top: 2px;
}
.club-card-number {
    font-family: 'Courier New', Courier, monospace;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.30em;
    color: #222;
    text-align: center;
    padding: 2px 0;
}
.club-card-barcode {
    display: block;
    width: 100%;
    height: 36px;
    margin: 2px 0;
}
.club-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}
.club-card-holder,
.club-card-since {
    display: flex;
    flex-direction: column;
}
.club-card-label {
    font-size: 8px;
    letter-spacing: 0.15em;
    color: #999;
    font-weight: 600;
    margin-bottom: 2px;
}
.club-card-name {
    font-size: 13px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: 0.04em;
}
.club-card-date {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

/* --- User Discount Cards --- */
.dc-item {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e5e5e5);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
}
.dc-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.dc-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.dc-item-name {
    font-size: 14px;
    font-weight: 700;
}
.dc-item-note {
    font-size: 12px;
    color: var(--hint-color, #999);
}
.dc-delete-btn {
    font-size: 18px;
    line-height: 1;
    padding: 2px 6px;
    opacity: 0.4;
}
.dc-delete-btn:hover {
    opacity: 1;
}
.dc-item-number {
    font-family: 'Courier New', Courier, monospace;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-align: center;
    padding: 4px 0;
}
.dc-item-barcode {
    display: block;
    width: 100%;
    height: 30px;
    margin-top: 6px;
}

/* --- Fullscreen card modal --- */
.card-fullscreen-wrap {
    position: relative;
    width: 92vw;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.card-fullscreen-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}
#cardFullscreenContent .club-card-inner {
    aspect-ratio: auto;
    padding: 28px;
    gap: 16px;
}
#cardFullscreenContent .club-card-barcode {
    height: 64px;
}
#cardFullscreenContent .club-card-number {
    font-size: 24px;
}
#cardFullscreenContent .club-card-qr {
    width: 68px;
    height: 68px;
}
.dc-item-fullscreen {
    background: var(--card-bg, #fff);
    border-radius: 14px;
    padding: 24px 28px;
    width: 100%;
}
.dc-item-fullscreen .dc-item-number {
    font-size: 24px;
    padding: 10px 0;
}
.dc-item-fullscreen .dc-item-name {
    font-size: 18px;
}
.dc-item-fullscreen .dc-item-barcode {
    height: 80px;
    margin-top: 12px;
}

/* Expand button on cards */
.card-expand-btn {
    background: none;
    border: none;
    color: var(--hint-color, #999);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}
.card-expand-btn:hover {
    color: var(--text-color, #1a1a1a);
}
.dc-expand-btn {
    opacity: 0.4;
    padding: 2px 4px;
}
.dc-expand-btn:hover {
    opacity: 1;
}

/* ============================
   Cost of Ownership
   ============================ */
.cost-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.cost-card {
    background: var(--card-bg, #f8f8f8);
    border: 1px solid var(--border-color, #eee);
    border-radius: 12px; padding: 14px; text-align: center;
}
.cost-card-label { font-size: 12px; color: var(--hint-color); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.cost-card-value { font-size: 22px; font-weight: 700; }
.cost-card-sub { font-size: 12px; color: var(--hint-color); margin-top: 4px; }
.cost-card-total { grid-column: 1 / -1; background: var(--accent-color, #4fc3f7); color: #fff; }
.cost-card-total .cost-card-label { color: rgba(255,255,255,0.7); }
.cost-card-total .cost-card-value { color: #fff; }
.chart-period-row { display: flex; gap: 4px; margin-bottom: 10px; }
.chart-period-btn {
    padding: 4px 12px; border-radius: 14px; font-size: 12px; font-weight: 500;
    border: 1px solid var(--border-color, #e0e0e0); background: transparent;
    color: var(--hint-color); cursor: pointer; transition: all 0.15s;
}
.chart-period-btn.active {
    background: var(--text-color, #333); color: var(--bg-color, #fff);
    border-color: var(--text-color, #333);
}
.chart-period-btn:hover:not(.active) { border-color: var(--text-color, #999); }

/* ─── Cost of Ownership chart container ─── */
#costChartWrap,
#motoPageChartWrap {
    position: relative;
    width: 100%;
    max-width: 100%;
}
#costChartWrap,
#motoPageChartWrap {
    position: relative;
    width: 100%;
}
#costChartWrap canvas,
#motoPageChartWrap canvas {
    display: block;
    width: 100% !important;
    height: 200px !important;
}
@media (min-width: 768px) {
    #costChartWrap canvas,
    #motoPageChartWrap canvas {
        height: 320px !important;
    }
}
#costStatsRow .ride-stats-row {
    flex-wrap: wrap;
    gap: 12px 20px;
}
#costStatsRow .ride-stat-val {
    font-size: 16px;
    word-break: break-all;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 600px) {
    #costStatsRow .ride-stats-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px 12px;
    }
    #costStatsRow .ride-stat {
        min-width: 0;
    }
    #costStatsRow .ride-stat-val {
        font-size: 14px;
    }
}

.cost-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 16px 0 0;
    margin-top: 8px;
}
.cost-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--hint-color);
}
.cost-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

.cost-bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding: 0 4px; }
.cost-bar-item { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.cost-bar { width: 100%; min-width: 16px; background: var(--accent-color, #4fc3f7); border-radius: 4px 4px 0 0; transition: height 0.3s; }
.cost-bar-label { font-size: 10px; color: var(--hint-color); margin-top: 4px; }

/* ============================
   Seasonal Checklists
   ============================ */
.season-banner {
    display: flex; align-items: center; gap: 12px;
    padding: 14px; border-radius: 12px; margin-bottom: 14px;
    background: linear-gradient(135deg, rgba(120,180,120,0.1), rgba(120,180,120,0.05));
    border: 1px solid rgba(120,180,120,0.2);
}
.season-banner-icon { font-size: 28px; }
.season-banner-text strong { font-size: 16px; display: block; }
.season-banner-text p { font-size: 13px; color: var(--hint-color); margin: 2px 0 0; }
.season-checklist { border: 1px solid var(--border-color, #eee); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.season-cl-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 14px; font-weight: 600; font-size: 14px;
}
.season-cl-title { cursor: pointer; flex: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.season-cl-title:hover { opacity: 0.7; }
.season-type-badge {
    font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 10px;
    letter-spacing: 0.02em;
}
.season-type-gasoline, .season-type-electric {
    background: rgba(150,150,150,0.1);
    color: var(--hint-color);
}
.season-cl-actions { display: flex; align-items: center; gap: 8px; }
.season-cl-progress { font-size: 12px; color: var(--hint-color); font-weight: 400; }
.season-cl-reset {
    background: none; border: none; cursor: pointer; padding: 4px;
    color: var(--hint-color); opacity: 0.4; transition: opacity 0.15s;
}
.season-cl-reset:hover { opacity: 1; color: #E53935; }
.season-cl-bar { height: 3px; background: var(--border-color, #eee); }
.season-cl-bar-fill { height: 100%; background: rgba(120,180,120,0.7); border-radius: 3px; transition: width 0.3s; }
.season-cl-items { display: none; padding: 8px 14px 14px; }
.season-checklist.open .season-cl-items { display: block; }
.season-cl-item {
    display: flex; align-items: flex-start; gap: 8px; padding: 8px 0;
    border-bottom: 1px solid var(--border-color, #eee); font-size: 14px; cursor: pointer;
}
.season-cl-item:last-child { border-bottom: none; }
.season-cl-item input[type="checkbox"] { margin-top: 2px; accent-color: rgba(120,180,120,0.9); }
.season-cl-hint { display: block; font-size: 12px; color: var(--hint-color); margin-top: 2px; }

/* ============================
   Catalog
   ============================ */
.catalog-chip-count {
    font-size: 10px;
    font-weight: 700;
    opacity: 0.5;
    margin-left: 2px;
}
.catalog-expand-btn {
    border: 1px dashed var(--border-color, #ccc) !important;
    color: var(--hint-color) !important;
    font-size: 12px !important;
}
.catalog-brand-group { margin-bottom: 20px; }
.catalog-brand-title { font-size: 16px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.catalog-models-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.catalog-model-card {
    padding: 14px 12px; border: 1px solid var(--border-color, #eee);
    border-radius: 10px; cursor: pointer; transition: all 0.15s;
}
.catalog-model-card:hover { border-color: rgba(160,160,160,0.6); background: rgba(160,160,160,0.04); }
.catalog-model-name { font-weight: 600; font-size: 14px; }
.catalog-model-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.catalog-owners { font-size: 11px; color: var(--hint-color); background: rgba(160,160,160,0.1); padding: 2px 8px; border-radius: 10px; }
.catalog-model-stats { display: flex; gap: 16px; margin: 12px 0; flex-wrap: wrap; }
.catalog-stat { font-size: 14px; color: var(--hint-color); }
.catalog-stat strong { color: #f5a623; }

/* Model hero photo */
.catalog-model-hero {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}
.catalog-model-hero img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

/* Owners dropdown */
.catalog-owners-dropdown { margin-top: 12px; }
.catalog-owners-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    color: var(--hint-color, #999);
    transition: opacity 0.15s;
}
.catalog-owners-toggle:hover { opacity: 0.7; }
.catalog-owners-arrow {
    transition: transform 0.2s;
}
.catalog-owners-dropdown.open .catalog-owners-arrow {
    transform: rotate(180deg);
}
.catalog-owners-dropdown.open .catalog-owners-toggle {
    order: 1;
}
.catalog-owners-dropdown {
    display: flex;
    flex-direction: column;
}
.catalog-owners-list {
    display: none;
}
.catalog-owners-dropdown.open .catalog-owners-list {
    display: block;
}
.catalog-owner-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}
.catalog-owner-item:hover { background: var(--item-bg); }
.catalog-owner-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.catalog-owner-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--border, #e0e0e0);
    color: var(--hint-color, #999);
    font-size: 15px;
    font-weight: 600;
}
.catalog-owner-info { display: flex; flex-direction: column; flex: 1; }
.catalog-owner-name { font-size: 14px; font-weight: 500; }
.catalog-owner-nickname { font-size: 12px; color: var(--hint-color); }

/* Reviews */
.review-card {
    padding: 14px; border: 1px solid var(--border-color, #eee);
    border-radius: 10px; margin-bottom: 10px;
}
.review-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.review-stars { color: #f5a623; font-size: 14px; }
.review-meta { font-size: 12px; color: var(--hint-color); }
.review-pros { color: #43A047; font-size: 14px; margin-bottom: 4px; }
.review-cons { color: #E53935; font-size: 14px; margin-bottom: 4px; }
.review-text { font-size: 14px; color: var(--text-color); line-height: 1.5; }
.rating-input { display: flex; gap: 4px; }
.rating-input .star { font-size: 28px; color: #ddd; cursor: pointer; transition: color 0.15s; }
.rating-input .star:hover, .rating-input .star.active { color: #f5a623; }

/* ============================
   Social Profile Enhancements
   ============================ */
.profile-sold-section { margin-top: 16px; opacity: 0.7; }
.profile-sold-title { font-size: 13px; color: var(--hint-color); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.profile-timeline { position: relative; padding-left: 20px; margin: 16px 0; }
.profile-timeline::before { content: ''; position: absolute; left: 6px; top: 0; bottom: 0; width: 2px; background: var(--border-color, #eee); }
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-item::before {
    content: ''; position: absolute; left: -17px; top: 4px;
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--accent-color, #4fc3f7); border: 2px solid var(--bg-color, #fff);
}
.timeline-item.sold::before { background: var(--hint-color); }
.timeline-item-title { font-weight: 600; font-size: 14px; }
.timeline-item-meta { font-size: 12px; color: var(--hint-color); margin-top: 2px; }

/* ─── Routes ─── */
.route-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
}
.route-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.route-date { font-size: 12px; color: var(--hint-color); }
.route-desc { font-size: 13px; color: var(--hint-color); margin-bottom: 10px; }
.route-points { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.route-point { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.route-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.route-dot-start { background: #4CAF50; }
.route-dot-end { background: #EF5350; }
.route-minimap { height: 140px; border-radius: 8px; margin-bottom: 10px; }
.route-card-footer { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--hint-color); }

/* ── Admin Analytics ── */
.an-tabs {
    display: flex;
    gap: 2px;
    background: var(--input-bg, #f2f2f7);
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 14px;
}
.an-tab {
    flex: 1;
    padding: 6px 4px;
    font-size: 12px;
    font-weight: 500;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.an-tab.active {
    background: var(--card-bg, #fff);
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,.10);
}
.an-group-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--text-secondary);
    margin: 14px 0 8px;
}
.an-group-title:first-child { margin-top: 0; }
.an-divider {
    height: 1px;
    background: var(--border-color);
    margin: 12px 0;
}
/* KPI grid */
.an-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
@media (max-width: 480px) { .an-kpi-grid { grid-template-columns: repeat(2, 1fr); } }
.an-kpi {
    background: var(--input-bg, #f7f7f9);
    border-radius: 10px;
    padding: 10px 12px;
}
.an-kpi-top { display: flex; align-items: baseline; gap: 6px; }
.an-kpi-val { font-size: 20px; font-weight: 700; line-height: 1.15; }
.an-kpi-trend { font-size: 11px; font-weight: 600; }
.an-trend-up { color: #4caf7d; }
.an-trend-dn { color: #d95f5f; }
.an-kpi-label { font-size: 12px; font-weight: 600; margin-top: 2px; }
.an-kpi-sub { font-size: 10px; color: var(--text-secondary); margin-top: 1px; line-height: 1.3; }
/* Stat rows */
.an-stat-block { display: flex; flex-direction: column; gap: 5px; }
.an-stat-block.compact .an-stat-row { padding: 2px 0; }
.an-stat-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    border-bottom: 1px solid var(--border-color);
}
.an-stat-row:last-child { border-bottom: none; }
.an-stat-label { font-size: 12px; color: var(--text-secondary); flex: 1; }
.an-stat-value { font-size: 13px; font-weight: 600; }
.an-stat-sub { font-size: 11px; color: var(--text-secondary); }
/* Bars */
.an-bars { display: flex; flex-direction: column; gap: 7px; }
.an-bar-row { display: flex; align-items: center; gap: 8px; }
.an-bar-label { font-size: 12px; width: 130px; flex-shrink: 0; color: var(--text-primary); }
.an-bar-track {
    flex: 1; height: 8px;
    background: transparent;
    border-radius: 3px; overflow: hidden;
}
.an-bar-fill {
    height: 100%; border-radius: 3px;
    background: rgba(229,57,53,0.18);
    border: 1px solid rgba(229,57,53,0.45);
    box-sizing: border-box;
    transition: width .35s ease;
}
.an-fill-green  { background: rgba(67,160,71,0.18);  border-color: rgba(67,160,71,0.45); }
.an-fill-red    { background: rgba(229,57,53,0.18);  border-color: rgba(229,57,53,0.45); }
.an-fill-amber  { background: rgba(251,140,0,0.18);  border-color: rgba(251,140,0,0.45); }
.an-bar-val { font-size: 11px; color: var(--text-secondary); width: 32px; text-align: right; flex-shrink: 0; }
.an-bar-legend { font-size: 10px; color: var(--text-secondary); margin-top: 4px; text-align: right; }
/* Feature cards */
.an-feat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
@media (max-width: 380px) { .an-feat-grid { grid-template-columns: 1fr; } }
.an-feat-card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
}
.an-feat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text-secondary); margin-bottom: 4px; }
.an-feat-val { font-size: 24px; font-weight: 700; line-height: 1.1; }
.an-feat-meta { font-size: 11px; color: var(--text-secondary); margin-top: 1px; }
/* User table */
.an-table-wrap { overflow-x: auto; margin-top: 4px; }
.an-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    min-width: 580px;
}
.an-th {
    padding: 7px 8px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}
.an-th:hover { color: var(--text-primary); }
.an-th-active { color: var(--text-primary) !important; }
.an-user-row { border-bottom: 1px solid var(--border-color); }
.an-user-row:last-child { border-bottom: none; }
.an-user-row:hover { background: var(--input-bg, #f7f7f9); }
.an-td-name { padding: 7px 8px; }
.an-td-c { padding: 7px 8px; text-align: center; white-space: nowrap; }
.an-name { font-weight: 500; font-size: 12px; }
.an-uname { font-size: 10px; color: var(--text-secondary); margin-top: 1px; }
.an-muted { color: var(--text-secondary); }
.an-online { color: #4caf7d; font-weight: 600; font-size: 11px; }
.an-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.an-badge-green  { background: #e8f5ee; color: #2e7d54; }
.an-badge-amber  { background: #fef3e2; color: #9a6200; }
.an-badge-red    { background: #fdecea; color: #b71c1c; }

/* ─── Discover / Nearby users ─── */
.discover-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.discover-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--input-bg, #f7f7f9);
    border-radius: 10px;
    transition: background 0.15s;
}
.discover-card:hover { background: var(--border-light, #eee); }
.discover-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--accent, #111);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}
.discover-info { flex: 1; min-width: 0; }
.discover-name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.discover-sub  { font-size: 11px; color: var(--text-secondary, #888); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.discover-follow-btn {
    flex-shrink: 0;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid var(--accent, #111);
    background: transparent;
    color: var(--accent, #111);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.discover-follow-btn:hover { background: var(--accent, #111); color: #fff; }
.discover-follow-btn--active { background: var(--accent, #111); color: #fff; }
.discover-follow-btn:disabled { opacity: 0.4; cursor: default; }

/* ─── Onboarding wizard ─── */
.onboarding-card {
    max-width: 420px;
    width: 100%;
    padding: 28px 24px 24px;
    text-align: center;
}
.ob-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 24px;
}
.ob-step {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--border-light, #e0e0e0);
    color: var(--text-secondary, #888);
    font-size: 13px;
    font-weight: 600;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background 0.25s, color 0.25s;
}
.ob-step.ob-step-active {
    background: var(--accent, #111);
    color: #fff;
}
.ob-step-line {
    flex: 1;
    max-width: 48px;
    height: 2px;
    background: var(--border-light, #e0e0e0);
    transition: background 0.25s;
}
.ob-step-line.ob-line-active { background: var(--accent, #111); }
.ob-icon { font-size: 40px; margin-bottom: 12px; }
.ob-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; color: var(--text-primary, #111); }
.ob-sub { font-size: 13px; color: var(--text-secondary, #888); margin-bottom: 4px; }
.ob-skip {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-secondary, #888);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.ob-skip:hover { color: var(--text-primary, #333); }
.ob-done-actions { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.ob-btn-outline {
    background: transparent !important;
    border: 1px solid var(--border-light, #ddd) !important;
    color: var(--text-primary, #333) !important;
}
.ob-btn-outline:hover { border-color: #999 !important; }

/* ─── Profile completeness card ─── */
.profile-completeness-card {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--card-radius, 12px);
    padding: 14px 16px;
    margin: 12px 0 16px;
}
.pc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}
.pc-title   { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.pc-pct     { font-size: 13px; font-weight: 700; color: var(--accent, #111); }
.pc-chevron { font-size: 12px; color: var(--text-secondary, #888); transition: transform 0.2s; }
.pc-open .pc-chevron { transform: rotate(180deg); }
.pc-body {
    display: none;
    overflow: hidden;
}
.pc-open .pc-body { display: block; }
.pc-bar {
    height: 6px;
    background: var(--border-light, #eee);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}
.pc-fill {
    height: 100%;
    background: var(--accent, #111);
    border-radius: 3px;
    transition: width 0.4s ease;
}
.pc-items { display: flex; flex-direction: column; gap: 6px; }
.pc-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    padding: 5px 6px;
    border-radius: 7px;
    transition: background 0.15s;
}
.pc-item.pc-todo {
    cursor: pointer;
    color: var(--text-primary);
}
.pc-item.pc-todo:hover { background: var(--input-bg, #f5f5f5); }
.pc-item.pc-done { color: var(--text-secondary, #888); }
.pc-item-icon {
    font-size: 13px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    font-weight: 700;
}
.pc-item.pc-done .pc-item-icon { color: var(--success, #4caf7d); }
.pc-item.pc-todo .pc-item-icon { color: var(--accent, #111); }
.pc-item-label { flex: 1; }
.pc-item-arrow { font-size: 11px; color: var(--text-secondary, #aaa); }

/* ─── Online counter in header ─── */
.online-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #4caf7d;
    border-radius: 50%;
    margin-left: 6px;
    vertical-align: middle;
    animation: pulse-online 2s ease-in-out infinite;
}
@keyframes pulse-online {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.online-count {
    font-size: 11px;
    color: var(--text-secondary, #888);
    margin-left: 4px;
    font-weight: 400;
    vertical-align: middle;
}

/* ─── Post reactions (hover-based, like chat) ─── */
.post-reactions-row {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 4px 0 2px;
    flex-wrap: wrap;
}
.forum-post:hover .post-reactions-row,
.post-reactions-row.has-reactions { display: flex; }

.post-reaction-chips { display: flex; gap: 4px; flex-wrap: wrap; }

.post-reaction-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: var(--input-bg, #f5f5f5);
    border: 1px solid var(--border-light, #e0e0e0);
    border-radius: 20px;
    padding: 3px 8px;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.12s, background 0.15s;
    line-height: 1;
}
.post-reaction-chip span {
    font-size: 12px;
    color: var(--text-secondary, #666);
    font-weight: 500;
}
.post-reaction-chip:hover { transform: scale(1.08); }
.post-reaction-chip.reaction-mine {
    background: #fff3cd;
    border-color: #ffc107;
}
.post-reaction-chip.reaction-mine span { color: #b8860b; }

.post-reaction-picker {
    display: flex;
    gap: 2px;
    margin-left: 2px;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.15s, max-width 0.2s;
}
.forum-post:hover .post-reaction-picker { max-width: 120px; opacity: 1; }

.post-emoji-pick {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 3px;
    border-radius: 6px;
    opacity: 0.4;
    transition: opacity 0.1s, transform 0.1s;
    font-family: inherit;
}
.post-emoji-pick:hover { opacity: 1; transform: scale(1.2); }

@media (hover: none) {
    .forum-post .post-reactions-row { display: flex; }
    .forum-post .post-reaction-picker { max-width: 120px !important; opacity: 1 !important; }
}

/* ─── Group Buy Tab ─── */
.gb-subtitle {
    font-size: 13px;
    color: var(--hint-color);
    margin: 0 0 16px;
    line-height: 1.5;
}

.gb-lot-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

.gb-lot-img {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    display: block;
    background: var(--secondary-bg);
}

.gb-lot-body {
    padding: 14px 16px 16px;
}

.gb-lot-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 6px;
    color: var(--text-color);
}

.gb-lot-desc {
    font-size: 13px;
    color: var(--hint-color);
    margin: 0 0 14px;
    line-height: 1.5;
}

.gb-vote-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 10px;
}

.gb-vote-btns {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.gb-vote-btn {
    flex: 1;
    padding: 10px 8px;
    border-radius: 10px;
    border: 1.5px solid var(--border-color);
    background: var(--secondary-bg);
    color: var(--text-color);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
}

.gb-vote-btn:hover { border-color: var(--accent); color: var(--accent); }

.gb-vote-btn.active-in {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.gb-vote-btn.active-out {
    background: var(--secondary-bg);
    border-color: var(--hint-color);
    color: var(--hint-color);
}

.gb-vote-counts {
    font-size: 12px;
    color: var(--hint-color);
    display: flex;
    gap: 14px;
}

.gb-vote-count-in { color: var(--accent); font-weight: 500; }

/* History */
.gb-history-item {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
}

.gb-history-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    user-select: none;
}

.gb-history-img {
    width: 100%;
    max-height: 160px;
    object-fit: cover;
    display: block;
    background: var(--secondary-bg);
    transition: max-height .35s ease, object-fit 0s .35s;
}

.gb-history-item.open .gb-history-img {
    max-height: 600px;
    object-fit: cover;
    transition: max-height .35s ease;
}

.gb-history-meta { flex: 1; min-width: 0; }

.gb-history-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 2px;
}

.gb-history-date {
    font-size: 12px;
    color: var(--hint-color);
}

.gb-history-total {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
}

.gb-history-chevron {
    color: var(--hint-color);
    transition: transform .2s;
}

.gb-history-item.open .gb-history-chevron { transform: rotate(180deg); }

.gb-history-breakdown {
    display: none;
    padding: 0 14px 14px;
    border-top: 1px solid var(--border-color);
}

.gb-history-item.open .gb-history-breakdown { display: block; }

.gb-breakdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 10px;
}

.gb-breakdown-table td {
    padding: 5px 0;
    color: var(--hint-color);
    vertical-align: top;
}

.gb-breakdown-table td:last-child {
    text-align: right;
    color: var(--text-color);
    font-variant-numeric: tabular-nums;
}

.gb-breakdown-table tr.gb-total td {
    font-weight: 700;
    color: var(--accent);
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
}

.gb-breakdown-note {
    font-size: 11px;
    color: var(--hint-color);
    margin-top: 8px;
    opacity: .7;
}

.gb-admin-form { padding: 12px; background: var(--secondary-bg); border-radius: 10px; margin-bottom: 16px; }

/* Participants droplist */
.gb-participants-row {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    margin-top: 2px;
}

.gb-avatars-mini {
    display: flex;
    margin-left: 4px;
}

.gb-avatar-mini {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--card-bg, var(--bg-color));
    margin-left: -6px;
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gb-avatar-mini:first-child { margin-left: 0; }

.gb-avatars-mini .gb-participant-avatar--empty {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--card-bg, var(--bg-color));
    margin-left: -6px;
    font-size: 10px;
}

.gb-participants-chevron {
    color: var(--accent);
    transition: transform .2s;
    flex-shrink: 0;
}

.gb-participants-list {
    margin-top: 10px;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
}

.gb-participant-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
}

.gb-participant-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.gb-participant-avatar--empty {
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gb-participant-name {
    font-size: 13px;
    color: var(--text-color);
}

.gb-participants-loading,
.gb-participants-empty {
    font-size: 12px;
    color: var(--hint-color);
    padding: 4px 0;
    margin: 0;
}
