/* Мини-приложение air: те же бежевый и тёмно-коричневый, но тёмная версия — по просьбе
   исполнителя 22.09.2026 (ориентир — приложение клуба «121»: тёмный фон, светлый текст).
   Фоны тёмно-коричневые, текст и кнопки бежевые. Тема одна, от системной темы Telegram
   не зависит. */
:root {
  --ground: #2B1F17;
  --surface: #3A2C21;
  --ready-bg: #4C3B2D;
  --ink: #EFE5D3;
  --ink-soft: #CDBBA2;
  --ink-faint: #A08C74;
  --line: #52412F;
  --accent: #E3D6C1;
  --accent-soft: #B9A78C;
  --on-accent: #2A1E15;
  --danger: #E08A72;
  --display: "Forum", Georgia, serif;
  --body: "Manrope", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}

/* Во весь экран сверху — статус-бар телефона и кнопки Telegram («Закрыть»). Скрипт Telegram
   отдаёт их высоту переменными; вне Telegram их нет, и отступ равен нулю. */
:root {
  --top-inset: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); }
body {
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; }
a { color: var(--accent); }

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(18px + var(--top-inset)) 16px calc(24px + env(safe-area-inset-bottom));
}
.page.with-action { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.center { text-align: center; }
.small { font-size: 13.5px; }
.mt12 { margin-top: 12px; }

/* ---------- шапка */
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 6px 0 18px; }
.eyebrow { margin: 0 0 4px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); }
h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 32px; line-height: 1.1; }
h2 { margin: 26px 0 10px; font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1.2; }

.pill-link {
  flex: none; margin-top: 4px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--accent-soft); background: var(--surface);
  color: var(--accent); font: 600 13px var(--body); cursor: pointer;
}
/* На главной шапки нет — афиша начинается сразу с карточек. Администратору — только плашка «Панель». */
.toolbar { display: flex; justify-content: flex-end; margin: -6px 0 10px; }
.toolbar .pill-link { margin-top: 0; }

/* ---------- главная: логотип и афиша плакатами, как у клубов */
.brand { text-align: center; margin: 2px 0 18px; }
.brand-logo { margin: 0; font-family: var(--display); font-weight: 400; font-size: 48px; line-height: 1; letter-spacing: 0.08em; }
.brand-sub { margin: 8px 0 0; font-family: var(--display); font-size: 21px; line-height: 1.2; color: var(--ink-soft); }

.poster-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; }
.poster { position: relative; display: block; text-decoration: none; color: inherit; -webkit-tap-highlight-color: transparent; }
.poster:active { opacity: 0.92; }
.poster-img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--ready-bg); }
/* Пока фото нет — плакат из названия: тип встречи мелко, название крупно. */
.poster .placeholder { aspect-ratio: 4 / 5; flex-direction: column; gap: 10px; padding: 28px 24px; text-align: center; }
.poster .placeholder .kind { font: 700 12px var(--body); letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent-soft); }
.poster .placeholder .name { font-family: var(--display); font-size: 30px; line-height: 1.15; color: var(--ink); text-wrap: balance; }
.date-badge {
  position: absolute; top: 12px; left: 12px; min-width: 64px; padding: 8px 10px 9px; border-radius: 14px;
  background: rgba(43, 31, 23, 0.86); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  text-align: center; line-height: 1.1;
}
.date-badge .d { display: block; font: 700 22px var(--body); color: var(--ink); }
.date-badge .m { display: block; margin-top: 3px; font: 600 11px var(--body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); }
.date-badge .w { display: block; margin-top: 2px; font: 600 11.5px var(--body); color: var(--accent-soft); }
.poster-bar { padding: 12px; }

.cards { display: flex; flex-direction: column; gap: 14px; }

/* ---------- обложка и заглушка (карточка встречи, панель) */
.cover { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--ready-bg); }
.placeholder {
  width: 100%; aspect-ratio: 16 / 10;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(120, 95, 70, 0.45), rgba(120, 95, 70, 0) 60%),
    linear-gradient(160deg, #4A3828, #33251A);
  font-family: var(--display); font-size: 30px; color: rgba(227, 214, 193, 0.62);
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--surface); border: 1px solid var(--accent-soft); color: var(--accent); }

/* ---------- карточка встречи */
/* Обложка встречи уходит под самый верх экрана, как афиши у клубов; кнопки Telegram лежат поверх неё. */
.hero { margin: calc(-18px - var(--top-inset)) -16px 0; }
.hero .cover { aspect-ratio: 4 / 3; }
.hero .placeholder { aspect-ratio: 16 / 8; }
/* Верх обложки занят кнопками Telegram — под ними должно остаться не меньше 160px картинки. */
.hero .cover, .hero .placeholder { min-height: calc(var(--top-inset) + 160px); }
.detail h1 { margin-top: 18px; font-size: 30px; }
.facts { margin: 14px 0 0; padding: 0; list-style: none; }
.facts li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.facts li:first-child { border-top: 1px solid var(--line); }
.facts .k { flex: none; width: 76px; color: var(--ink-faint); font-size: 14px; }
.facts .v { font-weight: 600; }
.about { margin: 18px 0 0; white-space: pre-line; color: var(--ink-soft); }

/* ---------- кнопки */
.btn {
  display: block; width: 100%; padding: 14px 18px; border-radius: 14px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--on-accent); font: 700 16px var(--body); text-align: center; text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.secondary { background: var(--surface); color: var(--accent); border: 1px solid var(--accent-soft); }
.btn.slim { display: inline-block; width: auto; padding: 9px 14px; font-size: 14px; }
.action-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--ground) 70%, rgba(43, 31, 23, 0));
}
.action-bar .btn { max-width: 528px; margin: 0 auto; }

.notice { margin: 16px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--accent-soft); font-size: 14.5px; }
.notice.error { border-color: var(--danger); color: var(--danger); }

/* ---------- панель */
.rows { display: flex; flex-direction: column; gap: 10px; }
.row {
  display: block; width: 100%; padding: 13px 14px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; color: inherit; font: inherit;
}
.row-top { display: flex; justify-content: space-between; gap: 10px; }
.row-title { font-weight: 700; }
.row-meta { margin-top: 3px; font-size: 13.5px; color: var(--ink-soft); }
.tag { flex: none; align-self: flex-start; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--accent); color: var(--on-accent); }
.tag.hidden { background: transparent; color: var(--ink-faint); border: 1px dashed var(--ink-faint); }
.tag.past { background: var(--line); color: var(--ink-soft); }

/* ---------- форма встречи */
.form { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.field label { display: block; margin-bottom: 5px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.field .hint { margin: 4px 0 0; font-size: 12.5px; color: var(--ink-faint); }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  caret-color: var(--accent);
  font: 16px var(--body); /* 16px — иначе iOS увеличивает страницу при фокусе */
}
.field textarea { min-height: 140px; resize: vertical; line-height: 1.45; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-faint); opacity: 1; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent-soft); outline-offset: 0; border-color: var(--accent-soft); }
.field.bad input, .field.bad select, .field.bad textarea { border-color: var(--danger); }
.err { margin: 5px 0 0; font-size: 13px; color: var(--danger); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }

.photo-box { position: relative; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.photo-box .cover, .photo-box .placeholder { aspect-ratio: 16 / 10; }
.photo-actions { display: flex; gap: 8px; margin-top: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- участницы */
.group { margin-top: 18px; }
.group h3 { margin: 0 0 8px; font-size: 14px; font-weight: 700; color: var(--accent); }
.person { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.person:first-of-type { border-top: 1px solid var(--line); }
.person .who { font-weight: 600; }
.person .sum { text-align: right; font-size: 14px; color: var(--ink-soft); }
.totals { margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
