/* Наш атлас - a plain Telegram look: Telegram's own colours (light or dark,
 * whatever the theme is), the system font, grouped lists like in Telegram's
 * settings. The one showpiece is the dotted globe. Outside Telegram (local
 * work) the --fb-* values stand in for Telegram's theme. */

:root {
  --fb-bg: #f0f0f5;
  --fb-section: #ffffff;
  --fb-text: #000000;
  --fb-hint: #8e8e93;
  --fb-accent: #2481cc;
  --fb-destructive: #e53935;

  --bg: var(--tg-theme-secondary-bg-color, var(--fb-bg));
  --section: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color, var(--fb-section)));
  --text: var(--tg-theme-text-color, var(--fb-text));
  --hint: var(--tg-theme-hint-color, var(--fb-hint));
  --accent: var(--tg-theme-button-color, var(--fb-accent));
  --accent-text: var(--tg-theme-button-text-color, #ffffff);
  --head: var(--tg-theme-section-header-text-color, var(--hint));
  --destructive: var(--tg-theme-destructive-text-color, var(--fb-destructive));
  --separator: rgba(128, 128, 128, 0.24);
  --press: rgba(128, 128, 128, 0.12);

  --her: #ff4f8b;
  --him: #3478f6;

  /* the globe keeps its atlas colours in both themes, only darker at night */
  --globe-sea-1: #d8ece9;
  --globe-sea-2: #8fbdc2;
  --globe-land: #f3e4c0;
  --globe-coast: #ad8e5c;
  --globe-border: rgba(120, 90, 50, 0.35);
  --globe-grid: rgba(50, 90, 100, 0.16);
  --globe-rim: rgba(70, 45, 20, 0.35);
  --globe-home: #2a2017;

  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --fb-bg: #101012;
  --fb-section: #1c1c1e;
  --fb-text: #ffffff;
  --fb-hint: #8d8d93;
  --fb-accent: #3e88f7;
  --fb-destructive: #ff5a52;
  --separator: rgba(160, 160, 170, 0.2);
  --press: rgba(255, 255, 255, 0.08);

  --globe-sea-1: #2b5875;
  --globe-sea-2: #10263d;
  --globe-land: #4a5e50;
  --globe-coast: #9cb39a;
  --globe-border: rgba(210, 230, 210, 0.25);
  --globe-grid: rgba(160, 200, 230, 0.12);
  --globe-rim: rgba(150, 200, 255, 0.3);
  --globe-home: #f3ead9;
  color-scheme: dark;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.38 var(--font);
}

body.page-open { overflow: hidden; }

/* room for the page button that stands in for Telegram's own outside Telegram */
body.has-fallback #app { padding-bottom: 90px; }
body.has-page-back .add-head { padding-left: 64px; }

button { font: inherit; color: inherit; cursor: pointer; -webkit-user-select: none; user-select: none; }
input, textarea { font: inherit; color: inherit; }

#app {
  max-width: 600px;
  margin: 0 auto;
  padding-bottom: 32px;
}

/* --------------------------------------------------------------- hero -- */

.hero { padding: 16px 16px 0; }

.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.hero h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.count { margin: 2px 0 0; color: var(--hint); font-size: 0.94rem; }

.members { display: inline-flex; padding-top: 4px; }

.ava {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-left: -8px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: var(--c);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  font-style: normal;
}

.ava:first-child { margin-left: 0; }

/* the globe and its + and - (two fingers and a double tap zoom it too) */
.globe-zone {
  position: relative;
  width: min(86vw, 400px);
  margin: 10px auto 6px;
}

.zoom {
  position: absolute;
  right: -6px;
  bottom: 6px;
  display: grid;
  gap: 6px;
}

.zoom button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: color-mix(in srgb, var(--section) 88%, transparent);
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.zoom button:disabled { opacity: 0.35; }

/* zoomed in, the globe is a window onto the map */
.globe-zone.is-zoomed .globe { border-radius: 24px; filter: none; box-shadow: 0 10px 26px rgba(20, 40, 60, 0.25); }

.globe {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  filter: drop-shadow(0 16px 22px rgba(20, 40, 60, 0.22));
  touch-action: pan-y;
  cursor: grab;
}

.globe:active { cursor: grabbing; }

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
  margin: 0 16px;
  color: var(--hint);
  font-size: 0.8rem;
}

.legend span { display: inline-flex; align-items: center; }

.dot {
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--c);
}

.ring {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border: 2px solid var(--text);
  border-radius: 50%;
}

/* --------------------------------------------------- grouped sections -- */

.group { margin: 26px 16px 0; }

.group-title {
  margin: 0 16px 7px;
  color: var(--head);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.group-foot { margin: 7px 16px 0; color: var(--hint); font-size: 0.8rem; }

.box {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--section);
}

/* -------------------------------------------------------------- rows -- */

.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 74px;
  padding: 10px 6px 10px 12px;
  background: var(--section);
  cursor: pointer;
}

.row + .row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 76px;
  right: 0;
  height: 1px;
  background: var(--separator);
  transform: scaleY(0.6);
}

.row:active { background: linear-gradient(var(--press), var(--press)), var(--section); }

.thumb {
  position: relative;
  flex: none;
  width: 52px;
  height: 52px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--globe-sea-2);
}

.thumb img,
.thumb canvas { display: block; width: 100%; height: 100%; object-fit: cover; }

.row-main { flex: 1; min-width: 0; }

.thumb-who {
  position: absolute;
  left: 4px;
  bottom: 4px;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.row-title {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  font-size: 1.02rem;
  font-weight: 600;
  white-space: nowrap;
}

.row-title span { overflow: hidden; text-overflow: ellipsis; }

.row-sub,
.row-meta {
  overflow: hidden;
  color: var(--hint);
  font-size: 0.84rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.row-meta { display: flex; align-items: center; margin-top: 1px; }
.row-meta .sep { margin: 0 6px; opacity: 0.6; }

.flag {
  display: inline-block;
  flex: none;
  width: 20px;
  height: 15px;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.2);
}

.flag--pin { width: auto; height: auto; box-shadow: none; }

/* the weather right now, big enough to see at a glance */
.row-wx {
  display: grid;
  flex: none;
  justify-items: center;
  min-width: 44px;
  line-height: 1.1;
}

.row-wx b { font-size: 1.35rem; font-weight: 400; }
.row-wx span { font-size: 0.95rem; font-weight: 600; }

.grip {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--hint);
  touch-action: none;
  cursor: grab;
}

.grip svg { width: 20px; height: 20px; fill: currentColor; }

/* dragging: the row lifts and follows the finger, the others make room */
body.is-sorting { -webkit-user-select: none; user-select: none; }
body.is-sorting .row { transition: transform 0.2s ease; }
body.is-sorting .row::before { opacity: 0; }

.row.is-dragging {
  z-index: 5;
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
  transition: none !important;
}

.row.flash { animation: flash 1.2s ease; }

@keyframes flash {
  0%, 100% { background: var(--section); }
  25% { background: linear-gradient(rgba(36, 129, 204, 0.18), rgba(36, 129, 204, 0.18)), var(--section); }
}

.empty {
  padding: 22px 18px;
  color: var(--hint);
  text-align: center;
}

.empty b { display: block; margin-bottom: 4px; color: var(--text); font-size: 1.05rem; }

/* --------------------------------------------------------- place page -- */

.page {
  position: fixed;
  z-index: 50;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  -webkit-overflow-scrolling: touch;
}

.page.is-open { transform: none; }
.page-inner { max-width: 600px; margin: 0 auto; padding-bottom: 40px; }

.cover {
  position: relative;
  height: min(42vh, 340px);
  overflow: hidden;
  background: var(--globe-sea-2);
}

.cover canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.cover:has(#cover-globe) { background: radial-gradient(120% 90% at 50% 40%, color-mix(in srgb, var(--globe-sea-1) 35%, var(--bg)), var(--bg)); }

.gallery {
  display: flex;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.gallery::-webkit-scrollbar { display: none; }

.slide {
  flex: 0 0 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  scroll-snap-align: start;
}

.slide img { display: block; width: 100%; height: 100%; object-fit: cover; }

.dots {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
}

.dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.5); }
.dots i.is-on { background: #fff; }

.page-head { padding: 16px 16px 0; }

.page-head h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.page-head h1 .flag { width: 28px; height: 21px; border-radius: 4px; }
.page-head p { margin: 3px 0 0; color: var(--hint); font-size: 0.92rem; }
.page-head .by { display: flex; align-items: center; flex-wrap: wrap; margin-top: 8px; }

/* when: two dates, "from" and "to" */
.when { display: flex; align-items: center; gap: 8px; padding: 8px 12px; }
.when label { display: grid; flex: 1; gap: 2px; min-width: 0; color: var(--hint); font-size: 0.78rem; }

.when input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 6px 10px;
  border: 0;
  border-radius: 10px;
  background: var(--press);
  color: var(--text);
  font-size: 0.98rem;
  -webkit-appearance: none;
  appearance: none;
}

.when-dash { padding-top: 16px; color: var(--hint); }
.when-sum { margin: 0 14px 10px; color: var(--hint); font-size: 0.84rem; }
.when-clear { padding: 0; border: 0; background: none; color: var(--link, var(--accent)); font-size: 0.84rem; }

/* how to get there: three tiles; the impossible ones say why */
.ways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px; }

.way {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-height: 104px;
  padding: 10px 4px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--press);
  text-align: center;
}

.way-icon { font-size: 1.9rem; line-height: 1.15; }
.way-name { font-size: 0.9rem; font-weight: 600; }
.way-time { color: var(--hint); font-size: 0.78rem; }
.way.is-on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--section)); }
.way.is-on .way-time { color: var(--accent); font-weight: 600; }
.way:disabled { opacity: 0.45; cursor: default; }
.way:disabled .way-icon { filter: grayscale(1); }

.hint { margin: 7px 16px 0; color: var(--hint); font-size: 0.8rem; }
.hint--wide { margin: 22px 32px 0; text-align: center; }
.kicker-new { margin: 0 0 4px !important; color: var(--accent) !important; font-size: 0.8rem !important; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }

/* weather: two weeks ahead, or what each month is usually like */
.wx { padding: 12px 0; }

.seg {
  display: flex;
  margin: 0 12px 10px;
  padding: 2px;
  border-radius: 9px;
  background: var(--press);
}

.seg button {
  flex: 1;
  padding: 7px 8px;
  border: 0;
  border-radius: 7px;
  background: none;
  font-size: 0.86rem;
  font-weight: 600;
}

.seg button.is-on { background: var(--section); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14); }

.strip {
  display: flex;
  gap: 4px;
  padding: 2px 12px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.strip::-webkit-scrollbar { display: none; }

.day {
  display: grid;
  flex: none;
  justify-items: center;
  gap: 3px;
  width: 58px;
  padding: 8px 2px;
  border-radius: 12px;
  font-size: 0.82rem;
}

.day:first-child { background: var(--press); }
.day.is-trip { background: color-mix(in srgb, var(--accent) 16%, transparent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.trip-wx { margin: 0 14px 10px; font-size: 0.9rem; }
.trip-wx b { font-weight: 600; }
.day-name { color: var(--hint); font-weight: 600; }
.day.is-weekend .day-name { color: var(--destructive); }
.day-date { color: var(--hint); font-size: 0.72rem; }
.day-icon { font-size: 1.45rem; line-height: 1.2; }
.day-max { font-size: 0.98rem; font-weight: 700; }
.day-min { color: var(--hint); }
.day-rain { min-height: 1em; color: var(--accent); font-size: 0.72rem; font-weight: 600; }

/* months: a bar from the night to the day temperature, on one scale for the year */
.months {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2px;
  padding: 4px 8px 0;
}

.month {
  display: grid;
  justify-items: center;
  gap: 4px;
  font-size: 0.7rem;
}

.month-max { font-size: 0.78rem; font-weight: 700; }
.month-min { color: var(--hint); }
.month-name { color: var(--hint); font-weight: 600; }
.month.is-now .month-name { text-decoration: underline; }
.month.is-trip { border-radius: 8px; background: color-mix(in srgb, var(--accent) 16%, transparent); }
.month.is-trip .month-name { color: var(--accent); }

.bar {
  position: relative;
  width: 7px;
  height: 84px;
  border-radius: 4px;
  background: var(--press);
}

.bar i {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--lo);
  height: var(--h);
  min-height: 6px;
  border-radius: 4px;
  background: linear-gradient(180deg, #ff9f43, #4fb3ff);
}

.month-rain { color: var(--accent); font-size: 0.66rem; }
.wx-note { margin: 10px 14px 0; color: var(--hint); font-size: 0.76rem; }
.wx-empty { margin: 6px 14px; color: var(--hint); font-size: 0.86rem; }

.note-box textarea {
  display: block;
  width: 100%;
  min-height: 92px;
  padding: 12px 14px;
  border: 0;
  background: var(--section);
  line-height: 1.4;
  resize: none;
  outline: none;
}

.note-box textarea::placeholder { color: var(--hint); }
.saved { min-height: 1.2em; margin: 6px 16px 0; color: var(--hint); font-size: 0.78rem; }

.photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 3px;
}

.tile {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  border-radius: 10px;
  background: var(--press);
}

.tile > button:first-child { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; }
.tile img { display: block; width: 100%; height: 100%; object-fit: cover; }

.tile .who {
  position: absolute;
  left: 6px;
  bottom: 6px;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--c);
}

.x {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 0.7rem;
}

.add-tile {
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

.add-tile b { display: block; font-size: 1.7rem; font-weight: 400; line-height: 1; }
/* added but not saved yet */
.tile.is-new { box-shadow: inset 0 0 0 2px var(--accent); }

.tile.is-new::after {
  content: "новое";
  position: absolute;
  top: 5px;
  left: 5px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 0.62rem;
  font-weight: 700;
  pointer-events: none;
}

@keyframes pulse { 50% { opacity: 0.45; } }

.link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 8px 40px 8px 12px;
  cursor: pointer;
}

.link + .link::before,
.link + .link-form::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12px;
  right: 0;
  height: 1px;
  background: var(--separator);
  transform: scaleY(0.6);
}

.link:active { background: var(--press); }

.link img,
.link-icon {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 9px;
  object-fit: cover;
}

.link-icon { display: grid; place-items: center; background: var(--press); font-size: 1.2rem; }
.link-text { flex: 1; min-width: 0; }

.link-text b {
  display: -webkit-box;
  overflow: hidden;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.25;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.link-text small { display: flex; align-items: center; margin-top: 2px; color: var(--hint); font-size: 0.78rem; }
.link .x { top: 50%; right: 10px; margin-top: -12px; background: var(--press); color: var(--hint); }

.link-form { position: relative; display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; }

.link-form input {
  flex: 1;
  min-width: 0;
  padding: 10px 0;
  border: 0;
  background: none;
  outline: none;
}

.link-form input::placeholder { color: var(--hint); }

.link-form button {
  flex: none;
  padding: 8px 14px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 0.9rem;
  font-weight: 600;
}

.danger {
  display: block;
  width: 100%;
  padding: 14px;
  border: 0;
  background: var(--section);
  color: var(--destructive);
  font-size: 1rem;
}

/* ---------------------------------------------------------- new place -- */

.add-head { padding: 18px 16px 0; }
.add-head h1 { margin: 0; font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; }

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 16px 0;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--section);
}

.search svg { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--hint); stroke-width: 2.2; stroke-linecap: round; }

.search input {
  flex: 1;
  min-width: 0;
  padding: 12px 0;
  border: 0;
  background: none;
  font-size: 1.05rem;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.search input::placeholder { color: var(--hint); }

.result {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 8px 14px;
  border: 0;
  background: var(--section);
  text-align: left;
}

.result + .result::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50px;
  right: 0;
  height: 1px;
  background: var(--separator);
  transform: scaleY(0.6);
}

.result:active { background: var(--press); }
.result:disabled { opacity: 0.5; }
.result .flag { width: 24px; height: 18px; }
.result-text { flex: 1; min-width: 0; }
.result-text b { display: block; font-weight: 600; }
.result-text small { display: block; overflow: hidden; color: var(--hint); font-size: 0.84rem; white-space: nowrap; text-overflow: ellipsis; }
.result-km { flex: none; color: var(--hint); font-size: 0.8rem; }
.muted { padding: 14px; color: var(--hint); }

.ideas { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 16px 0; }

.ideas button {
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--section);
  font-size: 0.92rem;
}

/* -------------------------------------------------------- photo viewer -- */

.viewer {
  position: fixed;
  z-index: 60;
  inset: 0;
  background: #000;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.viewer.is-open { opacity: 1; }

.viewer-track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.viewer-track::-webkit-scrollbar { display: none; }
.viewer-slide { display: grid; flex: 0 0 100%; place-items: center; scroll-snap-align: start; }
.viewer-slide img { max-width: 100%; max-height: 100%; }

.viewer-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

/* ------------------------------------------------------- small pieces -- */

.toast {
  position: fixed;
  z-index: 70;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 576px;
  margin: 0 auto;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(30, 30, 32, 0.94);
  color: #fff;
  font-size: 0.92rem;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast span { flex: 1; }
.toast.is-in { opacity: 1; transform: none; }
.toast button { flex: none; padding: 0; border: 0; background: none; color: #6cb4ff; font-weight: 700; }
body.has-fallback .toast { bottom: calc(76px + env(safe-area-inset-bottom)); }

/* outside Telegram its bottom button and back arrow are drawn by the page */
.main-fallback {
  position: fixed;
  z-index: 40;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  max-width: 576px;
  height: 50px;
  margin: 0 auto;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 1rem;
  font-weight: 600;
}

.back-fallback {
  position: fixed;
  z-index: 55;
  top: 10px;
  left: 10px;
  display: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
}

body.has-page-back .back-fallback { display: grid; }

.locked {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 90vh;
  padding: 24px;
  text-align: center;
}

.locked h1 { margin: 12px 0 6px; font-size: 1.5rem; }
.locked p { max-width: 22rem; margin: 0; color: var(--hint); }
.locked-globe { font-size: 3.4rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
