/* Моё расписание УЗИ — оболочка PWA (спецификация §9, макеты стр. 6–11) */

@font-face {
  font-family: "Manrope";
  src: url("/fonts/manrope.ttf") format("truetype");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --green: #1E7F4F;
  --green-soft: #E8F3EC;
  --orange: #F28C28;
  --red: #D93A3A;
  --bg: #F4F6F5;
  --splash: #B5E48C; /* салатовый экран загрузки: тот же цвет, что background_color в манифесте */
  --card: #FFFFFF;
  --note: #F3F6F4;
  --text: #14201A;
  --text-2: #56625C;
  --text-3: #9BA3A1;
  --line: #E3E7E5;
  --input-line: #CFDCD5;
  --radius: 14px;
  --tabbar-h: 66px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body[data-screen="login"],
body[data-screen="calendar"],
body[data-screen="day"] { background: var(--card); }

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

[hidden] { display: none !important; }

.ic {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- экран загрузки ---------- */

/* Продолжает системный экран загрузки Android, пока не запустился app.js:
   первый же экран приложения заменяет содержимое main. */
.boot {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: var(--splash);
}
.boot img { width: 144px; height: 144px; }

/* ---------- каркас ---------- */

main {
  max-width: 480px;
  margin: 0 auto;
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 24px);
  overflow-x: hidden;
}
body[data-screen="login"] main { padding-bottom: 0; }

.page { padding: calc(22px + var(--safe-top)) 16px 0; }
.muted { color: var(--text-2); }

.offline {
  position: sticky;
  top: 0;
  z-index: 15;
  padding: calc(6px + var(--safe-top)) 16px 6px;
  background: var(--orange);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

/* ---------- нижнее меню ---------- */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  background: var(--card);
  border-top: 1px solid #E9EEEC;
  padding: 0 var(--safe-right) max(10px, var(--safe-bottom)) var(--safe-left);
}
.tabbar a {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding-top: 11px;
  min-height: 56px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color .15s;
}
.tabbar a .ic { width: 26px; height: 26px; }
.tabbar a.active { color: var(--green); font-weight: 700; }

/* ---------- кнопки ---------- */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--radius);
  background: var(--green);
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 800;
}
.btn:disabled { opacity: .6; cursor: default; }

/* ---------- вход ---------- */

.login {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(48px + var(--safe-top)) 20px calc(20px + var(--safe-bottom));
}
.login-lock {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--green-soft);
  color: var(--green);
}
.login-lock .ic { width: 26px; height: 26px; stroke-width: 2; }
.login h1 {
  margin: 28px 0 10px;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.login-lead { margin: 0 0 32px; color: var(--text-2); font-size: 16px; line-height: 1.45; }
.login label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 700; }
.login input {
  display: block;
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid var(--input-line);
  border-radius: var(--radius);
  background: var(--card);
  font-size: 17px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.login input:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.login input[aria-invalid="true"] { border-color: var(--red); }
.login-error { min-height: 20px; margin: 8px 2px 0; color: var(--red); font-size: 14px; font-weight: 600; }
.login-https { margin-top: 12px; text-align: center; word-break: break-word; }
.login-bottom { margin-top: auto; padding-top: 24px; }
.login-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--note);
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.4;
}
.login-note .ic { width: 22px; height: 22px; color: var(--green); }

/* ---------- общие состояния: загрузка, ошибка, пусто, сообщение ---------- */

.btn-small { width: auto; min-height: 44px; padding: 0 18px; font-size: 15px; }

.sk {
  display: block;
  height: 14px;
  margin-bottom: 10px;
  border-radius: 8px;
  background: #E6EBE9;
  animation: sk-pulse 1.2s ease-in-out infinite alternate;
}
.sk.tall { height: 30px; }
.sk.w30 { width: 30%; }
.sk.w40 { width: 40%; }
.sk.w60 { width: 60%; }
.sk-light { background: rgba(255, 255, 255, .22); }
@keyframes sk-pulse { from { opacity: 1; } to { opacity: .45; } }

.error-box {
  margin: calc(96px + var(--safe-top)) 16px 0;
  padding: 24px 20px;
  background: var(--card);
  border: 1px solid #E9EEEC;
  border-radius: 20px;
  text-align: center;
}
.error-box b { display: block; margin-bottom: 6px; font-size: 17px; }
.error-box p { margin: 0 0 18px; color: var(--text-2); font-size: 14px; word-break: break-word; }
.error-box .btn { margin: 0 auto; }

.empty {
  padding: 28px 20px;
  background: var(--card);
  border-radius: 20px;
  color: var(--text-2);
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
  z-index: 20;
  width: calc(100% - 32px);
  max-width: 448px;
  transform: translateX(-50%);
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--text);
  color: #FFFFFF;
  font-size: 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
}

/* ---------- События: шапка ---------- */

.hero {
  padding: calc(18px + var(--safe-top)) 16px 20px;
  border-radius: 0 0 26px 26px;
  background: var(--green);
  color: #FFFFFF;
}
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.status { min-width: 0; }
.status-title { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; line-height: 1.25; letter-spacing: -.2px; }
.status-title .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #A9F0C2; }
.status-title .dot.bad { background: var(--orange); }
.status-sub { margin-top: 2px; color: rgba(255, 255, 255, .88); font-size: 13px; }

.notify-pill {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 10px 0 12px;
  border: 0;
  border-radius: 22px;
  background: #FFFFFF;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 700;
  transition: background .2s, color .2s;
}
.notify-pill .ic { width: 18px; height: 18px; }
.notify-pill[aria-checked="false"] { background: rgba(255, 255, 255, .15); color: #FFFFFF; }
.notify-pill:disabled { cursor: default; }

.sw {
  position: relative;
  flex: none;
  width: 34px;
  height: 20px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .42);
  transition: background .2s;
}
.sw::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #FFFFFF;
  transition: transform .2s;
}
[aria-checked="true"] > .sw { background: var(--orange); }
[aria-checked="true"] > .sw::after { transform: translateX(14px); }

.hero-date { margin-top: 22px; color: rgba(255, 255, 255, .9); font-size: 17px; font-weight: 500; }
.hero-big { display: flex; align-items: baseline; gap: 12px; margin-top: 2px; }
.hero-num { font-size: 46px; font-weight: 800; line-height: 1.1; letter-spacing: -1px; }
.hero-label { font-size: 17px; font-weight: 700; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.tile { min-width: 0; padding: 9px 5px 9px 9px; border-radius: var(--radius); background: rgba(255, 255, 255, .14); }
.tile b { display: block; font-size: 20px; font-weight: 800; line-height: 1.25; white-space: nowrap; }
.tile span {
  display: block;
  overflow: hidden;
  color: rgba(255, 255, 255, .92);
  font-size: 12.5px;
  letter-spacing: -.3px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hero-skeleton .sk-light.w40 { margin-top: 4px; }
.hero-skeleton .sk-light.tall { margin-top: 22px; }
.tile-sk { height: 54px; margin: 0; border-radius: var(--radius); }
.card-sk { height: 62px; margin-top: 8px; border-radius: 20px; background: #E9EEEC; }
.events-skeleton .feed { padding-top: 60px; }

/* ---------- События: фильтры, плашка, лента ---------- */

.chips { display: flex; gap: 8px; padding: 16px 16px 0; }
.chip {
  height: 36px;
  padding: 0 16px;
  border: 1px solid #E6EBE9;
  border-radius: 18px;
  background: var(--card);
  font-size: 15px;
  font-weight: 500;
}
.chip.active { border-color: #17221D; background: #17221D; color: #FFFFFF; font-weight: 700; }

.banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 16px 0;
  padding: 14px;
  border-radius: 20px;
  background: #FFF1E4;
}
.banner-text { flex: 1; min-width: 0; }
.banner-text b { display: block; color: #5A2A00; font-size: 15px; font-weight: 800; line-height: 1.3; }
.banner-text span { display: block; margin-top: 2px; color: #9A4A06; font-size: 14px; line-height: 1.3; }
.banner .btn { flex: none; min-height: 42px; padding: 0 14px; }

.feed { padding: 0 16px; }
.feed > .empty { margin-top: 16px; }
.group-label { padding: 16px 4px 8px; color: var(--text-2); font-size: 15px; font-weight: 700; }

.ev {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  margin-bottom: 8px;
  padding: 12px 12px 12px 14px;
  border-radius: 20px;
  background: var(--card);
  color: var(--text);
  text-decoration: none;
}
.ev-ic {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
}
.ev-ic .ic { width: 22px; height: 22px; }
.ev-ic.booked { background: var(--orange); color: #1A1300; }
.ev-ic.freed, .ev-ic.opened { background: var(--green-soft); color: var(--green); }
.ev-ic.day_closed { background: #EEF2EF; color: var(--text-2); }
.ev-body { flex: 1; min-width: 0; }
.ev-body b { display: block; font-size: 16px; font-weight: 700; }
.ev-body span { display: block; margin-top: 1px; color: var(--text-2); font-size: 15px; }
.ev-time { flex: none; color: var(--text-2); font-size: 14px; font-weight: 500; }
.ev .ev-chev { width: 18px; height: 18px; color: var(--text-3); stroke-width: 2; }

/* ---------- День ---------- */

.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: -6px 0 10px -4px;
  padding: 4px;
  color: var(--green);
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
}
.back .ic { width: 20px; height: 20px; stroke-width: 2; }
.day-title { margin: 0; font-size: 26px; font-weight: 800; line-height: 1.2; }
.day-addr { margin-top: 2px; color: var(--text-2); font-size: 15px; }
.day > .empty { margin-top: 16px; background: var(--bg); }

.strip {
  position: relative;
  display: flex;
  gap: 8px;
  margin: 16px -16px 0;
  padding: 0 16px 2px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.strip::-webkit-scrollbar { display: none; }
.sd {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 72px;
  border: 1px solid #E6EBE9;
  border-radius: 16px;
  background: var(--card);
  color: var(--text);
  text-decoration: none;
}
.sd small { color: var(--text-2); font-size: 13px; }
.sd b { font-size: 20px; font-weight: 800; line-height: 1.2; }
.sd i { display: block; overflow: hidden; width: 34px; height: 4px; margin-top: 5px; border-radius: 2px; background: var(--green-soft); }
.sd i::before { content: ""; display: block; width: var(--p); height: 100%; border-radius: 2px; background: var(--green); }
.sd.active { border-color: var(--green); background: var(--green); color: #FFFFFF; }
.sd.active small { color: rgba(255, 255, 255, .9); }
.sd.active i { background: rgba(255, 255, 255, .3); }
.sd.active i::before { background: #FFFFFF; }
.sd-sk { flex: none; width: 54px; height: 72px; margin: 0; border-radius: 16px; }

.day-sum {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 13px 14px;
  border-radius: 18px;
  background: var(--green-soft);
}
.day-sum small { display: block; color: #1C4830; font-size: 14px; font-weight: 500; }
.day-sum b { display: block; color: #0F4A2B; font-size: 22px; font-weight: 800; line-height: 1.25; }
.pill-new {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: #FDEFE2;
  color: #A04E00;
  font-size: 15px;
  font-weight: 800;
}
.pill-new::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.sum-sk { height: 72px; margin-top: 14px; border-radius: 18px; }
.slot-sk { height: 52px; margin: 6px 0 0 60px; border-radius: var(--radius); }

.slots { margin-top: 14px; }
.slot { display: grid; grid-template-columns: 60px 1fr; align-items: center; margin-bottom: 6px; }
.slot-time { color: #4D5B55; font-size: 15px; font-weight: 700; }
.slot-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 52px;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--green);
  color: #FFFFFF;
}
.slot-card b { display: block; font-size: 15px; font-weight: 800; }
.slot-card span { display: block; color: rgba(255, 255, 255, .95); font-size: 13px; font-weight: 500; }
.slot-card.new { background: var(--orange); color: #1A1300; }
.slot-card.new span { color: #3A2800; }
.slot-card.free { border: 1.5px dashed #C3CEC8; background: var(--card); color: var(--text); }
.slot-card.free span { color: var(--text-2); }
.slot-card.free.past { border-color: #E3E7E5; background: #F7F8F8; color: var(--text-3); }
.slot-card.free.past span { color: var(--text-3); }
.slot-card.new .tag-new {
  flex: none;
  padding: 3px 9px;
  border-radius: 8px;
  background: #FFFFFF;
  color: #C25A00;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
}

/* ---------- Календарь ---------- */

.cal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.cal-sub { color: var(--text-2); font-size: 14px; font-weight: 500; }
.cal-title { margin: 2px 0 0; font-size: 26px; font-weight: 800; line-height: 1.2; }
.cal-arrows { flex: none; display: flex; gap: 8px; padding-top: 2px; }
.arrow-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
}
.arrow-btn .ic { width: 20px; height: 20px; stroke-width: 2; }
.arrow-btn:disabled { border-color: #F0F2F1; color: #B9C0BC; cursor: default; }

.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-week { margin-top: 18px; padding-bottom: 6px; }
.cal-week span { color: var(--text-2); font-size: 15px; font-weight: 500; text-align: center; }
.cal[aria-busy] .cal-grid { margin-top: 18px; }
.cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 51px;
  border-radius: 12px;
  color: var(--text);
  text-align: center;
  text-decoration: none;
}
.cell b { font-size: 17px; font-weight: 800; line-height: 1.1; }
.cell small { margin-top: 2px; font-size: 11px; font-weight: 600; }
.cell.off { border: 1.5px dashed #DFE3E1; color: #BFC5C2; }
.cell.off b { font-weight: 700; }
.cell.l0 { background: #E8F3EC; }
.cell.l1 { background: #B4DEC2; }
.cell.l2 { background: #6FBF8C; }
.cell.l3 { background: var(--green); color: #FFFFFF; }
.cell.today { outline: 2px solid var(--orange); outline-offset: 2px; }
.cell.new::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
}
.cell-sk { height: 51px; margin: 0; border-radius: 12px; }

.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 18px;
  padding-left: 4px;
  color: var(--text-2);
  font-size: 13px;
}
.legend i { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border-radius: 4px; vertical-align: -1px; }
.legend .lg-free { background: #E8F3EC; }
.legend .lg-full { background: var(--green); }
.legend .lg-new { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); vertical-align: 1px; }
.cal .hint {
  margin-top: 18px;
  padding: 15px 14px;
  border-radius: 16px;
  background: var(--bg);
  color: #2F3C34;
  font-size: 14px;
}

/* ---------- Настройки ---------- */

.set-title { margin: 0; font-size: 30px; font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; }
.sec-label {
  margin: 22px 4px 8px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.set-title + .sec-label { margin-top: 18px; }
.set-card { padding: 2px 14px; border-radius: 20px; background: var(--card); }
.set-card .row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  margin: 0;
  padding: 13px 0;
  border: 0;
  border-bottom: 1px solid #EDEFEE;
  background: none;
  text-align: left;
}
.set-card .row:last-child { border-bottom: 0; }
.row-text { flex: 1; min-width: 0; }
.row-text b { display: block; font-size: 16px; font-weight: 700; }
.row-text span { display: block; margin-top: 2px; color: var(--text-2); font-size: 13.5px; letter-spacing: -.15px; word-break: break-word; }
.row-text span.err { color: #B3261E; }
.set-card .dot { flex: none; width: 9px; height: 9px; margin: 0 2px; border-radius: 50%; background: #2EA764; }
.set-card .dot.err { background: #D93025; }
.set-card .row-danger { color: #B3261E; font-size: 17px; font-weight: 800; }
.set-card .row[aria-busy="true"] { opacity: .6; }
.set-card .row:disabled { cursor: default; }
.set-card .row:disabled > * { opacity: .45; }
.set-error { margin: 8px 4px 0; color: #B3261E; font-size: 14px; font-weight: 600; line-height: 1.35; }
.set-note {
  margin: 12px 0 2px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #FFF1E4;
  color: #9A4A06;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.phone { padding: 14px 0; border-bottom: 1px solid #EDEFEE; }
.phone-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.phone-head b { font-size: 16px; font-weight: 700; }
.phone-badge {
  flex: none;
  padding: 3px 10px;
  border-radius: 999px;
  background: #EEF2EF;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
}
.phone-badge.on { background: var(--green-soft); color: var(--green); }
.phone-text, .phone-hint, .phone-msg { margin: 8px 0 0; color: var(--text-2); font-size: 14px; line-height: 1.35; word-break: break-word; }
.phone-msg { color: var(--green); font-weight: 600; }
.phone-msg.err { color: #B3261E; }
.phone-btn { width: 100%; margin-top: 12px; }
.phone-btn[aria-busy="true"] { opacity: .6; }
.phone + .set-note { margin-top: 12px; }

.set-card .sw { width: 46px; height: 28px; border-radius: 14px; background: #D5DDD9; }
.set-card .sw::after { top: 3px; left: 3px; width: 22px; height: 22px; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.set-card [aria-checked="true"] > .sw { background: var(--green); }
.set-card [aria-checked="true"] > .sw::after { transform: translateX(18px); }

.seg-wrap { padding: 14px 0; }
.seg-wrap > b { display: block; font-size: 16px; font-weight: 700; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 12px; padding: 4px; border-radius: 14px; background: #EEF2EF; }
.seg button {
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: #32403A;
  font-size: 15px;
  font-weight: 500;
}
.seg button[aria-checked="true"] { background: var(--card); color: var(--text); font-weight: 800; box-shadow: 0 1px 3px rgba(20, 32, 26, .06); }
.seg button[aria-busy="true"] { opacity: .6; }
.seg-hint { margin-top: 12px; color: var(--text-2); font-size: 14px; }

.sec-sk { margin: 22px 0 8px; }
.set-sk { height: 150px; }

/* ---------- переходы ---------- */

.screen-enter { animation: screen-enter .2s ease-out both; }
.slide-next { animation: slide-next .2s ease-out both; }
.slide-prev { animation: slide-prev .2s ease-out both; }

@keyframes screen-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes slide-next {
  from { opacity: 0; transform: translateX(32px); }
  to { opacity: 1; transform: none; }
}
@keyframes slide-prev {
  from { opacity: 0; transform: translateX(-32px); }
  to { opacity: 1; transform: none; }
}

/* ---------- плавные переходы (View Transitions, app.js → show) ----------
   Экран (main) уходит и приходит отдельно; нижнее меню остаётся на месте,
   у него плавно меняется только выбранная вкладка. html[data-nav] — направление. */
main { view-transition-name: screen; }
.tabbar { view-transition-name: tabbar; }
.boot { view-transition-name: boot; }
.boot img { view-transition-name: boot-icon; }

::view-transition-old(screen) { animation: vt-fade-out .18s ease-in both; }
::view-transition-new(screen) { animation: screen-enter .28s ease-out .06s both; }
html[data-nav="next"]::view-transition-old(screen) { animation: vt-out-left .26s ease-in both; }
html[data-nav="next"]::view-transition-new(screen) { animation: slide-next .3s ease-out both; }
html[data-nav="prev"]::view-transition-old(screen) { animation: vt-out-right .26s ease-in both; }
html[data-nav="prev"]::view-transition-new(screen) { animation: slide-prev .3s ease-out both; }

/* экран загрузки: салатовый фон растворяется, иконка чуть увеличивается и гаснет */
::view-transition-old(boot) { animation: vt-fade-out .45s ease-in .1s both; }
::view-transition-old(boot-icon) { animation: boot-icon-out .4s ease-in both; }
/* меню появляется (после загрузки или входа); при смене вкладки — обычная смена кадра */
::view-transition-new(tabbar):only-child { animation: vt-fade-in .3s ease-out .15s both; }

@keyframes vt-fade-out { to { opacity: 0; } }
@keyframes vt-fade-in { from { opacity: 0; } }
@keyframes vt-out-left { to { opacity: 0; transform: translateX(-32px); } }
@keyframes vt-out-right { to { opacity: 0; transform: translateX(32px); } }
@keyframes boot-icon-out { to { opacity: 0; transform: scale(1.3); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    transition-duration: 0s !important;
  }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) {
    animation: none !important;
  }
}
