/* Цвета приходят из Telegram (themeParams) — app.js кладёт их в эти
   переменные. Значения ниже — запасные, на случай открытия вне Telegram. */
:root {
  --bg: #ffffff;
  --text: #000000;
  --hint: #707579;
  --link: #3390ec;
  --button: #3390ec;
  --button-text: #ffffff;
  --secondary-bg: #f4f4f5;
}

* { box-sizing: border-box; }

/* Правила ниже задают display, поэтому атрибут hidden надо усилить —
   иначе скрытый лист остаётся на экране. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#map {
  position: absolute;
  inset: 0;
}

/* Число живых предложений в клетке. Точек людей на карте нет и не будет —
   клетка это всё, что карта знает. */
.cell-count {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  text-shadow: 0 0 3px var(--bg), 0 0 3px var(--bg);
  pointer-events: none;
}

.notice {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 24px;
  z-index: 1000;
  padding: 16px;
  border-radius: 14px;
  background: var(--bg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, .18);
  text-align: center;
}

.notice p { margin: 0 0 12px; }
.notice p:last-child { margin-bottom: 0; }

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  max-height: 62%;
  display: flex;
  flex-direction: column;
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
  border-radius: 16px 16px 0 0;
  background: var(--bg);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, .18);
}

.sheet-grip {
  width: 36px;
  height: 4px;
  margin: 0 auto 10px;
  border-radius: 2px;
  background: var(--hint);
  opacity: .35;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-weight: 600;
}

.sheet-list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.card {
  padding: 12px 0;
  border-top: 1px solid var(--secondary-bg);
}

.card:first-child { border-top: none; }

.card-head {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.card-when {
  margin-left: auto;
  color: var(--hint);
  font-size: 13px;
  white-space: nowrap;
}

.card-text { margin: 6px 0; }

.card-meta {
  color: var(--hint);
  font-size: 13px;
}

button {
  font: inherit;
  cursor: pointer;
}

.primary {
  width: 100%;
  margin-top: 10px;
  padding: 11px 16px;
  border: none;
  border-radius: 10px;
  background: var(--button);
  color: var(--button-text);
  font-weight: 600;
}

.ghost {
  border: none;
  background: none;
  color: var(--hint);
  font-size: 17px;
  line-height: 1;
  padding: 4px 8px;
}
