/* Веб-апп онбординга стенда news — стиль по референсу Readly:
   тёплый крем, янтарные pill-кнопки, мягкие карточки, clay-иллюстрации. */

:root {
  --bg: #F3F0EA;
  --card: #FFFFFF;
  --ink: #201D16;
  --muted: #8D8778;
  --line: #E5E0D5;
  --amber: #F6B60D;
  --amber-press: #E3A705;
  --amber-soft: #FBE7B2;
  --coral: #E8836B;
  --blue: #8FB0DE;
  --sage: #A9BC94;
  --r-card: 24px;
  --r-pill: 999px;
  --shadow: 0 10px 30px rgba(60, 50, 20, 0.10);
  --shadow-soft: 0 4px 14px rgba(60, 50, 20, 0.07);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}

#app { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }

/* ── Шапка: прогресс + skip ── */

.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px 6px;
}
.progress { display: flex; gap: 6px; flex: 1; }
.progress .seg {
  flex: 1; height: 4px; border-radius: 2px;
  background: var(--line); transition: background .3s;
}
.progress .seg.on { background: var(--amber); }
.skip {
  border: 0; background: rgba(255,255,255,.85); color: var(--muted);
  font-size: 14px; font-weight: 600; padding: 7px 14px; border-radius: var(--r-pill);
  box-shadow: var(--shadow-soft); cursor: pointer; visibility: hidden;
}
.skip.show { visibility: visible; }

/* ── Экраны ── */

.screen {
  display: none; flex: 1; flex-direction: column; align-items: center;
  padding: 8px 24px 120px; text-align: center;
  animation: fadein .35s ease;
}
.screen.on { display: flex; }
@keyframes fadein { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.hero { width: min(62vw, 250px); margin: 4vh auto 12px; }
.hero img { width: 100%; border-radius: 28px; }
.hero.round img { border-radius: 50%; }
.hero.float img { animation: floaty 4s ease-in-out infinite; border-radius: 0; mix-blend-mode: multiply; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 8px; }
h1 .accent { color: var(--amber-press); }
.sub { color: var(--muted); font-size: 15px; max-width: 300px; margin: 0 auto 10px; }

/* Компактный экран: всё влезает в 1 экран без скролла (случайный свайп не закроет апп). */
.screen.compact { padding-top: 4px; }
.screen.compact .hero { width: min(24vw, 96px); margin: 0 auto 6px; }
.screen.compact h1 { font-size: 21px; margin-bottom: 4px; }
.screen.compact .sub { font-size: 14px; margin-bottom: 6px; }
.screen.compact .expect { margin-top: 10px; gap: 8px; }
.screen.compact .expect .e { padding: 10px 14px; font-size: 14px; }
@media (max-height: 640px) {
  .screen.compact .hero { display: none; }
}

.values { margin: 18px auto 0; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.values .v {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: 18px; padding: 12px 16px;
  box-shadow: var(--shadow-soft); font-weight: 600; font-size: 15px;
}
.values .v .ico { font-size: 20px; }

/* ── Чипсы ── */

.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.chip {
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
  font-size: 14px; font-weight: 600; padding: 8px 13px; border-radius: var(--r-pill);
  cursor: pointer; transition: all .15s; box-shadow: var(--shadow-soft);
}
.chip.sel { background: var(--amber); border-color: var(--amber); color: #241C05; transform: scale(1.04); }
.chip.custom { border-style: dashed; color: var(--muted); }
.custom-input {
  display: none; margin-top: 12px; width: 100%;
  border: 1.5px solid var(--amber); border-radius: 16px; padding: 12px 16px;
  font-size: 15px; background: var(--card); outline: none;
}
.custom-input.show { display: block; }

/* ── Канал ── */

.field {
  width: 100%; margin-top: 16px; display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 18px;
  padding: 13px 16px; box-shadow: var(--shadow-soft);
}
.field.ok { border-color: var(--amber); }
.field .at { color: var(--muted); font-weight: 700; }
.field input {
  border: 0; outline: none; flex: 1; font-size: 16px; background: transparent; color: var(--ink);
}
.hint { margin-top: 10px; font-size: 13.5px; color: var(--muted); min-height: 20px; }
.hint.err { color: var(--coral); font-weight: 600; }

.chcard {
  display: none; width: 100%; margin-top: 14px; align-items: center; gap: 14px; text-align: left;
  background: var(--card); border-radius: 20px; padding: 14px 16px; box-shadow: var(--shadow);
  animation: fadein .3s ease;
}
.chcard.show { display: flex; }
.chcard img, .chcard .ava {
  width: 52px; height: 52px; border-radius: 50%; object-fit: cover;
  background: var(--amber-soft); display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 20px; color: var(--amber-press); flex: none;
}
.chcard .t { font-weight: 700; font-size: 16px; }
.chcard .s { color: var(--muted); font-size: 13.5px; }
.chcard .check { margin-left: auto; font-size: 22px; }

/* ── Ожидание анализа ── */

.expect { width: 100%; margin-top: 16px; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.expect .e {
  display: flex; gap: 12px; align-items: center; background: var(--card);
  border-radius: 18px; padding: 12px 16px; box-shadow: var(--shadow-soft); font-size: 14.5px; font-weight: 600;
}
.pline { margin-top: 14px; font-size: 14.5px; color: var(--amber-press); font-weight: 700; }
.timer { width: 100%; margin-top: 12px; }
.timer .bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.timer .fill {
  height: 100%; width: 4%; border-radius: 4px;
  background: linear-gradient(90deg, var(--amber), #F8CE55);
  transition: width 1s linear;
}
.timer .lbl { margin-top: 8px; font-size: 13px; color: var(--muted); }

/* ── Нижняя CTA ── */

.cta-wrap {
  position: fixed; left: 0; right: 0; bottom: 0;
  padding: 12px 20px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(243,240,234,0), var(--bg) 35%);
  display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.cta {
  width: 100%; border: 0; border-radius: var(--r-pill);
  background: var(--amber); color: #241C05;
  font-size: 16.5px; font-weight: 800; padding: 16px;
  box-shadow: 0 8px 22px rgba(246, 182, 13, .35);
  cursor: pointer; transition: transform .1s, opacity .2s;
}
.cta:active { transform: scale(.98); background: var(--amber-press); }
.cta:disabled { opacity: .35; box-shadow: none; }
.cta.ghost {
  background: transparent; box-shadow: none; color: var(--muted);
  font-weight: 600; font-size: 14.5px; padding: 8px;
}

/* ── Отчёт ── */

.report { text-align: left; align-items: stretch; padding-top: 4px; }
.rhead {
  display: flex; gap: 14px; align-items: center;
  background: var(--card); border-radius: var(--r-card); padding: 18px; box-shadow: var(--shadow);
}
.rhead .ava { width: 60px; height: 60px; font-size: 24px; }
.rhead h2 { font-size: 20px; font-weight: 800; }
.rhead .s { color: var(--muted); font-size: 13.5px; }
.rsec { margin-top: 16px; }
.rsec h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--card); border-radius: 18px; padding: 14px; box-shadow: var(--shadow-soft); }
.tile .n { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.tile .l { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.voice-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.voice-chips .vc {
  background: var(--amber-soft); color: #6B5205; font-weight: 700; font-size: 13.5px;
  padding: 7px 13px; border-radius: var(--r-pill);
}
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { background: var(--card); border-radius: 16px; padding: 11px 14px; box-shadow: var(--shadow-soft); }
.bar-row .t { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; margin-bottom: 7px; }
.bar-row .t .pct { color: var(--muted); font-weight: 700; }
.bar-row .track { height: 7px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar-row .fill { height: 100%; border-radius: 4px; }
.post-card {
  background: var(--card); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow-soft);
  margin-bottom: 10px;
}
.post-card .q { font-size: 14.5px; font-style: italic; color: var(--ink); }
.post-card .m { display: flex; gap: 14px; margin-top: 9px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.post-card .rank { float: right; font-size: 18px; }
.reco {
  background: linear-gradient(135deg, #FFF7E0, #FDEFC4); border-radius: var(--r-card);
  padding: 16px 18px; box-shadow: var(--shadow-soft); font-size: 14.5px;
}
.reco b { display: block; margin-bottom: 6px; }
.footnote { margin: 18px 0 8px; text-align: center; font-size: 12px; color: var(--muted); }

/* ── Тарифы ── */

.plans { display: flex; flex-direction: column; gap: 14px; width: 100%; margin-top: 12px; text-align: left; }
.plan {
  background: var(--card); border-radius: var(--r-card); padding: 20px;
  box-shadow: var(--shadow-soft); border: 2px solid transparent; position: relative;
}
.plan.hot { border-color: var(--amber); box-shadow: var(--shadow); }
.plan .badge {
  position: absolute; top: -11px; right: 18px; background: var(--amber); color: #241C05;
  font-size: 11.5px; font-weight: 800; padding: 4px 12px; border-radius: var(--r-pill);
}
.plan h3 { font-size: 18px; font-weight: 800; }
.plan .price { font-size: 26px; font-weight: 800; margin: 6px 0 2px; letter-spacing: -0.02em; }
.plan .price small { font-size: 14px; color: var(--muted); font-weight: 600; }
.plan ul { list-style: none; margin: 10px 0 14px; }
.plan li { font-size: 14px; padding: 4px 0; color: var(--ink); }
.plan li::before { content: "✓  "; color: var(--amber-press); font-weight: 800; }
.plan .pick {
  width: 100%; border: 0; border-radius: var(--r-pill); padding: 13px;
  font-size: 15px; font-weight: 800; cursor: pointer;
  background: var(--bg); color: var(--ink);
}
.plan.hot .pick { background: var(--amber); color: #241C05; box-shadow: 0 6px 16px rgba(246,182,13,.3); }

/* ── Мокап-оплата: нижний лист ── */

.sheet-back {
  position: fixed; inset: 0; background: rgba(32, 29, 22, .45);
  display: none; align-items: flex-end; z-index: 40;
}
.sheet-back.show { display: flex; }
.sheet {
  width: 100%; background: var(--bg); border-radius: 24px 24px 0 0;
  padding: 22px 20px calc(18px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 10px; text-align: center;
  animation: sheetup .25s ease;
}
@keyframes sheetup { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet h3 { font-size: 19px; font-weight: 800; }
.sheet .sub { margin-bottom: 4px; }

/* Тосты */
.toast {
  position: fixed; bottom: 110px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 600;
  padding: 11px 18px; border-radius: var(--r-pill); opacity: 0; pointer-events: none;
  transition: all .3s; max-width: 86vw; text-align: center; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
