:root {
  --paper: #f4efe6;
  --paper-2: #efe6d6;
  --ink: #1c1917;
  --muted: #6b635b;
  --line: #d9cfc0;
  --card: #fffaf2;
  --accent: #c2410c;
  --accent-ink: #9a3412;
  --teal: #0f766e;
  --ok: #166534;
  --danger: #b91c1c;
  --shadow: 0 0 0 1px var(--line);
  --display: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: "Segoe UI", system-ui, sans-serif;
  --pad: 20px;
}

html.tg-dark {
  --paper: var(--tg-theme-bg-color, #1c1917);
  --paper-2: var(--tg-theme-secondary-bg-color, #292524);
  --ink: var(--tg-theme-text-color, #f5f5f4);
  --muted: var(--tg-theme-hint-color, #a8a29e);
  --line: #44403c;
  --card: var(--tg-theme-secondary-bg-color, #292524);
  --accent: #fb923c;
  --accent-ink: #fdba74;
  --teal: #2dd4bf;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: var(--accent-ink); }
button, input, textarea, select { font: inherit; color: inherit; }

.wrap {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 28px var(--pad) 64px;
}

.hero {
  display: grid;
  gap: 22px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 720px) {
  .hero { grid-template-columns: 1.15fr 0.85fr; align-items: end; }
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.brand img {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: contain;
}
.brand strong {
  display: block;
  font-family: var(--display);
  font-size: 22px;
  line-height: 1.1;
}
.brand span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.city-pick {
  display: grid;
  gap: 6px;
  width: min(100%, 280px);
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
}
.city-pick select {
  width: 100%;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 650;
  color: var(--ink);
}
.city-step { width: 100%; margin-top: 18px; }

.kicker {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--teal);
  font-weight: 700;
  margin: 0 0 10px;
}

h1, h2, .display {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
}

h1 { font-size: clamp(34px, 7vw, 52px); }
h2 { font-size: 28px; margin-bottom: 12px; }
.lede { font-size: 18px; color: var(--muted); max-width: 38ch; margin: 14px 0 0; }
#step-1 .lede { max-width: none; text-align: justify; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.btn-emoji { font-size: 1.05em; line-height: 1; }
.btn-icon { width: 1.15em; height: 1.15em; flex: none; display: block; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.poster {
  border: 1px solid var(--line);
  background: var(--paper-2);
  overflow: hidden;
}
.poster img { width: 100%; height: auto; object-fit: contain; background: #fff; }

.section { padding: 36px 0; border-bottom: 1px solid var(--line); }
.section p { color: var(--muted); margin: 0 0 16px; }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.card, .choice {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 16px;
  text-align: left;
}

.choice {
  cursor: pointer;
  width: 100%;
}
.card strong, .choice strong { display: block; font-size: 16px; margin-bottom: 4px; }
.choice span, .card span { color: var(--muted); font-size: 13px; }
.choice small, .price { display: block; margin-top: 10px; color: var(--accent-ink); font-weight: 700; }
.choice[aria-pressed="true"], .choice.selected {
  border-color: var(--ink);
  outline: 2px solid var(--ink);
  outline-offset: -1px;
}

.why { display: grid; gap: 16px; }
@media (min-width: 720px) { .why { grid-template-columns: 1fr 1fr 1fr; } }
.why h3 { margin: 0 0 8px; font-size: 16px; }
.why p { margin: 0; }

ol.steps { margin: 0; padding: 0 0 0 18px; color: var(--muted); }
ol.steps li { margin: 8px 0; }

.form { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-size: 14px; font-weight: 650; }
input, textarea, select {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 12px 12px;
  border-radius: 0;
}
textarea { min-height: 120px; resize: vertical; }
.hint { font-weight: 400; color: var(--muted); font-size: 13px; }

.photos { display: flex; flex-wrap: wrap; gap: 8px; }
.photos img { width: 72px; height: 72px; object-fit: cover; border: 1px solid var(--line); }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.progress {
  display: flex;
  gap: 6px;
  margin: 8px 0 18px;
}
.progress i {
  height: 3px;
  flex: 1;
  background: var(--line);
}
.progress i.on { background: var(--ink); }

[hidden],
.hidden { display: none !important; }
.error { color: var(--danger); font-size: 14px; min-height: 1.2em; }
.ok { color: var(--ok); }

.mini-header { margin-bottom: 16px; }
.mini-header .home-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  max-width: 100%;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.mini-header img { width: 48px; height: 48px; object-fit: contain; }
.mini-header p { margin: 0; color: var(--muted); font-size: 13px; font-weight: 400; }

.success { padding: 28px 0 80px; }
.success h1 { font-size: 36px; margin-bottom: 12px; }

.nav-row { display: flex; gap: 10px; margin-top: 8px; }
.nav-row .btn-primary { flex: 1; }

.foot {
  padding: 24px 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.tg-only { display: none; }
html.in-telegram .web-only { display: none !important; }
html.in-telegram .tg-only { display: block; }
html.in-telegram .wrap { padding-bottom: 28px; }
