/* Шрифт Montserrat (SIL Open Font License) лежит в самом сайте: ничего не грузится с чужих серверов */
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/fonts/montserrat-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/fonts/montserrat-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


/* Палитра: только жёлтый и его оттенки (+ нейтральные текст/фон) */
:root {
  --primary: #FFDD2D;
  --primary-mid: #FFE44A;
  --primary-dark: #F0C800;
  --primary-soft: #FFF6C8;
  --yellow: #FFDD2D;
  --yellow2: #FFE44A;
  --yellow-dark: #F0C800;
  --yellow-soft: #FFF6C8;
  --yellow-pale: #FFF9E6;
  --yellow-warm: #FFE8A0;
  --yellow-deep: #E8C838;
  --yellow-gold: #D4A820;
  --yellow-amber: #C47A00;
  --bg: #FFFDF5;
  --bg-sky-top: #FFFDF5;
  --bg-sky-mid: #FFFDF5;
  --bg-sky-bottom: #FFF9E6;
  --card: #FFFFFF;
  --text: #000000;
  --muted: #5C5C5C;
  --gray: #5C5C5C;
  --border: #EDE4B8;
  /* бывшие mint/sand/coral → оттенки жёлтого */
  --mint: #FFF6C8;
  --sand: #FFF9E6;
  --mint-soft: #FFF6C8;
  --sand-soft: #FFF9E6;
  --coral-soft: #FFE8A0;
  --danger: #C47A00;
  --glass: rgba(255, 253, 245, 0.96);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
/* на телефоне вокруг приложения нет «серых» полос: фон страницы — цвет приложения.
   Тёмная подложка — только на планшете (см. медиа-запросы ниже) */
html,
body {
  margin: 0;
  font-family: Montserrat, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; }

#root {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  background: var(--bg);
}

/* мобильная оболочка по умолчанию */
.phone {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
  background: linear-gradient(
    180deg,
    var(--bg-sky-top) 0%,
    var(--bg-sky-mid) 50%,
    var(--bg-sky-bottom) 100%
  );
}

/* env(safe-area-inset-*) — отступы под вырез и полоску «домой» на iPhone */
.page {
  padding: calc(18px + env(safe-area-inset-top)) 18px calc(110px + env(safe-area-inset-bottom));
}

.app-toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  z-index: 80;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 12px;
  background: #1a1a1a;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  animation: toast-in 0.28s var(--ease-out);
  pointer-events: none;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.box-label-wrap {
  text-align: center;
}
.box-label,
.box-sticker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 10px auto 0;
  max-width: 280px;
  padding: 18px 16px 20px;
  background: #fff;
  color: #000;
  border: 2px solid #111;
  border-radius: 4px;
  box-sizing: border-box;
}
.box-sticker-mark {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #111;
  opacity: 0.7;
}
.box-sticker-qr,
.qr-sticker-img {
  width: 200px;
  height: 200px;
  background: #fff;
  border: none;
  border-radius: 0;
  padding: 0;
  image-rendering: pixelated;
}
.qr-sticker-placeholder {
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--primary-soft);
  padding: 12px;
}
.box-sticker-num {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #000;
  margin-top: 4px;
}
.box-sticker-room {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  color: #111;
  text-align: center;
  word-break: break-word;
}
.box-sticker-code {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #111;
}
.qr-sticker-actions {
  display: flex;
  justify-content: center;
  margin-top: 14px;
  padding: 0 36px 6px;
  box-sizing: border-box;
}
.qr-sticker-actions .btn {
  flex: 0 1 auto;
  width: auto;
  max-width: 180px;
  margin: 0;
  min-height: 34px;
  padding: 6px 14px;
  font-size: 12.5px;
  box-shadow: 0 3px 8px rgba(240, 200, 0, 0.28);
}
.qr-sticker-hint {
  margin: 0 12px 8px;
  text-align: center;
}
.qr-sticker-flash {
  animation: qr-flash 1.2s ease-in-out 2;
  outline: 2px solid var(--primary-dark);
  outline-offset: 2px;
  border-radius: 14px;
}
@keyframes qr-flash {
  0%, 100% { outline-color: var(--primary-dark); }
  50% { outline-color: transparent; }
}

@media print {
  @page {
    margin: 12mm;
  }
  body.print-qr * {
    visibility: hidden !important;
  }
  body.print-qr #qr-sticker,
  body.print-qr #qr-sticker * {
    visibility: visible !important;
  }
  body.print-qr .no-print,
  body.print-qr .qr-sticker-actions,
  body.print-qr .qr-sticker-hint,
  body.print-qr .menu,
  body.print-qr .toast,
  body.print-qr .dark {
    display: none !important;
    visibility: hidden !important;
  }
  body.print-qr #qr-sticker {
    position: fixed;
    left: 50%;
    top: 45%;
    transform: translate(-50%, -50%);
    width: 72mm;
    max-width: 72mm;
    margin: 0;
    padding: 8mm 6mm;
    background: #fff !important;
    color: #000 !important;
    border: 2px solid #000 !important;
    border-radius: 0;
    box-shadow: none;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  body.print-qr .box-sticker-qr,
  body.print-qr .qr-sticker-img {
    width: 48mm;
    height: 48mm;
  }
  body.print-qr .box-sticker-num {
    font-size: 22pt;
    color: #000 !important;
  }
  body.print-qr .box-sticker-room {
    font-size: 12pt;
    color: #000 !important;
  }
  body.print-qr .box-sticker-mark {
    font-size: 8pt;
    color: #000 !important;
    opacity: 1;
  }
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 22px;
  gap: 12px;
}
.title {
  font-size: 34px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -1.2px;
  line-height: 1.05;
}
.title-small {
  font-size: 24px;
  letter-spacing: -0.6px;
}
.subtitle {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  margin: 8px 0 0;
  line-height: 20px;
}
.page-head {
  margin-bottom: 24px;
}

/* softGlow как в theme.ts */
.hero {
  background: linear-gradient(180deg, var(--primary-mid), var(--primary-dark));
  border-radius: 28px;
  padding: 18px 12px 20px;
  margin-bottom: 14px;
  box-shadow: 0 6px 14px rgba(240, 200, 0, 0.35);
  overflow: visible;
}

.scene {
  text-align: center;
  margin-bottom: 10px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.scene svg,
.scene-model {
  display: block;
  width: min(100%, 440px);
  height: auto;
  max-height: 310px;
  margin: 0 auto;
  cursor: pointer;
  overflow: visible;
  transform-origin: center center;
  animation: scene-pulse 2.2s ease-in-out infinite;
}
.scene-label {
  font-weight: 800;
  font-size: 15px;
  color: #2b2300;
  margin-top: 18px;
  min-height: 20px;
}
.scene-hint {
  font-size: 12px;
  font-weight: 600;
  color: rgba(43, 35, 0, 0.7);
  margin-top: 4px;
}

@keyframes scene-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.045);
  }
}
@keyframes scene-label-pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 0.9;
  }
}
.scene.is-spinning svg,
.scene.is-spinning .scene-model,
.scene.is-spinning .scene-label {
  animation: none;
}
@media (prefers-reduced-motion: reduce) {
  .scene svg,
  .scene-model,
  .scene-label {
    animation: none;
  }
}

.progress-block {
  margin-top: 2px;
  padding: 0 6px;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 8px;
  gap: 12px;
}
.hero-days {
  font-size: 28px;
  font-weight: 800;
  margin: 0;
  line-height: 32px;
  color: var(--text);
}
.progress-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.55);
}
.progress-pct {
  font-size: 18px;
  font-weight: 700;
  line-height: 22px;
  margin-top: 1px;
}
.track {
  height: 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.12);
  overflow: hidden;
}
.fill {
  height: 100%;
  width: 100%;
  border-radius: 4px;
  background: #000;
  transform-origin: left center;
  transform: scaleX(0.02);
  transition: transform 0.6s var(--ease-out);
}
.progress-hint {
  font-size: 12px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.7);
  margin-top: 6px;
}

.card {
  background: var(--card);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.card-soft { background: var(--primary-soft); }

.plan-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.plan-icon {
  width: 40px;
  height: 40px;
  border-radius: 20px;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.plan-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 4px;
  line-height: 22px;
}
.plan-line {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  margin: 0;
  line-height: 20px;
}

.btn {
  border: none;
  border-radius: 999px;
  min-height: 48px;
  padding: 12px 20px;
  font-weight: 700;
  background: var(--primary);
  color: #000;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  box-shadow: 0 6px 14px rgba(240, 200, 0, 0.35);
}
.btn:disabled { opacity: 0.45; }
.btn-ghost {
  background: transparent;
  box-shadow: none;
  color: var(--muted);
}
.btn-danger {
  background: #FDE7E4;
  color: #B3261E;
  box-shadow: none;
}
.dialog-actions .btn.btn-danger {
  background: #D93025;
  color: #fff;
}
.btn-small {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 13px;
  width: auto;
  margin-top: 0;
  display: inline-flex;
}
.loading {
  text-align: center;
  padding: 18px;
  font-weight: 700;
  color: var(--muted);
}

.section {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  margin: 22px 0 14px;
}

.quiz-answer-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.quiz-answer-row:last-of-type {
  border-bottom: none;
  margin-bottom: 4px;
}
.quiz-answer-q {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 2px;
}
.quiz-answer-a {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

/* плашка даты переезда в коротком тесте */
.quiz-date-card {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  text-align: left;
  border: 2px solid var(--yellow-deep);
  border-radius: 18px;
  padding: 16px 16px 18px;
  margin: 4px 0 8px;
  background: linear-gradient(145deg, var(--primary) 0%, var(--yellow2) 55%, var(--yellow-warm) 100%);
  box-shadow: 0 8px 22px rgba(240, 200, 0, 0.42);
  color: var(--text);
  transition: transform 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
}
.quiz-date-card:active {
  transform: scale(0.985);
}
.quiz-date-card-on {
  border-color: var(--yellow-gold);
  box-shadow: 0 10px 26px rgba(212, 168, 32, 0.45);
}
.quiz-date-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.quiz-date-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.quiz-date-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--yellow-amber);
}
.quiz-date-value {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
}
.quiz-date-left {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-top: 2px;
}
.quiz-date-hint {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.tip-card {
  cursor: pointer;
  border: none;
  display: block;
}
.tip-card:active {
  transform: scale(0.98);
}
.tip-link {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

.guide-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--primary-soft);
}
.guide-step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: var(--primary);
  color: var(--text);
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.guide-step-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  font-weight: 600;
}

.tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.tile {
  width: calc(50% - 6px);
  min-height: 118px;
  border-radius: 18px;
  padding: 14px;
  border: none;
  text-align: left;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.tile-soft { background: var(--primary-soft); }
.tile-mint { background: var(--yellow-pale); }
.tile-sand { background: var(--yellow-warm); }
.tile-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}
.tile b {
  display: block;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 22px;
  margin: 0;
}
.tile span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin-top: 4px;
  line-height: 16px;
}

.opt {
  width: 100%;
  background: #fff;
  border: none;
  border-radius: 14px;
  padding: 14px 16px;
  font-weight: 600;
  font-size: 15px;
  text-align: left;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.opt-on {
  background: var(--primary);
  font-weight: 700;
}

/* fixed: меню всегда внизу видимого экрана, а не внизу длинной страницы */
.menu {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 398px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  height: 64px;
  background: var(--glass);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  z-index: 20;
  padding: 0 12px;
  backdrop-filter: blur(12px);
}
.menu button {
  border: none;
  background: transparent;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  padding: 6px;
}
.menu .open-box-icon {
  display: block;
  color: inherit;
}
.menu button.active {
  background: linear-gradient(180deg, var(--primary-mid), var(--primary-dark));
  border-radius: 14px;
  color: #000;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(240, 200, 0, 0.3);
}

.back {
  width: 40px;
  height: 40px;
  border-radius: 20px;
  border: none;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  font-size: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* затемнение и окна поверх видимого экрана (на длинной странице окно не уезжает вниз) */
.dark {
  position: fixed;
  inset: 0;
  /* мягкое тёплое затемнение вместо серого */
  background: rgba(60, 45, 0, 0.28);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  overflow-y: auto;
  z-index: 50;
  animation: fadeOverlay 0.22s ease both;
}
.popup {
  background: #fff;
  border-radius: 22px;
  padding: 18px 16px 16px;
  width: 92%;
  max-width: 360px;
  /* высокое окно (выбор размера коробки) прокручивается внутри и не уходит за край экрана */
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  animation: fadeInDown 0.28s var(--ease-out) both;
}
.dialog-popup {
  background: linear-gradient(180deg, #fffef8 0%, #ffffff 40%);
  border: 1px solid var(--border);
}
.popup h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.2;
}
.popup p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}
.error-code {
  display: inline-block;
  background: var(--primary);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  margin-bottom: 10px;
}
.error-code-soft {
  background: var(--primary-soft);
  color: #9A7B00;
  margin: 0 0 14px;
}
.dialog-error.dialog-tone-client {
  border-color: #f0d88a;
}
.dialog-error.dialog-tone-server {
  border-color: var(--yellow-amber);
  background: linear-gradient(180deg, #fff3c4 0%, #ffffff 45%);
}
.http-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.http-num {
  min-width: 52px;
  height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.3px;
}
.dialog-tone-server .http-num {
  background: var(--coral-soft);
  color: var(--danger);
}
.http-label {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.2px;
}
.dialog-title-soft {
  margin: 0 0 8px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  color: var(--muted);
  letter-spacing: 0.2px;
  text-transform: none;
}
.dialog-input {
  margin: 0 0 14px;
}
.dialog-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dialog-btn {
  margin-top: 0;
}
.dialog-actions .btn-sec {
  order: 2;
}
.dialog-actions .btn:not(.btn-sec) {
  order: 1;
}
.big-code {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 6px;
  text-align: center;
  margin: 4px 0 14px;
  font-variant-numeric: tabular-nums;
}

.check {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: #fff;
  border: none;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 8px;
  text-align: left;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.check.done { color: var(--muted); text-decoration: line-through; }
.mark {
  width: 22px;
  height: 22px;
  border-radius: 11px;
  border: 2px solid #000;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}
.check.done .mark { background: var(--primary); }

.check-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 8px;
}
.check-row .check {
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
}
.check-del {
  width: 44px;
  flex-shrink: 0;
  border: none;
  border-radius: 14px;
  background: #fff;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: var(--muted);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition:
    transform 0.14s var(--ease-out),
    background 0.2s ease;
}
.check-del:active {
  transform: scale(0.97);
  background: #ffe8e8;
  color: #b00020;
}

.dialog-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 4px;
}
.dialog-choices .btn {
  width: 100%;
}

.badge {
  font-size: 11px;
  font-weight: 700;
  background: var(--primary-soft);
  padding: 5px 9px;
  border-radius: 999px;
}
.row { display: flex; gap: 12px; align-items: center; }
.empty {
  text-align: center;
  padding: 28px;
  color: var(--muted);
  font-weight: 600;
}

/* FadeInDown как motion.tsx: delay index*45, duration 350, ease-out */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}
.fade-item {
  animation: fadeInDown 0.35s var(--ease-out) both;
}
.page-enter {
  animation: fadeInDown 0.28s var(--ease-out) both;
}

.btn,
.tile,
.opt,
.back,
.check,
.room-pick-item,
.size-pick-item,
.menu button {
  transition:
    transform 0.14s var(--ease-out),
    background 0.2s ease,
    box-shadow 0.2s ease;
}
.btn:active,
.tile:active,
.opt:active,
.back:active,
.check:active,
.room-pick-item:active,
.size-pick-item:active {
  transform: scale(0.97);
}
.menu button:active { transform: scale(0.96); }

/* остальные экраны — как карточки в Expo */
.page-top {
  margin-bottom: 14px;
}
.list-card {
  background: var(--card);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
}
.list-card.tile-mint { background: var(--yellow-pale); }
.list-card.tile-soft { background: var(--primary-soft); }
.list-card.tile-sand { background: var(--yellow-warm); }
.list-card.card-soft { background: var(--primary-soft); }
.list-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.list-top-hit {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.list-top-hit:active {
  opacity: 0.85;
}
.list-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.list-body { flex: 1; min-width: 0; }
.task-done .plan-title { text-decoration: line-through; color: var(--muted); }
.status {
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  flex-shrink: 0;
  align-self: center;
}
.st-new { background: var(--yellow-pale); color: var(--yellow-amber); }
.st-collected { background: var(--primary-soft); color: #9A7B00; }
.st-delivered { background: var(--yellow-pale); color: var(--yellow-amber); }
.st-unpacked { background: var(--primary-soft); color: var(--yellow-gold); }

/* трек статуса: тонкая линия + 3 точки */
.box-track {
  width: 100%;
  margin: 0;
}
.box-track-new {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--yellow-amber);
  letter-spacing: 0.01em;
}
.box-track.is-new.box-track-interactive .box-track-new {
  margin-bottom: 8px;
}
.box-track-rail {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
}
.box-track-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  min-width: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: default;
}
.box-track-interactive .box-track-step {
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 999px;
}
.box-track-interactive .box-track-step:active .box-track-dot {
  transform: scale(0.9);
}
.box-track-dot {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 2px solid var(--yellow-warm);
  background: #fff;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.1s ease;
}
.box-track-step.is-done .box-track-dot,
.box-track-step.is-current .box-track-dot {
  background: var(--primary);
  border-color: var(--yellow-gold);
}
.box-track-step.is-current .box-track-dot {
  border-color: var(--yellow-amber);
}
.box-track-step-label {
  font-size: 10px;
  font-weight: 600;
  line-height: 12px;
  text-align: center;
  color: var(--muted);
  max-width: 64px;
}
.box-track-step.is-done .box-track-step-label,
.box-track-step.is-current .box-track-step-label {
  color: var(--yellow-amber);
}
.box-track-seg {
  flex: 1 1 auto;
  height: 2px;
  margin: 9px 4px 0;
  border-radius: 999px;
  background: var(--yellow-pale);
  align-self: flex-start;
}
.box-track-interactive .box-track-seg {
  margin-top: 15px;
}
.box-track-seg.is-filled {
  background: var(--primary-dark);
}
.box-track-hint {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 500;
  line-height: 14px;
  color: var(--muted);
  text-align: center;
}
.box-track-compact {
  align-self: stretch;
  margin-bottom: 2px;
}
.box-track-compact .box-track-new {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
}
.box-track-compact .box-track-step {
  min-width: 0;
}
.box-track-compact.box-track-interactive .box-track-step {
  padding: 4px 6px;
}
.box-track-compact .box-track-dot {
  width: 14px;
  height: 14px;
  border-width: 1.5px;
}
.box-track-compact .box-track-seg {
  height: 1.5px;
  margin-top: 6px;
}
.box-track-compact.box-track-interactive .box-track-seg {
  margin-top: 10px;
}

/* коробки — сетка как в Expo BoxesScreen */
.boxes-search .btn { margin-top: 10px; }
.boxes-search .btn:first-child { margin-top: 0; }
.box-hit {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 10px 4px;
  border: none;
  background: transparent;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  color: var(--yellow-amber);
  line-height: 20px;
}
.box-section { margin-bottom: 14px; width: 100%; }
.box-section-title {
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 12px;
  line-height: 22px;
}
.box-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.box-tile {
  width: calc(50% - 6px);
  min-height: 120px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 8px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
}
.box-status {
  align-self: stretch;
  font-size: 10px;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--yellow-amber);
}
.box-tile-icon {
  color: var(--primary-dark);
  margin-top: 2px;
}
.box-num {
  font-size: 22px;
  font-weight: 800;
  margin-top: 6px;
  line-height: 28px;
  width: 100%;
}
.box-size {
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--primary-soft);
  font-size: 10px;
  font-weight: 600;
  max-width: 100%;
}
.box-size-auto {
  background: #fff8d6;
  border: 1px dashed var(--primary-dark);
  color: var(--muted);
}
.box-title-line {
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.box-meta {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  width: 100%;
}
.box-item-line {
  font-size: 15px;
  padding: 5px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.box-item-line.is-lost { color: var(--danger); font-weight: 700; }
.size-pick { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.size-pick-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  background: var(--bg);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.size-pick-item.on {
  border-color: var(--primary-dark);
  background: var(--primary-soft);
}
.size-pick-item b { font-size: 16px; }
.size-pick-item span { font-size: 12px; color: var(--muted); font-weight: 600; }
.empty-card {
  text-align: center;
  background: var(--card);
  border-radius: 18px;
  padding: 28px 18px;
  margin: 8px 0 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}
.avatar-lg {
  width: 72px;
  height: 72px;
  border-radius: 36px;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px auto 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.file-input {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: #fff;
}

.btn-sec {
  background: #fff;
  border: 1.5px solid var(--border);
  box-shadow: none;
}
.lead {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  margin: 0 0 14px;
}
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin: 12px 0 6px;
}
.field-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  /* 16px: меньше — и iOS Safari увеличивает страницу при вводе */
  font-size: 16px;
  font-weight: 600;
  background: #fff;
  color: var(--text);
}
.field-input:focus {
  outline: none;
  border-color: var(--primary-dark);
}
select.field-input,
.field-select {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--primary-soft);
  background-image: linear-gradient(45deg, transparent 50%, var(--yellow-amber) 50%),
    linear-gradient(135deg, var(--yellow-amber) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
}
.room-pick {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 4px;
}
.room-pick-item {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--primary-soft);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  color: var(--text);
  box-shadow: none;
}
.room-pick-item.on {
  border-color: var(--primary-dark);
  background: var(--primary);
  font-weight: 700;
}
.check-think {
  background: var(--sand-soft);
}
.profile-hero,
.family-hero {
  text-align: center;
}
.avatar-btn {
  border: none;
  background: transparent;
  padding: 0;
  margin: 4px auto 0;
  display: block;
}
.avatar-img {
  width: 88px;
  height: 88px;
  border-radius: 44px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.photo-link {
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  margin: 8px 0 4px;
  padding: 4px;
}
.invite-code {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--primary-dark);
  margin: 10px 0 6px;
  font-variant-numeric: tabular-nums;
  word-break: keep-all;
}
.invite-hint {
  text-align: center;
  margin: 0 0 12px;
  color: var(--muted);
}
.invite-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.invite-join-input {
  letter-spacing: 0.14em;
  font-weight: 700;
  font-size: 18px;
  text-align: center;
  text-transform: uppercase;
}
.offer-card {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: var(--card);
  border-radius: 18px;
  padding: 18px 16px;
  margin-bottom: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
}
.offer-card.offer-on {
  background: var(--primary-soft);
  box-shadow: 0 6px 14px rgba(240, 200, 0, 0.28);
}
.offer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.offer-head {
  min-width: 0;
  flex: 1;
}
.offer-tag {
  font-size: 12px;
  font-weight: 800;
  color: #9A7B00;
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.offer-title {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
}
.offer-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
  max-width: 140px;
  flex-shrink: 0;
}
.offer-price-range {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
  letter-spacing: -0.01em;
}
.offer-price-note {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--muted);
}
.offer-fit {
  margin: 0;
  padding-top: 2px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  font-weight: 500;
}
.offer-detail {
  padding: 18px 16px;
}
.offer-detail .plan-title {
  margin-bottom: 12px;
  line-height: 1.35;
}
.offer-detail .offer-recs-title {
  margin-top: 20px;
  margin-bottom: 10px;
}
.offer-step,
.offer-tip {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.55;
  font-weight: 500;
}
.offer-step:last-of-type,
.offer-tip:last-of-type {
  margin-bottom: 0;
}
.offer-tip { color: var(--muted); }
.offer-detail .btn {
  margin-top: 18px;
}
.photo-pick-row {
  display: flex;
  gap: 12px;
  margin: 8px 0 16px;
}
.photo-pick-card {
  flex: 1;
  border: none;
  background: var(--primary-soft);
  border-radius: 18px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 15px;
}
.photo-pick-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.photo-pick-hint {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}
.ai-preview {
  width: 100%;
  border-radius: 14px;
  max-height: 220px;
  object-fit: cover;
  margin-bottom: 8px;
}
.photo-modal .photo-pick-row { margin-top: 8px; }

.ai-draft-head { margin-top: 4px; }
.ai-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.ai-status {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #fff;
}
.ai-status-completed,
.ai-status-confirmed { color: var(--yellow-gold); }
.ai-status-pending,
.ai-status-processing { color: #9A7B00; }
.ai-status-failed { color: var(--danger); }
.ai-count {
  font-size: 14px;
  font-weight: 800;
}
.ai-summary {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 21px;
  color: var(--text);
}
.ai-item {
  background: var(--card);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
}
.ai-item.is-off { opacity: 0.5; }
.ai-item-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}
.ai-item-name {
  flex: 1;
  font-size: 16px;
  font-weight: 800;
  line-height: 22px;
}
.ai-fragile {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  background: var(--coral-soft);
  color: var(--danger);
  padding: 4px 8px;
  border-radius: 999px;
}
.ai-item-meta {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}
.ai-item-desc,
.ai-item-cond,
.ai-item-pack,
.ai-item-unc {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 19px;
  font-weight: 500;
  color: var(--text);
}
.ai-item-cond { color: var(--muted); }
.ai-item-pack { color: var(--yellow-gold); }
.ai-item-unc { color: var(--yellow-amber); }
.ai-busy-card { background: var(--yellow-pale); }
.ai-demo-note {
  margin: 10px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  line-height: 17px;
}
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* иконки Ionicons, встроенные в код */
.ion {
  display: inline-block;
  vertical-align: middle;
  fill: currentColor;
  flex-shrink: 0;
}

/* ===== Календарь плана (как PlanScreen Expo) ===== */
.plan-page { padding-bottom: 120px; }
.plan-page > .title,
.plan-page > .title-small {
  margin-bottom: 0;
}
.plan-page > .subtitle {
  margin-top: 8px;
  margin-bottom: 28px;
}
.plan-page .cal-card {
  margin-top: 8px;
}
.cal-card {
  background: #fff;
  border-radius: 18px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 14px 16px;
}
.cal-nav {
  border: none;
  min-width: 52px;
  background: var(--primary);
  border-radius: 14px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.cal-nav-label {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}
.mini-grid { display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; }
.mini-row { display: flex; gap: 2px; }
.mini-cell {
  width: 5px;
  height: 5px;
  border-radius: 2px;
  background: transparent;
}
.mini-cell.on { background: #000; opacity: 0.55; }
.cal-nav-arrow {
  display: flex;
  align-items: center;
  width: 36px;
  margin-top: 2px;
  font-weight: 700;
  font-size: 16px;
  line-height: 16px;
}
.cal-nav-arrow.right { justify-content: flex-end; }
.cal-nav-line {
  flex: 1;
  height: 2px;
  border-radius: 1px;
  background: #000;
  opacity: 0.45;
  margin: 0 2px;
}
.cal-center { flex: 1; text-align: center; }
.cal-month-big {
  font-size: 40px;
  font-weight: 800;
  line-height: 44px;
  letter-spacing: -1.2px;
}
.cal-month-meta {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 8px;
  margin-top: 4px;
}
.cal-month-circle {
  width: 30px;
  height: 30px;
  border-radius: 15px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.cal-year {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  font-weight: 700;
  line-height: 14px;
  color: var(--muted);
  text-align: left;
  margin-top: 2px;
}
.cal-grid {
  margin: 0 14px 8px;
  padding: 6px;
  border-radius: 14px;
  background: #FFF8DE;
}
.cal-wd {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  background: var(--primary);
  border-radius: 10px;
  padding: 2px 0;
}
.cal-wd-cell {
  flex: 1;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 0;
}
.cal-week { display: flex; gap: 6px; margin-bottom: 6px; }
.cal-day {
  flex: 1;
  aspect-ratio: 1;
  border: none;
  border-radius: 10px;
  background: #fff;
  padding: 5px 0 0 6px;
  text-align: left;
  position: relative;
}
.cal-day.muted { background: #fff; opacity: 0.55; }
.cal-day.has-events {
  background: var(--yellow-warm);
  box-shadow: inset 0 0 0 1px rgba(196, 122, 0, 0.22);
}
.cal-day.muted.has-events { background: var(--yellow-warm); }
.cal-day.selected {
  border: 2px solid var(--primary-dark);
  box-shadow: 0 4px 10px rgba(240, 200, 0, 0.35);
}
.cal-day.has-events.selected {
  background: var(--primary-soft);
  border-color: var(--yellow-amber);
}
.cal-num {
  font-size: 13px;
  font-weight: 700;
  line-height: 16px;
  color: #000;
}
.cal-num.out { color: var(--muted); }
.cal-num.on { color: #C9A000; }
.cal-move {
  display: inline-flex;
  width: 26px;
  height: 26px;
  border-radius: 13px;
  background: var(--primary);
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 4px 10px rgba(240, 200, 0, 0.35);
}
.cal-dot {
  position: absolute;
  bottom: 5px;
  left: 7px;
  width: 4px;
  height: 4px;
  border-radius: 2px;
  background: var(--primary);
}
.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 16px;
}
.leg {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.sw {
  width: 12px;
  height: 12px;
  border-radius: 6px;
  display: inline-block;
}
.sw.move { background: var(--primary); }
.sw.events {
  background: var(--yellow-warm);
  border: 1.5px solid var(--yellow-amber);
}
.day-head { margin: 0 0 10px; }
.day-title { font-size: 18px; font-weight: 700; }
.day-hint { font-size: 13px; color: var(--muted); margin-top: 2px; }
.untimed {
  background: var(--yellow-pale);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
}
.untimed-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}
.task-pill {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
  cursor: pointer;
}
.task-pill.done { opacity: 0.45; text-decoration: line-through; }
.timeline {
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.hour-row {
  display: flex;
  min-height: 64px;
  border-bottom: 1px solid var(--border);
}
.hour-label {
  width: 52px;
  padding: 10px 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.hour-slot {
  flex: 1;
  padding: 6px 8px 6px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.task-block {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  border-radius: 10px;
  padding: 8px 10px;
  min-height: 48px;
  color: var(--text);
  cursor: pointer;
}
.task-block.done { opacity: 0.45; }
.task-block.done .task-title { text-decoration: line-through; }
.task-time { font-size: 11px; font-weight: 600; color: var(--muted); }
.task-title { font-size: 14px; font-weight: 700; margin-top: 2px; }

.shell-main {
  min-height: 100%;
}

/* ===== Admin preview panel ===== */
.admin-body .phone,
.phone-admin {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 0 3px #1a1a1a;
}
.admin-bar {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 78px;
  z-index: 40;
  pointer-events: none;
}
.admin-toggle,
.admin-link {
  pointer-events: auto;
}
.admin-toggle {
  border: none;
  background: #1a1a1a;
  color: #FFDD2D;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.4px;
  padding: 8px 12px;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}
.admin-menu {
  margin-top: 8px;
  background: rgba(255, 253, 245, 0.98);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  max-height: 42vh;
  overflow: auto;
}
.admin-link {
  border: none;
  background: var(--primary-soft);
  border-radius: 12px;
  padding: 10px 8px;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  color: var(--text);
  text-decoration: none;
}
.admin-link.on {
  background: var(--primary);
}
.admin-link.admin-ext {
  grid-column: 1 / -1;
  background: #1a1a1a;
  color: #FFDD2D;
}

/* ============================================================
   Адаптив
   1) <640     — мобильный (телефон)
   2) 640–899  — планшет / узкое окно: шире, меню снизу
   3) ≥900     — горизонтальный десктоп: сайдбар слева
   4) ≥1100    — модель + план в два столбца
   5) ≥1280    — максимальная ширина
   ============================================================ */

/* --- планшет / узкий ландшафт --- */
@media (min-width: 640px) and (max-width: 899px) {
  /* планшет и телефон боком: светлый фон без рамки, меню закреплено внизу экрана */
  .phone {
    max-width: 760px;
  }
  .page {
    padding-left: 28px;
    padding-right: 28px;
  }
  .menu {
    max-width: 560px;
  }
  .tiles .tile {
    width: calc(33.333% - 8px);
  }
  .box-tile {
    width: calc(33.333% - 8px);
  }
  .scene {
    min-height: 260px;
  }
  .scene svg,
  .scene-model {
    width: min(100%, 420px);
    max-height: 300px;
  }
}

/* --- горизонтальный десктоп / широкий монитор --- */
@media (min-width: 900px) {
  body {
    background: linear-gradient(
      165deg,
      #ffffff 0%,
      #fffceb 42%,
      #ffe66a 100%
    );
    background-attachment: fixed;
  }
  #root {
    background: transparent;
    padding: 24px 28px;
    align-items: flex-start;
    justify-content: center;
    min-height: 0;
    height: 100dvh;
    box-sizing: border-box;
  }
  .phone {
    width: min(1240px, 100%);
    max-width: 1240px;
    min-height: 0;
    height: calc(100dvh - 48px);
    border-radius: 28px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    grid-template-rows: 1fr;
    margin: 0 auto;
    box-shadow:
      0 24px 64px rgba(0, 0, 0, 0.12),
      0 0 0 1px rgba(0, 0, 0, 0.04);
  }
  .shell-main {
    grid-column: 2;
    grid-row: 1;
    overflow: auto;
    height: 100%;
    min-height: 0;
    padding-bottom: 0;
  }
  .phone.no-menu {
    grid-template-columns: minmax(0, 1fr);
  }
  .phone.no-menu .shell-main {
    grid-column: 1;
  }
  .page {
    padding-top: 32px;
    padding-bottom: 48px;
  }
  .app-toast {
    left: calc(50% + 110px);
    bottom: 40px;
  }
  .home-side .card {
    align-self: start;
  }
  .menu {
    position: static;
    transform: none;
    max-width: none;
    grid-column: 1;
    grid-row: 1;
    height: auto;
    width: auto;
    left: auto;
    right: auto;
    bottom: auto;
    margin: 0;
    border-radius: 0;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 8px;
    padding: 28px 16px;
    background: rgba(255, 255, 255, 0.78);
    border-right: 1px solid var(--border);
    box-shadow: none;
    backdrop-filter: blur(16px);
  }
  .menu button {
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    font-size: 14px;
    padding: 14px 16px;
    border-radius: 16px;
  }
  .menu button.active {
    border-radius: 16px;
  }
  .page {
    padding: 32px 40px 48px;
    max-width: 1040px;
  }
  .page-home {
    max-width: none;
  }
  .title {
    font-size: 40px;
  }
  .title-small {
    font-size: 28px;
  }
  .home-top {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 20px;
  }
  .home-top > div {
    min-width: 0;
  }
  .home-side .card {
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .hero {
    padding: 22px 18px 24px;
  }
  .scene {
    min-height: 300px;
  }
  .scene svg,
  .scene-model {
    width: min(100%, 480px);
    max-height: 340px;
  }
  .tiles {
    gap: 14px;
  }
  .tiles .tile {
    width: calc(33.333% - 10px);
    min-height: 136px;
    padding: 18px;
  }
  .box-grid {
    gap: 14px;
  }
  .box-tile {
    width: calc(25% - 11px);
    min-height: 148px;
  }
  .list-card,
  .offer-card,
  .check,
  .tip-card {
    max-width: none;
  }
  .photo-pick-row {
    max-width: 520px;
  }
  .plan-page {
    max-width: 900px;
  }
  .cal-card {
    max-width: none;
  }
  .cal-day {
    min-height: 52px;
  }
  .timeline {
    max-width: none;
  }
  .dark {
    padding: 48px;
    align-items: center;
  }
  .popup,
  .dialog-popup {
    max-width: 420px;
    width: min(420px, 92%);
  }
  .admin-bar {
    left: 240px;
    right: 28px;
    bottom: 28px;
  }
  .admin-menu {
    max-width: 480px;
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/* десктоп шире: модель | план рядом */
@media (min-width: 1100px) {
  .home-top {
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
    gap: 22px;
  }
  .home-side {
    align-self: start;
  }
  .hero {
    height: 100%;
  }
  .scene {
    min-height: 340px;
  }
  .scene svg,
  .scene-model {
    width: min(100%, 520px);
    max-height: 360px;
  }
}

@media (min-width: 1280px) {
  #root {
    padding: 28px 36px 36px;
  }
  .phone {
    width: min(1360px, 100%);
    max-width: 1360px;
    grid-template-columns: 240px minmax(0, 1fr);
  }
  .page {
    padding: 36px 48px 56px;
    max-width: 1120px;
  }
  .tiles .tile {
    min-height: 148px;
  }
  .box-tile {
    width: calc(20% - 12px);
  }
  .scene {
    min-height: 380px;
  }
  .scene svg,
  .scene-model {
    width: min(100%, 560px);
    max-height: 400px;
  }
}

/* телефон в ландшафте — компактнее */
@media (max-width: 899px) and (orientation: landscape) and (max-height: 500px) {
  .page {
    padding-top: 12px;
    padding-bottom: 80px;
  }
  .hero {
    padding: 10px 10px 12px;
  }
  .scene {
    min-height: 160px;
  }
  .scene svg,
  .scene-model {
    max-height: 150px;
  }
  .menu {
    height: 56px;
    bottom: 8px;
  }
}

/* количество коробок в каждом статусе (экран «Прогресс») */
.status-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 10px;
}
.status-cell {
  background: var(--primary-soft);
  border-radius: 12px;
  padding: 8px 4px;
  text-align: center;
}
.status-cell b {
  display: block;
  font-size: 18px;
  font-weight: 800;
}
.status-cell span {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 2px;
  word-break: break-word;
}
/* пять шагов трека статуса помещаются на узком телефоне */
.box-track-interactive .box-track-step {
  padding: 6px 2px;
}
.box-track-step-label {
  max-width: 62px;
}
@media (max-width: 360px) {
  .status-grid { grid-template-columns: repeat(3, 1fr); }
  .box-track-step-label { font-size: 9px; max-width: 54px; }
  .menu button { font-size: 9px; padding: 6px 2px; }
}
.qr-sticker-actions {
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 8px 6px;
}

/* текущий шаг трека статуса заметно отличается от пройденных */
.box-track-step.is-current .box-track-dot {
  background: #000;
  border-color: #000;
  box-shadow: 0 0 0 4px var(--primary);
}
.box-track-step.is-current .box-track-step-label {
  color: #000;
  font-weight: 800;
}
.box-track-seg.is-filled {
  height: 3px;
}
/* длинные названия вещей переносятся, кнопки не вытесняются */
.box-item-line > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.box-item-line .row {
  flex-shrink: 0;
}
.dialog-choices {
  margin-bottom: 12px;
}
.photo-link {
  padding: 10px 12px;
}
.field-error {
  border-color: #D93025 !important;
}
.cal-dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: var(--yellow-amber);
}
.cal-num.on {
  color: #000;
}
.room-card-plain {
  background: var(--card);
}
@media (max-width: 360px) {
  .offer-top {
    flex-direction: column;
    gap: 6px;
  }
  .offer-price {
    align-items: flex-start;
    text-align: left;
    max-width: none;
  }
}
/* 5 шагов статуса на самых узких экранах (320–360 px) */
@media (max-width: 360px) {
  .box-track-interactive .box-track-step { padding: 4px 0; }
  .box-track-step-label { font-size: 8.5px; max-width: 48px; letter-spacing: -0.2px; }
  .box-track-seg { margin-left: 1px; margin-right: 1px; }
  .box-track-dot { width: 18px; height: 18px; }
}

/* дни раньше завтрашнего при выборе даты переезда в тесте */
.cal-day.cal-day-off {
  opacity: 0.3;
  cursor: not-allowed;
  background: #fff;
}

/* стартовый экран */
.welcome {
  text-align: center;
}
.welcome .list-card {
  text-align: left;
}
.welcome-logo {
  display: block;
  margin: 24px auto 14px;
  border-radius: 22px;
  box-shadow: 0 8px 20px rgba(240, 200, 0, 0.35);
}

/* живой сканер QR поверх приложения */
.scanner {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: #111;
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  gap: 12px;
}
.scanner-top b { display: block; font-size: 18px; }
.scanner-top span { font-size: 13px; opacity: 0.75; }
.scanner-view {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 20px;
  overflow: hidden;
  background: #000;
}
.scanner-view video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scanner-frame {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(64vw, 280px);
  height: min(64vw, 280px);
  transform: translate(-50%, -50%);
  border: 3px solid var(--primary);
  border-radius: 18px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
}
.scanner-msg {
  min-height: 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-align: center;
}
.scanner-actions .btn { margin-top: 8px; }
.scanner-actions .btn-sec { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.4); }
@media (min-width: 900px) {
  .scanner { padding: 32px max(32px, calc(50% - 360px)); }
}

/* несколько фото для ИИ */
.ai-thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 10px 0 4px;
}
.ai-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--primary-soft);
}
.ai-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ai-thumb-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 18px;
  line-height: 28px;
  padding: 0;
}

/* «− 3 +» */
.qty {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 2px;
}
.qty b {
  min-width: 24px;
  text-align: center;
  font-size: 14px;
}
.qty-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 16px;
  background: #fff;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  padding: 0;
}
.qty-btn:disabled { opacity: 0.35; }

/* строка вещи: название во всю ширину, кнопки под ним */
.box-item-line {
  flex-wrap: wrap;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.box-item-line:last-of-type { border-bottom: none; }
.box-item-line > span:first-child {
  flex: 1 1 100%;
  font-weight: 600;
}
.box-item-line > .row {
  flex: 1 1 100%;
  justify-content: flex-start;
  flex-wrap: wrap;
}
