:root {
  --blue: #2196F3;
  --blue-dark: #1565C0;
  --blue-light: #E3F2FD;
  --bg: #F5F9FE;
  --card: #FFFFFF;
  --text: #1A2B4C;
  --muted: #5E7498;
  --green: #2E9E5B;
  --red: #D64545;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(33, 150, 243, 0.12);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
}
#app {
  min-height: 100vh;
  display: flex; flex-direction: column;
  padding-bottom: calc(64px + var(--safe-b, 0px));
}

/* ---------- Header ---------- */
.header {
  background: linear-gradient(135deg, #2196F3 0%, #42A5F5 55%, #81D4FA 100%);
  color: #fff; padding: 16px 18px calc(14px + var(--safe-t, 0px));
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 3px 14px rgba(33, 150, 243, 0.35);
  position: sticky; top: 0; z-index: 10;
}
.logo {
  width: 48px; height: 48px; border-radius: 50%; object-fit: cover;
  border: 2px solid #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.4);
}
.header-title .h-main { font-size: 18px; font-weight: 800; letter-spacing: .2px; }
.header-title .h-sub { font-size: 12.5px; opacity: .9; }

/* ---------- Контент ---------- */
.content { flex: 1; padding: 16px 14px; }
.section-title {
  font-size: 15px; font-weight: 800; color: var(--blue-dark);
  margin: 4px 0 12px; display: flex; align-items: center; gap: 8px;
}
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px; margin-bottom: 12px;
  border: 1px solid #E4EEFA;
}
.card img.cover {
  width: 100%; max-height: 220px; object-fit: cover; border-radius: 12px;
  margin-bottom: 10px; display: block;
}
.card h3 { font-size: 16px; font-weight: 700; margin: 0 0 6px; }
.card p { margin: 0 0 8px; font-size: 14px; line-height: 1.45; }
.date { font-size: 12px; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 30px 0; font-size: 14px; }

/* ---------- Кнопки ---------- */
.btn {
  display: block; width: 100%; padding: 13px 0; border: 0; border-radius: 14px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: #fff; font-size: 15px; font-weight: 700; cursor: pointer;
  box-shadow: 0 3px 10px rgba(33, 150, 243, .28);
}
.btn:active { transform: scale(.97); }
.btn.ghost {
  background: transparent; color: var(--blue-dark);
  border: 2px solid var(--blue); box-shadow: none;
}
.btn.green { background: linear-gradient(135deg, #2E9E5B, #1E7A45); color: #fff; }

/* ---------- Пожертвование ---------- */
.donate-box { background: linear-gradient(135deg, #E3F2FD, #FFFFFF); border: 1.5px dashed var(--blue); }
.qr {
  display: block; width: 100%; max-width: 260px; margin: 0 auto; border-radius: 14px;
  border: 2px solid var(--blue); box-shadow: var(--shadow);
}

/* ---------- Табы ---------- */
.tabs {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: space-around; align-items: center;
  background: rgba(255,255,255,.97); border-top: 1px solid #E0EAF7;
  padding: 6px 0 calc(10px + var(--safe-b, 0px));
  box-shadow: 0 4px 16px rgba(0,0,0,.12); z-index: 20;
}
.tab {
  flex: 1; border: 0; background: none; font-size: 10.5px;
  color: #7A90B4; padding: 9px 0 4px; display: flex; flex-direction: column;
  align-items: center; gap: 2px; cursor: pointer;
}
.tab.active { color: var(--blue); font-weight: 700; }

/* ---------- Аукцион ---------- */
.chip-mini {
  background: var(--blue-light); color: var(--blue-dark); padding: 3px 10px;
  border-radius: 20px; font-size: 11.5px; font-weight: 600;
}
.pbar { background: #E3F2FD; border-radius: 8px; height: 12px; overflow: hidden; margin: 8px 0 4px; }
.pfill { background: linear-gradient(90deg, #2196F3, #1565C0); height: 100%; border-radius: 8px; min-width: 2px; }
.pfill.full { background: linear-gradient(90deg, #2E9E5B, #1E7A45); }
.lot-status {
  display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 700;
}
.lot-status.active { background: var(--blue-light); color: var(--blue-dark); }
.lot-status.closed { background: #FFE9E9; color: var(--red); }
.lot-status.sold   { background: #E2F4E6; color: var(--green); }
.price-big { font-size: 22px; font-weight: 800; color: var(--blue-dark); }
.timer { font-size: 13px; font-weight: 700; color: var(--red); }
.bid-input {
  display: block; width: 100%; padding: 12px; border-radius: 12px;
  border: 2px solid var(--blue); font-size: 16px; text-align: center;
  background: #fff; margin-bottom: 10px;
}
.bid-note { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* ---------- Отзывы ---------- */
.review-role { font-size: 12px; color: var(--muted); }
textarea, input[type=text] {
  width: 100%; padding: 12px; border-radius: 12px; border: 2px solid var(--blue);
  font-size: 15px; font-family: inherit; background: #fff; box-sizing: border-box;
}
select {
  width: 100%; padding: 12px; border-radius: 12px; border: 2px solid var(--blue);
  font-size: 15px; background: #fff;
}

/* ---------- Тосты ---------- */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: var(--blue-dark); color: #fff; padding: 11px 18px; border-radius: 12px;
  font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25); z-index: 50;
  animation: toastIn .25s ease-out; max-width: 90%;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } }

/* ---------- Модалка ---------- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(15,35,70,.55); z-index: 40;
  display: flex; align-items: center; justify-content: center;
}
.modal {
  background: #fff; border-radius: 18px; width: 92%; max-width: 380px;
  padding: 20px; box-shadow: 0 10px 30px rgba(0,0,0,.3);
  max-height: 80vh; overflow-y: auto;
}
.modal h3 { margin: 0 0 12px; color: var(--blue-dark); }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1A2E; --card: #16263F; --text: #E8EEFA; --muted: #8FA6C8;
    --blue-light: #1C3557;
  }
  body { background: var(--bg); color: var(--text); }
  .card { border-color: #22375A; }
  .header { background: linear-gradient(135deg, #1E5FA8, #2E7EC8); }
  .tabs { background: #101C33; border-top-color: #22375A; }
}