/* Телефон и планшет: своя раскладка.
   Ховера тут нет, поэтому всё управление внизу, цели крупные, подсказки видны сразу. */

body { font-size: 17px; }

/* ---------------------------------------------------------- кнопки */
.tag {
  min-height: 46px;
  font-size: 18px;
  padding: 10px 14px 11px;
  border-radius: 14px 8px 15px 9px / 9px 15px 8px 14px;
  transform: none;
}
.tag:nth-child(even) { transform: none; }
.tag:active { transform: translateY(1px); }

/* главный ряд: «дальше» широкая, меню рядом */
#bar {
  left: 0;
  right: 0;
  bottom: calc(62px + env(safe-area-inset-bottom, 0px));
  width: 100%;
  transform: none;
  padding: 0 10px;
  gap: 8px;
  flex-wrap: nowrap;
}
#bar .tag.primary {
  flex: 1 1 auto;
  min-height: 54px;
  font-size: 21px;
}
#bar .tag[data-act="menu"] { flex: 0 0 auto; }

#progress {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(124px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-size: 14px;
  padding: 4px 8px 5px;
  transform: none;
  background: rgba(243, 235, 215, 0.85);
  border-radius: 10px;
  z-index: 6;
}

/* меню: сетка на всю ширину, как лист бумаги поверх карты */
#menu {
  left: 10px;
  right: 10px;
  width: auto;
  transform: none;
  bottom: calc(152px + env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px;
  background: linear-gradient(176deg, var(--paper-light), var(--paper));
  border: 1.6px solid var(--edge);
  border-radius: 16px 10px 16px 10px / 10px 16px 10px 16px;
  box-shadow: 0 12px 34px rgba(40, 30, 20, 0.34);
}
#menu .tag { width: 100%; }

/* ---------------------------------------------------------- шкала времени */
#scalebar {
  height: 44px;
  width: calc(100vw - 20px);
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}
#scalebar .m { font-size: 13px; padding-bottom: 4px; }

/* ---------------------------------------------------------- прогулка */
#walkbar {
  left: 0;
  right: 0;
  width: 100%;
  transform: none;
  justify-content: space-between;
  padding: 0 12px;
  bottom: calc(124px + env(safe-area-inset-bottom, 0px));
}
#walkbar .tag.round { min-width: 88px; font-size: 26px; min-height: 54px; }
#walkbar .tag[data-act="open"] { min-height: 54px; font-size: 19px; }

/* ---------------------------------------------------------- листы снизу */
.sheet {
  top: auto;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: none;
  max-height: 82vh;
  border-radius: 18px 18px 0 0;
  transform: none;
  padding: 26px 16px calc(22px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 40px rgba(40, 30, 20, 0.34);
  animation: rise 0.22s ease-out;
}
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
.sheet.wide { width: 100%; }
.sheet::before {  /* ручка, как у шторки */
  content: "";
  top: 9px;
  left: 50%;
  width: 48px;
  height: 5px;
  border: 0;
  border-radius: 3px;
  background: rgba(59, 44, 34, 0.32);
  transform: translateX(-50%);
  box-shadow: none;
}
.sheet .close {
  top: 4px;
  right: 6px;
  width: 46px;
  height: 46px;
  font-size: 26px;
}
.sheet h2 { font-size: 27px; margin-right: 46px; }
.sheet .when { font-size: 15px; }
.quote { font-size: 17px; padding: 11px 14px 12px; }
.quote.me { margin-right: 14px; }
.quote.her { margin-left: 14px; }
.msgs { max-height: 54vh; }
.msg { font-size: 17px; }
.letter { font-size: 21px; }
.field { font-size: 19px; min-height: 48px; }
.hit { padding: 11px 8px; }
.row .tag { flex: 1 1 auto; }

/* ---------------------------------------------------------- подсказки */
/* на телефоне подсказка висит по центру над кнопками и не закрывает карту */
.hint-note {
  left: 50%;
  right: auto;
  top: auto;
  bottom: calc(184px + env(safe-area-inset-bottom, 0px));
  width: max-content;
  max-width: min(86vw, 440px);
  text-align: center;
  font-size: 16.5px;
  line-height: 1.32;
  color: var(--ink);
  padding: 11px 17px 12px;
  border-radius: 16px 9px 17px 10px / 10px 17px 9px 16px;
  box-shadow: 1px 3px 0 rgba(59, 44, 34, 0.16), 0 10px 26px rgba(40, 30, 20, 0.22);
  transform: translate(-50%, 0);
  animation: hintIn 0.34s ease-out;
}
.hint-note.gone { opacity: 0; transform: translate(-50%, 10px); }
@keyframes hintIn {
  from { opacity: 0; transform: translate(-50%, 14px) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
@media (prefers-reduced-motion: reduce) { .hint-note { animation: none; } }
/* меню раскрыто - поднимаем подсказку над ним */
body.menu-open .hint-note { bottom: calc(312px + env(safe-area-inset-bottom, 0px)); }
/* карточка события открыта - подсказка уезжает под самый верх, поверх неё ничего не лежит */
body.sheet-open .hint-note {
  top: calc(10px + env(safe-area-inset-top, 0px));
  bottom: auto;
  max-width: min(92vw, 440px);
}

/* ---------------------------------------------------------- конверт */
.envelope { padding: 40px 20px 28px; }
.envelope .to { font-size: 30px; margin-top: 76px; }
.envelope .dedication { font-size: 17px; }
.envelope .seal { width: 84px; height: 84px; font-size: 38px; }

/* на телефоне кнопка прижата к верхнему правому углу и поменьше */
#topbar { top: calc(8px + env(safe-area-inset-top, 0px)); right: calc(8px + env(safe-area-inset-right, 0px)); }
#topbar .tag { font-size: 16px; padding: 8px 12px 9px; }
