:root {
  --bg: #F0FAF6;
  --bg-grad-1: #E7F8EF;
  --bg-grad-2: #F0FAF6;
  --surface: #FFFFFF;
  --surface-2: #F5FBF8;
  --text: #0F2820;
  --text-secondary: #5C7A6F;
  --primary: #10A66B;
  --primary-dark: #0E9F6E;
  --primary-soft: #DCF5E8;
  --gold: #F4A300;
  --gold-light: #FFD86B;
  --gold-soft: #FFF4D6;
  --success: #10A66B;
  --danger: #E04848;
  --warning: #F4A300;
  --border: #DCEAE3;
  --disabled: #BFD3CB;
  --shadow-sm: 0 1px 2px rgba(15, 60, 40, 0.06);
  --shadow: 0 4px 14px rgba(15, 60, 40, 0.08);
  --shadow-coin: 0 6px 16px rgba(244, 163, 0, 0.32);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B1814;
    --bg-grad-1: #0F2620;
    --bg-grad-2: #0B1814;
    --surface: #142A22;
    --surface-2: #1A332A;
    --text: #E8F5EE;
    --text-secondary: #8FA89E;
    --primary: #34D399;
    --primary-dark: #10A66B;
    --primary-soft: #1F4A36;
    --gold: #FFD86B;
    --gold-light: #FFE58A;
    --gold-soft: #3A2D0E;
    --border: #1F3D33;
    --disabled: #2A453B;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  }
}

/* ---------- Темы оформления (выбор пользователя) ---------- */
html[data-theme="light"] {
  --bg:#F0FAF6;--bg-grad-1:#E7F8EF;--bg-grad-2:#F0FAF6;--surface:#FFFFFF;--surface-2:#F5FBF8;
  --text:#0F2820;--text-secondary:#5C7A6F;--primary:#10A66B;--primary-dark:#0E9F6E;--primary-soft:#DCF5E8;--border:#DCEAE3;
}
html[data-theme="dark"] {
  --bg:#0B1814;--bg-grad-1:#0F2620;--bg-grad-2:#0B1814;--surface:#142A22;--surface-2:#1A332A;
  --text:#E8F5EE;--text-secondary:#8FA89E;--primary:#34D399;--primary-dark:#10A66B;--primary-soft:#1F4A36;--border:#1F3D33;
}
html[data-theme="ocean"] {
  --bg:#EFF6FF;--bg-grad-1:#E0EEFF;--bg-grad-2:#EFF6FF;--surface:#FFFFFF;--surface-2:#F1F6FE;
  --text:#0E2238;--text-secondary:#5B7390;--primary:#2563EB;--primary-dark:#1D4ED8;--primary-soft:#DBE8FF;--border:#D6E4F5;
}
html[data-theme="amethyst"] {
  --bg:#150F22;--bg-grad-1:#1E1432;--bg-grad-2:#150F22;--surface:#241836;--surface-2:#2C1F44;
  --text:#F0E9FB;--text-secondary:#A99BC4;--primary:#A855F7;--primary-dark:#9333EA;--primary-soft:#3B2960;--border:#392851;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(180deg, var(--bg-grad-1), var(--bg-grad-2));
  background-attachment: fixed;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}

body {
  padding-top: env(safe-area-inset-top);
  min-height: 100vh;
}
body.modal-open {
  overflow: hidden;
  touch-action: none;
}

.hidden { display: none !important; }

.screen { min-height: 100vh; }

/* ---------- Onboarding ---------- */
.onboarding {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.onboarding-content {
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.logo {
  width: 96px;
  height: 96px;
  margin: 0 auto 20px;
  border-radius: 28px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  font-weight: 900;
  color: #7A4A00;
  box-shadow: var(--shadow-coin);
  position: relative;
}

.logo::after {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 22px;
  border: 2px solid rgba(122, 74, 0, 0.18);
  pointer-events: none;
}

.onboarding h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.tagline {
  color: var(--text-secondary);
  margin: 0 0 32px;
  font-size: 15px;
  line-height: 1.45;
  padding: 0 8px;
}

.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  text-align: left;
  box-shadow: var(--shadow);
}

.step input[type="url"] {
  margin-bottom: 14px;
  margin-top: 0;
}

/* ---------- Main screen layout ---------- */
.tab-panel { display: none; position: relative; }
.tab-panel.active { display: block; }

.app-header {
  background: var(--surface);
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.app-header h1 {
  font-size: 22px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-header h1::before {
  content: '₽';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #7A4A00;
  font-size: 18px;
  font-weight: 900;
  box-shadow: var(--shadow-coin);
  flex-shrink: 0;
}

.header-sub {
  margin: 4px 0 0 40px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

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

.icon-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 18px;
  color: var(--primary);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  transition: transform 0.15s;
}

.icon-btn:active { transform: scale(0.93); }
.icon-btn svg { display: block; }
#refreshBtn:active svg { animation: spin-once 0.5s ease; }
#settingsBtn:active svg { transform: rotate(60deg); transition: transform 0.3s; }

@keyframes spin-once {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ---------- Places list ---------- */
.places-list {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 130px;
}

.place-card {
  background: var(--surface);
  border-radius: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.place-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--gold));
  opacity: 0;
  transition: opacity 0.3s;
}

.place-card.is-eligible::before { opacity: 1; }

.place-card .top-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.place-card .info { flex: 1; min-width: 0; }

.place-card .name {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.2px;
  line-height: 1.25;
}

.place-card .name-text { color: var(--text); }

.place-card .category {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary);
  border-radius: 6px;
  padding: 2px 8px;
  margin: 4px 0 8px;
  letter-spacing: 0.2px;
  line-height: 1.3;
}

.place-card .address {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

.coin-badge {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7A4A00;
  font-size: 22px;
  font-weight: 900;
  box-shadow: var(--shadow-coin);
}

.place-card .meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.place-card .distance {
  font-size: 13px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.place-card .status {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.place-card .status.pending { color: var(--text-secondary); font-weight: 500; }
.place-card .status.near { color: var(--primary); }
.place-card .status.eligible { color: var(--gold); }
.place-card .status.reviewed { color: var(--text-secondary); font-weight: 500; }
.place-card .status.submitted { color: var(--warning); }
.place-card .status.approved { color: var(--success); }
.place-card .status.rejected { color: var(--danger); }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.place-card .status.near .status-dot {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.review-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
  letter-spacing: 0.2px;
}

.review-btn:active:not(:disabled) { transform: scale(0.98); }

.review-btn:not(:disabled) {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #7A4A00;
  box-shadow: var(--shadow-coin);
}

.review-btn:disabled {
  background: var(--surface-2);
  color: var(--text-secondary);
  cursor: not-allowed;
  border: 1px solid var(--border);
}

.review-btn.reviewed {
  background: transparent;
  color: var(--success);
  border: 1.5px solid var(--success);
  box-shadow: none;
}

.review-btn.submitted {
  background: var(--gold-soft);
  color: var(--warning);
  border: 1.5px solid var(--warning);
  box-shadow: none;
}

.review-btn.rejected {
  background: transparent;
  color: var(--danger);
  border: 1.5px solid var(--danger);
}

.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
}

.empty-state::before {
  content: '👟';
  display: block;
  font-size: 56px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state.empty-wallet::before { content: '💰'; }

.empty-state p { margin: 4px 0; }
.empty-state .hint { font-size: 14px; opacity: 0.7; }

.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

.settings-section {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 14px;
}

.settings-section-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.settings-section-hint {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.settings-section .btn-secondary {
  margin-top: 0;
  padding: 11px;
  font-size: 14px;
}

.settings-howto {
  margin-top: 18px;
  font-weight: 500;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ---------- Tab bar ---------- */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  z-index: 20;
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.tab-btn.active { color: var(--primary); }

.tab-icon {
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
}
.tab-icon svg { width: 24px; height: 24px; display: block; }

/* ---------- Wallet ---------- */
.wallet-content {
  padding: 20px 16px;
  padding-bottom: 130px;
}

.balance-card {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 22px;
  padding: 28px 24px;
  color: white;
  text-align: center;
  box-shadow: 0 10px 30px rgba(16, 166, 107, 0.3);
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
}

.balance-card::before {
  content: '₽';
  position: absolute;
  font-size: 220px;
  font-weight: 900;
  line-height: 1;
  top: -40px;
  right: -40px;
  opacity: 0.08;
}

.balance-label {
  font-size: 13px;
  opacity: 0.85;
  margin: 0 0 8px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.balance-amount {
  font-size: 56px;
  font-weight: 900;
  margin: 0;
  letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
}

.balance-amount .rub {
  font-size: 28px;
  margin-left: 6px;
  opacity: 0.85;
}

.balance-sub {
  font-size: 13px;
  opacity: 0.85;
  margin: 8px 0 0;
}

.referral-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.referral-head {
  margin-bottom: 14px;
}

.referral-label {
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 4px;
  letter-spacing: -0.2px;
}

.referral-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

.referral-code-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.referral-code-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.referral-code {
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--gold);
  flex: 1;
}

.referral-share-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.referral-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.referral-stat {
  flex: 1;
  background: var(--surface);
  border-radius: 14px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}

.referral-stat-label {
  font-size: 15px;
  color: var(--text);
  font-weight: 700;
}
.referral-stat-pct { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.referral-stat-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.referral-stat-amount {
  font-size: 15px;
  color: var(--gold);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.submissions-section h2 {
  font-size: 17px;
  font-weight: 800;
  margin: 0 0 12px;
}

.submissions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.submission-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.submission-card .sub-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.submission-card .sub-icon svg { display: block; }
.submission-card.pending .sub-icon {
  background: var(--gold-soft);
  color: var(--warning);
}
.submission-card.approved .sub-icon {
  background: var(--primary-soft);
  color: var(--success);
}
.submission-card.rejected .sub-icon {
  background: rgba(224, 72, 72, 0.15);
  color: var(--danger);
}

.submission-card .sub-info {
  flex: 1;
  min-width: 0;
}

.submission-card .sub-place {
  font-weight: 600;
  font-size: 14px;
  margin: 0 0 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.submission-card .sub-status {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
}

.submission-card .sub-amount {
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.submission-card.approved .sub-amount { color: var(--success); }
.submission-card.rejected .sub-amount { color: var(--danger); text-decoration: line-through; opacity: 0.6; }
.submission-card.pending .sub-amount { color: var(--warning); }

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 30, 24, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 2000; /* выше полной карты и её контролов (иначе карта перекрывает модалку) */
}

.modal.hidden { display: none !important; }

.modal-content {
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}

.modal-content label {
  display: block;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
}

input[type="url"], input[type="text"], input[type="number"] {
  display: block;
  width: 100%;
  padding: 14px;
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  margin-top: 12px;
  margin-bottom: 4px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.btn-primary, .btn-secondary {
  width: 100%;
  padding: 15px;
  border-radius: 12px;
  border: none;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
  letter-spacing: 0.2px;
  transition: transform 0.1s;
  font-family: inherit;
}

.btn-primary:active, .btn-secondary:active { transform: scale(0.985); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 12px rgba(16, 166, 107, 0.32);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.error {
  color: var(--danger);
  font-size: 13px;
  margin: 12px 0 0;
  font-weight: 500;
}

.hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 12px 0 0;
  line-height: 1.4;
}

.hint.error {
  color: var(--danger);
  font-weight: 500;
}

.reveal-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 14px;
  text-align: center;
  line-height: 1.3;
}
.reveal-name:empty { display: none; }

.modal-error {
  color: var(--danger);
  font-size: 13px;
  font-weight: 500;
  margin: 0 0 12px;
}

.how-list {
  margin: 0 0 16px;
  padding-left: 20px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
.how-list li { margin-bottom: 8px; }

.howto-section {
  font-size: 15px;
  font-weight: 700;
  margin: 18px 0 6px;
  color: var(--text);
}

.howto-compact {
  margin: 0 0 16px;
  padding: 12px 14px 12px 28px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.55;
}
.howto-compact li { margin: 0; padding: 0; }
.howto-compact li + li { margin-top: 4px; }

.upload-preview {
  margin-bottom: 16px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  max-height: 360px;
}

.upload-preview img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: contain;
  background: var(--surface-2);
}

/* ========== OTA update banner ========== */
.update-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0));
  background: linear-gradient(135deg, #2DC080 0%, #1F8F5C 100%);
  color: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .28);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 9999;
  font-size: 14px;
  animation: update-banner-in .3s ease-out;
}
.update-banner.hidden { display: none; }
@keyframes update-banner-in {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.update-banner-text {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}
.update-banner-text strong { color: #F5C842; font-weight: 700; }
.update-banner-icon { font-size: 20px; flex-shrink: 0; }
.update-banner-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.update-btn-install,
.update-btn-later {
  border: 0;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.update-btn-install { background: #F5C842; color: #5A3B0E; }
.update-btn-install:active { background: #E5A82A; }
.update-btn-later {
  background: transparent;
  color: rgba(255, 255, 255, .85);
  border: 1px solid rgba(255, 255, 255, .35);
}
.update-btn-later:active { background: rgba(255, 255, 255, .15); }

/* ========== Force update screen ========== */
.force-update-screen {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .85);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.force-update-screen.hidden { display: none; }
.force-update-box {
  background: var(--surface, #fff);
  border-radius: 20px;
  padding: 36px 28px 32px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0,0,0,.4);
}
.force-update-icon { font-size: 52px; margin-bottom: 16px; }
.force-update-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text, #111);
  margin: 0 0 12px;
}
.force-update-text {
  font-size: 15px;
  color: var(--text-secondary, #555);
  margin: 0 0 16px;
  line-height: 1.5;
}
.force-update-ver {
  font-size: 13px;
  color: var(--text-secondary, #888);
  margin: 0 0 28px;
}
.force-update-btn {
  width: 100%;
  padding: 16px;
  background: #2DC080;
  color: #fff;
  border: 0;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.force-update-btn:active { background: #1F8F5C; }

/* ========== iOS install prompt ========== */
.ios-steps {
  text-align: left;
  padding: 0 0 0 1.2em;
  margin: 16px auto 0;
  max-width: 360px;
  line-height: 1.5;
  color: var(--text-2, #5A6B62);
  font-size: 15px;
}
.ios-steps li { margin-bottom: 10px; }
.ios-steps strong { color: var(--text, #16201A); }
.hint-web {
  font-size: 13px;
  color: var(--text-2, #5A6B62);
  margin-top: 12px;
  text-align: center;
  display: block !important;
}

/* ---------- Map view ---------- */
.map-hint {
  position: absolute;
  top: 10px; left: 50%;
  transform: translateX(-50%);
  background: rgba(17,24,39,.82);
  color: #fff;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 20px;
  z-index: 600;
  pointer-events: none;
  white-space: nowrap;
}
.map-hint.hidden { display: none; }

.full-map-wrap {
  position: absolute;
  inset: 0;
  z-index: 5;
}
.full-map-wrap.hidden { display: none; }
.full-map { width: 100%; height: 100%; }

.rubli-pin span {
  display: block;
  width: 18px; height: 18px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.rubli-you {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #1f6feb;
  border: 3px solid #fff;
  box-shadow: 0 0 0 4px rgba(31,111,235,.3);
}

.pin-sheet {
  position: absolute;
  left: 10px; right: 10px; bottom: 10px;
  z-index: 600;
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,.22);
}
.pin-sheet.hidden { display: none; }
.pin-sheet-close {
  position: absolute;
  top: 8px; right: 10px;
  border: none; background: none;
  font-size: 22px; line-height: 1;
  color: #9ca3af; cursor: pointer;
}
.pin-sheet-name { font-size: 15px; font-weight: 700; color: #111827; margin: 0 24px 4px 0; }
.pin-sheet-dist { font-size: 13px; color: #6b7280; margin: 0 0 10px; }
.pin-sheet-btn {
  width: 100%;
  border: none;
  background: none;
  color: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 11px;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: filter 0.1s, background 0.1s;
}

.rubli-locate {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 9px;
  background: #fff;
  color: #1f6feb;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 5px rgba(0,0,0,.3);
}
.rubli-locate:active { background: #eef2f6; }

.pin-sheet-actions { display: flex; flex-direction: column; gap: 8px; }
.pin-sheet-actions .pin-sheet-btn { flex: none; width: 100%; }
/* Route = PRIMARY action: filled gradient, full-width, on top */
.pin-sheet-btn.route {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  font-size: 15px;
  font-weight: 700;
  padding: 13px;
  box-shadow: 0 4px 12px rgba(16, 166, 107, 0.32);
}
.pin-sheet-btn.route:active { filter: brightness(0.92); }
/* Review action = SECONDARY: outline, less prominent, below route */
.pin-sheet-btn:not(.route) {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 11px;
  min-height: 44px;
}
.pin-sheet-btn:not(.route):active:not(:disabled) { background: var(--primary-soft); }
/* Disabled state for review button: visibly inactive */
.pin-sheet-btn:disabled {
  background: transparent;
  color: #9ca3af;
  border: 1.5px solid #d1d5db;
  cursor: default;
  opacity: 0.65;
  box-shadow: none;
}

.btn-lg { font-size: 18px; padding: 14px 28px; }

/* ---------- Главный экран: мини-карта + счётчик заданий ---------- */
.mini-map-wrap { position: relative; z-index: 0; height: 200px; margin: 12px; border-radius: 16px;
  overflow: hidden; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.10); }
.mini-map-wrap.hidden { display: none; }
.mini-map { width: 100%; height: 100%; }
.mini-map-open { position: absolute; right: 10px; bottom: 10px; z-index: 5;
  background: rgba(255,255,255,.94); color: var(--primary); border: none; border-radius: 999px;
  padding: 8px 14px; font-size: 13px; font-weight: 700; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.18); }

.tasks-counter { text-align: center; padding: 20px 24px 28px; }
.tasks-counter.hidden { display: none; }
.tasks-count-text { font-size: 24px; font-weight: 700; line-height: 1.35; }
.tasks-count-text b { color: var(--primary); }
.tasks-count-sub { opacity: .75; margin: 10px 0 18px; font-size: 14px; }

/* Акцент: фото заведения обязательно */
.photo-emphasis { margin: 4px 0 14px; padding: 11px 13px; border-radius: 10px;
  background: rgba(245, 158, 11, .14); color: #92600a; font-size: 13px; line-height: 1.45; font-weight: 600; }

.map-close-btn { position: absolute; top: 10px; left: 10px; z-index: 1000;
  background: rgba(255,255,255,.94); color: var(--text); border: none; border-radius: 999px;
  padding: 9px 16px; font-size: 14px; font-weight: 700; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.2); }

/* ---------- Рефералы: тоталы и список ---------- */
.referral-totals { display: flex; gap: 12px; margin-bottom: 14px; }
.referral-total { flex: 1; background: var(--surface); border-radius: 14px; padding: 16px;
  text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.referral-total-num { display: block; font-size: 26px; font-weight: 800; color: var(--primary); }
.referral-total-label { display: block; font-size: 12px; opacity: .7; margin-top: 4px; }
.referral-levels { display: flex; gap: 10px; margin-bottom: 18px; }
.referrals-list { display: flex; flex-direction: column; gap: 8px; }
.referral-row { display: flex; align-items: center; gap: 10px; background: var(--surface);
  border-radius: 12px; padding: 9px 12px; box-shadow: 0 1px 6px rgba(0,0,0,.05); }
.referral-row-icon { font-size: 18px; flex: none; }
.referral-row-info { flex: 1; min-width: 0; }
.referral-row-name { margin: 0; font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.referral-row-sub { margin: 2px 0 0; font-size: 12px; opacity: .7; }
.referral-row-amount { font-weight: 800; color: var(--primary); white-space: nowrap; }

/* ---------- Выплаты ---------- */
.payout-section { margin-bottom: 22px; }
.payout-section h2 { margin-bottom: 6px; }
.payout-hint { font-size: 13px; opacity: .7; margin-bottom: 12px; }
.payout-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.payout-method { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 7px;
  width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 10px; cursor: pointer; box-shadow: var(--shadow-sm); color: var(--text); }
.payout-method:active { background: var(--primary-soft); }
.payout-method-wide { grid-column: 1 / -1; }
.payout-emblem { position: relative; width: 44px; height: 44px; border-radius: 12px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 20px; }
/* настоящий логотип (если файл есть в icons/pay/) кладётся поверх цветного бейджа */
.payout-logo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.emb-tbank { background: #1c1c1c; color: #FFDD2D; }
.emb-sber { background: #21A038; color: #fff; }
.emb-phone { background: #2563eb; color: #fff; }
.emb-yoomoney { background: #8B3FFD; color: #fff; }
.emb-cryptobot { background: #2AABEE; color: #fff; }
.payout-method-name { font-weight: 700; font-size: 14px; }
.payout-method-sub { font-size: 11px; color: var(--text-secondary); }

.payout-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; font-size: 13px; }
.payout-field span { font-weight: 600; opacity: .8; }
.payout-field input { padding: 12px 14px; border: 1px solid var(--border, #d1d5db); border-radius: 10px;
  font-size: 16px; background: var(--bg, #fff); color: var(--text); }
.payouts-list { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Аккаунт / auth ---------- */
.account-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; margin-bottom: 18px; padding: 12px 14px; background: var(--surface);
  border-radius: 12px; box-shadow: 0 1px 6px rgba(0,0,0,.05); }
.account-email { font-weight: 600; font-size: 14px; word-break: break-all; }
.account-actions { display: flex; gap: 8px; }
.btn-sm { padding: 8px 12px; font-size: 13px; }
.referral-link-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.referral-link { color: var(--primary); font-weight: 600; font-size: 13px; word-break: break-all; flex: 1; min-width: 60%; }
.referral-link-actions { display: flex; gap: 8px; }
.referral-copy-btn { background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; }

/* Переключатель тем */
.theme-row { display: flex; gap: 6px; }
.theme-swatch { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--surface-2); border: 2px solid var(--border); border-radius: 12px; padding: 10px 4px;
  cursor: pointer; color: var(--text); font-size: 11px; font-weight: 700;
  box-shadow: 0 2px 6px rgba(0,0,0,.12); transition: transform .08s, box-shadow .08s; }
.theme-swatch.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft), 0 2px 6px rgba(0,0,0,.12); }
.theme-dot { width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); flex: none; }
.sw-auto { background: linear-gradient(135deg,#F0FAF6 50%,#0B1814 50%); }
.sw-light { background: #F0FAF6; }
.sw-dark { background: #0B1814; }
.sw-ocean { background: #2563EB; }
.sw-amethyst { background: #A855F7; }
#authScreen .step input { display: block; width: 100%; box-sizing: border-box; margin-bottom: 10px;
  padding: 13px 14px; border: 1px solid var(--border, #d1d5db); border-radius: 10px; font-size: 16px;
  background: var(--bg, #fff); color: var(--text); }
#authScreen .btn-secondary { margin-top: 10px; }

/* ---------- Объёмные кнопки (явная кликабельность) ---------- */
.theme-swatch:active { transform: translateY(2px); }
.payout-method { box-shadow: 0 3px 8px rgba(0,0,0,.12); transition: transform .08s, box-shadow .08s, background .1s; }
.payout-method:active { transform: translateY(2px); box-shadow: 0 1px 3px rgba(0,0,0,.14); background: var(--primary-soft); }
.btn-secondary { box-shadow: 0 2px 6px rgba(0,0,0,.10); transition: transform .08s, box-shadow .08s; }
.btn-secondary:active { transform: translateY(2px); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.btn-primary { transition: transform .08s, filter .08s, box-shadow .08s; }
.btn-primary:active { transform: translateY(2px); filter: brightness(.95); }
.referral-copy-btn, .referral-share-btn { box-shadow: 0 2px 6px rgba(0,0,0,.14); transition: transform .08s; }
.referral-copy-btn:active, .referral-share-btn:active { transform: translateY(2px); }
.btn-sm { box-shadow: 0 2px 5px rgba(0,0,0,.10); }
.btn-sm:active { transform: translateY(2px); }

/* ---------- Баланс в шапке + быстрый вывод ---------- */
.header-balance-btn { display: inline-flex; align-items: center; gap: 7px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 7px 12px; cursor: pointer; color: var(--text);
  font-weight: 800; font-size: 14px; box-shadow: var(--shadow-sm); white-space: nowrap; transition: transform .08s; }
.header-balance-btn .hb-amount { font-variant-numeric: tabular-nums; }
.header-balance-btn svg { color: var(--primary); display: block; flex: none; }
.header-balance-btn:active { transform: translateY(1px); }

/* ---------- Бейдж уровня реферала ---------- */
.referral-row-badge { display: inline-block; font-size: 10px; font-weight: 700; border-radius: 6px;
  padding: 1px 7px; white-space: nowrap; }
.referral-row-badge.lvl1 { background: var(--primary-soft); color: var(--primary); }
.referral-row-badge.lvl2 { background: var(--gold-soft); color: var(--gold); }

/* ---------- «Мои отзывы» в разделе Места ---------- */
.my-reviews-section { margin-top: 18px; }
.my-reviews-section h2 { font-size: 17px; font-weight: 800; margin: 0 0 10px; }
.my-reviews-section .submissions-list { display: flex; flex-direction: column; gap: 8px; }

/* «Смотреть все» в блоке Мои отзывы */
.my-reviews-more { width: 100%; margin-top: 10px; }
#allReviewsList { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Подсказка «Настрой Яндекс» ---------- */
.yandex-setup-card { display: flex; align-items: center; gap: 12px; position: relative;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 14px 14px; margin: 0 0 12px; box-shadow: var(--shadow-sm); }
.ysc-icon { font-size: 24px; flex: none; }
.ysc-body { flex: 1; min-width: 0; padding-right: 8px; }
.ysc-title { margin: 0; font-weight: 800; font-size: 14px; }
.ysc-sub { margin: 2px 0 0; font-size: 12px; color: var(--text-secondary); }
.ysc-btn { flex: none; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff;
  border: none; border-radius: 10px; padding: 9px 14px; font-weight: 700; font-size: 13px; cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,.12); transition: transform .08s; }
.ysc-btn:active { transform: translateY(2px); }
.ysc-close { position: absolute; top: 5px; right: 8px; background: none; border: none; color: var(--text-secondary);
  font-size: 18px; line-height: 1; cursor: pointer; padding: 2px 6px; }
.ysetup-steps { margin: 0 0 18px; padding-left: 22px; display: flex; flex-direction: column; gap: 14px; font-size: 14px; }
.ysetup-steps li { line-height: 1.45; }
.ysetup-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.ysetup-have { font-size: 12px; color: var(--text-secondary); }
