/* ═══════════════════════════════════════
   Kampetto — TripAdvisor-style Design
═══════════════════════════════════════ */

:root {
  --green:       #00aa6c;
  --green-dark:  #004f32;
  --green-light: #e0f5ec;
  --green-hover: #00875a;
  --gold:        #f5a623;
  --gold-light:  #fde68a;
  --silver:      #94a3b8;
  --bronze:      #b45309;
  --red:         #e21836;
  --blue:        #3b82f6;
  --black:       #1a1a1a;
  --text:        #333;
  --text-sec:    #717171;
  --text-light:  #999;
  --surface:     #ffffff;
  --surface-2:   #f7f7f7;
  --border:      #e0e0e0;
  --border-2:    #f0f0f0;
  --shadow:      0 2px 8px rgba(0,0,0,.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,.12);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.16);
  --r:           12px;
  --r-sm:        8px;
  --r-xs:        4px;
  --header-h:    64px;
  --nav-h:       60px;
  --t:           .25s cubic-bezier(.4,0,.2,1);
  --max-w:       1200px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { height: 100%; height: -webkit-fill-available; width: 100%; overflow: clip; }
body { height: 100%; min-height: -webkit-fill-available; width: 100%; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif; background: var(--surface); color: var(--text); font-size: 16px; line-height: 1.5; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

/* ── iOS notch spacer ── */
.status-bar-spacer { height: env(safe-area-inset-top, 0px); background: var(--surface); position: fixed; top: 0; left: 0; right: 0; z-index: 9999; }

/* ═══════════════════════════════════
   TOP HEADER (TripAdvisor-style)
═══════════════════════════════════ */
.top-header {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: 0; right: 0;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 1500;
  display: block; /* always visible */
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 24px;
}
.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex-shrink: 0;
}
.header-logo svg { width: 36px; height: 36px; }
.header-logo-text {
  font-size: 22px;
  font-weight: 900;
  color: var(--black);
  letter-spacing: -0.5px;
}
.header-nav {
  display: none; /* hidden on mobile, shown on ≥640px */
  gap: 4px;
  flex: 1;
  justify-content: center;
}
.header-nav-btn {
  background: none;
  border: none;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  border-radius: 24px;
  transition: background .2s, color .2s;
  font-family: inherit;
}
.header-nav-btn:hover { background: var(--surface-2); }
.header-nav-btn.active { background: var(--green-light); color: var(--green); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════
   LANGUAGE TOGGLE
═══════════════════════════════════ */
.lang-pill {
  display: flex;
  gap: 2px;
  background: var(--surface-2);
  border-radius: 20px;
  padding: 2px;
  border: 1px solid var(--border);
}
.lang-toggle-btn {
  border: none;
  background: transparent;
  color: var(--text-sec);
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, color .2s;
  letter-spacing: .3px;
  font-family: inherit;
}
.lang-toggle-btn.active {
  background: var(--green);
  color: white;
}

/* ═══════════════════════════════════
   USER PILL
═══════════════════════════════════ */
.user-pill-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  transition: background .15s, box-shadow .15s;
}
.user-pill-btn:hover { box-shadow: var(--shadow); }
.user-icon { width: 18px; height: 18px; flex-shrink: 0; }
.user-pill-btn.signed-in {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
.user-pill-btn.signed-in .user-icon { stroke: white; }

/* Mobile: compact user pill (icon only, no label) */
@media (max-width: 639px) {
  .user-pill-label { display: none; }
  .user-pill-btn {
    width: 36px; height: 36px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
  }
}

/* ═══════════════════════════════════
   APP / VIEWS
═══════════════════════════════════ */
#app {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + var(--header-h));
  left: 0; right: 0;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  overflow: hidden;
}
.view {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
  background: var(--surface);
}
.view.active { opacity: 1; pointer-events: all; }
#view-map { overflow: hidden; }

/* ═══════════════════════════════════
   BOTTOM NAV (mobile only)
═══════════════════════════════════ */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 1000;
  box-shadow: 0 -1px 8px rgba(0,0,0,.06);
}
.nav-btn {
  flex: 1; border: none; background: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; cursor: pointer; color: var(--text-sec);
  padding-bottom: 4px;
  transition: color .2s;
  position: relative;
}
.nav-btn.active { color: var(--green); }
.nav-btn.active::after {
  content: ''; position: absolute; top: 0; left: 20%; right: 20%; height: 2.5px;
  background: var(--green); border-radius: 0 0 4px 4px;
}
.nav-icon { width: 22px; height: 22px; flex-shrink: 0; }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: .2px; }

/* ═══════════════════════════════════
   HERO — TripAdvisor "Where to?"
═══════════════════════════════════ */
.hero {
  position: relative;
  background: var(--surface);
  padding: 48px 20px 24px;
  text-align: center;
}
.hero-bg {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--green-light) 0%, var(--surface) 100%);
  pointer-events: none;
}
.hero-content {
  position: relative; z-index: 1;
  max-width: 680px;
  margin: 0 auto;
}
.hero-title {
  font-size: 36px;
  font-weight: 900;
  color: var(--black);
  letter-spacing: -1px;
  line-height: 1.15;
  margin-bottom: 20px;
  font-style: italic;
}

/* Search bar */
.hero-search-wrap {
  max-width: 580px;
  margin: 0 auto 20px;
}
.hero-search-bar {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 4px 4px 4px 16px;
  box-shadow: var(--shadow-md);
  transition: box-shadow .2s;
}
.hero-search-bar:focus-within {
  box-shadow: var(--shadow-lg);
  border-color: var(--green);
}
.search-icon {
  width: 20px; height: 20px;
  color: var(--text-sec);
  flex-shrink: 0;
  margin-right: 8px;
}
.hero-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: transparent;
  padding: 10px 4px;
}
.hero-search-input::placeholder { color: var(--text-light); }
.hero-search-btn {
  padding: 10px 20px;
  background: var(--green);
  color: white;
  border: none;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background .15s;
  flex-shrink: 0;
}
.hero-search-btn:hover { background: var(--green-hover); }
.hero-search-btn:active { background: var(--green-dark); }
.hero-search-btn.active {
  background: var(--green-dark);
}

/* Hero tabs */
.hero-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.hero-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-sec);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: color .2s, border-color .2s;
}
.hero-tab svg { width: 18px; height: 18px; flex-shrink: 0; }
.hero-tab:hover { color: var(--text); }
.hero-tab.active { color: var(--black); border-bottom-color: var(--black); }

/* ═══════════════════════════════════
   HOME CONTENT
═══════════════════════════════════ */
.home-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 16px;
}

/* Loading spinner */
.fields-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 0;
  color: var(--text-sec);
  font-size: 14px;
}
.fields-loading-dots {
  display: flex; gap: 6px;
}
.fields-loading-dots span {
  width: 8px; height: 8px;
  background: var(--green);
  border-radius: 50%;
  animation: dot-bounce .9s infinite ease-in-out;
}
.fields-loading-dots span:nth-child(2) { animation-delay: .15s; }
.fields-loading-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes dot-bounce {
  0%, 80%, 100% { transform: scale(.7); opacity: .5; }
  40%            { transform: scale(1);  opacity: 1; }
}

/* Stats bar */
.stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 16px 0 20px;
}
.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.stat-num {
  font-size: 24px;
  font-weight: 900;
  color: var(--black);
  line-height: 1;
}
.stat-label {
  font-size: 12px;
  color: var(--text-sec);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 2px;
}
.stat-sep {
  width: 1px;
  height: 28px;
  background: var(--border);
}

/* CTA Banner */
.cta-banner {
  background: var(--green);
  border-radius: var(--r);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.cta-banner:hover { background: var(--green-hover); }
.cta-banner:active { transform: scale(.99); }
.cta-left { display: flex; align-items: center; gap: 12px; }
.cta-icon { font-size: 24px; flex-shrink: 0; }
.cta-title { font-size: 15px; font-weight: 700; color: white; }
.cta-sub { font-size: 13px; color: rgba(255,255,255,.8); }
.cta-arrow { font-size: 20px; color: rgba(255,255,255,.8); flex-shrink: 0; }

/* Section headers */
.section-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 16px;
  padding: 0 4px;
}
.section-title { font-size: 22px; font-weight: 800; color: var(--black); }
.section-sub { font-size: 13px; color: var(--text-sec); }

/* ═══════════════════════════════════
   FIELDS GRID (card-based like TA)
═══════════════════════════════════ */
.fields-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.field-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border-radius: var(--r);
  padding: 14px 16px;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: box-shadow .2s, transform .15s;
}
.field-row:hover { box-shadow: var(--shadow-md); }
.field-row:active { transform: scale(.99); }
.field-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.field-row-info { flex: 1; min-width: 0; }
.field-row-name { font-size: 15px; font-weight: 700; color: var(--black); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field-row-meta { font-size: 13px; color: var(--text-sec); margin-top: 1px; }
.field-row-rating { font-size: 14px; font-weight: 800; flex-shrink: 0; }
.field-row-dist { font-size: 12px; font-weight: 600; color: var(--green); margin-right: 6px; white-space: nowrap; }

/* ═══════════════════════════════════
   RANKING LIST
═══════════════════════════════════ */
.ranking-list { display: flex; flex-direction: column; gap: 10px; }
.rank-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border-radius: var(--r);
  padding: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: box-shadow .2s, transform .15s;
  border: 1px solid var(--border-2);
  position: relative;
  overflow: hidden;
}
.rank-card:hover { box-shadow: var(--shadow-md); }
.rank-card:active { transform: scale(.99); }
.rank-card.rank-1::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--gold); }
.rank-card.rank-2::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--silver); }
.rank-card.rank-3::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #cd7f32; }
.rank-pos { font-size: 20px; font-weight: 900; color: var(--text-sec); min-width: 28px; text-align: center; flex-shrink: 0; }
.rank-pos.pos-1 { color: var(--gold); font-size: 22px; }
.rank-pos.pos-2 { color: var(--silver); }
.rank-pos.pos-3 { color: #cd7f32; }
.rank-info { flex: 1; min-width: 0; }
.rank-name { font-size: 16px; font-weight: 700; color: var(--black); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-meta { font-size: 13px; color: var(--text-sec); margin-top: 2px; }
.rank-score { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; }
.rank-avg { font-size: 22px; font-weight: 900; color: var(--black); line-height: 1; }
.rank-stars { display: flex; gap: 1px; margin-top: 2px; }
.rank-stars .star { font-size: 11px; }
.rank-count { font-size: 12px; color: var(--text-sec); margin-top: 2px; }
.rank-no-review { font-size: 12px; color: var(--text-sec); font-style: italic; }

/* ═══════════════════════════════════
   MAP VIEW
═══════════════════════════════════ */
.map-header {
  position: absolute; top: 0; left: 0; right: 0;
  height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px;
  z-index: 600;
}
.map-back-btn {
  background: none; border: none; color: var(--green);
  font-size: 14px; cursor: pointer; padding: 8px 4px; font-weight: 700;
  font-family: inherit;
}
.map-header-title { font-size: 16px; font-weight: 700; color: var(--black); }
.btn-icon-sm {
  width: 36px; height: 36px;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 50%; color: var(--green); font-size: 16px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.btn-icon-sm svg { width: 18px; height: 18px; }

#map-container { position: absolute; inset: 0; padding-top: 52px; }
#map { width: 100%; height: 100%; }
body.map-add-mode #map { cursor: crosshair; }

#add-mode-banner {
  position: absolute; top: 60px; left: 12px; right: 12px;
  background: var(--green); color: white;
  padding: 10px 16px; border-radius: var(--r);
  display: flex; align-items: center; justify-content: space-between;
  z-index: 700; box-shadow: var(--shadow-md);
  transform: translateY(-80px); opacity: 0;
  transition: transform var(--t), opacity var(--t);
  pointer-events: none;
}
#add-mode-banner.visible { transform: translateY(0); opacity: 1; pointer-events: all; }
#add-mode-banner span { font-size: 13px; font-weight: 600; }
#btn-cancel-add-mode { background: rgba(255,255,255,.25); border: none; color: white; padding: 5px 12px; border-radius: 20px; font-size: 12px; cursor: pointer; font-family: inherit; }

#btn-fab-add {
  position: absolute; top: 68px; right: 16px;
  width: 56px; height: 56px;
  background: var(--green); border: none; border-radius: 50%;
  color: white; font-size: 28px; font-weight: 300;
  box-shadow: var(--shadow-lg); cursor: pointer; z-index: 600;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s, background .15s;
}
#btn-fab-add:hover { background: var(--green-hover); }
#btn-fab-add:active { transform: scale(.92); }

#map-legend {
  position: absolute; bottom: 90px; left: 10px;
  background: rgba(255,255,255,.95); backdrop-filter: blur(8px);
  border-radius: var(--r-sm); padding: 10px 12px;
  font-size: 12px; box-shadow: var(--shadow);
  z-index: 500; pointer-events: none;
  border: 1px solid var(--border);
}
.legend-row { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.legend-row:last-child { margin-bottom: 0; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ═══════════════════════════════════
   PAGE SCROLL (Info / Dona / Rank)
═══════════════════════════════════ */
.page-scroll { height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }

.page-hero {
  padding: 40px 20px 32px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center;
  background: linear-gradient(180deg, var(--green) 0%, var(--green-dark) 100%);
}
.page-hero-gold { background: linear-gradient(180deg, #f59e0b 0%, #b45309 100%); }
.page-hero-logo svg { width: 56px; height: 56px; }
.page-hero-icon { font-size: 48px; }
.page-hero-title { font-size: 28px; font-weight: 900; color: white; letter-spacing: -0.5px; }
.page-hero-sub { font-size: 14px; color: rgba(255,255,255,.8); }

.page-body {
  max-width: 680px;
  margin: 0 auto;
  padding: 20px 16px;
}

.info-card {
  background: var(--surface);
  border-radius: var(--r);
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-2);
}
.info-card-icon { font-size: 28px; margin-bottom: 8px; }
.info-card-title { font-size: 18px; font-weight: 800; color: var(--black); margin-bottom: 10px; }
.info-card-text { font-size: 14px; color: var(--text-sec); line-height: 1.7; margin-bottom: 8px; }
.info-card-text:last-child { margin-bottom: 0; }

.info-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.info-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--text-sec); }
.info-step {
  background: var(--green); color: white;
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; flex-shrink: 0; margin-top: 1px;
}

.credits-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.credit-badge {
  background: var(--green-light); color: var(--green);
  padding: 4px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
  text-decoration: none;
}
a.credit-badge:hover { text-decoration: underline; }

/* Author */
.author-row {
  display: flex; align-items: center; gap: 12px;
  margin: 12px 0 16px; padding: 14px;
  background: var(--surface-2); border-radius: var(--r-sm);
}
.author-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--green); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; flex-shrink: 0;
}
.author-name { font-size: 15px; font-weight: 700; color: var(--black); }
.author-email { font-size: 12px; color: var(--green); text-decoration: none; }

/* Donate */
.donate-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.donate-btn {
  display: flex; align-items: center; gap: 14px;
  padding: 18px;
  border: none; border-radius: var(--r);
  cursor: pointer; width: 100%;
  text-align: left;
  transition: transform .15s, box-shadow .2s;
  box-shadow: var(--shadow);
}
.donate-btn:hover { box-shadow: var(--shadow-md); }
.donate-btn:active { transform: scale(.98); }
.donate-btn-coffee { background: #1a1a1a; color: white; }
.donate-btn-paypal { background: #003087; color: white; }
.donate-btn-share  { background: var(--green); color: white; }
.donate-btn-icon { font-size: 26px; flex-shrink: 0; }
.donate-btn-text { flex: 1; }
.donate-btn-label { font-size: 15px; font-weight: 700; }
.donate-btn-sub { font-size: 12px; opacity: .7; margin-top: 1px; }
.donate-btn-arrow { font-size: 18px; opacity: .6; }

/* ═══════════════════════════════════
   OVERLAY
═══════════════════════════════════ */
#overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1190; opacity: 0; pointer-events: none;
  transition: opacity var(--t);
}
#overlay.visible { opacity: 1; pointer-events: all; }

/* ═══════════════════════════════════
   PANEL: FIELD DETAIL
═══════════════════════════════════ */
#panel-field {
  position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  max-height: 82vh;
  background: var(--surface);
  border-radius: var(--r) var(--r) 0 0;
  box-shadow: var(--shadow-lg);
  z-index: 1200;
  overflow-y: auto; overscroll-behavior: contain;
  transform: translateY(calc(100% + var(--nav-h) + env(safe-area-inset-bottom, 0px)));
  transition: transform var(--t);
  -webkit-overflow-scrolling: touch;
}
#panel-field.open { transform: translateY(0); }

.panel-handle-wrap { padding: 10px 0 4px; display: flex; justify-content: center; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.panel-handle { width: 36px; height: 4px; background: var(--border); border-radius: 4px; }
.panel-top-actions { position: absolute; top: 8px; right: 12px; }
.btn-close { width: 32px; height: 32px; border: none; background: var(--surface-2); border-radius: 50%; font-size: 16px; color: var(--text-sec); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.btn-close:hover { background: var(--border); }

.panel-body { padding: 0 18px 28px; }
.panel-field-name { font-size: 22px; font-weight: 800; line-height: 1.2; margin-bottom: 4px; color: var(--black); }
.panel-field-team { font-size: 14px; font-weight: 600; color: var(--green); margin-bottom: 3px; }
.panel-field-meta { font-size: 13px; color: var(--text-sec); margin-bottom: 16px; }

.fd-global-rating { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.fd-big-score { font-size: 40px; font-weight: 900; color: var(--green); line-height: 1; }
.fd-stars-wrap { display: flex; flex-direction: column; gap: 2px; }
.fd-review-count { font-size: 12px; color: var(--text-sec); }
.no-reviews-msg { font-size: 14px; color: var(--text-sec); font-style: italic; }

.section-label { font-size: 12px; font-weight: 700; color: var(--text-sec); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 8px; }

.cat-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border-2); }
.cat-row:last-child { border-bottom: none; }
.cat-label { font-size: 14px; }
.cat-right { display: flex; align-items: center; gap: 6px; }
.cat-val { font-size: 12px; color: var(--text-sec); font-weight: 600; }
.cat-na { font-size: 14px; color: var(--border); }

.review-card { background: var(--surface-2); border-radius: var(--r); padding: 14px; margin-bottom: 10px; border: 1px solid var(--border-2); }
.review-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.review-author { font-size: 14px; font-weight: 700; color: var(--black); }
.review-date { font-size: 12px; color: var(--text-sec); }
.review-cats { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.rev-cat { display: flex; align-items: center; gap: 3px; background: white; padding: 3px 8px; border-radius: 20px; font-size: 11px; border: 1px solid var(--border); }
.rev-cat-label { color: var(--text-sec); }
.review-comment { font-size: 13px; font-style: italic; color: var(--text-sec); border-left: 3px solid var(--green-light); padding-left: 10px; margin-top: 8px; }
.empty-state { font-size: 14px; color: var(--text-sec); text-align: center; padding: 24px 0; font-style: italic; }

.panel-cta { margin-top: 20px; display: flex; flex-direction: column; gap: 8px; padding-top: 16px; border-top: 1px solid var(--border-2); }

/* ═══════════════════════════════════
   MODALS
═══════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  z-index: 1300;
  display: flex; align-items: flex-end;
  pointer-events: none; opacity: 0;
  transition: opacity var(--t);
}
.modal-overlay.open { pointer-events: all; opacity: 1; }
.modal-handle-wrap { padding: 10px 0 2px; display: flex; justify-content: center; }
.modal-card {
  background: var(--surface); width: 100%;
  border-radius: var(--r) var(--r) 0 0;
  max-height: 92vh; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 4px 20px 40px;
  box-shadow: var(--shadow-lg);
  transform: translateY(60px);
  transition: transform var(--t);
}
.modal-overlay.open .modal-card { transform: translateY(0); }
.modal-title { font-size: 20px; font-weight: 800; color: var(--black); margin-bottom: 4px; padding-top: 4px; }
.modal-subtitle { font-size: 14px; color: var(--text-sec); margin-bottom: 18px; }

/* ═══════════════════════════════════
   FORMS
═══════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 700; color: var(--text-sec); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; }
.form-input, .form-textarea {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--border); border-radius: var(--r-sm);
  font-size: 15px; color: var(--text); background: var(--surface);
  outline: none; transition: border-color .2s; font-family: inherit;
}
.form-input:focus, .form-textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-light); }
.form-textarea { resize: none; height: 88px; }
.char-counter { font-size: 12px; color: var(--text-sec); text-align: right; margin-top: 4px; }
.coords-display { font-size: 13px; color: var(--green); background: var(--green-light); padding: 8px 12px; border-radius: var(--r-xs); margin-bottom: 14px; font-weight: 600; }

.rating-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--border-2); }
.rating-row:last-child { border-bottom: none; }
.rating-label { font-size: 15px; font-weight: 500; }

.stars-input { display: flex; gap: 4px; }
.star-btn { font-size: 30px; cursor: pointer; color: #e0e0e0; transition: color .1s, transform .1s; user-select: none; -webkit-user-select: none; line-height: 1; }
.star-btn.active { color: var(--gold); }
.star-btn:active { transform: scale(1.25); }
.stars-input.disabled .star-btn { color: #e0e0e0 !important; cursor: default; pointer-events: none; opacity: 0.4; }

.absent-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.absent-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--green); cursor: pointer; }

.cat-absent-badge { font-size: 11px; font-weight: 600; color: var(--text-2); background: var(--border-2); border-radius: 4px; padding: 2px 6px; }

.stars-display { display: inline-flex; gap: 1px; line-height: 1; }
.stars-display.stars-xl .star { font-size: 22px; }
.stars-display.stars-lg .star { font-size: 18px; }
.stars-display.stars-md .star { font-size: 15px; }
.stars-display.stars-sm .star { font-size: 13px; }
.stars-display.stars-xs .star { font-size: 11px; }
.star.filled { color: var(--gold); }
.star.empty  { color: #d1d5db; }

.form-actions { display: flex; gap: 10px; margin-top: 20px; }
.btn-primary {
  width: 100%; padding: 14px;
  background: var(--green); color: white;
  border: none; border-radius: 28px;
  font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: background .15s;
}
.btn-primary:hover { background: var(--green-hover); }
.btn-primary:active { background: var(--green-dark); }
.btn-secondary {
  flex: 1; padding: 13px;
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 28px;
  font-size: 15px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: background .15s;
}
.btn-secondary:hover { background: var(--surface-2); }
.form-actions .btn-primary { flex: 2; }

.btn-outline { width: 100%; padding: 13px; background: white; color: var(--green); border: 1.5px solid var(--green); border-radius: 28px; font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit; }
.btn-outline-sm { width: 100%; padding: 12px; background: white; color: var(--text); border: 1.5px solid var(--border); border-radius: 28px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; transition: border-color .15s; }
.btn-outline-sm:hover { border-color: var(--green); color: var(--green); }
.btn-danger { width: 100%; padding: 13px; background: #fee2e2; color: var(--red); border: 1.5px solid #fca5a5; border-radius: 28px; font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit; }
.settings-divider { height: 1px; background: var(--border); margin: 16px 0; }
.settings-note { font-size: 12px; color: var(--text-sec); text-align: center; margin-top: 16px; }

/* Select field list */
.select-field-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; }
.select-field-item { padding: 12px 14px; background: var(--surface-2); border-radius: var(--r); cursor: pointer; border: 1.5px solid var(--border-2); transition: border-color .15s; }
.select-field-item:hover { border-color: var(--green); }
.select-field-item:active { background: var(--green-light); }
.select-field-item-name { font-size: 15px; font-weight: 600; }
.select-field-item-meta { font-size: 12px; color: var(--text-sec); margin-top: 2px; }

/* ═══════════════════════════════════
   AUTH
═══════════════════════════════════ */
.auth-tabs {
  display: flex; gap: 4px; margin-bottom: 18px;
  background: var(--surface-2); border-radius: 28px;
  padding: 3px;
}
.auth-tab {
  flex: 1; padding: 10px 0; border-radius: 25px;
  background: transparent; border: none; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 600;
  color: var(--text-sec);
  transition: background .15s, color .15s;
}
.auth-tab.active {
  background: var(--surface); color: var(--black);
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.auth-form { display: none; }
.auth-form.active { display: block; }
.form-hint { font-size: 11px; color: var(--text-sec); margin-top: 4px; line-height: 1.4; }
.btn-text {
  background: none; border: none; cursor: pointer;
  color: var(--green); font-family: inherit; font-size: 13px;
  padding: 4px 0; text-decoration: underline;
}

/* Profile modal */
.profile-user { display: flex; align-items: center; gap: 14px; padding: 14px 0 10px; }
.profile-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--green); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; flex-shrink: 0;
}
.profile-nickname { font-size: 17px; font-weight: 700; color: var(--black); }
.profile-email { font-size: 13px; color: var(--text-sec); margin-top: 2px; }

.lang-selector { display: flex; gap: 8px; margin-top: 4px; }
.lang-sel-btn {
  flex: 1; padding: 10px;
  border: 1.5px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--text-sec);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
  font-family: inherit;
}
.lang-sel-btn.active { border-color: var(--green); color: var(--green); background: var(--green-light); }

/* Input with inline button */
.input-with-btn { display: flex; gap: 8px; }
.input-with-btn .form-input { flex: 1; }
.btn-inline {
  padding: 9px 16px; white-space: nowrap;
  background: var(--green); color: #fff;
  border: none; border-radius: var(--r-sm);
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .15s;
}
.btn-inline:hover { background: var(--green-hover); }

/* ═══════════════════════════════════
   TOAST
═══════════════════════════════════ */
#toast-container {
  position: fixed; bottom: calc(var(--nav-h) + 12px); left: 16px; right: 16px;
  z-index: 2000; pointer-events: none;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.toast {
  padding: 12px 20px; border-radius: 28px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(12px);
  transition: opacity .25s, transform .25s;
  max-width: 360px; text-align: center;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: var(--green-dark); color: white; }
.toast-error   { background: #7f1d1d; color: white; }
.toast-info    { background: #1e3a5f; color: white; }

/* ═══════════════════════════════════
   LEGAL VIEWS
═══════════════════════════════════ */
.view-legal { background: var(--surface); }
.legal-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--green);
  padding: 14px 16px;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  display: flex; align-items: center;
}
.legal-back-btn {
  background: none; border: none;
  color: white; font-size: 15px; font-weight: 600;
  cursor: pointer; padding: 4px 0; font-family: inherit;
}
.legal-scroll { height: calc(100% - 50px); }
.legal-body {
  padding: 24px 20px 60px;
  max-width: 680px;
  margin: 0 auto;
}
.legal-body h2 { font-size: 22px; font-weight: 900; color: var(--black); margin-bottom: 4px; }
.legal-body h3 { font-size: 16px; font-weight: 800; color: var(--black); margin: 20px 0 8px; padding-bottom: 4px; border-bottom: 2px solid var(--green-light); }
.legal-body h4 { font-size: 14px; font-weight: 700; color: var(--text); margin: 12px 0 6px; }
.legal-body p { font-size: 14px; line-height: 1.75; color: #555; margin-bottom: 10px; }
.legal-body ul { margin: 6px 0 10px 18px; }
.legal-body li { font-size: 14px; line-height: 1.75; color: #555; margin-bottom: 4px; }
.legal-body a { color: var(--green); text-decoration: underline; }
.legal-body strong { color: var(--black); }
.legal-body code { background: #f3f4f6; padding: 1px 5px; border-radius: 4px; font-size: 13px; font-family: monospace; }
.legal-body em { font-style: italic; color: #888; }
.legal-updated { font-size: 12px; color: var(--text-sec); margin-bottom: 16px !important; }
.gdpr-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--green-light); color: var(--green-dark); border: 1px solid var(--green); padding: 7px 12px; border-radius: var(--r-sm); font-size: 13px; font-weight: 700; margin-bottom: 16px; }
.gdpr-table { width: 100%; border-collapse: collapse; margin: 8px 0 14px; font-size: 13px; }
.gdpr-table th { background: var(--green); color: white; padding: 8px 10px; text-align: left; font-weight: 700; }
.gdpr-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; color: #555; }
.gdpr-table tr:last-child td { border-bottom: none; }
.gdpr-table tr:nth-child(even) td { background: var(--surface-2); }

.legal-links-card { padding: 16px; }
.legal-link-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 14px;
  background: var(--surface-2); border: 1.5px solid var(--border-2);
  border-radius: var(--r); cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--text);
  margin-bottom: 8px; text-align: left;
  transition: border-color .15s, background .15s;
  font-family: inherit;
}
.legal-link-btn:last-child { margin-bottom: 0; }
.legal-link-btn:hover { border-color: var(--green); }
.legal-link-btn:active { background: var(--green-light); color: var(--green); }
.legal-arrow { margin-left: auto; color: var(--text-sec); font-size: 16px; }

/* ═══════════════════════════════════
   AMBASSADORS
═══════════════════════════════════ */
.ambassadors-list { display: flex; flex-direction: column; gap: 8px; }
.amb-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--r); padding: 12px 16px;
  box-shadow: var(--shadow);
}
.amb-pos { min-width: 28px; text-align: center; font-size: 18px; font-weight: 800; color: var(--text-sec); }
.amb-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--green); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; flex-shrink: 0;
}
.amb-info { flex: 1; min-width: 0; }
.amb-name { font-size: 15px; font-weight: 700; color: var(--black); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.amb-count { font-size: 18px; font-weight: 800; color: var(--green); text-align: right; white-space: nowrap; }
.amb-count-label { font-size: 11px; color: var(--text-sec); font-weight: 500; }

/* ═══════════════════════════════════
   SHARE ROW
═══════════════════════════════════ */
.share-row { display: flex; align-items: center; gap: 10px; padding: 14px 0 4px; }
.share-label { font-size: 13px; color: var(--text-sec); flex-shrink: 0; }
.share-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: none; cursor: pointer; transition: opacity .15s, transform .1s;
  flex-shrink: 0;
}
.share-btn svg { width: 20px; height: 20px; }
.share-btn:active { opacity: .75; transform: scale(.92); }
.share-wa   { background: #25d366; color: #fff; }
.share-tg   { background: #229ed9; color: #fff; }
.share-fb   { background: #1877f2; color: #fff; }
.share-copy { background: var(--surface-2); border: 1.5px solid var(--border) !important; color: var(--text); }

/* Website link */
.fd-website-link {
  display: inline-block; padding: 4px 0;
  font-size: 13px; color: var(--green);
  text-decoration: none; word-break: break-all;
}
.fd-website-link:hover { text-decoration: underline; }

/* Deleted banner */
.deleted-banner {
  background: #fef3c7; color: #92400e;
  border: 1px solid #fde68a; border-radius: var(--r);
  padding: 12px 16px; font-size: 13px; font-weight: 500;
  margin-bottom: 12px;
}

/* Danger CTA */
.panel-cta-danger { padding: 0 0 16px; margin-top: 4px; }
.btn-danger-sm {
  width: 100%; padding: 10px 16px;
  background: transparent; border: 1.5px solid var(--red);
  border-radius: 28px; color: var(--red);
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .15s;
}
.btn-danger-sm:hover { background: #fee2e2; }

/* Edit field wrap */
#fd-edit-wrap { padding: 0 0 4px; }
#fd-edit-wrap .btn-outline-sm { width: 100%; }

/* Coordinate row */
.coords-row { display: flex; gap: 8px; }
.coords-row .form-input { flex: 1; }

/* Edit history */
.edit-row { padding: 10px 0; border-bottom: 1px solid var(--border-2); font-size: 13px; }
.edit-row:last-child { border-bottom: none; }
.edit-author { font-weight: 600; color: var(--green); margin-right: 8px; }
.edit-date   { color: var(--text-sec); font-size: 12px; }
.edit-detail { margin-top: 4px; color: var(--text-sec); line-height: 1.6; }
.edit-detail s { color: var(--red); text-decoration-color: var(--red); }

/* Contact button */
.btn-contact-mail {
  display: inline-block; margin-top: 12px;
  padding: 10px 20px; border-radius: 28px;
  background: var(--green); color: #fff;
  font-size: 14px; font-weight: 600; text-decoration: none;
  transition: background .15s;
}
.btn-contact-mail:hover { background: var(--green-hover); }

/* Search empty */
.search-empty { padding: 24px 16px; text-align: center; color: var(--text-sec); font-size: 14px; }

/* Google login button */
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 11px 16px; margin-bottom: 4px;
  background: white; border: 1.5px solid #dadce0; border-radius: 28px;
  cursor: pointer; font-family: inherit; font-size: 15px; font-weight: 600;
  color: #3c4043; transition: background .15s, box-shadow .15s;
}
.btn-google:hover { box-shadow: 0 1px 6px rgba(0,0,0,.12); }
.google-icon { width: 20px; height: 20px; flex-shrink: 0; }
.auth-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 14px 0; color: var(--text-sec); font-size: 13px;
}
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ═══════════════════════════════════
   TABLET/DESKTOP (640px+)
═══════════════════════════════════ */
@media (min-width: 640px) {
  /* Show nav links in header, hide bottom nav */
  .header-nav { display: flex; }
  .bottom-nav { display: none; }

  /* Restore full user pill */
  .user-pill-btn {
    width: auto; height: auto;
    padding: 6px 14px;
    border-radius: 24px;
  }
  .user-pill-label { display: inline; }

  /* App area: no bottom nav offset */
  #app {
    bottom: 0;
  }

  /* Hero bigger on desktop */
  .hero { padding: 64px 40px 32px; }
  .hero-title { font-size: 52px; }
  .hero-search-bar { padding: 6px 6px 6px 24px; }
  .hero-search-input { font-size: 17px; padding: 14px 8px; }
  .hero-search-btn { padding: 14px 28px; font-size: 15px; }

  /* Fields as 2-column grid */
  .fields-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  /* Panel slides from right */
  #panel-field {
    left: auto; right: 20px; bottom: 20px;
    width: 400px; max-height: 80vh;
    border-radius: var(--r);
    transform: translateX(440px);
    transition: transform var(--t);
  }
  #panel-field.open { transform: translateX(0); }

  /* Modals centered */
  .modal-overlay { align-items: center; justify-content: center; }
  .modal-card { width: 480px; max-height: 90vh; border-radius: var(--r); transform: translateY(24px) scale(.97); }
  .modal-overlay.open .modal-card { transform: translateY(0) scale(1); }

  /* Toast */
  #toast-container { left: auto; width: 360px; right: 24px; bottom: 24px; }
}

/* Large desktop: 3-column grid */
@media (min-width: 1024px) {
  .fields-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .home-content { padding: 0 32px; }
}

/* Extra-large: 4-column */
@media (min-width: 1400px) {
  .fields-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .home-content {
    max-width: 1600px;
    padding: 0 48px;
  }
}
