/* GB7 Garage — application component styles */

/* ------------------------------------------------------------------ Shell */

.shell { min-height: 100dvh; }

.rail {
  display: none;
}

.main {
  padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 24px);
  min-width: 0;
}

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 var(--gutter);
  padding-top: env(safe-area-inset-top);
  box-sizing: content-box;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.topbar__title { font-weight: 700; letter-spacing: -0.01em; font-size: var(--fs-md); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__actions { display: flex; align-items: center; gap: 4px; }

.wordmark { display: inline-flex; align-items: baseline; gap: 6px; font-weight: 800; letter-spacing: 0.02em; font-size: 15px; }
.wordmark__gb7 { color: var(--text); }
.wordmark__garage { color: var(--muted); font-weight: 600; letter-spacing: 0.22em; font-size: 11px; }
.wordmark__dot { width: 6px; height: 6px; background: var(--accent); border-radius: 1px; transform: translateY(-1px); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(6, 1fr);
  height: var(--tabbar); padding-bottom: env(safe-area-inset-bottom); box-sizing: content-box;
  background: color-mix(in srgb, var(--bg-elev) 90%, transparent);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-top: 1px solid var(--line);
}
.tabbar a, .tabbar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600;
  color: var(--muted); background: none; border: 0; cursor: pointer; padding: 0;
  transition: color var(--dur) var(--ease);
}
.tabbar a.active { color: var(--text); }
.tabbar a.active svg { color: var(--accent); }
.tabbar__create span.plus {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 6px 20px rgba(228, 70, 44, 0.35);
}

@media (min-width: 1024px) {
  .shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); }
  .tabbar { display: none; }
  .main { padding-bottom: 48px; }
  .rail {
    display: flex; flex-direction: column; gap: 4px;
    position: sticky; top: 0; height: 100dvh; padding: 24px 16px;
    border-right: 1px solid var(--line); background: var(--bg);
  }
  .rail__brand { padding: 4px 12px 24px; }
  .rail a.navlink, .rail button.navlink {
    display: flex; align-items: center; gap: 14px; padding: 11px 12px; border-radius: var(--r-md);
    font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 650; color: var(--muted);
    background: none; border: 0; cursor: pointer; text-align: left; width: 100%;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  }
  .rail a.navlink:hover, .rail button.navlink:hover { background: var(--surface); color: var(--text); }
  .rail a.navlink.active { color: var(--text); background: var(--surface); }
  .rail a.navlink.active svg { color: var(--accent); }
  .rail__spacer { flex: 1; }
  .rail .btn { justify-content: center; margin: 12px 0; }
  .topbar--mobile-only { display: none; }
}

.page { padding: 20px var(--gutter) 0; max-width: var(--content); margin: 0 auto; }
.page--wide { max-width: var(--wide); }
.page--flush { padding-left: 0; padding-right: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 8px 0 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: var(--fs-xl); letter-spacing: -0.03em; line-height: 1.05; font-weight: 750; }
.page-head p { margin: 6px 0 0; color: var(--muted); }

.section { margin: 32px 0; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section__head h2 { margin: 0; font-size: var(--fs-md); font-weight: 700; letter-spacing: -0.01em; }
.section__head a { font-size: var(--fs-sm); color: var(--muted); }

/* ------------------------------------------------------------------ Buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: var(--r-md);
  font-size: var(--fs-sm); font-weight: 650; letter-spacing: 0.01em;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  cursor: pointer; white-space: nowrap; user-select: none;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform 80ms ease, opacity var(--dur);
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn--solid { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn--solid:hover { background: var(--text-2); }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: var(--surface); }
.btn--danger { color: var(--danger); }
.btn--lg { min-height: 50px; padding: 0 22px; font-size: var(--fs-base); border-radius: var(--r-lg); }
.btn--sm { min-height: 32px; padding: 0 12px; font-size: 12px; }
.btn--block { width: 100%; }
.btn--upper { text-transform: uppercase; letter-spacing: 0.14em; font-size: 11.5px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-md);
  border: 0; background: transparent; color: var(--text-2); cursor: pointer; position: relative;
}
.icon-btn:hover { background: var(--surface); color: var(--text); }
.icon-btn .dot {
  position: absolute; top: 8px; right: 8px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center;
}

/* ------------------------------------------------------------------ Forms */

.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > span.label { color: var(--text-2); }
.field__hint { font-size: 12px; color: var(--muted); }
.field__error { font-size: 12px; color: var(--danger); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 11px 14px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  outline: none; transition: border-color var(--dur) var(--ease), background var(--dur);
  font-size: 16px; /* prevents iOS zoom */
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--text-2); background: var(--surface-2); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: var(--fs-sm); color: var(--text-2); margin-bottom: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@media (min-width: 560px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
.fieldset { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 18px 4px; margin: 0 0 18px; }
.fieldset legend { padding: 0 6px; }

/* ------------------------------------------------------------------ Tabs, chips, segmented */

.tabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 18px;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button, .tabs a {
  flex-shrink: 0; padding: 12px 14px; margin-bottom: -1px; background: none; border: 0; border-bottom: 2px solid transparent;
  font-size: 11.5px; letter-spacing: var(--tracking-label); text-transform: uppercase; font-weight: 650;
  color: var(--muted); cursor: pointer;
}
.tabs .active, .tabs [aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tabs--sticky { position: sticky; top: calc(56px + env(safe-area-inset-top)); z-index: 20; background: var(--bg); }
@media (min-width: 1024px) { .tabs--sticky { top: 0; } }

.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.segmented button { padding: 7px 14px; border-radius: 8px; border: 0; background: none; color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips--scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  height: 34px; padding: 0 13px; border-radius: var(--r-pill);
  border: 1px solid var(--line-strong); background: transparent; color: var(--text-2);
  font-size: 12.5px; font-weight: 600; cursor: pointer; transition: all var(--dur) var(--ease);
}
.chip:hover { border-color: var(--text-2); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .swatch { width: 8px; height: 8px; border-radius: 2px; }

.tag {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700;
  background: var(--surface-2); color: var(--text-2);
}
.tag--accent { background: var(--accent-soft); color: var(--accent); }
.tag--legacy { background: var(--legacy-soft); color: var(--legacy); }
.tag--ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }

/* ------------------------------------------------------------------ Cards */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.card--pad { padding: 18px; }
.card--link { display: block; transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease); }
.card--link:hover { border-color: var(--line-strong); }

.stack { display: grid; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.tiny { font-size: 12px; }
.grow { flex: 1; min-width: 0; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.divider { height: 1px; background: var(--line); margin: 18px 0; border: 0; }

.grid-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.grid-badges { display: grid; gap: 18px 12px; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.hscroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 72%); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding-left: var(--gutter); padding-right: var(--gutter); scroll-padding: var(--gutter); }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; }
@media (min-width: 768px) { .hscroll { grid-auto-columns: minmax(260px, 300px); } }

/* Media / plates */
.media { position: relative; overflow: hidden; background: var(--surface-2); }
.media img { width: 100%; height: 100%; object-fit: cover; }
.ratio-16x9 { aspect-ratio: 16 / 9; }
.ratio-4x3 { aspect-ratio: 4 / 3; }
.ratio-4x5 { aspect-ratio: 4 / 5; }
.ratio-1 { aspect-ratio: 1; }
.ratio-21x9 { aspect-ratio: 21 / 9; }

.plate {
  position: relative; width: 100%; height: 100%; overflow: hidden;
  background:
    radial-gradient(120% 90% at 85% 10%, color-mix(in srgb, var(--plate-tone, var(--tone-road)) 26%, transparent), transparent 60%),
    linear-gradient(160deg, var(--surface-3), var(--surface) 70%);
}
.plate svg.plate__lines { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.55; color: var(--plate-tone, var(--tone-road)); }
.plate__code { position: absolute; left: 14px; bottom: 12px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em; color: var(--text-2); opacity: 0.8; }
.plate__glyph { position: absolute; right: 14px; top: 14px; color: var(--plate-tone, var(--tone-road)); opacity: 0.9; }

/* Location card */
.loc-card { overflow: hidden; }
.loc-card .media { aspect-ratio: 4 / 3; }
.loc-card__body { padding: 14px 16px 16px; }
.loc-card__kind { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.loc-card__name { font-size: var(--fs-md); font-weight: 700; letter-spacing: -0.015em; margin: 0; line-height: 1.2; }
.loc-card__meta { margin-top: 6px; font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.loc-card__state { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; z-index: 2; }

.kind-dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; flex-shrink: 0; }
.kind-road { --plate-tone: var(--tone-road); }
.kind-track { --plate-tone: var(--tone-track); }
.kind-museum { --plate-tone: var(--tone-museum); }
.kind-event { --plate-tone: var(--tone-event); }

/* Vehicle card */
.car-card { overflow: hidden; }
.car-card .media { aspect-ratio: 16 / 10; }
.car-card__body { padding: 14px 16px 16px; }
.car-card__year { font-family: var(--font-mono); font-size: 12px; color: var(--muted); letter-spacing: 0.08em; }
.car-card__title { margin: 2px 0 0; font-size: var(--fs-md); font-weight: 700; letter-spacing: -0.015em; line-height: 1.2; }
.car-card__variant { color: var(--muted); font-size: var(--fs-sm); }

.progress { height: 4px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width 400ms var(--ease); }

/* Avatar */
.avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: var(--surface-3); flex-shrink: 0; display: grid; place-items: center; font-weight: 700; color: var(--text-2); font-size: 14px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 32px; height: 32px; font-size: 12px; }
.avatar--xs { width: 24px; height: 24px; font-size: 10px; }
.avatar--lg { width: 88px; height: 88px; font-size: 30px; border: 3px solid var(--bg); }

/* User row */
.user-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.user-row__name { font-weight: 650; line-height: 1.2; }
.user-row__handle { color: var(--muted); font-size: 12.5px; }

/* ------------------------------------------------------------------ Post card */

.post { border-bottom: 1px solid var(--line); padding: 18px 0 14px; }
.post:first-child { padding-top: 6px; }
.post__head { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.post__who { flex: 1; min-width: 0; line-height: 1.3; }
.post__who a.name { font-weight: 650; }
.post__time { color: var(--muted); font-size: 12px; }
.post__activity { font-size: var(--fs-base); color: var(--text-2); margin: -2px 0 12px; line-height: 1.45; }
.post__activity b, .post__activity a.strong { color: var(--text); font-weight: 650; }
.post__body { margin: 0 0 12px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.55; }
.post__body a { color: var(--accent); }
.post__media { border-radius: var(--r-lg); overflow: hidden; margin-bottom: 12px; display: grid; gap: 2px; }
.post__media--2 { grid-template-columns: 1fr 1fr; }
.post__media--3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.post__media--3 > :first-child { grid-row: span 2; }
.post__media--4 { grid-template-columns: 1fr 1fr; }
.post__media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.post__media--1 img { aspect-ratio: auto; max-height: 640px; }
.post__attach { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 12px; background: var(--bg-elev); }
.post__attach:hover { border-color: var(--line-strong); }
.post__attach-text { flex: 1; min-width: 0; }
.post__attach-title { font-weight: 650; line-height: 1.25; }
.post__actions { display: flex; align-items: center; gap: 2px; margin-left: -10px; }
.post__actions button, .post__actions a {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border-radius: var(--r-md);
  background: none; border: 0; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer;
}
.post__actions button:hover, .post__actions a:hover { color: var(--text); background: var(--surface); }
.post__actions .on { color: var(--accent); }
.post__actions .spacer { flex: 1; }

/* ------------------------------------------------------------------ Badge emblem */

.badge-tile { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 6px 2px; border-radius: var(--r-lg); cursor: pointer; background: none; border: 0; color: inherit; }
.badge-tile:hover .emblem { transform: translateY(-2px); }
.badge-tile__name { font-size: 12.5px; font-weight: 650; line-height: 1.25; max-width: 13ch; }
.badge-tile__date { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); letter-spacing: 0.06em; }
.emblem { transition: transform var(--dur) var(--ease); }
.emblem--locked { opacity: 0.38; filter: grayscale(1); }

/* ------------------------------------------------------------------ Passport */

.passport-cover {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 26px 22px 22px;
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, rgba(255,255,255,0.018) 14px 15px),
    radial-gradient(120% 120% at 100% 0%, var(--accent-soft), transparent 55%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
}
.passport-cover__title { font-size: var(--fs-xs); letter-spacing: 0.28em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.passport-cover__name { font-size: var(--fs-xl); font-weight: 780; letter-spacing: -0.035em; line-height: 1; margin: 10px 0 2px; text-transform: uppercase; }
.passport-cover__mrz { font-family: var(--font-mono); font-size: 11px; color: var(--faint); letter-spacing: 0.12em; margin-top: 18px; overflow: hidden; white-space: nowrap; text-overflow: clip; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-top: 20px; }
@media (min-width: 640px) { .stat-grid--7 { grid-template-columns: repeat(7, 1fr); } .stat-grid--4 { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); padding: 14px 12px; }
.stat__n { font-family: var(--font-mono); font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.stat__l { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-top: 7px; font-weight: 650; }
.stat-grid--hero .stat__n { font-size: 30px; }

.country-stamp { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); }
.country-stamp__code { font-family: var(--font-mono); font-weight: 700; letter-spacing: 0.12em; }

/* ------------------------------------------------------------------ Timeline */

.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1px; background: var(--line-strong); }
.tl-item { position: relative; padding: 0 0 22px; }
.tl-item::before { content: ''; position: absolute; left: -21px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 2px solid var(--muted); }
.tl-item--accent::before { border-color: var(--accent); background: var(--accent); }
.tl-item__date { font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: 0.08em; }
.tl-item__title { font-weight: 650; margin: 3px 0 2px; }
.tl-item__body { color: var(--text-2); font-size: var(--fs-sm); white-space: pre-wrap; }
.tl-item__media { display: flex; gap: 6px; margin-top: 10px; }
.tl-item__media img { width: 84px; height: 64px; object-fit: cover; border-radius: var(--r-sm); }

/* ------------------------------------------------------------------ Hero (location / car / profile) */

.hero { position: relative; }
.hero .media { aspect-ratio: 16 / 11; }
@media (min-width: 768px) { .hero .media { aspect-ratio: 21 / 9; border-radius: 0 0 var(--r-xl) var(--r-xl); } }
.hero__shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(11,11,12,0.86)); pointer-events: none; }
.hero__content { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 20px; color: #f2efe9; }
.hero__content h1 { margin: 6px 0 0; font-size: var(--fs-2xl); line-height: 0.98; letter-spacing: -0.04em; font-weight: 800; text-transform: uppercase; }
.hero__content .label { color: rgba(242,239,233,0.75); }
.hero__credit { position: absolute; right: 10px; top: 10px; font-size: 10px; color: rgba(255,255,255,0.6); }

.spec-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
@media (min-width: 640px) { .spec-list { grid-template-columns: repeat(3, 1fr); } }
.spec { background: var(--surface); padding: 14px 16px; min-width: 0; }
.spec dt { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.spec dd { margin: 5px 0 0; font-weight: 650; overflow-wrap: anywhere; }
.spec dd.mono { font-size: 15px; }

.action-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.prose { color: var(--text-2); line-height: 1.7; white-space: pre-wrap; }
.prose p { margin: 0 0 1em; }

/* ------------------------------------------------------------------ Profile */

.profile-cover { aspect-ratio: 3 / 1; min-height: 140px; }
@media (min-width: 768px) { .profile-cover { border-radius: 0 0 var(--r-xl) var(--r-xl); } }
.profile-head { padding: 0 var(--gutter); max-width: var(--wide); margin: -44px auto 0; position: relative; }
.profile-head__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.profile-head h1 { margin: 12px 0 0; font-size: var(--fs-lg); letter-spacing: -0.02em; line-height: 1.15; }
.profile-head .handle { color: var(--muted); }
.profile-head .bio { margin: 10px 0 0; color: var(--text-2); white-space: pre-wrap; max-width: 60ch; }
.profile-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; margin-top: 10px; }
.profile-meta a b, .profile-meta span b { color: var(--text); font-weight: 650; }

/* ------------------------------------------------------------------ Map */

.map { width: 100%; height: 100%; min-height: 320px; background: var(--surface); border-radius: var(--r-lg); overflow: hidden; z-index: 0; }
.map-full { height: calc(100dvh - 56px - var(--tabbar) - env(safe-area-inset-bottom) - env(safe-area-inset-top) - 116px); min-height: 380px; }
@media (min-width: 1024px) { .map-full { height: calc(100dvh - 190px); } }
.leaflet-container { font-family: var(--font-sans); background: var(--surface) !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface) !important; color: var(--text) !important; border-radius: var(--r-md) !important; box-shadow: var(--shadow-2) !important; }
.leaflet-popup-content { margin: 12px 14px !important; font-size: 13px; }
.leaflet-popup-content a.pop-title { font-weight: 700; display: block; margin-bottom: 2px; }
.leaflet-control-attribution { background: color-mix(in srgb, var(--bg) 70%, transparent) !important; color: var(--muted) !important; font-size: 10px !important; }
.leaflet-control-attribution a { color: var(--text-2) !important; }
.leaflet-bar a { background: var(--surface) !important; color: var(--text) !important; border-color: var(--line) !important; }
.pin { width: 14px; height: 14px; border-radius: 4px; transform: rotate(45deg); border: 2px solid var(--bg); box-shadow: 0 2px 8px rgba(0,0,0,0.5); }
.pin--done { outline: 2px solid var(--text); outline-offset: 1px; }

/* ------------------------------------------------------------------ Overlays */

.backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,0.6); backdrop-filter: blur(3px); animation: fade 160ms var(--ease); }
.sheet {
  position: fixed; z-index: 81; left: 0; right: 0; bottom: 0; max-height: 88dvh; overflow: auto;
  background: var(--bg-elev); border-top: 1px solid var(--line-strong); border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 10px var(--gutter) calc(20px + env(safe-area-inset-bottom));
  animation: up 220ms var(--ease);
}
.sheet__grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 0 auto 14px; }
.sheet h2 { font-size: var(--fs-md); margin: 0 0 14px; }
@media (min-width: 768px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: min(560px, 92vw); transform: translate(-50%, -50%); border-radius: var(--r-xl); border: 1px solid var(--line-strong); animation: pop 200ms var(--ease); padding-bottom: 22px; }
  .sheet__grip { display: none; }
}
.create-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 480px) { .create-grid { grid-template-columns: repeat(3, 1fr); } }
.create-item { display: grid; gap: 10px; padding: 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); text-align: left; cursor: pointer; color: var(--text); font-weight: 650; font-size: 13.5px; line-height: 1.25; }
.create-item:hover { border-color: var(--line-strong); background: var(--surface-2); }
.create-item svg { color: var(--accent); }

.toasts { position: fixed; z-index: 100; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 14px); display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
@media (min-width: 1024px) { .toasts { bottom: 24px; } }
.toast { pointer-events: auto; padding: 12px 16px; border-radius: var(--r-md); background: var(--text); color: var(--bg); font-weight: 600; font-size: 13.5px; box-shadow: var(--shadow-2); animation: up 200ms var(--ease); }
.toast--error { background: var(--danger); color: #fff; }

/* Unlock celebration */
.unlock { text-align: center; padding: 10px 0 6px; }
.unlock__kicker { color: var(--accent); }
.unlock h2 { font-size: var(--fs-xl); letter-spacing: -0.03em; margin: 8px 0 4px; }
.unlock__emblems { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin: 22px 0; }
.unlock__emblems .emblem { animation: stamp 520ms var(--ease) both; }
.unlock__emblems .emblem:nth-child(2) { animation-delay: 120ms; }
.unlock__emblems .emblem:nth-child(3) { animation-delay: 240ms; }

/* ------------------------------------------------------------------ States */

.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 40%, var(--surface) 80%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: var(--r-md); }
.skel-line { height: 12px; margin: 8px 0; }
.empty { text-align: center; padding: 48px 20px; border: 1px dashed var(--line-strong); border-radius: var(--r-lg); color: var(--muted); }
.empty h3 { color: var(--text); margin: 14px 0 6px; font-size: var(--fs-md); }
.empty p { margin: 0 auto 16px; max-width: 42ch; font-size: var(--fs-sm); }
.empty svg { margin: 0 auto; color: var(--faint); }
.error-state { padding: 24px; border-radius: var(--r-lg); background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--text-2); }
.notice { padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); color: var(--text-2); font-size: var(--fs-sm); border: 1px solid var(--line); }
.notice--accent { background: var(--accent-soft); border-color: transparent; }

/* Uploader */
.uploader { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.uploader__tile { position: relative; aspect-ratio: 1; border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); }
.uploader__tile img { width: 100%; height: 100%; object-fit: cover; }
.uploader__tile button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,0.65); color: #fff; display: grid; place-items: center; cursor: pointer; }
.uploader__tile .cover-flag { position: absolute; left: 4px; bottom: 4px; }
.uploader__add { aspect-ratio: 1; border-radius: var(--r-md); border: 1px dashed var(--line-strong); display: grid; place-items: center; color: var(--muted); cursor: pointer; background: transparent; font-size: 12px; gap: 4px; align-content: center; }
.uploader__add:hover { color: var(--text); border-color: var(--text-2); }
.uploader__busy { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,0.5); color: #fff; font-size: 12px; }

/* Search */
.searchbar { position: relative; }
.searchbar svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.searchbar .input { padding-left: 42px; border-radius: var(--r-pill); }
.result-list { display: grid; }
.result { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.result:hover { background: var(--surface); }
.result__thumb { width: 48px; height: 48px; border-radius: var(--r-md); overflow: hidden; flex-shrink: 0; }

/* Notifications & messages */
.list-item { display: flex; align-items: flex-start; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.list-item--unread { background: linear-gradient(90deg, var(--accent-soft), transparent 60%); }
.bubbles { display: grid; gap: 6px; padding: 12px 0 90px; }
.bubble { max-width: 78%; padding: 9px 13px; border-radius: 16px; background: var(--surface-2); white-space: pre-wrap; word-wrap: break-word; }
.bubble--mine { justify-self: end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.bubble:not(.bubble--mine) { border-bottom-left-radius: 4px; }
.composer-bar { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding: 10px var(--gutter); background: var(--bg); border-top: 1px solid var(--line); display: flex; gap: 8px; }
@media (min-width: 1024px) { .composer-bar { left: var(--rail); bottom: 0; } }

/* Admin */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 650; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }

/* Auth */
.auth { min-height: 100dvh; display: grid; }
@media (min-width: 960px) { .auth { grid-template-columns: 1.1fr 1fr; } }
.auth__art { display: none; position: relative; overflow: hidden; border-right: 1px solid var(--line); }
@media (min-width: 960px) { .auth__art { display: block; } }
.auth__art-copy { position: absolute; left: 48px; bottom: 48px; right: 48px; }
.auth__art-copy h2 { font-size: var(--fs-2xl); line-height: 0.95; letter-spacing: -0.04em; margin: 12px 0 0; text-transform: uppercase; font-weight: 800; }
.auth__panel { display: flex; flex-direction: column; justify-content: center; padding: 32px var(--gutter); max-width: 460px; width: 100%; margin: 0 auto; }
.auth__panel h1 { font-size: var(--fs-xl); letter-spacing: -0.035em; line-height: 1.05; margin: 28px 0 8px; }
.auth__panel > p { color: var(--muted); margin: 0 0 26px; }

/* ------------------------------------------------------------------ Animations */

@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(16px); opacity: 0; } }
@keyframes pop { from { transform: translate(-50%, -48%) scale(0.98); opacity: 0; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes stamp { 0% { transform: scale(1.6) rotate(-12deg); opacity: 0; } 60% { transform: scale(0.94) rotate(2deg); opacity: 1; } 100% { transform: none; } }

/* Auth screens render without app navigation */
.shell--bare .rail, .shell--bare .tabbar, .shell--bare .topbar { display: none !important; }
.shell--bare { display: block; }
.shell--bare .main { padding-bottom: 0; }

/* Dark map: darken standard OSM tiles when no dark tile provider is configured */
.leaflet-tile-pane .tiles--dark { filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.88) saturate(0.35); }

/* Way out of the sign-in screens (they hide the app navigation) */
.auth__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 28px; font-size: 13px; }
.auth__top a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); padding: 8px 0; }
.auth__top a:hover { color: var(--text); }

/* Car cover photo controls */
.cover-btn { position: absolute; top: 14px; right: 14px; z-index: 3; display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 999px; background: rgba(0,0,0,0.55); color: #fff; font-size: 12.5px; font-weight: 650; cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.cover-btn:hover { background: rgba(0,0,0,0.7); }
.uploader__tile .make-cover { position: absolute; left: 4px; bottom: 4px; width: auto; height: auto; border-radius: 6px; padding: 3px 7px; font-size: 11px; font-weight: 650; background: rgba(0,0,0,0.65); color: #fff; border: 0; cursor: pointer; }
