/* ==========================================================================
   Summit — design system
   ========================================================================== */
:root {
  --bg: #f5f7f5; --surface: #ffffff; --surface-2: #f0f4f1; --surface-3: #e7ede9;
  --ink: #1d2826; --ink-2: #3b4845; --muted: #6b7a76; --line: #e1e8e4; --line-strong: #cfd9d4;
  --mint: #d9f29a; --mint-strong: #9ac356; --accent: #4f7f3a; --accent-ink: #1d2826; --orange: #ec7548; --danger: #d6453a; --ok: #2f8f5b; --warn: #b8860b;
  --shadow-sm: 0 1px 2px rgba(22, 34, 31, .06); --shadow: 0 10px 30px rgba(22, 34, 31, .08); --shadow-lg: 0 24px 60px rgba(22, 34, 31, .18);
  --radius: 16px; --radius-sm: 10px; --radius-lg: 22px;
  --sidebar-w: 248px; --topbar-h: 64px;
  --font: Manrope, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
body.theme-dark {
  --bg: #0e1413; --surface: #151d1c; --surface-2: #1b2524; --surface-3: #23302e;
  --ink: #e7eee9; --ink-2: #c3cfca; --muted: #8fa19b; --line: #25312f; --line-strong: #33413e;
  --accent: #b5d98a; --shadow: 0 10px 30px rgba(0, 0, 0, .35); --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
body.has-overlay { overflow: hidden; }
img, video, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; line-height: 1.15; }
h1 { font-size: clamp(26px, 3vw, 34px); font-weight: 800; }
h2 { font-size: 22px; font-weight: 800; }
h3 { font-size: 16px; font-weight: 700; }
h4 { font-size: 14px; font-weight: 700; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--mint-strong); outline-offset: 2px; border-radius: 6px; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 999; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 12px; }
.icon { flex-shrink: 0; display: block; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- Type utils */
.eyebrow { font: 500 10.5px/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.eyebrow.accent { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.danger { color: var(--danger) !important; }
.spacer { flex: 1; }
.mt { margin-top: 22px; }
.section-label { display: flex; align-items: center; gap: 8px; font-size: 17px; margin: 28px 0 14px; }
.section-label small { font-weight: 500; font-size: 13px; }
.section-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.big-num { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }

/* ------------------------------------------------------------------ Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; font-weight: 700; font-size: 13.5px; white-space: nowrap; transition: transform .15s var(--ease), background .2s, box-shadow .2s, color .2s; border: 1px solid transparent; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--ink); color: var(--mint); }
.btn-primary:hover { box-shadow: 0 6px 18px rgba(29, 40, 38, .25); }
body.theme-dark .btn-primary { background: var(--mint); color: #17201e; }
.btn-ghost { border-color: var(--line-strong); background: var(--surface); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-soft { background: var(--surface-2); color: var(--ink); }
.btn-soft:hover { background: var(--surface-3); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-glass { background: rgba(255, 255, 255, .18); color: #fff; border-color: rgba(255, 255, 255, .45); backdrop-filter: blur(8px); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn-xs { height: 26px; padding: 0 10px; font-size: 11.5px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 14.5px; }
.btn-block { width: 100%; }
.grow { flex: 1; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--ink-2); transition: background .2s, color .2s, transform .15s; flex-shrink: 0; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.on { color: var(--accent); }
.icon-btn.on .icon { fill: currentColor; }
.icon-btn.filled { background: var(--ink); color: var(--mint); }
body.theme-dark .icon-btn.filled { background: var(--mint); color: #17201e; }
.icon-btn.glass { background: rgba(10, 15, 14, .45); color: #fff; backdrop-filter: blur(10px); }
.icon-btn.glass:hover { background: rgba(10, 15, 14, .65); }
.link, .link-plain, .link-strong { font-weight: 700; color: var(--ink); text-align: left; }
.link { color: var(--accent); }
.link:hover, .link-plain:hover { text-decoration: underline; }
.link-strong { font-weight: 800; }
.text-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--accent); font-size: 13px; }
.muted-link { color: var(--muted); font-size: 13px; margin: 4px 0; }

/* -------------------------------------------------------------------- Forms */
.input { width: 100%; height: 42px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); transition: border .2s, box-shadow .2s; }
textarea.input { height: auto; padding: 11px 14px; resize: vertical; line-height: 1.5; }
select.input { padding-right: 32px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7a76' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input:focus { outline: none; border-color: var(--mint-strong); box-shadow: 0 0 0 4px rgba(154, 195, 86, .22); }
.input.narrow { width: auto; min-width: 150px; }
.input-icon { position: relative; display: flex; align-items: center; }
.input-icon > .icon { position: absolute; left: 13px; color: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 38px; }
.form-stack { display: grid; gap: 14px; }
.field { display: grid; gap: 7px; }
.field > label, .field-head label, .tool-label { font-weight: 700; font-size: 13px; }
.field > .seg, .field > .stepper-input { justify-self: start; align-self: start; }
.field-head { display: flex; justify-content: space-between; align-items: baseline; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.range { width: 100%; accent-color: var(--mint-strong); height: 24px; }
.range-field { display: grid; gap: 2px; font-size: 13px; }
.range-field span { display: flex; justify-content: space-between; }
.range-inline { display: flex; align-items: center; gap: 10px; font-size: 13px; white-space: nowrap; }
.range-inline .range { width: 130px; }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.check-row input { margin-top: 3px; accent-color: var(--mint-strong); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; font-weight: 600; }
.switch-row > span:first-child { display: grid; }
.switch-row small { font-weight: 500; }
.switch-row.inline { padding: 0; gap: 10px; font-size: 13px; }
.switch { position: relative; width: 44px; height: 26px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--line-strong); border-radius: 99px; transition: .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--mint-strong); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--mint-strong); outline-offset: 2px; }
.seg { display: inline-flex; padding: 4px; gap: 2px; background: var(--surface-2); border-radius: 999px; }
.seg.full { display: flex; }
.seg.full button { flex: 1; }
.seg.center { display: flex; width: fit-content; margin: 6px auto 0; }
.seg button { height: 32px; padding: 0 14px; border-radius: 999px; font-weight: 700; font-size: 12.5px; color: var(--muted); transition: .2s; }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-row.tight { gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-strong); font-weight: 600; font-size: 12.5px; transition: .15s; white-space: nowrap; }
.chip:hover { border-color: var(--ink-2); }
.chip.active { background: var(--ink); color: var(--mint); border-color: var(--ink); }
body.theme-dark .chip.active { background: var(--mint); color: #17201e; border-color: var(--mint); }
.chip.static { cursor: default; background: var(--surface-2); border-color: transparent; }
.chip.static:hover { border-color: transparent; }
.chip.xs { height: 22px; padding: 0 8px; font-size: 11px; }
.chip.ghost { border-style: dashed; color: var(--muted); }
.chip.ok { color: var(--ok); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 28px; height: 28px; border-radius: 50%; background: var(--c); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); }
.swatch.active { box-shadow: 0 0 0 2px var(--ink); }
.stepper-input { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 999px; height: 42px; background: var(--surface); }
.stepper-input button { width: 40px; height: 100%; display: grid; place-items: center; border-radius: 999px; }
.stepper-input button:hover { background: var(--surface-2); }
.stepper-input output { min-width: 32px; text-align: center; font-weight: 800; }
.stepper-input.sm { height: 32px; }
.stepper-input.sm button { width: 30px; }
.time-input { position: relative; }
.time-input input { width: 100%; height: 56px; font: 700 26px var(--mono); padding: 0 44px 0 16px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface); }
.time-input .icon { position: absolute; right: 16px; top: 19px; color: var(--muted); }
.option-list { display: grid; gap: 10px; }
.option { display: grid; grid-template-columns: auto auto 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: 14px; cursor: pointer; transition: .15s; }
.option input { accent-color: var(--mint-strong); }
.option > span:nth-child(3) { display: grid; }
.option.active { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 13px; }
.notice.ok { background: rgba(47, 143, 91, .1); color: var(--ok); }

/* ---------------------------------------------------------------- Surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card.pad { padding: 22px; }
.card-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.card-grid.compact { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.empty { display: grid; justify-items: center; gap: 10px; padding: 48px 24px; text-align: center; grid-column: 1 / -1; color: var(--muted); }
.empty h3 { color: var(--ink); }
.empty-inline { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 16px 4px; font-size: 13px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin-top: 6px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px; margin-bottom: 20px; }
.tabs-line { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 6px 0 22px; overflow-x: auto; scrollbar-width: none; }
.tabs-line .tab { display: inline-flex; align-items: center; gap: 8px; padding: 12px 14px; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs-line .tab.active { color: var(--ink); border-color: var(--ink); }
.progress { display: block; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress.thin { height: 5px; }
.progress i { display: block; height: 100%; border-radius: inherit; background: var(--mint-strong); transition: width .6s var(--ease); }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 700; background: rgba(0, 0, 0, .55); color: #fff; }
.status-pill.ok { background: rgba(47, 143, 91, .92); }
.tier-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 99px; font: 500 10.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--tier); background: color-mix(in srgb, var(--tier) 14%, transparent); border: 1px solid color-mix(in srgb, var(--tier) 40%, transparent); }
.tier-emblem { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: #fff; background: linear-gradient(145deg, color-mix(in srgb, var(--tier) 80%, #fff), var(--tier)); box-shadow: 0 6px 16px color-mix(in srgb, var(--tier) 40%, transparent); flex-shrink: 0; }
.tier-emblem.sm { width: 30px; height: 30px; border-radius: 10px; }
.tier-emblem.lg { width: 58px; height: 58px; border-radius: 18px; transform: rotate(-4deg); }
.tier-emblem.lg b { position: absolute; right: -6px; bottom: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); color: var(--ink); font-size: 11px; display: grid; place-items: center; box-shadow: var(--shadow-sm); transform: rotate(4deg); }
.stars { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; }
.stars .star-icon { color: #e8a317; fill: #e8a317; }
.difficulty-meter { display: inline-flex; gap: 3px; }
.difficulty-meter i { width: 16px; height: 6px; border-radius: 3px; background: var(--surface-3); }
.difficulty-meter i.on { background: linear-gradient(90deg, var(--mint-strong), var(--orange)); }
.difficulty-row { display: flex; align-items: center; gap: 10px; font-size: 13px; margin: 12px 0; }
.difficulty-row.compact { margin: 8px 0; flex-wrap: wrap; gap: 8px; }
.kind-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; background: var(--pin); color: #fff; font-size: 11.5px; font-weight: 700; box-shadow: 0 4px 12px rgba(0, 0, 0, .2); }
.grade-badge { font: 500 11.5px var(--mono); padding: 4px 8px; border-radius: 8px; background: var(--surface-2); white-space: nowrap; }
.elev-badge { position: absolute; left: 12px; bottom: 12px; font: 500 12px var(--mono); padding: 5px 10px; border-radius: 99px; background: rgba(0, 0, 0, .55); color: #fff; backdrop-filter: blur(6px); }
.date-block { display: grid; place-items: center; min-width: 48px; padding: 6px 4px; border-radius: 12px; background: var(--surface-2); line-height: 1.1; }
.date-block small { font: 500 10px var(--mono); text-transform: uppercase; color: var(--muted); letter-spacing: .08em; }
.date-block b { font-size: 20px; }
.date-block.lg { min-width: 64px; padding: 10px 6px; }
.date-block.lg b { font-size: 26px; }

/* ------------------------------------------------------------------ Avatars */
.avatar { display: inline-grid; place-items: center; border-radius: 50%; font-weight: 800; color: #fff; background: var(--ink); background-size: cover; background-position: center; flex-shrink: 0; letter-spacing: -.02em; }
.avatar-xs { width: 22px; height: 22px; font-size: 9px; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-md { width: 40px; height: 40px; font-size: 14px; }
.avatar-lg { width: 60px; height: 60px; font-size: 20px; }
.avatar-xl { width: 84px; height: 84px; font-size: 28px; }
.avatar-xxl { width: 118px; height: 118px; font-size: 38px; }
.c-ink { background: linear-gradient(135deg, #34423f, #1d2826); color: var(--mint); }
.c-warm { background: linear-gradient(135deg, #f0a36b, #d9622f); }
.c-green { background: linear-gradient(135deg, #7db36a, #3f7d4c); }
.c-purple { background: linear-gradient(135deg, #a88bf0, #6a4bc9); }
.c-teal { background: linear-gradient(135deg, #5fc2b8, #2a8a80); }
.c-blue { background: linear-gradient(135deg, #7aa7f5, #3868d0); }
.c-orange { background: linear-gradient(135deg, #f5b35f, #e07a2a); }
.c-sky { background: linear-gradient(135deg, #7fd0f0, #3c93c2); }
.c-red { background: linear-gradient(135deg, #f08a80, #cf4a3f); }

/* ===================================================================== Shell */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 22px 16px 16px; border-right: 1px solid var(--line); background: var(--surface); overflow-y: auto; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 22px; font-weight: 800; letter-spacing: -.05em; padding: 0 8px; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--ink); color: var(--mint); }
body.theme-dark .brand-mark { background: var(--mint); color: #17201e; }
.brand-mark.lg { width: 48px; height: 48px; border-radius: 15px; }
.brand-dot { color: var(--orange); }
.create-btn { height: 44px; }
.side-nav { display: grid; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 13px; padding: 10px 12px; border-radius: 12px; color: var(--muted); font-weight: 600; transition: .15s; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--surface-2); color: var(--ink); font-weight: 800; }
.nav-item.active .icon { color: var(--accent); }
.nav-new { margin-left: auto; font: 500 9.5px var(--mono); font-style: normal; text-transform: uppercase; letter-spacing: .08em; background: var(--mint); color: #1d2826; padding: 3px 7px; border-radius: 99px; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 10px; }
.side-streak { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: linear-gradient(135deg, rgba(236, 117, 72, .12), rgba(212, 160, 23, .1)); color: var(--orange); }
.side-streak span { display: grid; color: var(--ink); line-height: 1.3; }
.side-streak small { color: var(--muted); font-size: 11.5px; }
.side-profile { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
.side-profile:hover { background: var(--surface-2); }
.side-profile span { display: grid; line-height: 1.3; min-width: 0; }
.side-profile small { color: var(--muted); }
.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 16px; height: var(--topbar-h); padding: 0 28px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s; }
body.scrolled .topbar, body.map-mode .topbar, body.reels-mode .topbar { border-color: var(--line); }
.search-trigger { display: flex; align-items: center; gap: 10px; flex: 1; max-width: 520px; height: 42px; padding: 0 12px 0 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-strong); color: var(--muted); transition: .15s; }
.search-trigger:hover { border-color: var(--ink-2); }
.search-trigger span { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
kbd { font: 500 11px var(--mono); padding: 3px 7px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--muted); }
.topbar-right { position: relative; margin-left: auto; display: flex; align-items: center; gap: 4px; }
.count-badge { position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--orange); color: #fff; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg); }
.count-badge.accent { background: var(--ink); color: var(--mint); }
body.theme-dark .count-badge.accent { background: var(--mint); color: #17201e; }
.count-badge.bump { animation: bump .45s var(--ease); }
@keyframes bump { 40% { transform: scale(1.45); } }
.avatar-btn { margin-left: 6px; border-radius: 50%; }
.mobile-brand, .mobile-only { display: none; }
.main { flex: 1; padding: 20px 28px 60px; }
body.map-mode .main, body.reels-mode .main { padding: 0; }
.mobile-nav { display: none; }

/* =================================================================== Home */
.home-layout { display: grid; grid-template-columns: minmax(0, 620px) 340px; gap: 32px; justify-content: center; }
.feed-col { display: grid; gap: 16px; align-content: start; min-width: 0; }
.stories { display: flex; gap: 14px; padding: 14px 16px; overflow-x: auto; scrollbar-width: none; }
.story { display: grid; justify-items: center; gap: 6px; position: relative; flex-shrink: 0; }
.story small { font-size: 11.5px; max-width: 66px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.story .avatar { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--line-strong); }
.story.ring .avatar { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px transparent; background-clip: padding-box; position: relative; }
.story.ring::before { content: ""; position: absolute; top: -5px; width: 70px; height: 70px; border-radius: 50%; background: conic-gradient(var(--mint-strong), var(--orange), #d4a017, var(--mint-strong)); z-index: 0; }
.story .avatar { position: relative; z-index: 1; }
.story-plus { position: absolute; right: 2px; top: 42px; z-index: 2; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--mint); display: grid; place-items: center; border: 2px solid var(--surface); }
.composer-prompt { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; }
.composer-input { flex: 1; min-width: 180px; height: 42px; text-align: left; padding: 0 16px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-weight: 600; }
.composer-input:hover { background: var(--surface-3); }
.composer-quick { display: flex; gap: 8px; width: 100%; padding-left: 52px; }
.feed-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.feed-tabs .tab { height: 34px; padding: 0 14px; border-radius: 999px; font-weight: 700; font-size: 13px; color: var(--muted); white-space: nowrap; }
.feed-tabs .tab:hover { color: var(--ink); background: var(--surface); }
.feed-tabs .tab.active { background: var(--ink); color: var(--mint); }
body.theme-dark .feed-tabs .tab.active { background: var(--mint); color: #17201e; }
.active-filter { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; border-radius: 12px; background: var(--mint); color: #1d2826; font-size: 13px; }
.active-filter .icon-btn { margin-left: auto; color: #1d2826; }
.feed-list { display: grid; gap: 18px; }
.feed-list.narrow { max-width: 620px; }
.post { overflow: hidden; }
.post-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.post-author { display: flex; align-items: center; gap: 10px; text-align: left; min-width: 0; }
.post-author span { display: grid; line-height: 1.25; min-width: 0; }
.post-author small { color: var(--muted); font-size: 12px; }
.post-author.light { color: #fff; }
.post-meta { display: grid; line-height: 1.3; min-width: 0; }
.post-meta > .link-strong { font-weight: 800; width: fit-content; }
.post-sub { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); min-width: 0; white-space: nowrap; }
.post-sub .post-place { overflow: hidden; text-overflow: ellipsis; }
.avatar-link { border-radius: 50%; }
.post-place { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; color: var(--ink-2); font-size: 12px; }
button.post-place:hover { color: var(--accent); }
.media { position: relative; overflow: hidden; background: #111; user-select: none; }
.media-feed { aspect-ratio: 4 / 5; }
.media-feed.is-reel, .media-feed:has(video) { cursor: pointer; }
.scene, .media-frame { position: absolute; inset: 0; }
.scene-svg { width: 100%; height: 100%; display: block; }
.kenburns .scene-svg { animation: kenburns 16s ease-in-out infinite alternate; transform-origin: 60% 40%; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.14) translate(-2%, 2%); } }
.media-frame { container-type: inline-size; }
.media-frame video, .media-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-badge { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .45); color: #fff; backdrop-filter: blur(6px); }
.double-tap-heart { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; pointer-events: none; opacity: 0; }
.double-tap-heart .icon { fill: #fff; filter: drop-shadow(0 8px 20px rgba(0, 0, 0, .35)); }
.double-tap-heart.pop { animation: heartpop .8s var(--ease); }
@keyframes heartpop { 0% { opacity: 0; transform: scale(.3); } 25% { opacity: 1; transform: scale(1.15); } 45% { transform: scale(.95); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(1.05) translateY(-20px); } }
.media-missing-note { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; color: #aab; font-size: 13px; background: #1a2322; }
.post-footer { padding: 12px 16px 14px; display: grid; gap: 6px; }
.stat-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 2px; }
.stat-chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 8px; background: var(--surface-2); font-size: 12px; font-weight: 700; color: var(--ink-2); }
.stat-chip.strong { background: color-mix(in srgb, var(--chip) 14%, transparent); color: var(--chip); }
body.theme-dark .stat-chip.strong { color: color-mix(in srgb, var(--chip) 60%, #fff); }
.stat-chip.grade { font-family: var(--mono); font-weight: 500; background: var(--ink); color: var(--mint); }
body.theme-dark .stat-chip.grade { background: var(--mint); color: #17201e; }
.stat-chip.flash { background: rgba(212, 160, 23, .16); color: #9a6e00; }
body.theme-dark .stat-chip.flash { color: #f1c24c; }
.post-actions { display: flex; align-items: center; gap: 2px; margin: 0 -8px; }
.act { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); transition: transform .15s; }
.act:hover { color: var(--muted); }
.act:active { transform: scale(.85); }
.act.liked { color: #e0453a; }
.act.liked .icon, .act.saved .icon { fill: currentColor; }
.act.pop { animation: bump .4s var(--ease); }
.post-likes { font-size: 13.5px; }
.post-caption { font-size: 14px; line-height: 1.5; }
.hashtag { color: var(--accent); font-weight: 600; }
.hashtag:hover { text-decoration: underline; }
.comment-preview { display: grid; gap: 3px; font-size: 13.5px; }
.comment-inline { display: flex; gap: 8px; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }
.comment-inline input { flex: 1; border: 0; background: none; outline: none; font-size: 13.5px; }
.comment-inline button { font-weight: 800; color: var(--accent); }
.rail { display: grid; gap: 16px; align-content: start; position: sticky; top: calc(var(--topbar-h) + 16px); max-height: calc(100vh - var(--topbar-h) - 32px); overflow-y: auto; scrollbar-width: none; }
.rail-card { padding: 18px; }
.streak-pill { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 99px; background: rgba(236, 117, 72, .12); color: var(--orange); font-weight: 800; }
.streak-pill small { color: var(--muted); font-weight: 600; font-size: 11px; }
.week-bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; height: 110px; margin: 8px 0 14px; }
.wb { display: grid; grid-template-rows: 1fr auto; gap: 6px; text-align: center; }
.wb small { font: 500 10.5px var(--mono); color: var(--muted); }
.wb.today small { color: var(--ink); font-weight: 700; }
.wb-bar { display: flex; align-items: flex-end; justify-content: center; }
.wb-bar i { width: 100%; max-width: 22px; border-radius: 4px 4px 2px 2px; background: var(--mint-strong); transition: height .5s var(--ease); }
.wb-bar i.empty { background: var(--surface-3); }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.mini-stats div { display: grid; }
.mini-stats strong { font-size: 18px; letter-spacing: -.02em; }
.mini-stats span { font-size: 11.5px; color: var(--muted); }
.rank-mini-list { display: grid; gap: 12px; }
.rank-mini { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; }
.rank-mini > span:nth-child(2) { display: grid; line-height: 1.25; }
.rank-mini small { color: var(--muted); font-size: 12px; }
.rank-mini .progress { grid-column: 2; }
.comp-mini { display: flex; align-items: center; gap: 12px; padding: 8px; margin: 0 -8px; border-radius: 12px; }
.comp-mini:hover { background: var(--surface-2); }
.comp-mini > span:last-child { display: grid; line-height: 1.3; min-width: 0; }
.comp-mini small { color: var(--muted); font-size: 12px; }
.suggest-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; }

/* ================================================================ Overlays */
.overlay { position: fixed; inset: 0; z-index: 200; background: rgba(12, 18, 17, 0); transition: background .22s; }
.overlay.open { background: rgba(12, 18, 17, .55); backdrop-filter: blur(3px); }
.modal-backdrop { display: grid; place-items: center; padding: 20px; overflow-y: auto; }
.modal { position: relative; width: 100%; max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 26px; transform: translateY(14px) scale(.98); opacity: 0; transition: transform .25s var(--ease), opacity .2s; }
.overlay.open .modal { transform: none; opacity: 1; }
.modal-sm { max-width: 420px; } .modal-md { max-width: 580px; } .modal-lg { max-width: 880px; } .modal-xl { max-width: 1120px; }
.modal-x { position: absolute; top: 14px; right: 14px; z-index: 5; }
.modal-head { margin-bottom: 16px; padding-right: 40px; }
.modal-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.modal-actions.start { justify-content: flex-start; }
.modal-actions.center { justify-content: center; }
.drawer-backdrop { display: flex; justify-content: flex-end; }
.drawer { width: min(480px, 100%); height: 100%; background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .3s var(--ease); }
.overlay.open .drawer { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 22px 12px; }
.drawer-head h2:empty { display: none; }
.drawer-body { flex: 1; overflow-y: auto; padding: 0 22px 28px; }
.place-drawer .drawer-head, .product-drawer .drawer-head { position: absolute; right: 8px; top: 8px; z-index: 5; padding: 0; }
.place-drawer .drawer-head .icon-btn, .product-drawer .drawer-head .icon-btn { background: rgba(10, 15, 14, .45); color: #fff; }
.place-drawer .drawer, .product-drawer .drawer { position: relative; width: min(520px, 100%); }
.place-drawer .drawer-body, .product-drawer .drawer-body { padding: 0; }
.narrow-drawer .drawer { width: min(400px, 100%); }
.menu-sheet .modal { padding: 8px; }
.menu-list { display: grid; }
.menu-list button { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; font-weight: 600; text-align: left; }
.menu-list button:hover { background: var(--surface-2); }
.menu-list button[data-close] { justify-content: center; color: var(--muted); }
.comments-drawer .drawer-body { display: flex; flex-direction: column; }
.comment-list { flex: 1; display: grid; gap: 16px; align-content: start; overflow-y: auto; padding: 6px 0 16px; }
.comment { display: flex; gap: 10px; }
.comment p { font-size: 13.5px; }
.comment small { color: var(--muted); font-size: 11.5px; }
.comment-compose { display: flex; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--surface); }
.comment-compose input { flex: 1; height: 40px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface-2); }
.share-list { display: grid; gap: 2px; max-height: 320px; overflow-y: auto; margin: 12px 0; }
.share-person { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; text-align: left; }
.share-person span:nth-child(2) { display: grid; flex: 1; line-height: 1.3; }
.share-person small { color: var(--muted); }
.share-person:hover { background: var(--surface-2); }
.check-circle { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; color: transparent; }
.share-person.selected .check-circle { background: var(--ink); border-color: var(--ink); color: var(--mint); }
.user-head { display: flex; gap: 18px; align-items: center; margin-bottom: 18px; }
.user-head p { margin-top: 4px; }
.user-stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; padding: 14px 0; border-block: 1px solid var(--line); }
.user-stats div { display: grid; }
.user-stats strong { font-size: 20px; }
.user-stats span { color: var(--muted); font-size: 12px; }
.grid-posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 18px; border-radius: 12px; overflow: hidden; }
.grid-posts.large { gap: 6px; }
.grid-tile { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--surface-3); }
.grid-tile .scene-svg, .grid-tile video, .grid-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.grid-media { position: absolute; inset: 0; }
.grid-tile:hover .scene-svg, .grid-tile:hover video, .grid-tile:hover img { transform: scale(1.05); }
.grid-label { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 99px; background: rgba(0, 0, 0, .55); color: #fff; font: 500 11px var(--mono); backdrop-filter: blur(4px); }
.grid-video { position: absolute; top: 8px; right: 8px; color: #fff; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .5)); }
.grid-hover { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6px; color: #fff; font-weight: 800; background: rgba(0, 0, 0, .4); opacity: 0; transition: .2s; }
.grid-hover .icon { fill: #fff; }
.grid-tile:hover .grid-hover { opacity: 1; }
.toast-host { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 400; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 18px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; box-shadow: var(--shadow-lg); transform: translateY(16px); opacity: 0; transition: .3s var(--ease); max-width: min(92vw, 520px); }
.toast .icon { color: var(--mint); }
.toast.warn .icon { color: #f5b35f; }
.toast.show { transform: none; opacity: 1; }
body.theme-dark .toast { background: #eef3ef; color: #17201e; }
body.theme-dark .toast .icon { color: var(--accent); color: #4f7f3a; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 500; }
.popover { position: absolute; right: 0; top: 52px; width: 240px; padding: 8px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); display: grid; z-index: 60; animation: pop .18s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.popover a, .popover button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; font-weight: 600; text-align: left; }
.popover a:hover, .popover button:hover { background: var(--surface-2); }
.popover hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.pop-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.pop-head span { display: grid; line-height: 1.3; }
.pop-head small { color: var(--muted); }
.palette { align-items: start; padding-top: 12vh; }
.palette .modal { padding: 0; overflow: hidden; }
.palette .modal-x { display: none; }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-input input { flex: 1; border: 0; outline: none; background: none; font-size: 17px; color: var(--ink); }
.palette-results { max-height: 56vh; overflow-y: auto; padding: 8px; }
.pal-group { font: 500 10.5px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 10px 10px 4px; }
.pal-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 10px; text-align: left; color: var(--ink-2); }
.pal-item > span { flex: 1; display: grid; line-height: 1.3; min-width: 0; }
.pal-item small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-item > .icon:last-child { opacity: 0; }
.pal-item.active, .pal-item:hover { background: var(--surface-2); color: var(--ink); }
.pal-item.active > .icon:last-child { opacity: 1; }
.notif-actions { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.notif-list { display: grid; gap: 4px; }
.notif { display: flex; gap: 12px; padding: 12px; border-radius: 12px; font-size: 13.5px; }
.notif.unread { background: color-mix(in srgb, var(--mint) 35%, transparent); }
.notif p { display: grid; gap: 2px; }
.notif small { color: var(--muted); font-size: 11.5px; }
.notif-icon { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; flex-shrink: 0; color: var(--accent); }
.badge-unlock { position: fixed; left: 50%; top: calc(var(--topbar-h) + 12px); z-index: 450; display: flex; align-items: center; gap: 14px; padding: 14px 16px 14px 14px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-lg); border: 1px solid var(--line); transform: translate(-50%, -160%); transition: transform .5s var(--ease); min-width: 320px; }
.badge-unlock.show { transform: translate(-50%, 0); }
.badge-unlock div { display: grid; flex: 1; line-height: 1.3; }
.badge-unlock small { color: var(--muted); }

/* ================================================================ Composer */
.composer-modal .modal { padding: 0; }
.composer-head { display: flex; align-items: center; gap: 14px; padding: 20px 64px 16px 24px; border-bottom: 1px solid var(--line); }
.composer-head > div { flex: 1; }
.stepper { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.stepper li { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 500 12px var(--mono); background: var(--surface-2); color: var(--muted); }
.stepper li.current { background: var(--ink); color: var(--mint); }
.stepper li.done { background: var(--mint); color: #1d2826; }
.composer-body { padding: 22px 24px 24px; }
.dropzone { display: grid; place-items: center; align-content: center; gap: 10px; min-height: 360px; padding: 24px; border: 2px dashed var(--line-strong); border-radius: 20px; background: var(--surface-2); text-align: center; cursor: pointer; transition: .2s; overflow: hidden; position: relative; }
.dropzone:hover, .dropzone.drag { border-color: var(--mint-strong); background: color-mix(in srgb, var(--mint) 20%, var(--surface-2)); }
.dropzone.has-file { padding: 0; border-style: solid; background: #111; }
.dropzone.has-file video, .dropzone.has-file img { max-height: 460px; width: auto; }
.dz-icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.composer-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.filter-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.filter-grid.compact { grid-template-columns: repeat(8, 1fr); margin-top: 8px; }
.filter-tile { display: grid; gap: 6px; justify-items: center; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.filter-tile span { width: 100%; aspect-ratio: 3 / 4; border-radius: 10px; background: linear-gradient(135deg, #7aa7f5, #f0a36b) center / cover; border: 2px solid transparent; }
.filter-tile.active { color: var(--ink); }
.filter-tile.active span { border-color: var(--ink); }
.details-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; }
.details-form { display: grid; gap: 18px; align-content: start; }
.type-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.type-tile { display: grid; justify-items: center; gap: 6px; padding: 12px 4px; border-radius: 14px; border: 1px solid var(--line-strong); font-size: 12px; font-weight: 700; color: var(--muted); transition: .15s; }
.type-tile:hover { border-color: var(--chip); color: var(--chip); }
.type-tile.active { background: var(--chip); border-color: var(--chip); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--chip) 35%, transparent); }
.grade-picker { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: thin; }
.grade-chip { flex-shrink: 0; min-width: 52px; height: 44px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--line-strong); font: 500 14px var(--mono); transition: .15s; }
.grade-chip:hover { border-color: var(--ink); }
.grade-chip.active { background: var(--ink); color: var(--mint); border-color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow); }
body.theme-dark .grade-chip.active { background: var(--mint); color: #17201e; }
.flash-note { display: inline-flex; align-items: center; gap: 4px; color: #9a6e00; font-weight: 700; font-size: 12px; }
.details-preview { display: grid; gap: 14px; align-content: start; position: sticky; top: 0; }
.preview-media { position: relative; aspect-ratio: 4 / 5; border-radius: 16px; overflow: hidden; background: #111; }
.preview-media img, .preview-media video { width: 100%; height: 100%; object-fit: cover; }
.rank-preview { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 16px; background: color-mix(in srgb, var(--tier, #888) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--tier, #888) 30%, transparent); font-size: 13px; }
.rank-preview > div { display: grid; line-height: 1.35; }
.rank-preview strong { font-size: 17px; }
.rank-preview small { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.rank-preview.muted { background: var(--surface-2); border: 0; }

/* ================================================================== Editor */
.editor { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "stage tools" "timeline timeline" "meta meta"; gap: 16px 24px; }
.editor-stage { grid-area: stage; display: grid; gap: 10px; justify-items: center; }
.phone-frame { position: relative; width: 270px; aspect-ratio: 9 / 16; border-radius: 26px; overflow: hidden; background: #000; box-shadow: 0 0 0 6px #111, var(--shadow-lg); container-type: inline-size; touch-action: none; }
.phone-frame video { width: 100%; height: 100%; object-fit: cover; }
.ed-overlays { position: absolute; inset: 0; pointer-events: none; }
.ed-overlays .overlay-text { pointer-events: auto; cursor: grab; }
.ed-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .45); color: #fff; backdrop-filter: blur(6px); transition: opacity .2s; }
.ed-play .icon { fill: #fff; }
.ed-play.is-playing { opacity: 0; }
.phone-frame:hover .ed-play.is-playing { opacity: 1; }
.ed-time { position: absolute; bottom: 10px; right: 10px; font: 500 11px var(--mono); padding: 3px 8px; border-radius: 99px; background: rgba(0, 0, 0, .55); color: #fff; }
.ed-music-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; background: var(--surface-2); font-size: 12px; font-weight: 700; }
.editor-tools { grid-area: tools; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.seg-tabs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); }
.seg-tab { display: grid; justify-items: center; gap: 3px; padding: 8px 2px; border-radius: 10px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.seg-tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.tool-panels { flex: 1; min-height: 300px; max-height: 420px; overflow-y: auto; padding-right: 4px; }
.tool-panel { display: grid; gap: 10px; }
.tool-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tool-row.gap { justify-content: flex-start; flex-wrap: wrap; }
.tool-label { display: flex; align-items: center; gap: 6px; }
.tool-hint { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.tool-row output { font: 500 12px var(--mono); color: var(--muted); }
.track-list { display: grid; gap: 4px; }
.track { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; text-align: left; border: 1px solid transparent; cursor: pointer; }
.track > span:nth-child(2) { flex: 1; display: grid; line-height: 1.3; }
.track small { color: var(--muted); font-size: 11.5px; }
.track:hover { background: var(--surface-2); }
.track.active { border-color: var(--ink); background: var(--surface-2); }
.track-art { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, hsl(var(--h) 70% 60%), hsl(calc(var(--h) + 50) 70% 45%)); flex-shrink: 0; }
.track-art.none { background: var(--surface-3); color: var(--muted); }
.upload-line { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: 12px; font-weight: 700; font-size: 13px; cursor: pointer; }
.upload-line:hover { border-color: var(--mint-strong); }
.cover-preview { display: grid; place-items: center; }
.cover-preview canvas { width: 135px; height: 240px; border-radius: 14px; background: #111; box-shadow: var(--shadow); }
.timeline { grid-area: timeline; position: relative; height: 64px; border-radius: 12px; overflow: hidden; background: #111; touch-action: none; cursor: pointer; }
.filmstrip { display: grid; grid-template-columns: repeat(10, 1fr); height: 100%; }
.frame { background-size: cover; background-position: center; border-right: 1px solid rgba(0, 0, 0, .3); }
.frame.skeleton { background: linear-gradient(90deg, #1d2524, #2b3533, #1d2524); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.trim-shade { position: absolute; top: 0; bottom: 0; background: rgba(0, 0, 0, .6); pointer-events: none; }
.trim-shade.left { left: 0; }
.trim-window { position: absolute; top: 0; bottom: 0; border: 3px solid var(--mint); border-radius: 10px; pointer-events: none; }
.trim-handle { position: absolute; top: -3px; bottom: -3px; width: 18px; background: var(--mint); pointer-events: auto; cursor: ew-resize; display: grid; place-items: center; }
.trim-handle::after { content: ""; width: 3px; height: 22px; border-radius: 2px; background: #1d2826; }
.trim-handle.left { left: -3px; border-radius: 8px 0 0 8px; }
.trim-handle.right { right: -3px; border-radius: 0 8px 8px 0; }
.playhead { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #fff; box-shadow: 0 0 6px rgba(0, 0, 0, .6); pointer-events: none; }
.timeline-meta { grid-area: meta; display: flex; justify-content: space-between; font: 500 11.5px var(--mono); color: var(--muted); margin-top: -8px; }
.overlay-text { position: absolute; transform: translate(-50%, -50%); font-weight: 800; font-size: calc(var(--size, 7) * 1cqw); text-align: center; max-width: 90%; line-height: 1.1; text-shadow: 0 2px 12px rgba(0, 0, 0, .45); white-space: pre-wrap; user-select: none; }
.overlay-text.style-classic { font-weight: 600; font-family: Georgia, serif; font-style: italic; }
.overlay-text.style-mono { font-family: var(--mono); font-weight: 500; letter-spacing: -.02em; }
.overlay-text.style-outline { -webkit-text-stroke: calc(var(--size, 7) * .1cqw) #000; paint-order: stroke fill; text-shadow: none; }
.overlay-text.style-highlight { background: rgba(0, 0, 0, .65); padding: .15em .45em; border-radius: .3em; text-shadow: none; }
.grade-sticker { position: absolute; left: 5cqw; top: 5cqw; padding: 1.4cqw 3.4cqw; border-radius: 99px; background: var(--mint); color: #1d2826; font: 500 max(11px, 4.2cqw) var(--mono); box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }
.vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, .55)); pointer-events: none; }

/* =================================================================== Reels */
.reels-page { position: relative; height: calc(100vh - var(--topbar-h)); background: #0b0f0e; }
.reels-scroller { height: 100%; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; outline: none; }
.reels-scroller::-webkit-scrollbar { display: none; }
.reel { height: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: grid; place-items: center; padding: 16px 0; }
.reel-stage { position: relative; height: 100%; aspect-ratio: 9 / 16; max-width: 100vw; border-radius: 18px; overflow: visible; }
.reel-stage .media { position: absolute; inset: 0; border-radius: 18px; }
.reel-stage .media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .35), transparent 22%, transparent 55%, rgba(0, 0, 0, .75)); pointer-events: none; }
.reel-stage.paused .media::before { content: ""; position: absolute; left: 50%; top: 50%; z-index: 3; width: 72px; height: 72px; margin: -36px 0 0 -36px; border-radius: 50%; background: rgba(0, 0, 0, .45) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpolygon points='7 4 20 12 7 20'/%3E%3C/svg%3E") center / 30px no-repeat; }
.reel-sound { position: absolute; top: 14px; right: 14px; z-index: 4; }
.reel-info { position: absolute; left: 0; right: 70px; bottom: 0; z-index: 3; padding: 18px; color: #fff; display: grid; gap: 8px; }
.reel-user { display: flex; align-items: center; gap: 10px; }
.reel-caption { font-size: 14px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.reel-caption .hashtag { color: #fff; font-weight: 800; }
.reel-info .stat-chip { background: rgba(255, 255, 255, .18); color: #fff; backdrop-filter: blur(6px); }
.reel-info .stat-chip.grade { background: var(--mint); color: #1d2826; }
.reel-info .tier-chip { background: rgba(0, 0, 0, .35); }
.reel-place { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; color: #fff; opacity: .9; width: fit-content; }
.reel-music { display: flex; align-items: center; gap: 8px; font-size: 12.5px; overflow: hidden; }
.marquee { overflow: hidden; white-space: nowrap; max-width: 220px; mask-image: linear-gradient(90deg, #000 80%, transparent); }
.marquee span { display: inline-block; padding-right: 40px; animation: marquee 9s linear infinite; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-60%); } }
.reel-rail { position: absolute; right: -72px; bottom: 12px; z-index: 4; display: grid; gap: 14px; justify-items: center; }
.rail-btn { display: grid; justify-items: center; gap: 3px; color: var(--ink); font-size: 12px; font-weight: 700; }
.rail-btn .icon { padding: 11px; width: 50px; height: 50px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); transition: transform .15s; }
.rail-btn:active .icon { transform: scale(.88); }
.reels-page .rail-btn { color: #e7eee9; }
.reels-page .rail-btn .icon { background: #1d2826; color: #fff; }
.rail-btn.on .icon { color: #e0453a; fill: #e0453a; }
.rail-btn[data-action="save-post"].on .icon { color: var(--mint); fill: var(--mint); }
.music-disc { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: radial-gradient(circle, #111 22%, hsl(var(--h) 60% 50%) 23%, hsl(calc(var(--h) + 60) 60% 35%)); border: 3px solid #222; }
.reel.active .music-disc { animation: spin 4s linear infinite; }
.reels-nav { position: absolute; right: 24px; top: 50%; transform: translateY(-50%); display: grid; gap: 10px; }
.reels-create { position: absolute; left: 24px; top: 18px; }
.reels-page .empty { color: #aab; margin: 20vh auto; max-width: 420px; }

/* ===================================================================== Map */
.map-page { position: relative; height: calc(100vh - var(--topbar-h)); overflow: hidden; }
.leaflet-host { position: absolute; inset: 0; background: #aad3df; z-index: 0; }
body.theme-dark .leaflet-host { background: #0f1a1c; }
.map-page.adding .leaflet-host { cursor: crosshair; }
.glass-panel { background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(14px) saturate(1.3); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.map-top { position: absolute; z-index: 500; top: 16px; left: 372px; right: 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; pointer-events: none; }
.map-top > * { pointer-events: auto; }
.map-search { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 260px; max-width: 520px; height: 48px; padding: 0 6px 0 16px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); color: var(--muted); border: 1px solid var(--line); }
.map-search input { flex: 1; border: 0; outline: none; background: none; color: var(--ink); font-size: 14.5px; }
.map-crumb { display: flex; align-items: center; gap: 4px; padding: 10px 14px; border-radius: 999px; font-size: 13px; color: var(--muted); font-weight: 600; flex-wrap: wrap; }
.map-crumb .current { color: var(--ink); font-weight: 800; }
.map-sidebar { position: absolute; z-index: 500; top: 16px; left: 16px; bottom: 16px; width: 340px; display: flex; flex-direction: column; padding: 16px; transition: transform .3s var(--ease); }
.map-sidebar.collapsed { transform: translateX(calc(-100% + 44px)); }
.map-sidebar.collapsed [data-map-collapse] { transform: rotate(180deg); }
.map-side-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.map-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.map-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--line-strong); font-size: 12.5px; font-weight: 700; color: var(--muted); background: var(--surface); transition: .15s; }
.map-chip .icon { color: var(--pin); }
.map-chip.on { background: var(--pin); border-color: var(--pin); color: #fff; }
.map-chip.on .icon { color: #fff; }
.map-filters { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px 0; margin-bottom: 8px; display: grid; gap: 10px; }
.map-filters summary { display: flex; align-items: center; gap: 6px; font-weight: 800; cursor: pointer; list-style: none; }
.map-filters[open] summary { margin-bottom: 8px; }
.map-filters .switch-row { padding: 2px 0; font-size: 13px; }
.map-results { flex: 1; overflow-y: auto; margin: 0 -8px; padding: 0 4px; }
.result-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: 12px; text-align: left; color: var(--muted); }
.result-row > span:nth-child(2) { flex: 1; display: grid; line-height: 1.3; min-width: 0; color: var(--ink); }
.result-row small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-row:hover { background: var(--surface-2); }
.result-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: var(--pin); flex-shrink: 0; }
.map-detail { position: absolute; z-index: 600; top: 16px; right: 16px; bottom: 16px; width: 420px; overflow-y: auto; padding: 0; animation: slidein .35s var(--ease); }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }
.map-bottom { position: absolute; z-index: 500; left: 372px; right: 80px; bottom: 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; pointer-events: none; }
.map-bottom > * { pointer-events: auto; }
body.map-detail-open .map-top, body.map-detail-open .map-bottom { right: 452px; }
.zoom-steps, .basemaps { display: flex; padding: 4px; border-radius: 999px; gap: 2px; }
.zoom-steps button, .basemaps button { height: 30px; padding: 0 11px; border-radius: 99px; font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.zoom-steps button.on { color: var(--ink); }
.zoom-steps button.on:last-of-type, .zoom-steps button.on:not(:has(~ .on)) { background: var(--ink); color: var(--mint); }
.basemaps button.active { background: var(--ink); color: var(--mint); }
body.theme-dark .basemaps button.active, body.theme-dark .zoom-steps button.on:not(:has(~ .on)) { background: var(--mint); color: #17201e; }
.map-add.active { background: var(--orange); color: #fff; }
.map-legend { position: absolute; z-index: 500; right: 70px; top: 80px; display: grid; gap: 5px; padding: 12px 14px; font-size: 11.5px; font-weight: 600; }
body.map-detail-open .map-legend { display: none; }
@media (max-width: 1500px) { body.map-detail-open .zoom-steps { display: none; } }
.map-legend strong { font-size: 12px; margin-bottom: 2px; }
.map-legend span { display: flex; align-items: center; gap: 8px; }
.map-legend i { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--pin); color: #fff; font-style: normal; }
.map-legend i.peak { background: none; color: var(--ink); font-size: 13px; }
.map-legend i.camp { background: #fff; color: #c2410c; border: 2px solid #c2410c; }
.map-pin { position: relative; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: var(--pin); color: #fff; border: 2.5px solid #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, .3); transition: transform .15s; }
.map-pin .icon { transform: rotate(45deg); }
.leaflet-marker-icon:hover .map-pin { transform: rotate(-45deg) scale(1.15); }
.map-pin.community-ring { box-shadow: 0 0 0 3px #d4a017, 0 4px 10px rgba(0, 0, 0, .3); }
.map-peak { position: relative; display: block; width: 26px; height: 22px; color: #3a2e25; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); }
.map-peak.eight { color: #7a1f1a; }
.map-peak b, .map-peak small { position: absolute; left: 30px; white-space: nowrap; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff; color: #1d2826; }
.map-peak b { top: -2px; font-size: 12px; font-weight: 800; }
.map-peak small { top: 13px; font: 500 10px var(--mono); }
.peaks-compact .map-peak small, .peaks-compact .map-peak:not(.headline) b { display: none; }
body.theme-dark .map-peak { color: #e8d6c4; }
body.theme-dark .map-peak.eight { color: #ff9b85; }
body.theme-dark .map-peak b, body.theme-dark .map-peak small { color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000, 0 0 4px #000; }
.map-camp { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #fff; color: #c2410c; border: 2px solid #c2410c; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.map-camp.summit { background: #c2410c; color: #fff; border-color: #fff; }
.map-cluster { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; font-weight: 800; color: #fff; border: 3px solid rgba(255, 255, 255, .85); box-shadow: 0 4px 12px rgba(0, 0, 0, .3); }
.map-cluster.c-gym { background: #2f6fdb; } .map-cluster.c-sport { background: #e0653a; } .map-cluster.c-boulder { background: #7c4ddb; } .map-cluster.c-trad { background: #c2410c; } .map-cluster.c-community { background: #b8860b; }
.me-dot { display: block; width: 18px; height: 18px; border-radius: 50%; background: #2f6fdb; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(47, 111, 219, .25); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 12px rgba(47, 111, 219, 0); } }
.leaflet-tooltip { font-family: var(--font); border-radius: 10px; border: 0; box-shadow: var(--shadow); padding: 6px 10px; font-size: 12px; }
.camp-label { font-weight: 700; }
.leaflet-control-zoom { border: 0 !important; box-shadow: var(--shadow) !important; border-radius: 12px !important; overflow: hidden; margin: 0 16px 16px 0 !important; }
.leaflet-control-zoom a { width: 38px !important; height: 38px !important; line-height: 38px !important; background: var(--surface) !important; color: var(--ink) !important; border-color: var(--line) !important; }
.leaflet-control-scale { margin-left: 372px !important; margin-bottom: 70px !important; }
.leaflet-control-attribution { font-size: 10px; background: color-mix(in srgb, var(--surface) 75%, transparent) !important; color: var(--muted); }
.leaflet-control-attribution a { color: var(--accent); }
.map-offline { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; padding: 24px; background: var(--surface-2); color: var(--muted); }
.map-offline h3 { color: var(--ink); }

/* ================================================================== Detail */
.detail-hero { position: relative; height: 200px; overflow: hidden; }
.detail-hero .scene-svg { width: 100%; height: 100%; }
.detail-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .25), transparent 40%, color-mix(in srgb, var(--surface) 60%, transparent) 88%, var(--surface)); }
.detail-hero-top { position: absolute; z-index: 2; inset: 14px 14px auto; display: flex; justify-content: space-between; align-items: center; }
.detail-main { padding: 0 22px 26px; margin-top: -26px; position: relative; z-index: 2; display: grid; gap: 14px; }
.detail-title { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.detail-title p { margin-top: 4px; font-size: 13px; }
.detail-actions { display: flex; }
.detail-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.detail-stats > div { display: grid; padding: 12px; border-radius: 14px; background: var(--surface-2); line-height: 1.25; }
.detail-stats strong { font-size: 16px; letter-spacing: -.02em; }
.detail-stats strong.ok { color: var(--ok); }
.detail-stats strong.closed { color: var(--danger); }
.detail-stats span { font-size: 11.5px; color: var(--muted); }
.detail-desc { font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.fact-list { display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); }
.fact-list span { display: flex; align-items: center; gap: 8px; }
.detail-section { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.detail-section h4 { display: flex; align-items: center; gap: 8px; }
.detail-cta { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-cta .btn { flex: 1; }
.kit-list { display: grid; gap: 4px; }
.kit-item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; text-align: left; }
.kit-item > span:nth-child(2) { flex: 1; display: grid; line-height: 1.3; min-width: 0; }
.kit-item small { color: var(--muted); font-size: 12px; }
.kit-item:hover { background: var(--surface-2); }
.kit-art { position: relative; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; background: color-mix(in srgb, var(--tone) 18%, var(--surface-2)); flex-shrink: 0; }
.kit-art i { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; border-radius: 99px; background: var(--ink); color: var(--mint); font: 700 11px var(--font); font-style: normal; display: grid; place-items: center; }
.classics { display: grid; gap: 6px; }
.classic { display: flex; justify-content: space-between; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.classic b { font-family: var(--mono); font-weight: 500; }
.mini-posts { display: grid; gap: 6px; }
.mini-post { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 12px; text-align: left; }
.mini-post:hover { background: var(--surface-2); }
.mini-post > span:last-child { display: grid; line-height: 1.3; }
.mini-post small { color: var(--muted); font-size: 12px; }
.mini-thumb { width: 44px; height: 44px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: var(--surface-3); flex-shrink: 0; }
.mini-thumb .scene-svg { width: 100%; height: 100%; }
.leaderboards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.lb-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; border-bottom: 1px solid var(--line); }
.lb-row > b { width: 16px; color: var(--muted); font-family: var(--mono); font-weight: 500; }
.lb-row span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-row strong { font-family: var(--mono); font-weight: 500; }
.route-tabs { display: grid; gap: 6px; }
.route-tab { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-strong); text-align: left; }
.route-tab i { width: 22px; height: 4px; border-radius: 2px; background: var(--c); }
.route-tab span { display: grid; line-height: 1.3; }
.route-tab small { color: var(--muted); font-size: 12px; }
.route-tab.active { border-color: var(--c); box-shadow: 0 0 0 1px var(--c); background: color-mix(in srgb, var(--c) 7%, transparent); }
.elev-profile { position: relative; padding: 6px 0 0; }
.elev-profile svg { width: 100%; height: auto; overflow: visible; }
.elev-profile .grid { stroke: var(--line); stroke-width: 1; }
.elev-profile .axis { font: 500 10px var(--mono); fill: var(--muted); }
.elev-profile .area { fill: color-mix(in srgb, var(--c) 16%, transparent); }
.elev-profile .line { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; }
.elev-profile .hit { fill: transparent; cursor: pointer; }
.elev-profile .dot { fill: var(--surface); stroke: var(--c); stroke-width: 2; }
.elev-profile .camp .dot { fill: var(--c); stroke: var(--surface); }
.elev-profile .summit .dot { fill: var(--ink); stroke: var(--surface); }
.chart-tip { position: absolute; z-index: 10; transform: translate(-50%, calc(-100% - 10px)); padding: 6px 10px; border-radius: 8px; background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 700; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow); }
.camp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.camp-list li { position: relative; display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.camp-list li:not(:last-child)::before { content: ""; position: absolute; left: 11px; top: 30px; bottom: -8px; border-left: 2px dashed var(--line-strong); }
.camp-list li span:last-child { display: flex; justify-content: space-between; flex: 1; font-size: 13px; }
.camp-list small { font-family: var(--mono); color: var(--muted); }
.camp-dot { position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.camp-list li.camp .camp-dot { background: #fff; color: #c2410c; border: 2px solid #c2410c; }
.camp-list li.summit .camp-dot { background: #c2410c; color: #fff; }
.community-note { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--warn); background: rgba(212, 160, 23, .1); padding: 10px 12px; border-radius: 10px; }

/* ============================================================ Place cards */
.place-card { overflow: hidden; display: flex; flex-direction: column; transition: transform .2s var(--ease), box-shadow .2s; }
.place-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.place-art { position: relative; display: block; height: 150px; overflow: hidden; }
.place-art .scene-svg { width: 100%; height: 100%; transition: transform .5s var(--ease); }
.place-card:hover .place-art .scene-svg { transform: scale(1.05); }
.place-art .status-pill, .place-art .kind-badge { position: absolute; left: 12px; top: 12px; }
.place-body { display: grid; gap: 8px; padding: 14px 16px 16px; flex: 1; align-content: start; }
.place-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.place-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; padding-top: 8px; }
.place-foot > div { display: flex; gap: 6px; align-items: center; }
.trail-stats { display: flex; gap: 14px; font-size: 13px; font-weight: 700; flex-wrap: wrap; }
.trail-stats span { display: inline-flex; align-items: center; gap: 5px; }
.route-mini { display: grid; gap: 4px; font-size: 12.5px; }
.route-mini span { display: flex; align-items: center; gap: 8px; }
.route-mini i { width: 16px; height: 3px; border-radius: 2px; }
.grade-guide { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.table-wrap { overflow-x: auto; max-height: 460px; overflow-y: auto; margin-top: 10px; }
.grade-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.grade-table th { text-align: left; font: 500 10.5px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 8px; position: sticky; top: 0; background: var(--surface); }
.grade-table td { padding: 8px; border-top: 1px solid var(--line); }
.level-list { display: grid; gap: 14px; margin-top: 10px; }
.level-list div { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; }
.level-list p { grid-column: 2; }

/* ============================================================ Competitions */
.region-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; scrollbar-width: none; }
.region-chip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-strong); font-weight: 700; white-space: nowrap; }
.region-chip span { font: 500 11px var(--mono); padding: 2px 7px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.region-chip.active { background: var(--ink); color: var(--mint); border-color: var(--ink); }
.region-chip.active span { background: rgba(255, 255, 255, .15); color: var(--mint); }
body.theme-dark .region-chip.active { background: var(--mint); color: #17201e; }
.month-label { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 22px 0 12px; }
.comp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; }
.comp-card { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; padding: 16px; align-items: center; }
.comp-card.registered { border-color: var(--mint-strong); box-shadow: 0 0 0 1px var(--mint-strong); }
.comp-main { display: grid; gap: 6px; min-width: 0; }
.comp-main .link { color: var(--ink-2); font-weight: 600; }
.comp-side { display: grid; gap: 8px; justify-items: end; }
.spots { display: grid; gap: 4px; font-size: 12px; color: var(--muted); max-width: 260px; }
.spots .progress i { background: var(--orange); }
.spots b.warn { color: var(--danger); }
.disc-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 6px; font: 500 10.5px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: #fff; }
.d-bouldering { background: #7c4ddb; } .d-lead { background: #e0653a; } .d-speed { background: #b8860b; } .d-combined { background: #2f6fdb; }
.comp-detail { display: grid; gap: 16px; }
.comp-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 13.5px; font-weight: 600; }
.comp-facts span { display: flex; align-items: center; gap: 8px; }

/* =================================================================== Saved */
.saved-place { display: flex; gap: 12px; align-items: center; padding: 10px; text-align: left; transition: .2s; }
.saved-place:hover { box-shadow: var(--shadow); }
.saved-place > span:last-child { display: grid; line-height: 1.3; min-width: 0; }
.saved-place .eyebrow { margin: 0; }
.saved-art { width: 64px; height: 64px; border-radius: 12px; overflow: hidden; flex-shrink: 0; }
.saved-art .scene-svg { width: 100%; height: 100%; }

/* ==================================================================== Shop */
.shop-hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: center; padding: 34px; overflow: hidden; background: linear-gradient(120deg, var(--surface) 40%, color-mix(in srgb, var(--mint) 45%, var(--surface))); }
.shop-hero h1 { font-size: clamp(30px, 4vw, 46px); letter-spacing: -.04em; margin: 4px 0 10px; }
.shop-hero em { font-style: normal; color: var(--accent); }
.promo-strip { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; padding: 9px 14px; border-radius: 99px; background: var(--ink); color: #fff; font-size: 13px; }
.promo-strip b { color: var(--mint); font-family: var(--mono); }
.hero-art { display: flex; align-items: flex-end; justify-content: center; gap: 0; }
.hero-art .product-art:nth-child(1) { transform: rotate(-8deg); }
.hero-art .product-art:nth-child(2) { transform: translateY(-30px) rotate(10deg); margin-left: -20px; }
.hero-art .product-art:nth-child(3) { margin-left: -10px; }
.product-art .fill { fill: color-mix(in srgb, var(--tone) 70%, #fff); stroke: #1d2826; stroke-width: 2.4; stroke-linejoin: round; }
.product-art .line { fill: none; stroke: #1d2826; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.kit-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.kit-card { display: grid; gap: 4px; padding: 16px; transition: .2s; }
.kit-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kit-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--mint); color: #1d2826; margin-bottom: 6px; }
.kit-arts { display: flex; margin-top: 8px; }
.kit-arts i { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--tone) 22%, var(--surface-2)); border: 2px solid var(--surface); margin-left: -8px; }
.kit-arts i:first-child { margin-left: 0; }
.shop-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px; margin-top: 28px; align-items: start; }
.shop-filters { position: sticky; top: calc(var(--topbar-h) + 16px); display: grid; gap: 16px; padding: 16px; }
.cat-list { display: grid; gap: 2px; }
.cat { display: flex; justify-content: space-between; padding: 8px 10px; border-radius: 10px; font-weight: 600; color: var(--ink-2); text-align: left; }
.cat span { font: 500 11px var(--mono); color: var(--muted); }
.cat:hover { background: var(--surface-2); }
.cat.active { background: var(--ink); color: var(--mint); }
.cat.active span { color: var(--mint); }
body.theme-dark .cat.active { background: var(--mint); color: #17201e; }
body.theme-dark .cat.active span { color: #17201e; }
.shop-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.product-card { overflow: hidden; display: flex; flex-direction: column; transition: transform .2s var(--ease), box-shadow .2s; }
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.product-art-wrap { position: relative; display: grid; place-items: center; aspect-ratio: 1; background: color-mix(in srgb, var(--tone) 16%, var(--surface-2)); }
.product-art-wrap .product-art { transition: transform .4s var(--ease); }
.product-card:hover .product-art { transform: scale(1.06) rotate(-3deg); }
.product-badge { position: absolute; left: 10px; top: 10px; padding: 4px 9px; border-radius: 99px; background: var(--ink); color: var(--mint); font: 500 10px var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.product-body { display: grid; gap: 4px; padding: 12px 14px 14px; flex: 1; }
.product-body h3 { font-size: 15px; }
.product-meta { display: flex; align-items: center; gap: 6px; }
.product-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.product-foot strong { font-size: 17px; }
.pd-art { position: relative; display: grid; place-items: center; height: 300px; background: color-mix(in srgb, var(--tone) 18%, var(--surface-2)); }
.pd-body { padding: 22px; display: grid; gap: 12px; }
.pd-price { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.size-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 6px; }
.size { height: 42px; border-radius: 10px; border: 1px solid var(--line-strong); font-weight: 700; }
.size:hover { border-color: var(--ink); }
.size.active { background: var(--ink); color: var(--mint); border-color: var(--ink); }
.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.pd-buy { display: flex; gap: 10px; align-items: center; }
.pd-perks { display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); padding: 12px; border-radius: 12px; background: var(--surface-2); }
.pd-perks span { display: flex; align-items: center; gap: 8px; }
.spec-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.spec-list li { display: flex; align-items: center; gap: 8px; }
.spec-list .icon { color: var(--ok); }
.review { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.review div { display: flex; justify-content: space-between; margin-bottom: 4px; }
.review-stars { color: #e8a317; letter-spacing: 1px; }
.related { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.related-item { display: grid; gap: 4px; font-size: 11.5px; text-align: left; }
.related-item > span { display: grid; place-items: center; aspect-ratio: 1; border-radius: 12px; background: color-mix(in srgb, var(--tone) 18%, var(--surface-2)); }
.kit-total { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; font-weight: 700; }
.kit-total b { font-size: 20px; }
.ship-progress { display: grid; gap: 8px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 13px; margin-bottom: 14px; }
.ship-progress span:first-child { display: flex; align-items: center; gap: 6px; }
.cart-lines { display: grid; gap: 12px; }
.cart-line { display: flex; gap: 12px; align-items: flex-start; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.cl-info { flex: 1; display: grid; gap: 2px; min-width: 0; }
.cl-row { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.promo-form { display: flex; gap: 8px; margin: 16px 0 6px; }
.totals { display: grid; gap: 8px; margin: 16px 0; }
.totals div { display: flex; justify-content: space-between; font-size: 14px; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; font-weight: 700; }
.totals .grand { padding-top: 10px; border-top: 1px solid var(--line); font-size: 17px; }
.totals .grand dt { color: var(--ink); font-weight: 800; }
.totals .ok dt, .totals .ok dd { color: var(--ok); }
.empty-cart { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 60px 10px; color: var(--muted); }
.empty-cart h3 { color: var(--ink); }
.checkout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; max-width: 1100px; margin: 0 auto; align-items: start; }
.checkout-main { display: grid; gap: 18px; }
.checkout-steps { display: flex; gap: 20px; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.checkout-steps li { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--muted); }
.checkout-steps span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: 12px; }
.checkout-steps .current { color: var(--ink); }
.checkout-steps .current span { background: var(--ink); color: var(--mint); }
.checkout-steps .done span { background: var(--mint); color: #1d2826; }
.checkout-summary { position: sticky; top: calc(var(--topbar-h) + 16px); display: grid; gap: 12px; }
.sum-line { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.sum-line > span:nth-child(2) { flex: 1; display: grid; line-height: 1.3; }
.review-box { display: grid; gap: 2px; padding: 14px; border-radius: 12px; background: var(--surface-2); font-size: 13.5px; }
.review-box p { margin-bottom: 8px; }
.order-done { max-width: 520px; margin: 40px auto; display: grid; justify-items: center; text-align: center; gap: 8px; }
.done-check { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: var(--mint); color: #1d2826; margin-bottom: 8px; animation: bump .6s var(--ease); }
.big-total { font-size: 32px; font-weight: 800; letter-spacing: -.03em; margin: 8px 0; }

/* ================================================================= Profile */
.profile-hero { overflow: hidden; margin-bottom: 8px; }
.ph-cover { height: 150px; overflow: hidden; }
.ph-cover .scene-svg { width: 100%; height: 100%; }
.ph-main { display: grid; grid-template-columns: auto 1fr auto auto; gap: 20px; align-items: end; padding: 0 26px; margin-top: -54px; }
.ph-avatar { position: relative; cursor: pointer; border-radius: 50%; }
.ph-avatar .avatar { border: 5px solid var(--surface); box-shadow: var(--shadow); }
.ph-cam { position: absolute; right: 6px; bottom: 6px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--mint); border: 3px solid var(--surface); }
.ph-id { padding: 64px 0 6px; display: grid; gap: 3px; }
.ph-id p.muted { display: flex; align-items: center; gap: 4px; }
.ph-bio { max-width: 520px; }
.ph-featured { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.mini-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 4px 6px; border-radius: 99px; font-size: 11.5px; font-weight: 700; background: color-mix(in srgb, var(--tone-c) 14%, transparent); color: var(--tone-c); }
.ph-level { position: relative; display: grid; place-items: center; }
.ph-level svg { transform: rotate(-90deg); }
.lv-track { fill: none; stroke: var(--surface-3); stroke-width: 7; }
.lv-fill { fill: none; stroke: var(--mint-strong); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease); }
.ph-level > span { position: absolute; display: grid; text-align: center; line-height: 1; }
.ph-level small { font: 500 9px var(--mono); letter-spacing: .12em; color: var(--muted); }
.ph-level b { font-size: 26px; }
.ph-actions { display: flex; gap: 8px; padding-bottom: 10px; }
.ph-stats { display: grid; grid-template-columns: repeat(6, auto) 1fr; gap: 26px; align-items: center; padding: 20px 26px 22px; margin-top: 18px; border-top: 1px solid var(--line); }
.ph-stats > div { display: grid; line-height: 1.2; }
.ph-stats strong { font-size: 20px; letter-spacing: -.02em; display: flex; align-items: center; gap: 4px; }
.ph-stats strong.flame { color: var(--orange); }
.ph-stats span { font-size: 12px; color: var(--muted); }
.stat-btn { display: grid; text-align: left; line-height: 1.2; }
.stat-btn:hover strong { color: var(--accent); }
.ph-stats .xp { display: grid; gap: 6px; font-size: 12px; min-width: 200px; }
.rank-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.rank-card { padding: 18px; display: grid; gap: 14px; position: relative; overflow: hidden; }
.rank-card::before { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--tier) 22%, transparent), transparent 70%); }
.rank-top { display: flex; gap: 14px; align-items: center; }
.rank-top h3 { font-size: 22px; color: var(--tier); }
.tier-track { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; }
.tier-track i { height: 6px; border-radius: 3px; background: var(--surface-3); }
.tier-track i.on { background: var(--c); }
.rank-next { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.overall { display: grid; justify-items: end; line-height: 1.1; }
.overall strong { font-size: 34px; letter-spacing: -.04em; color: var(--c); }
.overall small { color: var(--muted); font-size: 11.5px; }
.overall em { font-style: normal; font-weight: 800; font-size: 12px; color: var(--c); margin-top: 4px; }
body.theme-dark .overall strong, body.theme-dark .overall em { color: color-mix(in srgb, var(--c) 55%, #fff); }
.radar-wrap { position: relative; }
.radar { width: 100%; max-width: 440px; display: block; margin: 0 auto; overflow: visible; }
.r-grid { fill: none; stroke: var(--line-strong); stroke-width: 1; }
.r-area { fill: color-mix(in srgb, var(--mint-strong) 30%, transparent); stroke: #6b9652; stroke-width: 2; stroke-linejoin: round; transition: all .5s var(--ease); }
body.theme-dark .r-area { stroke: var(--mint); }
.r-pt .hit { fill: transparent; cursor: pointer; }
.r-pt .dot { fill: #4f7f3a; stroke: var(--surface); stroke-width: 2; }
body.theme-dark .r-pt .dot { fill: var(--mint); }
.r-pt:hover .dot { r: 7; }
.r-label { font: 500 10.5px var(--mono); letter-spacing: .1em; fill: var(--muted); }
.r-value { font: 800 13px var(--font); letter-spacing: 0; fill: var(--ink); }
.table-toggle { margin-top: 10px; font-size: 13px; }
.table-toggle summary { cursor: pointer; color: var(--accent); font-weight: 700; }
.tip { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.pb-list { display: grid; gap: 8px; }
.pb { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.pb > span:nth-child(2) { display: grid; line-height: 1.25; }
.pb small { color: var(--muted); font-size: 11.5px; }
.pb strong { font-size: 16px; }
.pb em { font-style: normal; font-size: 12px; color: var(--muted); }
.pb-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); color: var(--accent); }
.badge-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.badge-section { margin-bottom: 26px; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.tone-green { --tone-c: #2f8f5b; } .tone-blue { --tone-c: #2f6fdb; } .tone-purple { --tone-c: #7c4ddb; } .tone-orange { --tone-c: #e0653a; } .tone-red { --tone-c: #d6453a; } .tone-gold { --tone-c: #b8860b; } .tone-teal { --tone-c: #1f8a80; }
.badge-tile { position: relative; display: grid; justify-items: center; gap: 6px; padding: 18px 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); text-align: center; transition: transform .2s var(--ease), box-shadow .2s; }
.badge-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.badge-tile strong { font-size: 13px; }
.badge-tile small { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.badge-tile .progress { width: 80%; margin-top: 4px; }
.badge-tile .progress i { background: var(--tone-c); }
.badge-tile .prog { font-family: var(--mono); }
.badge-tile.earned { background: linear-gradient(180deg, color-mix(in srgb, var(--tone-c) 9%, var(--surface)), var(--surface)); border-color: color-mix(in srgb, var(--tone-c) 30%, transparent); }
.badge-tile.featured { box-shadow: 0 0 0 2px var(--tone-c); }
.badge-tile.locked .badge-medal { background: var(--surface-3); color: var(--muted); box-shadow: none; }
.badge-medal { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--tone-c) 55%, #fff), var(--tone-c)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--tone-c) 18%, transparent), 0 6px 14px color-mix(in srgb, var(--tone-c) 35%, transparent); }
.badge-medal.big { width: 58px; height: 58px; }
.badge-pin { position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; gap: 3px; font: 500 9.5px var(--mono); text-transform: uppercase; color: var(--tone-c); }
.stat-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat-tile { padding: 18px; display: grid; gap: 2px; }
.stat-tile small { font: 500 10.5px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.stat-tile strong { font-size: 30px; letter-spacing: -.04em; }
.stat-tile span { font-size: 12.5px; }
.bar-chart { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; height: 180px; align-items: stretch; }
.bc-col { display: grid; grid-template-rows: 1fr auto; gap: 6px; text-align: center; cursor: default; }
.bc-col small { font: 500 9.5px var(--mono); color: var(--muted); white-space: nowrap; }
.bc-bar { display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--line-strong); }
.bc-bar i { width: 100%; max-width: 28px; background: var(--mint-strong); border-radius: 4px 4px 0 0; min-height: 2px; transition: height .6s var(--ease); }
.bc-bar i.zero { background: var(--surface-3); }
.bc-col:hover .bc-bar i { background: #6b9652; }
.chart-tip.floating { transform: translate(-50%, calc(-100% - 6px)); }
.pyramid { display: grid; gap: 6px; }
.py-row { display: grid; grid-template-columns: 34px 1fr 24px; gap: 10px; align-items: center; font-size: 13px; }
.py-label { font-family: var(--mono); color: var(--muted); }
.py-track { display: flex; justify-content: center; }
.py-track i { display: block; height: 18px; border-radius: 4px; background: var(--mint-strong); transition: width .6s var(--ease); }
.py-row b { text-align: right; }
.mix-list { display: grid; gap: 12px; }
.mix-row { display: grid; grid-template-columns: 160px 1fr 30px; gap: 12px; align-items: center; font-size: 13px; }
.mix-row span:first-child { display: flex; align-items: center; gap: 8px; }
.mix-row b { text-align: right; }
.order-list { display: grid; gap: 14px; }
.order { padding: 16px; display: grid; gap: 12px; }
.order-head { display: flex; align-items: center; gap: 14px; }
.order-head > div { flex: 1; display: grid; }
.order-items { display: flex; gap: 10px; flex-wrap: wrap; }
.order-item { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border-radius: 12px; background: var(--surface-2); text-align: left; }
.order-item > span:last-child { display: grid; line-height: 1.3; }

/* ================================================================ Messages */
.messages-modal .modal { padding: 0; height: min(680px, calc(100vh - 40px)); overflow: hidden; }
.messages-modal .modal-body { height: 100%; }
.dm { display: grid; grid-template-columns: 300px 1fr; height: 100%; }
.dm-inbox { border-right: 1px solid var(--line); padding: 22px 12px 12px; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.dm-inbox h2 { padding: 0 8px; }
.dm-list { overflow-y: auto; display: grid; gap: 2px; align-content: start; }
.dm-person { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; text-align: left; }
.dm-person > span:not(.avatar) { flex: 1; display: grid; line-height: 1.3; min-width: 0; }
.dm-person small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-person em { font-style: normal; font-size: 11px; color: var(--muted); }
.dm-person:hover, .dm-person.active { background: var(--surface-2); }
.dm-thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.dm-empty { margin: auto; display: grid; justify-items: center; gap: 8px; text-align: center; color: var(--muted); padding: 20px; }
.dm-empty h3 { color: var(--ink); }
.dm-head { display: flex; align-items: center; gap: 8px; padding: 16px 60px 14px 18px; border-bottom: 1px solid var(--line); }
.dm-back { display: none; }
.dm-msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.bubble { position: relative; max-width: 72%; padding: 10px 14px; border-radius: 20px; font-size: 14px; line-height: 1.4; word-wrap: break-word; }
.bubble.recv { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 6px; }
.bubble.sent { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 6px; }
body.theme-dark .bubble.sent { background: #2f5e44; }
.bubble.has-share { padding: 4px; background: var(--surface-2); color: var(--ink); }
.bubble img { display: block; max-width: 220px; border-radius: 16px; }
.unsend { position: absolute; left: -30px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); opacity: 0; transition: .15s; }
.bubble:hover .unsend { opacity: 1; }
.dm-share { display: flex; gap: 10px; align-items: center; padding: 6px; text-align: left; border-radius: 16px; background: var(--surface); width: 260px; max-width: 100%; }
.dm-share > span:last-child { display: grid; line-height: 1.3; min-width: 0; font-size: 12.5px; }
.dm-share small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-share-art { width: 58px; height: 72px; border-radius: 12px; overflow: hidden; flex-shrink: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--tone, #999) 18%, var(--surface-2)); }
.dm-share-art .scene-svg { width: 100%; height: 100%; }
.typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; border-radius: 20px; background: var(--surface-2); }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: typing 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 50% { transform: translateY(-4px); opacity: .5; } }
.dm-compose { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); }
.dm-compose label { cursor: pointer; }
.settings-group { padding: 16px 0; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.settings-group:first-of-type { border-top: 0; padding-top: 0; }

/* ==================================================================== Auth */
body.signed-out .app, body.signed-out .mobile-nav { display: none; }
.auth-screen { position: fixed; inset: 0; z-index: 300; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--surface); overflow-y: auto; }
.auth-art { position: relative; overflow: hidden; }
.auth-art .scene-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.auth-quote { position: absolute; left: 48px; bottom: 56px; right: 48px; color: #fff; display: grid; gap: 14px; text-shadow: 0 2px 20px rgba(0, 0, 0, .3); }
.auth-quote h2 { font-size: clamp(30px, 3.4vw, 46px); letter-spacing: -.04em; }
.auth-quote p { font-size: 16px; opacity: .9; max-width: 420px; }
.auth-panel { display: grid; place-items: center; padding: 40px 24px; }
.auth-form { width: 100%; max-width: 380px; display: grid; gap: 14px; }
.auth-form .brand { padding: 0; margin-bottom: 18px; }
.auth-error { color: var(--danger); font-size: 13px; min-height: 18px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* ============================================================== Responsive */
@media (max-width: 1280px) {
  .home-layout { grid-template-columns: minmax(0, 600px) 300px; gap: 24px; }
  .rank-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ph-stats { grid-template-columns: repeat(3, auto); row-gap: 14px; }
  .ph-stats .xp { grid-column: 1 / -1; }
}
@media (max-width: 1100px) {
  .home-layout { grid-template-columns: minmax(0, 620px); }
  .rail { display: none; }
  .details-layout { grid-template-columns: 1fr; }
  .details-preview { position: static; grid-template-columns: 180px 1fr; align-items: center; }
  .editor { grid-template-columns: 1fr; grid-template-areas: "stage" "timeline" "meta" "tools"; }
  .phone-frame { width: 220px; }
  .shop-layout { grid-template-columns: 1fr; }
  .shop-filters { position: static; }
  .cat-list { display: flex; overflow-x: auto; scrollbar-width: none; }
  .cat { white-space: nowrap; gap: 8px; }
  .checkout { grid-template-columns: 1fr; }
  .checkout-summary { position: static; }
  .profile-grid { grid-template-columns: 1fr; }
  .ph-main { grid-template-columns: auto 1fr; }
  .ph-level { display: none; }
  .ph-actions { grid-column: 1 / -1; }
  .comp-grid { grid-template-columns: 1fr; }
  .map-sidebar { width: 300px; }
  .map-top, .map-bottom { left: 332px; }
  .leaflet-control-scale { margin-left: 332px !important; }
  .map-detail { width: 380px; }
  body.map-detail-open .map-top, body.map-detail-open .map-bottom { right: 412px; }
  .map-legend { display: none; }
}
@media (max-width: 900px) {
  :root { --topbar-h: 58px; }
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { padding: 0 12px 0 16px; gap: 8px; }
  .search-trigger { display: none; }
  .mobile-brand, .mobile-only { display: inline-flex; }
  .main { padding: 16px 16px 96px; }
  body.map-mode .main, body.reels-mode .main { padding-bottom: 0; }
  .mobile-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; height: calc(64px + env(safe-area-inset-bottom, 0px)); padding: 0 8px env(safe-area-inset-bottom, 0px); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .mobile-nav a { display: grid; justify-items: center; gap: 2px; font-size: 10.5px; font-weight: 700; color: var(--muted); }
  .mobile-nav a.active { color: var(--ink); }
  .mobile-nav a.active .icon { color: var(--accent); }
  .tab-create { justify-self: center; width: 52px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--ink); color: var(--mint); }
  body.theme-dark .tab-create { background: var(--mint); color: #17201e; }
  .reels-page, .map-page { height: calc(100vh - var(--topbar-h) - 64px - env(safe-area-inset-bottom, 0px)); height: calc(100dvh - var(--topbar-h) - 64px - env(safe-area-inset-bottom, 0px)); }
  .reel { padding: 0; }
  .reel-stage { height: 100%; width: 100%; aspect-ratio: auto; border-radius: 0; }
  .reel-stage .media { border-radius: 0; }
  .reel-rail { right: 10px; bottom: 90px; }
  .reel-info { right: 64px; }
  .reels-page .rail-btn .icon { background: rgba(0, 0, 0, .35); backdrop-filter: blur(6px); }
  .reels-nav { display: none; }
  .reels-create { left: auto; right: 12px; top: 12px; height: 36px; padding: 0 12px; }
  .reel-sound { top: 60px; right: 12px; left: auto; }
  .map-sidebar { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 42%; padding: 12px; }
  .map-sidebar.collapsed { transform: translateY(calc(100% - 56px)); }
  .map-sidebar.collapsed [data-map-collapse] { transform: rotate(90deg); }
  [data-map-collapse] { transform: rotate(-90deg); }
  .map-top { left: 8px; right: 8px; top: 8px; }
  .map-search { min-width: 0; max-width: none; height: 44px; }
  .map-crumb { font-size: 12px; padding: 6px 12px; }
  .map-bottom { left: 8px; right: 8px; bottom: auto; top: 110px; }
  .zoom-steps { display: none; }
  .map-add { height: 34px; padding: 0 12px; font-size: 12px; }
  .basemaps button { padding: 0 9px; font-size: 11.5px; height: 28px; }
  .leaflet-control-scale { display: none; }
  .leaflet-control-zoom { margin-bottom: calc(42vh + 20px) !important; margin-right: 10px !important; }
  .map-detail { top: 8px; left: 8px; right: 8px; bottom: 8px; width: auto; }
  body.map-detail-open .map-top, body.map-detail-open .map-bottom { right: 8px; }
  .shop-hero { grid-template-columns: 1fr; padding: 24px; }
  .hero-art { display: none; }
  .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dm { grid-template-columns: 1fr; }
  .dm-thread { display: none; }
  .dm.thread-open .dm-inbox { display: none; }
  .dm.thread-open .dm-thread { display: flex; }
  .dm-back { display: grid; }
  .auth-screen { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .filter-grid.compact { grid-template-columns: repeat(4, 1fr); }
  .type-grid { grid-template-columns: repeat(4, 1fr); }
  .toast-host { bottom: 84px; }
  .badge-unlock { min-width: 0; width: calc(100% - 24px); }
}
@media (max-width: 600px) {
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { max-height: 94vh; border-radius: 22px 22px 0 0; padding: 22px 18px; transform: translateY(40px); }
  .palette .modal { border-radius: 0 0 18px 18px; }
  .palette { align-items: start; padding-top: 0; }
  .messages-modal .modal { height: 94vh; }
  .composer-head { padding: 16px 56px 12px 16px; }
  .composer-body { padding: 16px; }
  .field-grid, .field-grid.three { grid-template-columns: 1fr; }
  .details-preview { grid-template-columns: 1fr; }
  .preview-media { display: none; }
  .phone-frame { width: 190px; }
  .seg-tab span { display: none; }
  .comp-card { grid-template-columns: auto 1fr; }
  .comp-side { grid-column: 1 / -1; grid-auto-flow: column; justify-content: space-between; align-items: center; }
  .comp-facts { grid-template-columns: 1fr; }
  .badge-row { grid-template-columns: repeat(2, 1fr); }
  .ph-main { grid-template-columns: 1fr; justify-items: start; padding: 0 18px; }
  .ph-id { padding-top: 6px; }
  .ph-stats { grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 16px 18px; }
  .avatar-xxl { width: 96px; height: 96px; font-size: 30px; }
  .rank-grid { grid-template-columns: 1fr; }
  .leaderboards { grid-template-columns: 1fr; }
  .related { grid-template-columns: repeat(2, 1fr); }
  .mix-row { grid-template-columns: 120px 1fr 26px; }
  .composer-quick { padding-left: 0; overflow-x: auto; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-grid { grid-template-columns: 1fr; }
  .detail-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail-stats strong { font-size: 14px; }
  .toolbar .input.narrow { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   v3 additions
   ========================================================================== */

/* Layering: map controls stay inside the map; overlays always win */
.map-page { isolation: isolate; }
.overlay { z-index: 1200; }
.toast-host { z-index: 1400; }
.badge-unlock { z-index: 1350; }
.confetti { z-index: 1500; }
.popover { z-index: 1100; }
.topbar { z-index: 900; }
.mobile-nav { z-index: 950; }
.auth-screen { z-index: 1000; }

/* ------------------------------------------------------------ Avatar frames */
.av-frame { position: relative; display: inline-grid; place-items: center; border-radius: 50%; padding: 3px; background: conic-gradient(from 210deg, var(--f1), var(--f2), var(--f1)); flex-shrink: 0; }
.av-frame > .avatar { box-shadow: 0 0 0 2px var(--surface); }
.av-frame.fr-xs, .av-frame.fr-sm { padding: 2px; }
.av-frame.fr-lg { padding: 3.5px; }
.av-frame.fr-xl, .av-frame.fr-xxl { padding: 5px; }
.av-frame.fr-xxl > .avatar { box-shadow: 0 0 0 4px var(--surface); }
.av-frame.fr-anim { background: conic-gradient(from var(--fa, 0deg), var(--f1), var(--f2), #fff, var(--f2), var(--f1)); animation: frame-spin 4s linear infinite; }
@property --fa { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes frame-spin { to { --fa: 360deg; } }
.av-frame.fr-anim::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; box-shadow: 0 0 14px color-mix(in srgb, var(--f2) 55%, transparent); pointer-events: none; }
.fr-aurora { background: conic-gradient(from var(--fa, 0deg), #5bf2c5, #7c4ddb, #2f6fdb, #5bf2c5); }
.fr-streak { background: conic-gradient(from var(--fa, 0deg), #ffd166, #ec7548, #e0453a, #ffd166); }
.fr-tag { position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); padding: 2px 8px; border-radius: 99px; background: linear-gradient(135deg, var(--f1), var(--f2)); color: #111; font: 700 9.5px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); border: 1.5px solid var(--surface); }
.fr-rank .fr-tag { bottom: -11px; }
.fr-emblem { position: absolute; right: -6px; bottom: -4px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); line-height: 0; }
.fr-lg .fr-emblem { right: -8px; bottom: 2px; }
.fr-xl .fr-emblem, .fr-xxl .fr-emblem { right: -4px; bottom: 6px; }
.fr-xl .fr-tag, .fr-xxl .fr-tag { font-size: 11px; padding: 3px 10px; }

/* --------------------------------------------------------------- Emblems */
.emblem { display: block; overflow: visible; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .22)); }
.emblem .em-aura { animation: em-pulse 2.6s ease-in-out infinite; transform-origin: center; }
.emblem .em-rays { animation: spin 18s linear infinite; transform-origin: 32px 32px; }
.emblem .em-twinkle { animation: twinkle 1.8s ease-in-out infinite; transform-origin: 58px 12px; }
@keyframes em-pulse { 50% { opacity: .55; transform: scale(1.06); } }
@keyframes twinkle { 50% { opacity: .2; transform: scale(.5); } }
.tier-chip.with-emblem { gap: 4px; padding-left: 3px; height: 24px; }
.tier-chip.with-emblem .emblem { filter: none; }
.rank-mini { grid-template-columns: auto 1fr; }
.rank-mini .emblem { grid-row: span 2; }
.rank-card { background: radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--tier) 14%, transparent), transparent 60%), var(--surface); }
.rank-emblem-wrap { line-height: 0; }
.rank-card.tier-bg-6, .rank-card.tier-bg-7 { border-color: color-mix(in srgb, var(--tier) 40%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--tier) 25%, transparent), 0 10px 30px color-mix(in srgb, var(--tier) 18%, transparent); }
.next-emblem { display: inline-block; vertical-align: middle; margin-left: 4px; line-height: 0; }
.tier-ladder { margin-top: 14px; }
.tier-ladder summary { display: flex; align-items: center; gap: 8px; font-weight: 800; cursor: pointer; list-style: none; }
.ladder { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.ladder-step { display: grid; justify-items: center; text-align: center; gap: 4px; }
.ladder-step small { font: 500 10px var(--mono); color: var(--muted); }
.ph-best { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; }
.ph-cover { position: relative; }
.ph-frame-btn { position: absolute; right: 14px; top: 14px; }
.user-rank { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); }
.user-rank span { display: grid; line-height: 1.2; }
.user-rank .eyebrow { margin: 0; }
.rankup { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 10px 0; }
.rankup .emblem { animation: rank-pop .9s var(--ease); }
@keyframes rank-pop { 0% { transform: scale(.2) rotate(-30deg); opacity: 0; } 60% { transform: scale(1.12) rotate(6deg); opacity: 1; } 100% { transform: none; } }

/* ----------------------------------------------------------- Rarity medals */
.rt-common { --rc: #94a3a0; } .rt-rare { --rc: #3b82f6; } .rt-epic { --rc: #8b5cf6; } .rt-legendary { --rc: #f59e0b; } .rt-mythic { --rc: #ec4899; }
.medal { position: relative; display: inline-grid; place-items: center; width: 54px; height: 54px; flex-shrink: 0; }
.medal.m-sm { width: 34px; height: 34px; } .medal.m-lg { width: 72px; height: 72px; } .medal.m-xl { width: 128px; height: 128px; }
.medal-shape { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--tone-c); }
.medal-core { position: absolute; inset: 9%; display: grid; place-items: center; border-radius: inherit; color: #fff; background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--tone-c) 55%, #fff), var(--tone-c)); }
.medal.m-xl .medal-core .icon { width: 56px; height: 56px; }
.medal.r-common .medal-shape { background: color-mix(in srgb, var(--tone-c) 70%, #fff); }
.medal.r-rare .medal-shape { background: linear-gradient(135deg, #f8fafc, #94a3b8 45%, #e2e8f0 60%, #64748b); }
.medal.r-rare { filter: drop-shadow(0 4px 8px color-mix(in srgb, var(--tone-c) 35%, transparent)); }
.medal.r-epic .medal-shape, .medal.r-epic .medal-core { clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); border-radius: 0; }
.medal.r-epic .medal-shape { background: linear-gradient(160deg, #e9d5ff, #7c3aed 55%, #3b0764); }
.medal.r-epic { filter: drop-shadow(0 0 10px rgba(139, 92, 246, .55)); animation: glow-epic 2.8s ease-in-out infinite; }
@keyframes glow-epic { 50% { filter: drop-shadow(0 0 18px rgba(139, 92, 246, .85)); } }
.medal.r-legendary .medal-shape, .medal.r-legendary .medal-core { clip-path: polygon(50% 0, 98% 16%, 98% 52%, 50% 100%, 2% 52%, 2% 16%); border-radius: 0; }
.medal.r-legendary .medal-shape { background: #b45309; }
.medal.r-legendary .medal-shape::before { content: ""; position: absolute; inset: -50%; background: conic-gradient(#fde68a, #f59e0b, #fff7d6, #b45309, #fde68a); animation: spin 3.5s linear infinite; }
.medal.r-legendary .medal-core { inset: 10%; z-index: 1; background: radial-gradient(circle at 30% 25%, #fde68a, #d97706 60%, #92400e); }
.medal.r-legendary { filter: drop-shadow(0 0 12px rgba(245, 158, 11, .6)); }
.medal.r-mythic .medal-shape, .medal.r-mythic .medal-core { clip-path: polygon(50% 0, 62% 30%, 95% 25%, 72% 52%, 90% 85%, 55% 72%, 50% 100%, 45% 72%, 10% 85%, 28% 52%, 5% 25%, 38% 30%); border-radius: 0; }
.medal.r-mythic .medal-shape { background: #111; }
.medal.r-mythic .medal-shape::before { content: ""; position: absolute; inset: -50%; background: conic-gradient(#ff6b9d, #ffd166, #5bf2c5, #5b8def, #c77dff, #ff6b9d); animation: spin 2.5s linear infinite; }
.medal.r-mythic .medal-core { inset: 18%; z-index: 1; background: conic-gradient(from 45deg, #ec4899, #8b5cf6, #3b82f6, #10b981, #f59e0b, #ec4899); animation: holo 3s linear infinite; }
.medal.r-mythic .medal-core .icon { filter: drop-shadow(0 0 3px rgba(0, 0, 0, .5)); }
@keyframes holo { to { filter: hue-rotate(360deg); } }
.medal.r-mythic { filter: drop-shadow(0 0 14px rgba(236, 72, 153, .6)); animation: float 3s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-3px); } }
.medal .spark { position: absolute; width: 6px; height: 6px; background: #fff; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: twinkle 1.6s ease-in-out infinite; z-index: 2; }
.medal .s1 { top: 2%; right: 6%; } .medal .s2 { bottom: 10%; left: 0; animation-delay: .5s; width: 5px; height: 5px; } .medal .s3 { top: 40%; right: -6%; animation-delay: 1s; width: 4px; height: 4px; }
.medal.locked { filter: grayscale(1) opacity(.45); animation: none; }
.medal.locked .medal-shape::before { animation: none; }
.medal.locked .medal-core { background: var(--surface-3); color: var(--muted); animation: none; }

.badge-tile { border-width: 1.5px; }
.badge-tile .rarity-tag { position: absolute; top: 8px; left: 8px; font: 500 8.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--rc); }
.badge-tile.earned.rt-rare { border-color: color-mix(in srgb, #3b82f6 40%, transparent); }
.badge-tile.earned.rt-epic { border-color: color-mix(in srgb, #8b5cf6 55%, transparent); background: linear-gradient(180deg, color-mix(in srgb, #8b5cf6 12%, var(--surface)), var(--surface)); }
.badge-tile.earned.rt-legendary { border-color: #f59e0b; background: linear-gradient(180deg, color-mix(in srgb, #f59e0b 16%, var(--surface)), var(--surface)); box-shadow: 0 0 0 1px color-mix(in srgb, #f59e0b 30%, transparent), 0 8px 24px rgba(245, 158, 11, .18); }
.badge-tile.earned.rt-mythic { border: 1.5px solid transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, conic-gradient(from var(--fa, 0deg), #ec4899, #8b5cf6, #3b82f6, #10b981, #f59e0b, #ec4899) border-box; animation: frame-spin 4s linear infinite; }
.badge-tile.featured { box-shadow: 0 0 0 2px var(--rc); }
.rarity-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.rarity-card { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); text-align: left; }
.rarity-card span { display: grid; line-height: 1.25; }
.rarity-card strong { color: var(--rc); }
.rarity-card small { color: var(--muted); font-family: var(--mono); }
.rarity-card.active { border-color: var(--rc); box-shadow: 0 0 0 1px var(--rc); }

/* Profile showcase */
.showcase { display: flex; align-items: center; gap: 16px; padding: 18px 26px 0; flex-wrap: wrap; }
.showcase-slots { display: flex; gap: 12px; flex-wrap: wrap; }
.showcase-slot { display: grid; justify-items: center; gap: 4px; width: 128px; padding: 12px 8px 10px; border-radius: 16px; border: 1.5px dashed var(--line-strong); text-align: center; background: var(--surface); }
.showcase-slot.filled { border-style: solid; border-color: color-mix(in srgb, var(--rc) 45%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--rc) 10%, var(--surface)), var(--surface)); }
.showcase-slot strong { font-size: 12.5px; line-height: 1.2; }
.showcase-slot small { font: 500 9.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--rc, var(--muted)); }
.showcase-slot.empty { color: var(--muted); height: 124px; align-content: center; }
.sc-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 12px 0 18px; }
.sc-slot { position: relative; display: grid; justify-items: center; align-content: center; gap: 4px; min-height: 170px; padding: 16px 8px 40px; border-radius: 18px; border: 2px dashed var(--line-strong); text-align: center; cursor: pointer; background: var(--surface-2); }
.sc-slot.active { border-color: var(--ink); border-style: solid; box-shadow: 0 0 0 3px color-mix(in srgb, var(--mint) 60%, transparent); }
.sc-slot:not(.empty) { border-style: solid; border-color: color-mix(in srgb, var(--rc) 50%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--rc) 12%, var(--surface)), var(--surface)); }
.sc-slot small { color: var(--muted); font-size: 11.5px; }
.sc-num { position: absolute; top: 8px; left: 10px; font: 500 11px var(--mono); color: var(--muted); }
.sc-tools { position: absolute; bottom: 8px; display: flex; gap: 4px; }
.sc-tools button { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line-strong); }
.sc-tools button:disabled { opacity: .3; }
.sc-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; max-height: 300px; overflow-y: auto; padding: 4px; }
.sc-badge { display: grid; justify-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); font-size: 11px; line-height: 1.2; text-align: center; }
.sc-badge:hover { border-color: var(--rc); }
.sc-badge.used { opacity: .45; }

/* Frame picker */
.fp-preview { display: grid; place-items: center; padding: 10px 0 24px; }
.fp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin-bottom: 14px; }
.fp-opt { display: grid; justify-items: center; gap: 8px; padding: 16px 8px 12px; border-radius: 16px; border: 1.5px solid var(--line); text-align: center; background: var(--surface); }
.fp-opt small { color: var(--muted); font-size: 11px; line-height: 1.3; }
.fp-opt.active { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.fp-opt strong { font-size: 13px; margin-top: 6px; }

/* ------------------------------------------------------------------ Stories */
.story { cursor: pointer; }
.story-btn { border-radius: 50%; position: relative; z-index: 1; }
.story.seen::before { content: ""; position: absolute; top: -5px; width: 70px; height: 70px; border-radius: 50%; background: var(--line-strong); z-index: 0; }
.story.add .story-plus, .story .story-plus { cursor: pointer; }
.story-overlay { display: grid; place-items: center; background: rgba(5, 8, 8, 0); }
.story-overlay.open { background: rgba(5, 8, 8, .92); backdrop-filter: blur(6px); }
.story-stage { position: relative; width: min(420px, 100vw); height: min(92vh, 780px); aspect-ratio: 9 / 16; max-height: 100dvh; border-radius: 18px; overflow: hidden; background: #111; box-shadow: var(--shadow-lg); touch-action: none; user-select: none; }
.story-bars { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 4; display: flex; gap: 4px; }
.story-bars span { flex: 1; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .35); overflow: hidden; }
.story-bars i { display: block; height: 100%; background: #fff; }
.story-head { position: absolute; top: 20px; left: 10px; right: 10px; z-index: 4; display: flex; align-items: center; gap: 6px; color: #fff; }
.story-head small { opacity: .75; font-size: 12px; }
.story-music { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 3px 8px; border-radius: 99px; background: rgba(0, 0, 0, .35); color: #fff; }
.story-media, .story-scene, .story-textcard { position: absolute; inset: 0; }
.story-scene .scene-svg, .story-scene img, .story-scene video { width: 100%; height: 100%; object-fit: cover; }
.story-textcard { display: grid; place-items: center; padding: 28px; }
.story-textcard p { color: #fff; font-size: clamp(22px, 6vw, 30px); font-weight: 800; text-align: center; line-height: 1.2; text-shadow: 0 2px 12px rgba(0, 0, 0, .2); }
.story-caption { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); max-width: 86%; padding: 8px 14px; border-radius: 12px; background: rgba(0, 0, 0, .55); color: #fff; font-weight: 700; font-size: 16px; text-align: center; }
.story-sticker { top: 70px !important; left: 14px !important; font-size: 14px !important; padding: 6px 14px !important; }
.story-zone { position: absolute; top: 70px; bottom: 80px; z-index: 3; width: 35%; background: none; }
.story-zone.prev { left: 0; } .story-zone.next { right: 0; width: 65%; }
.story-foot { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; display: flex; align-items: center; gap: 8px; padding: 14px 12px calc(14px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(transparent, rgba(0, 0, 0, .6)); color: #fff; }
.muted-light { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; opacity: .85; }
.story-reply { display: flex; gap: 6px; width: 100%; align-items: center; }
.story-reply input { flex: 1; height: 42px; padding: 0 16px; border-radius: 99px; border: 1.5px solid rgba(255, 255, 255, .6); background: transparent; color: #fff; font-size: 16px; }
.story-reply input::placeholder { color: rgba(255, 255, 255, .75); }
.story-reply .icon-btn.on { color: #e0453a; }
.story-reply .icon-btn.on .icon { fill: #e0453a; }
.story-compose .modal { max-width: 760px; }
.sc-layout { display: grid; grid-template-columns: 240px 1fr; gap: 20px; }
.sc-preview { position: relative; aspect-ratio: 9 / 16; border-radius: 16px; overflow: hidden; background: #111; }
.story-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; color: #aab; font-size: 13px; }

/* ---------------------------------------------------------------- Carousels */
.is-carousel { position: relative; }
.car-track { position: absolute; inset: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.car-track::-webkit-scrollbar { display: none; }
.car-slide { position: relative; flex: 0 0 100%; height: 100%; scroll-snap-align: center; overflow: hidden; }
.car-slide .scene, .car-slide .media-frame { position: absolute; inset: 0; }
.car-count { position: absolute; top: 12px; right: 12px; z-index: 3; padding: 3px 9px; border-radius: 99px; background: rgba(0, 0, 0, .6); color: #fff; font: 500 11.5px var(--mono); }
.is-carousel .media-badge { right: auto; left: 12px; }
.car-dots { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; gap: 5px; padding: 4px 6px; border-radius: 99px; background: rgba(0, 0, 0, .25); }
.car-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .5); transition: .2s; }
.car-dots i.on { background: #fff; transform: scale(1.25); }
.car-nav { position: absolute; top: 50%; z-index: 3; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .9); color: #111; box-shadow: var(--shadow); opacity: 0; transition: opacity .2s; }
.car-nav.prev { left: 10px; } .car-nav.next { right: 10px; }
.media:hover .car-nav { opacity: 1; }
@media (hover: none) { .car-nav { display: none; } }

/* Media picker (composer) */
.media-picker { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.mp-preview { position: relative; aspect-ratio: 4 / 5; border-radius: 18px; overflow: hidden; background: #111; }
.mp-preview img, .mp-preview video { width: 100%; height: 100%; object-fit: cover; }
.mp-side { display: grid; gap: 12px; align-content: start; }
.mp-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.mp-thumb, .mp-add { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-3); cursor: pointer; border: 2px solid transparent; }
.mp-thumb.active { border-color: var(--ink); }
.mp-thumb img, .mp-thumb video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.mp-num { position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .6); color: #fff; font: 500 10.5px var(--mono); }
.mp-kind { position: absolute; top: 4px; right: 4px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6)); }
.mp-tools { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; padding: 3px; background: linear-gradient(transparent, rgba(0, 0, 0, .6)); }
.mp-tools button { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .92); color: #111; }
.mp-add { display: grid; place-content: center; justify-items: center; gap: 2px; border: 2px dashed var(--line-strong); background: var(--surface); color: var(--muted); }

/* Voiceover */
.voice-box { display: grid; gap: 8px; padding: 12px; margin-top: 6px; border-radius: 14px; background: var(--surface-2); }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #e0453a; box-shadow: 0 0 0 3px rgba(224, 69, 58, .25); }
#ed-rec.recording { background: #e0453a; color: #fff; }
#ed-rec.recording .rec-dot { background: #fff; animation: pulse-rec 1s infinite; }
@keyframes pulse-rec { 50% { opacity: .3; } }

/* ------------------------------------------------------------ Reels / feed */
.reels-top { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 20; display: grid; justify-items: center; gap: 8px; width: min(640px, 92%); pointer-events: none; }
.reels-top > * { pointer-events: auto; }
.reels-tabs { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 99px; background: rgba(15, 20, 19, .6); backdrop-filter: blur(10px); }
.rt { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px; border-radius: 99px; color: rgba(255, 255, 255, .75); font-weight: 700; font-size: 13px; }
.rt.active { background: #fff; color: #111; }
.rt.lang.on { color: var(--mint); }
.reels-tags { display: flex; gap: 6px; overflow-x: auto; max-width: 100%; scrollbar-width: none; padding: 0 4px; }
.rtag { flex-shrink: 0; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; color: #fff; background: rgba(255, 255, 255, .14); backdrop-filter: blur(6px); }
.rtag.active { background: var(--mint); color: #111; }
.reel-reason { display: inline-flex; align-items: center; gap: 5px; width: fit-content; padding: 3px 9px; border-radius: 99px; background: rgba(255, 255, 255, .16); font-size: 11.5px; font-weight: 700; backdrop-filter: blur(6px); }
.post-reason { display: flex; align-items: center; gap: 6px; padding: 10px 16px 0; font-size: 12px; font-weight: 700; color: var(--muted); }
.translate-btn { display: inline-flex; align-items: center; gap: 5px; width: fit-content; font-size: 12.5px; font-weight: 700; color: var(--accent); }
.translate-btn.light { color: #fff; opacity: .9; }
.translated { font-size: 14px; line-height: 1.5; padding: 8px 12px; border-left: 3px solid var(--mint-strong); background: var(--surface-2); border-radius: 0 10px 10px 0; }
.translated small { display: flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 11px; color: var(--muted); }
.translated.light { background: rgba(0, 0, 0, .35); color: #fff; }
.translated.light small { color: rgba(255, 255, 255, .7); }

/* ------------------------------------------------------------------ Reviews */
.star-row { position: relative; display: inline-flex; line-height: 0; vertical-align: middle; }
.sr-base, .sr-fill { display: inline-flex; gap: 1px; }
.sr-base .icon { color: var(--line-strong); fill: var(--line-strong); }
.sr-fill { position: absolute; inset: 0; width: var(--pct); overflow: hidden; }
.sr-fill .icon { color: #e8a317; fill: #e8a317; flex-shrink: 0; }
.review-summary { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; padding: 12px; border-radius: 14px; background: var(--surface-2); }
.rs-big { display: grid; justify-items: center; gap: 4px; }
.rs-big strong { font-size: 34px; letter-spacing: -.04em; line-height: 1; }
.rs-bars { display: grid; gap: 4px; }
.rs-bars div { display: grid; grid-template-columns: 10px 1fr 22px; gap: 8px; align-items: center; font-size: 11.5px; }
.rs-bars small { text-align: right; color: var(--muted); }
.review-list { display: grid; gap: 12px; }
.review-item { display: flex; gap: 10px; }
.review-item > div { display: grid; gap: 2px; min-width: 0; }
.ri-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ri-head .link-strong { font-size: 13px; }
.review-text { font-size: 13.5px; color: var(--ink-2); }
.star-input { display: flex; justify-content: center; gap: 4px; }
.star-input button { color: var(--line-strong); transition: transform .12s; }
.star-input button .icon { fill: currentColor; }
.star-input button.on { color: #e8a317; }
.star-input button:hover { transform: scale(1.15); }
.star-label { text-align: center; font-weight: 800; }
.order-review { display: flex; gap: 6px; flex-wrap: wrap; }

/* -------------------------------------------------------- Places & live OSM */
.detail-addr { display: flex; align-items: flex-start; gap: 6px; margin-top: 4px; font-size: 13px; color: var(--ink-2); }
.detail-addr .icon { margin-top: 3px; color: var(--accent); }
.community-note.osm { color: var(--ink-2); background: var(--surface-2); }
.community-note a { color: var(--accent); font-weight: 700; }
.osm-tag { font: 500 9.5px var(--mono); font-style: normal; letter-spacing: .08em; padding: 2px 6px; border-radius: 6px; background: color-mix(in srgb, #7ebc6f 22%, transparent); color: #3b7d2c; }
body.theme-dark .osm-tag { color: #9fd98f; }
.live-status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin: 0 0 8px; min-height: 16px; flex-wrap: wrap; }
.live-near { display: flex; align-items: center; gap: 16px; padding: 16px 18px; margin-bottom: 16px; flex-wrap: wrap; }
.live-near > div { flex: 1; min-width: 200px; }
.live-near-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, #7ebc6f 22%, var(--surface)); color: #3b7d2c; }
#live-near-grid:not(:empty) { margin-bottom: 20px; }
.osm-card .place-body { padding-top: 16px; }
.map-pin.osm-pin { width: 26px; height: 26px; border-width: 2px; opacity: .92; }
.map-pin.osm-pin .icon { width: 12px; height: 12px; }
.map-cluster.c-route { background: #d6336c; } .map-cluster.c-live { background: #3b7d2c; }
.map-legend i.osm { width: auto; padding: 0 4px; border-radius: 4px; font: 500 8px var(--mono); background: #3b7d2c; }
.result-row .osm-tag { margin-left: auto; }

/* ------------------------------------------------------------ Competitions */
.zone-seg { display: flex; flex-wrap: wrap; width: fit-content; max-width: 100%; margin-bottom: 14px; }
.zone-seg button { display: inline-flex; align-items: center; gap: 6px; }
.region-chips.sub { margin-top: -6px; }
.region-chip.sm { height: 34px; padding: 0 12px; font-size: 12.5px; }
.zone-note { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; color: var(--muted); margin: -6px 0 14px; }
.zone-chip { background: color-mix(in srgb, #2f6fdb 14%, transparent) !important; color: #2f6fdb; }
body.theme-dark .zone-chip { color: #8fb2ff; }

/* ---------------------------------------------------------------- Languages */
.lang-search { margin-bottom: 12px; }
.lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-bottom: 16px; }
.lang-opt { display: grid; gap: 1px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); text-align: left; line-height: 1.25; }
.lang-opt small { color: var(--muted); font-size: 11.5px; }
.lang-opt:hover { border-color: var(--ink-2); }
.lang-opt.active { border-color: var(--ink); background: var(--surface-2); box-shadow: 0 0 0 1px var(--ink); }
.setting-link { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border-radius: 14px; background: var(--surface-2); text-align: left; }
.setting-link > span:not(.setting-frame) { flex: 1; display: grid; line-height: 1.3; }
.setting-frame { display: grid; place-items: center; width: 50px; }
.settings-group h3 { display: flex; align-items: center; gap: 8px; }
.install-steps { display: grid; gap: 12px; margin-bottom: 14px; }
.install-step { display: flex; gap: 12px; align-items: flex-start; }
.install-step > span { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); flex-shrink: 0; }
.install-step .icon { display: inline; vertical-align: middle; }
body > .skiptranslate, .goog-te-banner-frame { display: none !important; }
body { top: 0 !important; }

/* -------------------------------------------------------------------- Auth */
.auth-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.auth-top .brand { margin: 0; }
.saved-accounts { display: grid; gap: 6px; }
.saved-acct { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); text-align: left; }
.saved-acct span { display: grid; line-height: 1.3; }
.saved-acct small { color: var(--muted); }
.pass-wrap { position: relative; }
.pass-wrap .icon-btn { position: absolute; right: 5px; top: 5px; }
.pw-rules { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.pw-rules span::before { content: "○ "; }
.pw-rules span.ok { color: var(--ok); }
.pw-rules span.ok::before { content: "✓ "; }
.onboarding .modal { max-width: 560px; }
.ob-avatar { display: grid; justify-items: center; gap: 16px; padding: 20px 0; cursor: pointer; }
.epic-unlock .modal { background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--rc) 25%, var(--surface)), var(--surface) 70%); overflow: hidden; }
.epic { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 10px 0; }
.epic .medal { animation: rank-pop 1s var(--ease), float 3s ease-in-out 1s infinite; }
.epic h2 { font-size: 28px; }
.epic .eyebrow { color: var(--rc); }
.badge-unlock .medal { flex-shrink: 0; }

/* ------------------------------------------------------------- Mobile/app */
@media (display-mode: standalone) {
  .topbar { padding-top: env(safe-area-inset-top, 0px); height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px)); }
}
@media (max-width: 1280px) { .ladder { grid-template-columns: repeat(4, minmax(0, 1fr)); } .rarity-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .input, textarea.input, select.input, .comment-inline input, .comment-compose input, .palette-input input, .map-search input, #dm-input { font-size: 16px; }
  .reels-top { top: 8px; }
  .reels-tabs .rt { height: 28px; padding: 0 10px; font-size: 12px; }
  .reel-info { padding-bottom: 20px; }
  .showcase { padding: 16px 18px 0; }
  .showcase-slot { width: calc(33% - 8px); min-width: 92px; }
  .showcase-slot .medal.m-lg { width: 54px; height: 54px; }
  .media-picker { grid-template-columns: 1fr; }
  .mp-preview { max-height: 46vh; aspect-ratio: auto; height: 46vh; }
  .sc-layout { grid-template-columns: 1fr; }
  .sc-preview { max-width: 220px; margin: 0 auto; width: 100%; }
  .story-stage { width: 100vw; height: 100dvh; border-radius: 0; max-height: none; }
  .story-head { top: calc(20px + env(safe-area-inset-top, 0px)); }
  .story-bars { top: calc(10px + env(safe-area-inset-top, 0px)); }
  .icon-btn, .act { min-width: 44px; min-height: 44px; }
  .icon-btn.sm { min-width: 36px; min-height: 36px; }
  .ph-frame-btn { top: 10px; right: 10px; }
}
@media (max-width: 600px) {
  .rarity-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ladder { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sc-slots { gap: 8px; }
  .sc-slot { min-height: 150px; padding: 12px 4px 40px; }
  .sc-slot .medal.m-lg { width: 54px; height: 54px; }
  .review-summary { grid-template-columns: 1fr; }
  .lang-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .zone-seg button { font-size: 11.5px; padding: 0 10px; }
  .fp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fp-opt { padding: 12px 4px 10px; }
  .fp-opt small { display: none; }
}
@media (min-width: 1800px) {
  .main { padding-left: 48px; padding-right: 48px; }
  .home-layout { grid-template-columns: minmax(0, 680px) 380px; gap: 48px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}

/* --------------------------------------------------------------------- RTL */
[dir="rtl"] .leaflet-host, [dir="rtl"] .map-page, [dir="rtl"] .emblem, [dir="rtl"] .timeline, [dir="rtl"] .car-track { direction: ltr; }
[dir="rtl"] .sidebar { border-right: 0; border-left: 1px solid var(--line); }
[dir="rtl"] .search-trigger span, [dir="rtl"] .pal-item, [dir="rtl"] .result-row, [dir="rtl"] .dm-person, [dir="rtl"] .kit-item, [dir="rtl"] .menu-list button { text-align: right; }
[dir="rtl"] .drawer-backdrop { justify-content: flex-start; }
[dir="rtl"] .drawer { transform: translateX(-100%); }
[dir="rtl"] .overlay.open .drawer { transform: none; }
[dir="rtl"] .topbar-right { margin-left: 0; margin-right: auto; }
[dir="rtl"] .popover { right: auto; left: 0; }
[dir="rtl"] .modal-x { right: auto; left: 14px; }
[dir="rtl"] .modal-head { padding-right: 0; padding-left: 40px; }
.fr-xxl .fr-emblem, .fr-xl .fr-emblem { top: 2px; right: -6px; bottom: auto; }

/* ==========================================================================
   v4 — stories ring, promo contrast, location dot, topo, spots, social, privacy
   ========================================================================== */
/* Stories: one centred gradient ring; rank tag hidden in the tray */
.story.ring::before, .story.seen::before { content: none; display: none; }
.story .avatar, .story.ring .avatar { box-shadow: none; }
.story-ring { display: inline-grid; place-items: center; padding: 5px; border-radius: 50%; background: var(--line-strong); line-height: 0; }
.story-ring > * { box-shadow: 0 0 0 2.5px var(--surface) !important; border-radius: 50%; }
.story.seen .story-ring { padding: 3.5px; }
.story.ring .story-ring { background: conic-gradient(from 210deg, var(--mint-strong), var(--orange), #d4a017, var(--mint-strong)); }
.story.add .story-ring { background: transparent; padding: 3px; }
.stories .av-frame { padding: 0; background: none; filter: none; animation: none; box-shadow: none; }
.stories .av-frame::before, .stories .av-frame::after { content: none; display: none; }
.stories .av-frame > .avatar { box-shadow: none; }
.stories .fr-tag, .stories .fr-emblem { display: none !important; }
.story-plus { top: auto; bottom: 22px; right: 0; }
.rail { grid-template-columns: minmax(0, 1fr); }
.rail > * { min-width: 0; }

/* Promo strip: fixed dark pill in both themes */
.promo-strip { background: #1d2826; color: #f2f6f3; border: 1px solid rgba(217, 242, 154, .35); box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.promo-strip b { color: #d9f29a; }

/* Map: "you are here" dot, accuracy circle, here chip */
.me-dot { position: relative; display: block; width: 22px; height: 22px; }
.me-core { position: absolute; inset: 3px; border-radius: 50%; background: #1a73e8; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
.me-pulse { position: absolute; inset: -10px; border-radius: 50%; background: rgba(26, 115, 232, .35); animation: me-pulse 2s ease-out infinite; }
@keyframes me-pulse { from { transform: scale(.4); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }
.me-dot.mini { width: 14px; height: 14px; flex-shrink: 0; }
.me-dot.mini .me-core { inset: 0; border-width: 2px; }
.here-chip { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; text-align: left; font-size: 12.5px; max-width: 280px; }
.here-chip strong { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.here-chip small { display: block; color: var(--muted); font-size: 11.5px; }
[data-map-locate].on { color: #1a73e8; }
[data-map-locate].locating .icon { animation: spin 1.2s linear infinite; }
.map-cluster.c-trail { background: #2f8f5b; }
.map-pin.has-photo::after { content: ""; position: absolute; top: -4px; right: -4px; width: 11px; height: 11px; border-radius: 50%; background: #22d3ee; border: 2px solid #fff; }
@media (prefers-reduced-motion: reduce) { .me-pulse { animation: none; opacity: .4; } }

/* Topo editor + lightbox */
.topo { display: grid; gap: 12px; }
.topo-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.swatches { display: flex; gap: 6px; }
.swatch { width: 24px; height: 24px; border-radius: 50%; background: var(--c); border: 2px solid var(--surface); box-shadow: 0 0 0 1.5px var(--line-strong); }
.swatch.active { box-shadow: 0 0 0 2.5px var(--ink); transform: scale(1.1); }
.range-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--muted); }
.range-inline .range { width: 90px; }
.input.narrow#tp-label { width: 80px; }
.topo-stage { position: relative; border-radius: 14px; overflow: hidden; background: #0b0f0e; display: grid; place-items: center; }
.topo-stage canvas { display: block; max-width: 100%; max-height: 62vh; touch-action: none; cursor: crosshair; }
.topo-hint { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 11.5px; pointer-events: none; }
.lightbox .modal { background: #0b0f0e; padding: 0; }
.lb { position: relative; display: grid; place-items: center; min-height: 50vh; }
.lb img { max-height: 82vh; width: auto; object-fit: contain; }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-prev { left: 10px; } .lb-next { right: 10px; }
.lb .car-count { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); }

/* Community spot form + gallery */
.spot-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.spot-photos { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.spot-photo { position: relative; width: 92px; height: 92px; border-radius: 12px; overflow: hidden; }
.spot-photo img { width: 100%; height: 100%; object-fit: cover; }
.spot-photo button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .65); color: #fff; }
.spot-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.spot-thumb { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.spot-thumb img, .spot-thumb .skeleton { width: 100%; height: 100%; object-fit: cover; display: block; }
.spot-thumb small { position: absolute; left: 6px; bottom: 6px; padding: 1px 6px; border-radius: 99px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 10.5px; }

/* Conditions + gym contact */
.cond-now { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cond-now > span:nth-child(2) { flex: 1; min-width: 150px; }
.cond-now strong, .cond-now small { display: block; }
.cond-icon { font-size: 28px; line-height: 1; }
.cond-verdict { padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 800; background: var(--surface-3); }
.cond-verdict.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.cond-verdict.warn { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); }
.cond-verdict.bad { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
.cond-days { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.cond-days > div { display: grid; justify-items: center; gap: 2px; padding: 8px; border-radius: 12px; background: var(--surface-2); font-size: 12px; }
.cond-days span { font-size: 20px; }
.contact-card { display: grid; gap: 6px; margin: 14px 0; }
.contact-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
a.contact-row:hover { border-color: var(--mint-strong); }
.contact-row > span { flex: 1; min-width: 0; }
.contact-row small { display: block; font-size: 11px; color: var(--muted); }
.contact-row strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Social: tags, mentions, collabs, views, privacy */
.mention { color: var(--accent); font-weight: 700; }
.mention:hover { text-decoration: underline; }
.tagged-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin: 6px 0; }
.post-views, .rail-views { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.rail-views { color: #fff; font-weight: 700; text-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.avatar-stack { display: inline-flex; flex-shrink: 0; }
.avatar-stack > * + * { margin-left: -12px; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px var(--surface); }
.post-names { display: inline; }
.collab-invite { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; background: color-mix(in srgb, var(--mint) 22%, var(--surface)); border-bottom: 1px solid var(--line); font-size: 13px; }
.collab-invite > span { flex: 1; min-width: 200px; }
.collab-invite > div { display: flex; gap: 6px; }
.people-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.person-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 3px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; }
.person-chip button { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: var(--muted); }
.person-chip button:hover { background: var(--surface-3); color: var(--ink); }
.lock-chip { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; padding: 2px 8px; border-radius: 99px; background: var(--surface-3); color: var(--ink-2); font-size: 11.5px; font-weight: 700; letter-spacing: 0; }
.private-lock { display: grid; justify-items: center; gap: 8px; padding: 40px 20px; text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--radius); margin-top: 16px; }
.req-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.req-row:last-child { border-bottom: 0; }
.req-row > span { flex: 1; min-width: 150px; }
.req-row strong, .req-row small { display: block; }
.tab-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 99px; background: var(--orange); color: #fff; font-size: 10.5px; font-weight: 800; }
.privacy-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.privacy-opt { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 14px; border: 1.5px solid var(--line-strong); text-align: left; }
.privacy-opt strong, .privacy-opt small { display: block; }
.privacy-opt small { color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.privacy-opt.active { border-color: var(--mint-strong); background: color-mix(in srgb, var(--mint) 18%, transparent); }
.req { color: var(--danger); font-weight: 800; }
.at { color: var(--muted); font-weight: 700; }
.sync-pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 99px; background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); font-size: 11px; font-weight: 800; vertical-align: middle; }
.acct-summary { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--surface-2); margin-bottom: 12px; min-width: 0; }
.acct-summary > span { min-width: 0; }
.acct-summary strong, .acct-summary small { display: block; overflow: hidden; text-overflow: ellipsis; }
.notif-enable { display: flex; align-items: center; gap: 12px; width: calc(100% - 24px); margin: 10px 12px; padding: 12px; border-radius: 14px; text-align: left; background: color-mix(in srgb, var(--mint) 25%, var(--surface)); border: 1px solid var(--mint-strong); }
.notif-enable strong, .notif-enable small { display: block; }
.notif-enable small { color: var(--muted); font-size: 12px; }
a.notif { display: flex; color: inherit; }
.new-activity { position: fixed; z-index: 900; left: 50%; top: calc(var(--topbar-h) + 12px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 99px; background: var(--mint); color: #1d2826; font-weight: 800; font-size: 13px; box-shadow: var(--shadow-lg); animation: pop-in .3s var(--ease); }
@keyframes pop-in { from { transform: translate(-50%, -10px); opacity: 0; } }

/* Competitions: official IFSC events */
.comp-card.official { border-color: color-mix(in srgb, #2f6fdb 40%, var(--line)); }
.official-chip { background: color-mix(in srgb, #2f6fdb 18%, transparent) !important; color: #4d8bf0 !important; display: inline-flex; align-items: center; gap: 4px; }
.live-chip { background: color-mix(in srgb, var(--danger) 16%, transparent) !important; color: var(--danger) !important; }
.example-chip { opacity: .75; }
.comp-side a.btn { gap: 6px; }
.comp-side { display: grid; gap: 6px; justify-items: end; }

@media (max-width: 640px) {
  .privacy-opts { grid-template-columns: 1fr; }
  .here-chip { max-width: 100%; }
  .topo-tools .spacer { display: none; }
  .topo-stage canvas { max-height: 55vh; }
}
body.theme-dark .region-chip.active span { background: rgba(0, 0, 0, .14); color: #17201e; }
.comp-main p.small .icon { display: inline-block; vertical-align: -2px; }
.av-frame { flex: none !important; }
.spot-photos .mp-add { width: 92px; height: 92px; display: grid; place-content: center; justify-items: center; gap: 4px; text-align: center; }
p.small > .icon:first-child, p.muted > .icon:first-child { display: inline-block; vertical-align: -2px; }
@media (max-width: 900px) {
  .topbar-right { gap: 0; min-width: 0; }
  .map-top .here-chip { display: none !important; }
}
@media (max-width: 420px) {
  .topbar { padding: 0 8px 0 12px; gap: 4px; }
  .mobile-brand { font-size: 19px; gap: 6px; padding: 0 2px; }
  .topbar-right .icon-btn { width: 36px; height: 36px; }
}
.feed-col { grid-template-columns: minmax(0, 1fr); }

/* ------------------------------------------------------- Guest (signed out) */
body.guest [data-action="messages"], body.guest [data-action="notifications"], body.guest [data-action="cart"], body.guest .side-streak { display: none; }
.guest-auth { display: flex; gap: 6px; align-items: center; }
.guest-auth .btn { white-space: nowrap; }
.auth-top-actions { display: flex; gap: 6px; align-items: center; }
.join-card { display: grid; justify-items: center; gap: 10px; text-align: center; max-width: 460px; margin: 40px auto; }
.join-card-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.join-prompt-body { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 8px 4px 4px; }
.join-prompt-body .modal-actions.stack { display: grid; justify-content: stretch; gap: 8px; width: 100%; margin-top: 8px; }
