/* ============================================================
   OnlyBuilds — base styles
   Design tokens lifted from BrickLookup with accent retuned to
   automotive orange. Keeps both sites recognizably sibling.
   ============================================================ */

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

:root {
    --bg-primary: #0f1117;
    --bg-secondary: #161822;
    --bg-card: #1c1f2e;
    --bg-card-hover: #242840;
    --bg-input: #1c1f2e;
    --bg-sidebar: #161822;
    --border: #2a2d3e;
    --border-hover: #3a3d5e;
    --text-primary: #e8eaf0;
    --text-secondary: #9499b3;
    --text-muted: #7a7f9e;
    --accent: #ff6b35;
    --accent-hover: #ff8559;
    --accent-dim: rgba(255, 107, 53, 0.12);
    --green: #34d399;
    --orange: #fb923c;
    --red: #f87171;
    --blue: #60a5fa;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 18px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
    --transition: 0.2s ease;
    --sidebar-width: 280px;
    --header-height: 64px;
    --max-content: 1400px;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ─── Site Header ─────────────────────────────────────────── */

.site-header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background: rgba(15, 17, 23, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 20px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 19px;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    flex-shrink: 0;
}
.site-logo .logo-mark {
    width: 30px; height: 30px;
    background: linear-gradient(135deg, var(--accent), #ff3d00);
    border-radius: 8px;
    display: grid; place-items: center;
    color: #0f1117;
    font-weight: 900;
}
.site-logo .logo-text { color: var(--text-primary); }
.site-logo .logo-text em { color: var(--accent); font-style: normal; }

.header-search {
    position: relative;
    flex: 1;
    max-width: 520px;
}
.header-search input {
    width: 100%;
    height: 40px;
    padding: 0 14px 0 42px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.header-search input::placeholder { color: var(--text-muted); }
.header-search input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}
.header-search svg {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    width: 18px; height: 18px; color: var(--text-muted); pointer-events: none;
}

.header-nav { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.header-nav a, .header-nav button {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    background: transparent;
    border: none;
    transition: all var(--transition);
}
.header-nav a:hover, .header-nav button:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.04);
}

.btn-primary {
    background: var(--accent) !important;
    color: #0f1117 !important;
    font-weight: 600 !important;
}
.btn-primary:hover { background: var(--accent-hover) !important; color: #0f1117 !important; }

.avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--bg-card); border: 1px solid var(--border);
    object-fit: cover;
}

/* ─── Browse Layout (matches BrickLookup) ─────────────────── */

.layout { display: flex; min-height: calc(100vh - var(--header-height)); }

.sidebar {
    position: sticky;
    top: var(--header-height);
    align-self: flex-start;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 20px 16px 80px;
    flex-shrink: 0;
}

.sidebar-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.sidebar-header h2 { font-size: 16px; font-weight: 700; }
.clear-filters-btn {
    background: none; border: 1px solid var(--border);
    color: var(--text-secondary); font-size: 12px;
    padding: 4px 12px; border-radius: 6px;
    transition: all var(--transition);
}
.clear-filters-btn:hover { border-color: var(--accent); color: var(--accent); }

.filter-group { margin-bottom: 8px; }
.filter-title {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 8px; font-size: 12px; font-weight: 700;
    color: var(--text-secondary); text-transform: uppercase;
    letter-spacing: 0.5px; cursor: pointer;
    border-radius: var(--radius-sm); user-select: none;
}
.filter-title:hover { background: rgba(255,255,255,0.03); }
.filter-title .chevron { width: 16px; height: 16px; transition: transform 0.3s ease; }
.filter-title.collapsed .chevron { transform: rotate(-90deg); }

.filter-options { padding: 4px 0; max-height: 380px; overflow-y: auto; }
.filter-options.collapsed { max-height: 0; overflow: hidden; padding: 0; }

.filter-option {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 8px; border-radius: 6px; cursor: pointer;
    transition: background var(--transition);
    font-size: 13px; color: var(--text-primary);
}
.filter-option:hover { background: rgba(255,255,255,0.04); }
.filter-option input[type="checkbox"], .filter-option input[type="radio"] { display: none; }
.checkmark {
    width: 18px; height: 18px; border: 2px solid var(--border-hover);
    border-radius: 4px; flex-shrink: 0; position: relative;
    transition: all var(--transition);
}
.filter-option input:checked + .checkmark {
    background: var(--accent); border-color: var(--accent);
}
.filter-option input:checked + .checkmark::after {
    content: ''; position: absolute; left: 5px; top: 2px;
    width: 5px; height: 9px; border: solid var(--bg-primary);
    border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.filter-label { flex: 1; }
.filter-count {
    font-size: 11px; color: var(--text-muted);
    background: var(--bg-primary); padding: 1px 7px;
    border-radius: 10px; min-width: 24px; text-align: center;
}

.see-more-btn {
    background: none; border: none; color: var(--accent);
    font-size: 12px; font-weight: 600; padding: 6px 8px;
}
.see-more-btn:hover { text-decoration: underline; }

/* Range sliders (year, future numeric filters) */
.slider-filter { padding: 8px 8px 4px; }
.slider-values {
    display: flex; justify-content: space-between;
    font-size: 13px; font-weight: 600;
    color: var(--accent); margin-bottom: 10px;
}
.range-slider { position: relative; height: 30px; }
.range-slider input[type="range"] {
    position: absolute;
    width: 100%; height: 30px; top: 0;
    pointer-events: none;
    -webkit-appearance: none; appearance: none;
    background: transparent;
    z-index: 2; margin: 0;
}
.range-slider input[type="range"]::-webkit-slider-thumb {
    pointer-events: all;
    -webkit-appearance: none;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-primary);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
    position: relative; z-index: 3;
}
.range-slider input[type="range"]::-moz-range-thumb {
    pointer-events: all;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-primary);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.slider-track {
    position: absolute; top: 50%; transform: translateY(-50%);
    left: 0; right: 0; height: 4px;
    background: var(--border); border-radius: 2px;
    z-index: 1;
}
.slider-track::after {
    content: ''; position: absolute;
    height: 100%; background: var(--accent);
    border-radius: 2px;
    left: var(--slider-left, 0%);
    right: var(--slider-right, 0%);
}

/* ─── Main content ────────────────────────────────────────── */

.main-content {
    flex: 1;
    padding: 20px 24px 80px;
    min-width: 0;
}

.toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.toolbar-left { display: flex; align-items: center; gap: 12px; }
.result-count { font-size: 14px; color: var(--text-secondary); font-weight: 600; }
.sort-select {
    background: var(--bg-card); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: 8px;
    padding: 8px 30px 8px 12px; font-size: 13px; font-family: inherit;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239499b3' stroke-width='2'><path d='m6 9 6 6 6-6'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    cursor: pointer;
}

/* ─── Build / Car cards (browse grid) ─────────────────────── */

.build-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.build-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform var(--transition), border-color var(--transition), background var(--transition);
    display: flex; flex-direction: column;
}
.build-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.build-card-photo {
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, #1c1f2e, #242840);
    position: relative;
    overflow: hidden;
}
.build-card-photo img {
    width: 100%; height: 100%; object-fit: cover;
}
.build-card-photo .badge {
    position: absolute; top: 10px; left: 10px;
    background: rgba(15,17,23,0.78); backdrop-filter: blur(6px);
    color: var(--accent); font-size: 11px; font-weight: 700;
    padding: 4px 8px; border-radius: 6px;
    text-transform: uppercase; letter-spacing: 0.5px;
}

.build-card-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.build-card-title { font-size: 15px; font-weight: 700; line-height: 1.3; }
.build-card-sub { font-size: 12px; color: var(--text-muted); }

.build-card-owner {
    display: flex; align-items: center; gap: 8px;
    padding-top: 10px; margin-top: auto;
    border-top: 1px solid var(--border);
    font-size: 12px; color: var(--text-secondary);
}
.build-card-owner .avatar { width: 24px; height: 24px; }
.build-card-stats {
    display: flex; align-items: center; gap: 12px;
    margin-left: auto; color: var(--text-muted); font-size: 12px;
}
.build-card-stats span { display: inline-flex; align-items: center; gap: 4px; }
.build-card-stats svg { width: 13px; height: 13px; }

/* ─── Profile page ────────────────────────────────────────── */

.profile-wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 18px 80px;
}

.profile-head {
    display: flex; flex-direction: column; align-items: center;
    text-align: center; gap: 14px; padding: 14px 0 24px;
}
.profile-avatar {
    width: 112px; height: 112px; border-radius: 50%;
    border: 3px solid var(--bg-primary);
    box-shadow: 0 0 0 2px var(--accent), var(--shadow-lg);
    object-fit: cover;
    background: var(--bg-card);
}
.profile-name { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.profile-handle { font-size: 14px; color: var(--text-muted); }
.profile-bio { font-size: 14px; color: var(--text-secondary); max-width: 480px; line-height: 1.55; }
.profile-meta {
    display: flex; gap: 18px; font-size: 13px; color: var(--text-secondary);
    flex-wrap: wrap; justify-content: center;
}
.profile-meta strong { color: var(--text-primary); font-weight: 700; }

.profile-actions {
    display: flex; gap: 8px; margin-top: 4px;
}
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 16px; border-radius: 10px;
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text-primary); font-size: 13px; font-weight: 600;
    transition: all var(--transition);
}
.btn:hover { background: var(--bg-card-hover); border-color: var(--border-hover); }
.btn.btn-accent {
    background: var(--accent); color: #0f1117; border-color: var(--accent);
}
.btn.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* Social links (linktree-style) */
.profile-links {
    display: flex; flex-direction: column; gap: 8px;
    margin: 18px 0 24px;
}
.profile-link {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px; font-weight: 600;
    transition: all var(--transition);
}
.profile-link:hover {
    transform: translateY(-1px);
    border-color: var(--accent);
    background: var(--bg-card-hover);
}
.profile-link .platform-icon {
    width: 22px; height: 22px; flex-shrink: 0;
    color: var(--accent);
}
.profile-link .label { flex: 1; }
.profile-link .external {
    color: var(--text-muted); font-size: 12px;
}

/* Profile garage grid */
.profile-section-title {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 12px; font-weight: 700;
    color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.6px;
    margin: 4px 0 12px;
}
.profile-section-title a { color: var(--accent); text-transform: none; letter-spacing: 0; }

.profile-cars {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.profile-car {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition);
}
.profile-car:hover { border-color: var(--accent); transform: translateY(-2px); }
.profile-car-photo { aspect-ratio: 16/10; background: var(--bg-secondary); }
.profile-car-photo img { width: 100%; height: 100%; object-fit: cover; }
.profile-car-body { padding: 10px 12px; }
.profile-car-title { font-size: 14px; font-weight: 700; line-height: 1.2; }
.profile-car-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* QR modal */
.qr-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.7);
    display: none; align-items: center; justify-content: center;
    z-index: 200; padding: 24px;
}
.qr-overlay.active { display: flex; }
.qr-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 28px 22px;
    max-width: 360px; width: 100%;
    text-align: center;
}
.qr-canvas {
    background: #fff; border-radius: var(--radius);
    padding: 16px; margin: 14px auto;
    width: fit-content;
}
.qr-canvas canvas, .qr-canvas svg { display: block; }
.qr-url {
    font-size: 12px; color: var(--text-muted);
    word-break: break-all; margin-top: 4px;
}

/* ─── Car detail page ─────────────────────────────────────── */

.car-wrap { max-width: 920px; margin: 0 auto; padding: 16px 18px 80px; }

.car-back {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--text-secondary); font-size: 13px;
    margin-bottom: 12px;
}
.car-back:hover { color: var(--accent); }

/* Slideshow — ported from Tunerzine: main image + thumbnail strip */
.ob-gallery {
    margin: 0 0 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.ob-gallery-main {
    position: relative;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    aspect-ratio: 3/2;
    overflow: hidden;
}

.ob-gallery-image-wrap {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%;
    cursor: zoom-in;
}

.ob-gallery-image {
    display: block;
    max-width: 100%; max-height: 100%;
    width: auto; height: auto;
    object-fit: contain;
}

.ob-gallery-controls {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--bg-secondary);
    padding: 12px;
    border-top: 1px solid var(--border);
}

.ob-gallery-nav {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    width: 44px; height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    padding: 0;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.ob-gallery-nav:hover {
    background: var(--accent); border-color: var(--accent); color: #0f1117;
}

.ob-gallery-chevron {
    display: inline-block; width: 12px; height: 12px;
    border-top: 2.5px solid currentColor;
    border-right: 2.5px solid currentColor;
}
.ob-gallery-prev .ob-gallery-chevron { transform: rotate(-135deg); margin-left: 3px; }
.ob-gallery-next .ob-gallery-chevron { transform: rotate(45deg); margin-right: 3px; }

.ob-gallery-counter {
    color: var(--text-secondary);
    font-size: 12px; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase;
}

.ob-gallery-thumbs {
    display: flex; gap: 6px;
    padding: 0 12px 14px;
    overflow-x: auto; overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) rgba(255,255,255,0.08);
    background: var(--bg-secondary);
    max-width: 100%; min-width: 0;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    white-space: nowrap;
}
.ob-gallery-thumbs::-webkit-scrollbar { height: 12px; }
.ob-gallery-thumbs::-webkit-scrollbar-thumb {
    background: var(--accent); border-radius: 6px; min-width: 60px;
}
.ob-gallery-thumbs::-webkit-scrollbar-thumb:hover { background: var(--accent-hover); }
.ob-gallery-thumbs::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.08);
    border-radius: 6px; margin: 0 4px;
}

.ob-gallery-thumb {
    flex: 0 0 auto;
    width: 120px; height: 80px;
    padding: 0;
    border: 2px solid transparent;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    transition: border-color var(--transition);
}
.ob-gallery-thumb img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.ob-gallery-thumb:hover { border-color: var(--border-hover); }
.ob-gallery-thumb.active { border-color: var(--accent); }

@media (max-width: 600px) {
    .ob-gallery-nav { width: 40px; height: 40px; }
    .ob-gallery-thumb { width: 90px; height: 60px; }
}

.car-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; margin-bottom: 8px; flex-wrap: wrap;
}
.car-title { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.car-sub { font-size: 14px; color: var(--text-muted); margin-top: 2px; }

.car-owner {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
}
.car-owner .avatar { width: 32px; height: 32px; }

.car-desc {
    margin: 14px 0 20px;
    font-size: 14px; line-height: 1.6;
    color: var(--text-secondary);
}

/* Mod list */
.mod-section { margin-top: 28px; }
.mod-section h2 {
    font-size: 18px; font-weight: 700;
    margin-bottom: 12px;
}

.mod-category {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
    overflow: hidden;
}
.mod-category-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}
.mod-category-title {
    font-size: 12px; font-weight: 700;
    color: var(--accent);
    text-transform: uppercase; letter-spacing: 0.6px;
}
.mod-category-count {
    font-size: 12px; color: var(--text-muted);
}
.mod-list { list-style: none; }
.mod-item {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 14px; padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
.mod-item:last-child { border-bottom: none; }
.mod-info { min-width: 0; flex: 1; }
.mod-name { font-size: 14px; font-weight: 600; }
.mod-brand { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.mod-notes { font-size: 12px; color: var(--text-secondary); margin-top: 4px; line-height: 1.5; }
.mod-cta {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 10px; border-radius: 8px;
    background: var(--accent-dim); color: var(--accent);
    font-size: 12px; font-weight: 600;
    border: 1px solid transparent;
    white-space: nowrap;
    transition: all var(--transition);
}
.mod-cta:hover {
    background: var(--accent); color: #0f1117;
}

/* ─── Forms / editor ──────────────────────────────────────── */

.form-row { margin-bottom: 14px; }
.form-row label {
    display: block; font-size: 12px; font-weight: 600;
    color: var(--text-secondary); margin-bottom: 6px;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.form-row input[type="text"],
.form-row input[type="url"],
.form-row input[type="number"],
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-row textarea { min-height: 90px; resize: vertical; }
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

/* Platform picker — quick-add chips for social links */
.platform-picker {
    display: flex; flex-wrap: wrap; gap: 8px;
}
.platform-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-primary);
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}
.platform-chip:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
}
.platform-chip.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}
.platform-chip svg {
    width: 16px; height: 16px;
}
.platform-chip.active svg { color: var(--accent); }

/* Saved-link row inside garage editor */
.saved-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
}
.saved-link .platform-icon {
    width: 22px; height: 22px;
    color: var(--accent);
    flex-shrink: 0;
    display: inline-flex;
}
.saved-link .saved-link-info { flex: 1; min-width: 0; }
.saved-link .saved-link-platform {
    font-size: 11px; font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.saved-link .saved-link-handle {
    font-size: 14px; font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.saved-link .saved-link-actions {
    display: flex; gap: 4px;
}
.saved-link .icon-btn {
    width: 30px; height: 30px;
    display: grid; place-items: center;
    background: none; border: none; color: var(--text-muted);
    border-radius: 6px;
    transition: all var(--transition);
}
.saved-link .icon-btn:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}
.saved-link .icon-btn.danger:hover { color: var(--red); }

.editor-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 14px;
}

/* ─── Empty / loading states ──────────────────────────────── */

.empty {
    text-align: center; padding: 60px 20px;
    color: var(--text-muted);
}
.empty h3 { color: var(--text-primary); margin-bottom: 6px; }
.empty p { font-size: 14px; }

.skeleton {
    background: linear-gradient(90deg, var(--bg-card), var(--bg-card-hover), var(--bg-card));
    background-size: 200% 100%;
    animation: skeleton 1.5s infinite;
}
@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ─── Mobile ──────────────────────────────────────────────── */

@media (max-width: 860px) {
    .sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        height: 100vh;
        z-index: 150;
        transform: translateX(-100%);
        width: 86%; max-width: 320px;
        transition: transform 0.3s ease;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay {
        position: fixed; inset: 0; background: rgba(0,0,0,0.6);
        z-index: 140; display: none;
    }
    .sidebar-overlay.active { display: block; }
    .main-content { padding: 14px 14px 80px; }
    .build-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
    .header-nav a:not(.btn-primary) { display: none; }
    .car-title { font-size: 22px; }
    .profile-name { font-size: 22px; }
    .profile-avatar { width: 96px; height: 96px; }
    .site-logo { font-size: 17px; }
    .site-logo .logo-mark { width: 26px; height: 26px; }
}

@media (max-width: 480px) {
    .header-search { max-width: none; }
    .site-header { padding: 0 12px; gap: 10px; }
    .build-grid { grid-template-columns: 1fr 1fr; }
    .build-card-body { padding: 10px; }
    .build-card-title { font-size: 13px; }
}
