:root {
  --ink: #0D0B68;
  --violet: #7D71FF;
  --lilac: #EDEFFF;
  --muted: #5B5A8A;
  --line: #D8D6F0;
  --bg: #FAFAFF;
  --white: #FFFFFF;
  --tabbar-h: 60px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { scroll-padding-top: calc(56px + var(--safe-top)); }
body {
  font-family: "Tutu Sans", "TutuSans", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
[hidden] { display: none !important; }

/* ---------- Шапка ---------- */
/* Шапка закреплена жёстко: sticky на iPhone иногда уезжает при прокрутке */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  padding-top: var(--safe-top);
  background: rgba(250, 250, 255, .86);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 840px; margin: 0 auto;
  height: 52px; padding: 0 20px;
  display: flex; align-items: center; gap: 10px;
}
.topbar-inner img { border-radius: 6px; }
.topbar-title { font-weight: 650; font-size: 17px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.offline-badge {
  font-size: 11px; font-weight: 650; padding: 2px 8px; border-radius: 999px;
  background: #FFF5DE; color: #5A3A00;
}

/* ---------- Страница ---------- */
.page {
  max-width: 840px;
  margin: 0 auto;
  /* сверху — место под закреплённую шапку (52px + вырез экрана) */
  padding: calc(53px + var(--safe-top) + 20px) 20px calc(var(--tabbar-h) + var(--safe-bottom) + 32px);
}
.view { animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .view { animation: none; } }

figure { margin: 0; }

/* Текст из админки: абзацы и списки */
.rich { margin: 0 0 10px; }
.rich p { margin: 0 0 8px; }
.rich ul, .rich ol { margin: 4px 0 8px; padding-left: 20px; }
.rich li { margin: 3px 0; }
.rich > :last-child { margin-bottom: 0; }
.rich h3 { font-size: 18px; line-height: 1.3; margin: 18px 0 8px; }
.rich > h3:first-child { margin-top: 4px; }
.page-text { font-size: 16px; }
.page-text p { margin-bottom: 12px; }
.hero img {
  width: 100%; height: 320px; object-fit: cover; display: block; border-radius: 12px;
  background: var(--lilac);
}
.cap { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 12px; }
.pill {
  display: inline-block; padding: 4px 10px; border: 1px solid var(--line);
  border-radius: 999px; font-size: 13px; background: var(--white);
}
.pill.active { background: var(--ink); color: var(--white); border-color: var(--ink); }
h1 { font-size: 32px; line-height: 1.2; font-weight: 650; margin: 0 0 8px; }
h2 { font-size: 22px; line-height: 1.3; margin: 0 0 10px; font-weight: 650; }
p { margin: 0 0 10px; }
.lead { color: var(--muted); font-size: 16px; }
a { color: var(--violet); text-decoration: none; }
a:hover { text-decoration: underline; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 20px 0 8px; }
.stat { background: var(--lilac); border-radius: 10px; padding: 14px 12px; }
.stat b { display: block; font-size: 20px; font-weight: 650; }
.stat span { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; margin: 14px 0;
}
.card ul { margin: 6px 0 0; padding-left: 20px; }
.card li { margin: 5px 0; }
.photo img {
  width: 100%; height: 200px; object-fit: cover; display: block; border-radius: 8px;
  background: var(--lilac);
}
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.muted { color: var(--muted); font-size: 14px; }
.section-kicker {
  margin: 8px 0 6px; color: var(--violet); font-size: 12px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
}
.footer-note { margin-top: 24px; font-size: 12px; color: var(--muted); }

.loading { padding: 80px 0; text-align: center; color: var(--muted); }

/* ---------- Обзор ---------- */
.announcement {
  margin: 0 0 16px; padding: 13px 15px; border-radius: 12px;
  border-left: 4px solid var(--violet); background: var(--lilac); font-size: 15px;
}
.announcement.warning { border-left-color: #C47500; background: #FFF5DE; color: #5A3A00; }
.announcement.good { border-left-color: #16835A; background: #EAF8F1; color: #124F3A; }
.push .btn, .install .btn { margin-top: 4px; }
.push.ok { background: #EAF8F1; border-color: #BFE7D3; padding: 12px 16px; }
.push.ok b { color: #124F3A; }
.push.ok p { margin: 2px 0 0; color: #2E6B55; }
.push.off { background: #FFF5DE; border-color: #F0DDB0; }
.steps { margin: 4px 0 0; padding-left: 20px; font-size: 15px; }
.steps li { margin: 6px 0; }
.share-ico { display: inline-block; padding: 0 5px; border: 1px solid var(--line); border-radius: 5px; font-size: 12px; color: var(--violet); }
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 45; background: rgba(13, 11, 104, .35);
  display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease;
}
.sheet {
  width: 100%; max-width: 480px; background: var(--white); border-radius: 20px 20px 0 0;
  padding: 22px 20px calc(18px + var(--safe-bottom)); text-align: center;
  animation: sheet-up .25s ease;
}
@keyframes sheet-up { from { transform: translateY(40px); } to { transform: none; } }
.sheet-icon { font-size: 36px; line-height: 1; margin-bottom: 8px; }
.sheet h3 { margin: 0 0 6px; font-size: 20px; }
.sheet p { color: var(--muted); font-size: 15px; margin: 0 0 16px; }
.sheet .btn { display: block; width: 100%; margin: 8px 0 0; }
.countdown {
  margin: 18px 0 0; padding: 16px; border-radius: 12px;
  background: var(--ink); color: var(--white);
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.countdown b { font-size: 34px; line-height: 1; font-weight: 650; }
.countdown span { color: #C9C5FF; }
.next b.label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--violet); margin-bottom: 6px; }
.next .row { display: flex; gap: 12px; align-items: baseline; }
.next .row .time { min-width: 96px; }
.next a { display: inline-block; margin-top: 8px; font-size: 14px; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 0; }
.quick a {
  display: block; padding: 14px; border-radius: 12px; background: var(--white);
  border: 1px solid var(--line); color: var(--ink);
  transition: border-color .15s, transform .15s;
}
.quick a:hover { text-decoration: none; border-color: var(--violet); }
.quick a:active { transform: scale(.98); }
.quick b { display: block; }
.quick span { font-size: 13px; color: var(--muted); }
.btn {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 650;
  padding: 10px 16px; border-radius: 10px; background: var(--violet); color: var(--white);
  min-height: 44px;
}
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); margin-top: 6px; }

/* ---------- Программа ---------- */
.daytabs {
  position: sticky; top: calc(53px + var(--safe-top)); z-index: 10;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  padding: 10px 0; margin: 0 0 8px; background: var(--bg);
}
.daytabs button {
  appearance: none; font: inherit; color: var(--ink); cursor: pointer;
  border: 1px solid var(--line); background: var(--white); border-radius: 12px;
  padding: 8px 0; display: flex; flex-direction: column; align-items: center; line-height: 1.2;
  position: relative;
}
.daytabs button b { font-size: 20px; font-weight: 650; }
.daytabs button span { font-size: 12px; color: var(--muted); }
.daytabs button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--white); }
.daytabs button[aria-selected="true"] span { color: #C9C5FF; }
.daytabs button.today::after {
  content: ""; position: absolute; top: 6px; right: 8px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--violet);
}
.dayview { display: none; }
.dayview.active { display: block; animation: fade .2s ease; }
.schedule { margin: 12px 0 22px; }
.slot {
  display: grid; grid-template-columns: 112px 1fr; gap: 14px;
  padding: 10px 8px; margin: 0 -8px; border-bottom: 1px solid var(--line); border-radius: 8px;
}
.slot:last-child { border-bottom: 0; }
.time { font-weight: 650; white-space: nowrap; }
.slot > div > b { display: block; margin-bottom: 2px; }
.slot .note { margin: 0; color: var(--muted); font-size: 14px; }
.slot.past { opacity: .5; }
.slot.now { background: var(--lilac); border-bottom-color: transparent; }
.slot.now .time::after {
  content: "сейчас"; display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px;
  background: var(--violet); color: var(--white); font-size: 11px; vertical-align: 2px;
}
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.check { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.check h3 { margin: 0 0 8px; font-size: 16px; }
.check ul { margin: 6px 0 0; padding-left: 20px; }
.check li { margin: 5px 0; }

/* ---------- Дорога ---------- */
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.fact { background: var(--lilac); border-radius: 10px; padding: 14px; }
.fact > b { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.fact .rich { margin: 0; }
.copy {
  display: block; margin-top: 8px; appearance: none; border: 0; background: none; padding: 0;
  font: inherit; font-size: 14px; color: var(--violet); cursor: pointer;
}
.links { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.links a {
  display: inline-block; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--white); font-size: 14px;
}

/* ---------- Вещи ---------- */
.weather { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.weather > div { padding: 11px; border-radius: 9px; background: var(--lilac); }
.weather b { display: block; }
.weather span { font-size: 13px; color: var(--muted); }
.weather .w-icon { font-size: 26px; line-height: 1.2; display: block; margin: 4px 0 2px; }
.weather .w-temp { display: block; font-size: 20px; font-weight: 650; color: var(--ink); }
.weather .w-desc { display: block; }
.weather .w-meta { display: block; font-size: 12px; margin-top: 4px; }
.weather .w-empty { display: block; margin-top: 6px; }
.pack-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pack-progress { font-size: 14px; font-weight: 650; color: var(--violet); white-space: nowrap; }
.check label {
  display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; cursor: pointer;
  border-top: 1px solid var(--lilac);
}
.check h3 + label { border-top: 0; }
.check input {
  appearance: none; -webkit-appearance: none; flex: none; margin: 2px 0 0;
  width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line); background: var(--white);
  display: grid; place-content: center; cursor: pointer; transition: background .15s, border-color .15s;
}
.check input::after {
  content: ""; width: 10px; height: 6px; border: solid var(--white); border-width: 0 0 2px 2px;
  transform: rotate(-45deg) translate(1px, -1px); opacity: 0;
}
.check input:checked { background: var(--violet); border-color: var(--violet); }
.check input:checked::after { opacity: 1; }
.check input:checked + * , .check label:has(input:checked) { color: var(--muted); }
.check label:has(input:checked) { text-decoration: line-through; text-decoration-color: var(--line); }
.check input:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }

/* ---------- Галерея отеля ---------- */
.back {
  display: grid; place-items: center; width: 32px; height: 32px; margin-left: -8px;
  color: var(--ink); border-radius: 8px;
}
.back svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.hero-link { position: relative; display: block; }
.hero-badge {
  position: absolute; right: 12px; bottom: 12px; padding: 6px 12px; border-radius: 999px;
  background: rgba(13, 11, 104, .78); color: var(--white); font-size: 13px; font-weight: 600;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.hero-link:hover { text-decoration: none; }
.segmented {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 16px 0 14px;
  background: var(--lilac); border-radius: 12px;
}
.segmented button {
  appearance: none; border: 0; font: inherit; font-weight: 650; font-size: 15px; cursor: pointer;
  padding: 9px 0; border-radius: 9px; background: transparent; color: var(--muted);
}
.segmented button span { font-weight: 500; opacity: .7; }
.segmented button[aria-selected="true"] { background: var(--white); color: var(--ink); box-shadow: 0 1px 3px rgba(13, 11, 104, .12); }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 0 -4px; }
@media (min-width: 700px) { .photo-grid { grid-template-columns: repeat(4, 1fr); } }
.photo-grid button {
  appearance: none; border: 0; padding: 0; cursor: zoom-in; aspect-ratio: 1; overflow: hidden;
  border-radius: 6px; background: var(--lilac);
}
.photo-grid img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.photo-grid button:active img { transform: scale(.96); }
.player {
  position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000;
}
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-title { font-size: 17px; margin: 10px 0 14px; }
.video-list { display: grid; gap: 8px; }
.video-list button {
  appearance: none; font: inherit; text-align: left; cursor: pointer; color: var(--ink);
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--white);
}
.video-list button[aria-current="true"] { border-color: var(--violet); background: var(--lilac); }
.video-list .play {
  flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--violet); color: var(--white); font-size: 13px;
}
.video-list b { display: block; font-weight: 600; }
.video-list small { color: var(--muted); }

.lightbox {
  position: fixed; inset: 0; z-index: 50; background: #000; display: flex; align-items: center; justify-content: center;
  touch-action: pan-y;
}
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; transition: opacity .15s; }
.lb-top {
  position: absolute; left: 0; right: 0; top: 0; padding: calc(10px + var(--safe-top)) 12px 10px 18px;
  display: flex; align-items: center; justify-content: space-between; color: #fff; font-size: 14px;
  background: linear-gradient(rgba(0,0,0,.55), transparent);
}
.lb-top button, .lb-nav {
  appearance: none; border: 0; cursor: pointer; color: #fff; background: rgba(255,255,255,.14);
  width: 40px; height: 40px; border-radius: 50%; font-size: 18px; line-height: 1;
}
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); font-size: 30px; }
.lb-nav.prev { left: 10px; } .lb-nav.next { right: 10px; }
@media (hover: none) { .lb-nav { display: none; } }
.lb-cap {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0; color: #fff; font-size: 14px; text-align: center;
  padding: 24px 16px calc(14px + var(--safe-bottom)); background: linear-gradient(transparent, rgba(0,0,0,.6));
}
.lb-cap:empty { display: none; }

/* ---------- Колокольчик и экран уведомлений ---------- */
.bell {
  position: relative; display: grid; place-items: center; width: 38px; height: 38px; margin-right: -8px;
  border-radius: 10px; color: var(--ink);
}
.bell svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bell[aria-current="page"] { color: var(--violet); }
.bell-count {
  position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: #E5484D; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  border: 2px solid var(--bg);
}
.inbox-list { display: grid; gap: 10px; margin-top: 8px; }
.note-card {
  position: relative; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  transition: box-shadow .3s, border-color .3s;
}
.note-card.unread { border-color: #C9C3FF; background: #FBFAFF; }
.note-card.unread::before {
  content: ""; position: absolute; top: 19px; left: -5px; width: 9px; height: 9px; border-radius: 50%; background: var(--violet);
}
.note-card.focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(125, 113, 255, .25); }
.note-card time { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.note-card b { display: block; margin-bottom: 2px; }
.note-card p { margin: 0; white-space: pre-line; }
.note-card .go { display: inline-block; margin-top: 8px; font-size: 14px; font-weight: 600; }
.inbox-empty { margin-top: 12px; }

/* ---------- Нижняя навигация ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: center;
  padding-bottom: var(--safe-bottom);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  flex: 1; max-width: 168px; height: var(--tabbar-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: 11px; font-weight: 600; text-decoration: none;
}
.tabbar svg {
  width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.tabbar a[aria-current="page"] { color: var(--violet); }
.tabbar a[aria-current="page"] svg { stroke-width: 2.2; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 14px); z-index: 40;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--white); padding: 10px 16px; border-radius: 10px; font-size: 14px;
  transition: opacity .2s, transform .2s; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 700px) {
  .stats, .two, .facts, .check-grid, .weather { grid-template-columns: 1fr; }
  .weather { grid-template-columns: 1fr 1fr; }
  .slot { grid-template-columns: 1fr; gap: 2px; }
  .hero img { height: 220px; }
  h1 { font-size: 28px; }
}
@media (max-width: 380px) {
  .quick { grid-template-columns: 1fr; }
}
@media print {
  .topbar, .tabbar, .daytabs, .install, .countdown, #nextUp, .quick, #packReset { display: none !important; }
  .view, .dayview { display: block !important; }
  body { background: #fff; }
  .page { padding: 0; }
}
