@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&family=Nunito+Sans:ital,wght@0,300;0,400;0,500;0,600;1,400&display=swap');

/* ═══════════════════════════════════════════════════
   DESIGN TOKENS — mojeszczyty.pl Brand System v1.0
═══════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Primary — Zieleń Górska */
  --p900: #0D2E1A; --p800: #1A4728; --p700: #1F5A32;
  --p600: #256B3B; --p500: #2D8049; --p400: #3A9A5A;
  --p300: #6CB98A; --p200: #A8D9BB; --p100: #D4EDE0; --p50: #EDF7F2;

  /* Accent — Zieleń Checkmark */
  --a600: #2E8B1F; --a500: #3DAA28; --a400: #52C23A;
  --a300: #7DD466; --a200: #B2E8A0; --a100: #D8F5CE; --a50: #F0FAE9;

  /* Neutral — Forest Stone */
  --n900: #141C18; --n800: #1E2922; --n700: #2E3D35;
  --n600: #4A5E53; --n500: #6B7D72; --n400: #8E9E96;
  --n300: #B5C2BC; --n200: #D8E2DD; --n100: #EBF0ED; --n50: #F5F7F6;

  /* Semantic tokens */
  --color-primary:        var(--p600);
  --color-primary-dark:   var(--p700);
  --color-primary-light:  var(--p50);
  --color-accent:         var(--a500);
  --color-accent-dark:    var(--a600);
  --color-accent-light:   var(--a50);
  --color-bg:             #F4F8F5;
  --color-surface:        #FFFFFF;
  --color-border:         #DDE7E2;
  --color-border-strong:  var(--n300);
  --color-text-primary:   var(--n900);
  --color-text-secondary: var(--n600);
  --color-text-muted:     var(--n400);
  --color-dark:           var(--p800);
  --color-dark-muted:     var(--p200);
  --color-danger:         #DC2626;
  --color-danger-light:   #FEF2F2;

  /* Typography */
  --font-heading: 'Nunito', sans-serif;
  --font-body:    'Nunito Sans', sans-serif;

  /* Radii */
  --r-xs:   4px;
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   20px;
  --r-2xl:  24px;
  --r-full: 999px;

  /* Shadows */
  --shadow-sm:   0 1px 4px rgba(26,71,40,.06);
  --shadow-md:   0 4px 16px rgba(26,71,40,.08);
  --shadow-lg:   0 8px 32px rgba(26,71,40,.12);
  --shadow-card: 0 2px 8px rgba(26,71,40,.06);
  --shadow-hover:0 6px 24px rgba(26,71,40,.10);
}

/* ── BASE ── */
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text-primary);
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-dark); }
input, button, select, textarea { font-family: var(--font-body); }

/* ── LAYOUT ── */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }
.container { max-width: 1000px; margin: 0 auto; padding: 0 1.25rem; }
.main-content { flex: 1; padding: 2rem 0 4rem; }

/* ══════════════════════════════════════
   TOPNAV
══════════════════════════════════════ */
.topnav {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
}
.topnav-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 60px;
}
.topnav-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--p700);
  text-decoration: none;
  flex-shrink: 0;
}
.topnav-logo span { color: var(--a500); }
.topnav-logo svg { flex-shrink: 0; }

.topnav-links {
  display: flex;
  gap: 2px;
  margin-left: 1rem;
}
.topnav-link {
  padding: 6px 14px;
  font-family: var(--font-heading);
  font-size: .82rem;
  font-weight: 600;
  color: var(--color-text-muted);
  border-radius: var(--r-full);
  transition: all .15s;
  cursor: pointer;
  border: none;
  background: none;
}
.topnav-link:hover { color: var(--p600); background: var(--p50); }
.topnav-link.active { color: var(--p700); background: var(--p50); }

.topnav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--color-border);
  border-radius: var(--r-full);
  background: var(--color-surface);
  cursor: default;
}
.user-chip-name {
  font-family: var(--font-heading);
  font-size: .8rem;
  font-weight: 700;
  color: var(--color-text-primary);
}
.topnav-logout {
  font-size: .75rem;
  color: var(--color-text-muted);
  cursor: pointer;
  border: none;
  background: none;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  transition: all .15s;
  font-family: var(--font-body);
}
.topnav-logout:hover { color: var(--color-danger); background: var(--color-danger-light); }

/* ── AVATAR ── */
.avatar {
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  flex-shrink: 0;
  text-transform: uppercase;
}
.avatar-sm  { width: 30px; height: 30px; font-size: .7rem; }
.avatar-md  { width: 40px; height: 40px; font-size: .85rem; }
.avatar-lg  { width: 56px; height: 56px; font-size: 1.1rem; }
.avatar-xl  { width: 72px; height: 72px; font-size: 1.4rem; }
.av-0 { background: var(--p100); color: var(--p800); border: 2px solid var(--p200); }
.av-1 { background: #DBEAFE; color: #1E40AF; border: 2px solid #BFDBFE; }
.av-2 { background: #FEE2E2; color: #991B1B; border: 2px solid #FECACA; }
.av-3 { background: #FEF3C7; color: #92400E; border: 2px solid #FDE68A; }
.av-4 { background: #FCE7F3; color: #9D174D; border: 2px solid #FBCFE8; }
.av-5 { background: #D1FAE5; color: #065F46; border: 2px solid #A7F3D0; }
.av-6 { background: var(--a100); color: var(--a600); border: 2px solid var(--a200); }
.av-7 { background: #EDE9FE; color: #4C1D95; border: 2px solid #DDD6FE; }

/* ══════════════════════════════════════
   AUTH
══════════════════════════════════════ */
#view-auth { display: none; }
.auth-page {
  min-height: 100vh;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.auth-container { width: 100%; max-width: 420px; }

.auth-brand {
  text-align: center;
  margin-bottom: 2.5rem;
}
.auth-brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: .75rem;
}
.auth-brand h1 {
  font-family: var(--font-heading);
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--p800);
}
.auth-brand h1 span { color: var(--a500); }
.auth-brand p {
  font-size: .83rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: .09em;
  font-weight: 600;
}

.auth-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-2xl);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.auth-tabs {
  display: flex;
  background: var(--n50);
  border-radius: var(--r-lg);
  padding: 4px;
  gap: 4px;
  margin-bottom: 1.75rem;
}
.auth-tab {
  flex: 1;
  padding: 9px;
  font-family: var(--font-heading);
  font-size: .83rem;
  font-weight: 700;
  border: none;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all .15s;
}
.auth-tab.active {
  background: var(--color-surface);
  color: var(--p700);
  box-shadow: var(--shadow-sm);
}

/* OAuth */
.oauth-btns { display: flex; flex-direction: column; gap: 8px; margin-bottom: 1.25rem; }
.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  background: var(--color-surface);
  font-family: var(--font-heading);
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--color-text-primary);
  transition: all .15s;
  width: 100%;
}
.oauth-btn:hover { background: var(--n50); border-color: var(--n300); box-shadow: var(--shadow-sm); }
.oauth-btn.github { background: #24292E; color: #fff; border-color: #24292E; }
.oauth-btn.github:hover { background: #3a3f45; }

.auth-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 1rem 0;
  color: var(--color-text-muted);
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--color-border);
}

/* Form fields */
.field { margin-bottom: 1rem; }
.field-label {
  display: block;
  font-family: var(--font-heading);
  font-size: .73rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .4rem;
}
.field-input {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: .88rem;
  color: var(--color-text-primary);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--r-lg);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field-input:focus {
  border-color: var(--p400);
  box-shadow: 0 0 0 3px rgba(37,107,59,.1);
}
.field-input::placeholder { color: var(--n300); }

.auth-error {
  font-size: .78rem;
  color: var(--color-danger);
  text-align: center;
  min-height: 1.2rem;
  margin-top: .5rem;
  font-weight: 600;
}
.auth-error.success { color: var(--a600); }

/* ══════════════════════════════════════
   BUTTONS
══════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--font-heading);
  font-weight: 700;
  border: none;
  cursor: pointer;
  border-radius: var(--r-full);
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

/* Sizes */
.btn-xl  { padding: 14px 32px; font-size: 1rem; }
.btn-lg  { padding: 11px 26px; font-size: .9rem; }
.btn-md  { padding: 8px 20px;  font-size: .83rem; }
.btn-sm  { padding: 6px 14px;  font-size: .77rem; }
.btn-xs  { padding: 4px 10px;  font-size: .7rem; }

/* Variants */
.btn-primary { background: var(--p600); color: #fff; }
.btn-primary:hover { background: var(--p700); box-shadow: 0 4px 12px rgba(37,107,59,.3); }

.btn-accent { background: var(--a500); color: #fff; }
.btn-accent:hover { background: var(--a600); box-shadow: 0 4px 12px rgba(61,170,40,.3); }

.btn-secondary { background: var(--p50); color: var(--p700); border: 1.5px solid var(--p200); }
.btn-secondary:hover { background: var(--p100); border-color: var(--p300); }

.btn-ghost { background: transparent; color: var(--p600); border: 1.5px solid var(--p300); }
.btn-ghost:hover { background: var(--p50); }

.btn-dark { background: var(--p800); color: #fff; }
.btn-dark:hover { background: var(--p900); }

.btn-danger { background: var(--color-danger); color: #fff; }
.btn-danger:hover { background: #B91C1C; }

.btn-outline { background: transparent; color: var(--color-text-secondary); border: 1.5px solid var(--color-border); }
.btn-outline:hover { border-color: var(--n300); background: var(--n50); }

.btn-full { width: 100%; }

/* ══════════════════════════════════════
   BADGES
══════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-heading);
  font-weight: 700;
  border-radius: var(--r-full);
  white-space: nowrap;
}
.badge-lg { padding: 5px 13px; font-size: .8rem; }
.badge-md { padding: 3px 10px; font-size: .73rem; }
.badge-sm { padding: 2px 8px;  font-size: .66rem; }

.badge-conquered { background: var(--a100); color: var(--a600); border: 1px solid var(--a200); }
.badge-todo      { background: var(--n100); color: var(--n600); border: 1px solid var(--n200); }
.badge-planned   { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.badge-region    { background: var(--p50); color: var(--p700); border: 1px solid var(--p200); }

/* ══════════════════════════════════════
   HERO / PROGRESS WIDGET
══════════════════════════════════════ */
.hero-widget {
  background: var(--p800);
  border-radius: var(--r-2xl);
  padding: 2.5rem 2.5rem 2rem;
  margin-bottom: 1.75rem;
  position: relative;
  overflow: hidden;
}
.hero-widget::before {
  content: '';
  position: absolute;
  right: -60px; bottom: -60px;
  width: 280px; height: 280px;
  background: var(--p700);
  border-radius: 50%;
  opacity: .5;
}
.hero-widget::after {
  content: '';
  position: absolute;
  right: 80px; bottom: -80px;
  width: 200px; height: 200px;
  background: var(--p600);
  border-radius: 50%;
  opacity: .3;
}
.hero-content { position: relative; z-index: 1; }
.hero-tag {
  font-family: var(--font-heading);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--a300);
  margin-bottom: .5rem;
}
.hero-title {
  font-family: var(--font-heading);
  font-size: 1.7rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-bottom: .4rem;
}
.hero-sub {
  font-size: .88rem;
  color: var(--p200);
  margin-bottom: 1.75rem;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-mountain-bg {
  position: absolute;
  right: 2rem; top: 50%;
  transform: translateY(-50%);
  z-index: 0;
  opacity: .2;
}

.progress-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.prog-stat {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-xl);
  padding: 1.1rem 1.25rem;
  text-align: center;
}
.prog-stat-val {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--p700);
  line-height: 1;
}
.prog-stat-label {
  font-size: .68rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-top: 4px;
}

.progress-bar-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-xl);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
}
.progress-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: .9rem;
}
.progress-bar-title {
  font-family: var(--font-heading);
  font-size: .78rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: .09em;
}
.progress-bar-count {
  font-family: var(--font-heading);
  font-size: .88rem;
  font-weight: 800;
  color: var(--p700);
}
.progress-track {
  height: 8px;
  background: var(--n100);
  border-radius: var(--r-full);
  overflow: hidden;
  margin-bottom: .5rem;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--p600), var(--a500));
  border-radius: var(--r-full);
  transition: width .6s cubic-bezier(.4,0,.2,1);
}
.progress-pct {
  font-size: .75rem;
  color: var(--color-text-muted);
  font-weight: 600;
}
.progress-pct strong { color: var(--p600); font-family: var(--font-heading); }

/* Mini progress bars (by region) */
.mini-prog-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: .45rem 0;
  border-bottom: 1px solid var(--n100);
}
.mini-prog-row:last-child { border-bottom: none; }
.mini-prog-label { font-size: .78rem; font-weight: 600; color: var(--color-text-secondary); width: 140px; flex-shrink: 0; }
.mini-prog-track { flex: 1; height: 5px; background: var(--n100); border-radius: var(--r-full); overflow: hidden; }
.mini-prog-fill  { height: 100%; background: var(--a500); border-radius: var(--r-full); }
.mini-prog-count { font-family: var(--font-heading); font-size: .75rem; font-weight: 800; color: var(--p700); min-width: 32px; text-align: right; }

/* ══════════════════════════════════════
   FILTER BAR
══════════════════════════════════════ */
.filter-bar {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.filter-btn {
  padding: 6px 16px;
  font-family: var(--font-heading);
  font-size: .78rem;
  font-weight: 700;
  border: 1.5px solid var(--color-border);
  border-radius: var(--r-full);
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all .15s;
}
.filter-btn:hover { border-color: var(--p300); color: var(--p600); }
.filter-btn.active { background: var(--p600); border-color: var(--p600); color: #fff; }

.search-wrap { margin-left: auto; position: relative; }
.search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--n400);
  pointer-events: none;
}
.search-input {
  padding: 7px 14px 7px 36px;
  font-family: var(--font-body);
  font-size: .8rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--r-full);
  background: var(--color-surface);
  color: var(--color-text-primary);
  outline: none;
  width: 200px;
  transition: border-color .15s, box-shadow .15s;
}
.search-input:focus { border-color: var(--p400); box-shadow: 0 0 0 3px rgba(37,107,59,.08); }
.search-input::placeholder { color: var(--n300); }

/* ══════════════════════════════════════
   PEAK CARDS GRID
══════════════════════════════════════ */
.peaks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 14px;
}

.peak-card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--r-xl);
  overflow: hidden;
  transition: box-shadow .2s, transform .18s, border-color .2s;
  cursor: default;
}
.peak-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
  border-color: var(--p200);
}
.peak-card.is-conquered {
  border-color: var(--a300);
  background: linear-gradient(145deg, #fff 55%, var(--a50));
}

.peak-card-header {
  padding: 1.1rem 1.15rem .85rem;
  display: flex;
  align-items: flex-start;
  gap: 11px;
}
.peak-card-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: var(--p50);
}
.peak-card-icon.done { background: var(--a100); }

.peak-card-info { flex: 1; min-width: 0; }
.peak-card-name {
  font-family: var(--font-heading);
  font-size: .98rem;
  font-weight: 800;
  color: var(--color-text-primary);
  line-height: 1.25;
  margin-bottom: 2px;
}
.peak-card-region {
  font-size: .72rem;
  color: var(--color-text-muted);
  font-weight: 500;
  margin-bottom: 5px;
}

.peak-card-alt-wrap { text-align: right; flex-shrink: 0; }
.peak-card-alt {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--p700);
  line-height: 1;
}
.peak-card-alt-unit {
  font-size: .62rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* Gallery thumbnails */
.peak-gallery {
  display: flex;
  gap: 5px;
  padding: 0 1.15rem .75rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.peak-gallery::-webkit-scrollbar { display: none; }
.gallery-thumb {
  width: 58px; height: 44px;
  object-fit: cover;
  border-radius: var(--r-sm);
  flex-shrink: 0;
  cursor: pointer;
  transition: opacity .15s;
  border: 1.5px solid var(--color-border);
}
.gallery-thumb:hover { opacity: .88; }
.gallery-add-btn {
  width: 58px; height: 44px;
  border-radius: var(--r-sm);
  border: 1.5px dashed var(--n300);
  background: var(--n50);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: var(--n400);
  font-size: .75rem;
  transition: all .15s;
  font-family: var(--font-heading);
  font-weight: 700;
}
.gallery-add-btn:hover { border-color: var(--p400); color: var(--p600); background: var(--p50); }

/* Card footer */
.peak-card-footer {
  padding: .75rem 1.15rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--n100);
}
.peak-date-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .73rem;
  color: var(--color-text-muted);
  margin-left: auto;
  flex-shrink: 0;
}
.peak-date-input {
  font-size: .72rem;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--r-sm);
  padding: 3px 8px;
  font-family: var(--font-body);
  background: var(--n50);
  outline: none;
  cursor: pointer;
  transition: border-color .15s;
}
.peak-date-input:focus { border-color: var(--p400); }
.peak-photo-btn {
  display: flex; align-items: center; gap: 4px;
  font-family: var(--font-heading);
  font-size: .72rem;
  font-weight: 700;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--r-sm);
  padding: 4px 9px;
  background: var(--color-surface);
  cursor: pointer;
  transition: all .15s;
}
.peak-photo-btn:hover { border-color: var(--p300); color: var(--p600); }

/* ══════════════════════════════════════
   PEAK LIST (compact)
══════════════════════════════════════ */
.peaks-list { display: flex; flex-direction: column; gap: 6px; }
.peak-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: .85rem 1.1rem;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: all .15s;
}
.peak-list-item:hover { border-color: var(--p200); box-shadow: var(--shadow-sm); }
.peak-list-item.is-conquered { border-color: var(--a200); background: var(--a50); }

.check-circle {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--n300);
  background: var(--color-surface);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all .2s;
  cursor: pointer;
}
.check-circle.filled { background: var(--a500); border-color: var(--a500); }

.pli-info { flex: 1; min-width: 0; }
.pli-name { font-family: var(--font-heading); font-size: .88rem; font-weight: 800; color: var(--color-text-primary); }
.pli-region { font-size: .7rem; color: var(--color-text-muted); font-weight: 500; }
.pli-right { text-align: right; flex-shrink: 0; }
.pli-alt { font-family: var(--font-heading); font-size: .85rem; font-weight: 800; color: var(--p700); }
.pli-date { font-size: .68rem; color: var(--color-text-muted); margin-top: 1px; }

/* ══════════════════════════════════════
   SECTION TITLES
══════════════════════════════════════ */
.section-eyebrow {
  font-family: var(--font-heading);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--a500);
  margin-bottom: .3rem;
}
.section-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--color-text-primary);
  margin-bottom: 1.1rem;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}

/* ══════════════════════════════════════
   LEADERBOARD
══════════════════════════════════════ */
.lb-live-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: .72rem;
  font-weight: 700;
  color: #92400E;
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  border-radius: var(--r-full);
  padding: 4px 12px;
  margin-bottom: 1rem;
}
.lb-live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #F59E0B;
  animation: pulse-dot 1.5s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

.lb-table {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.lb-row {
  display: grid;
  grid-template-columns: 44px 1fr 72px 100px;
  gap: 8px;
  align-items: center;
  padding: .85rem 1.1rem;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--r-lg);
  transition: box-shadow .15s;
}
.lb-row:hover { box-shadow: var(--shadow-sm); }
.lb-row.is-me { border-color: var(--a300); background: var(--a50); }
.lb-rank {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
  text-align: center;
  color: var(--color-text-muted);
}
.lb-rank.rank-1 { font-size: 1.2rem; }
.lb-rank.rank-2 { font-size: 1.15rem; }
.lb-rank.rank-3 { font-size: 1.1rem; }
.lb-user { display: flex; align-items: center; gap: 9px; min-width: 0; }
.lb-username {
  font-family: var(--font-heading);
  font-size: .88rem;
  font-weight: 800;
  color: var(--color-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-you-tag {
  font-size: .64rem;
  font-weight: 700;
  background: var(--a100);
  color: var(--a600);
  padding: 1px 7px;
  border-radius: var(--r-full);
  flex-shrink: 0;
}
.lb-count {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
  color: var(--p700);
  text-align: center;
}
.lb-prog-cell { }
.lb-prog-pct {
  font-size: .7rem;
  color: var(--color-text-muted);
  font-weight: 600;
  margin-bottom: 3px;
}
.lb-prog-track { height: 4px; background: var(--n100); border-radius: var(--r-full); overflow: hidden; }
.lb-prog-fill  { height: 100%; background: var(--p500); border-radius: var(--r-full); }
.lb-row.is-me .lb-prog-fill { background: var(--a500); }

/* ══════════════════════════════════════
   PROFILE
══════════════════════════════════════ */
.profile-hero {
  background: var(--p800);
  border-radius: var(--r-2xl);
  padding: 2rem 2.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
  position: relative;
  overflow: hidden;
}
.profile-hero::after {
  content: '';
  position: absolute;
  right: -40px; bottom: -40px;
  width: 180px; height: 180px;
  background: var(--p700); border-radius: 50%; opacity: .5;
}
.profile-hero-content { position: relative; z-index: 1; }
.profile-name {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 2px;
}
.profile-since { font-size: .78rem; color: var(--p200); margin-bottom: 1rem; }
.profile-stats { display: flex; gap: 2rem; }
.pstat-val { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 800; color: #fff; }
.pstat-label { font-size: .65rem; font-weight: 700; color: var(--p300); text-transform: uppercase; letter-spacing: .08em; }

/* ══════════════════════════════════════
   MODAL / GALLERY
══════════════════════════════════════ */
.modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(14,20,16,.65);
  backdrop-filter: blur(3px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-backdrop.open { display: flex; }

.modal {
  background: var(--color-surface);
  border-radius: var(--r-2xl);
  padding: 1.75rem;
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modal-in .2s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.modal-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-text-primary);
}
.modal-subtitle { font-size: .78rem; color: var(--color-text-muted); margin-top: 2px; }
.modal-close {
  background: var(--n50);
  border: none;
  border-radius: 50%;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: all .15s;
  flex-shrink: 0;
}
.modal-close:hover { background: var(--n100); color: var(--color-text-primary); }

.modal-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 1rem;
}
.modal-photo-wrap {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1.5px solid var(--color-border);
}
.modal-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.modal-photo-del {
  position: absolute;
  top: 5px; right: 5px;
  width: 24px; height: 24px;
  background: rgba(14,20,16,.6);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .15s;
}
.modal-photo-del:hover { background: rgba(220,38,38,.85); }
.modal-empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--color-text-muted);
  font-size: .83rem;
}
.modal-upload-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px;
  background: var(--a50);
  border: 1.5px dashed var(--a300);
  border-radius: var(--r-lg);
  font-family: var(--font-heading);
  font-size: .83rem;
  font-weight: 700;
  color: var(--a600);
  cursor: pointer;
  transition: all .15s;
}
.modal-upload-label:hover { background: var(--a100); }
.modal-upload-label input[type=file] { display: none; }

/* ══════════════════════════════════════
   SAVING INDICATOR
══════════════════════════════════════ */
.saving-indicator {
  font-size: .72rem;
  color: var(--color-text-muted);
  text-align: right;
  min-height: 1.1rem;
  margin-bottom: .35rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}
.saving-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--a500); animation: pulse-dot 1s infinite; }

/* ══════════════════════════════════════
   TABS
══════════════════════════════════════ */
.tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 1.75rem;
  background: var(--n50);
  border-radius: var(--r-xl);
  padding: 5px;
  border: 1px solid var(--color-border);
}
.tab-btn {
  flex: 1;
  padding: 9px 16px;
  font-family: var(--font-heading);
  font-size: .82rem;
  font-weight: 700;
  border: none;
  border-radius: var(--r-lg);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all .15s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.tab-btn:hover { color: var(--p600); }
.tab-btn.active {
  background: var(--color-surface);
  color: var(--p700);
  box-shadow: var(--shadow-sm);
}

/* ══════════════════════════════════════
   EMPTY / LOADING STATES
══════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--color-text-muted);
}
.empty-state svg { margin-bottom: 1rem; opacity: .4; }
.empty-state h3 { font-family: var(--font-heading); font-size: 1rem; font-weight: 700; margin-bottom: .35rem; color: var(--color-text-secondary); }
.empty-state p { font-size: .83rem; }

.loading-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-muted);
  font-size: .85rem;
  font-weight: 600;
}

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 720px) {
  .topnav-links { display: none; }
  .hero-widget { padding: 1.75rem 1.5rem 1.5rem; }
  .hero-title { font-size: 1.35rem; }
  .progress-row { grid-template-columns: repeat(3,1fr); gap: .7rem; }
  .prog-stat-val { font-size: 1.35rem; }
  .peaks-grid { grid-template-columns: 1fr; }
  .lb-row { grid-template-columns: 36px 1fr 52px 80px; }
  .profile-hero { flex-direction: column; gap: 1rem; padding: 1.5rem; }
  .profile-stats { gap: 1.25rem; }
  .hero-mountain-bg { display: none; }
  .search-input { width: 160px; }
}
@media (max-width: 480px) {
  .progress-row { grid-template-columns: 1fr 1fr; }
  .progress-row .prog-stat:last-child { grid-column: 1/-1; }
  .tab-btn { font-size: .75rem; padding: 8px 10px; }
  .auth-card { padding: 1.5rem; }
}

/* ── SHARE BUTTON ── */
.btn-share {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-family: var(--font-heading);
  font-size: .75rem;
  font-weight: 700;
  border: 1.5px solid var(--a200);
  border-radius: var(--r-full);
  background: var(--a50);
  color: var(--a600);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.btn-share:hover {
  background: var(--a100);
  border-color: var(--a400);
  box-shadow: 0 2px 8px rgba(46,139,31,.2);
  transform: translateY(-1px);
}
.btn-share:disabled {
  opacity: .6;
  cursor: wait;
  transform: none;
}
