/* Onboarding «знакомство с Мирой» on the n10 chat page (Mira:Onboarding = stories | chat | off).
   Shared by both variants:
     .onb            — the overlay shell: fixed between the header (--bar-h) and the tab bar (--tabbar-h),
                       z 45 (over the chat, under header 50 / drawer 55 / tab bar 60 / sheets 70), so the
                       shell stays usable; from 900px a dimmed backdrop with the story card in the middle.
     html.onb-open   — set by the variant's script while the overlay is up (body does not scroll).
     .onb.is-leaving — fade-out before the script removes the overlay and the chat shows.
   Variant C «Истории» (Views/Shared/_OnboardStoriesN10.cshtml + js/mira-onboard-stories.js): every rule is
   under .onb-stories. Variant B «Знакомство в чате» keeps its rules under .onb-chat in mira-onboard-chat.css.
   Prototype: mira-prototype/site/pages/onboard-c.html (scoped with tools/mira_scope_css.py; the
   prototype's body[data-state=OB-C*] became .ob[data-step="0…5"], keyframes are obs-* to stay unique). */

/* ========== shell (B and C) ========== */
html[data-edition=n10] .onb { position: fixed; z-index: 45; left: 0; right: 0; top: var(--bar-h); bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: center; }
@media (min-width: 900px) {
  html[data-edition=n10] .onb { padding: 20px var(--gutter); background: rgba(5, 7, 20, .66); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
}
@media (min-width: 1100px) { html[data-edition=n10] .onb { bottom: 0; } }
html[data-edition=n10].onb-open body { overflow: hidden; }
html[data-edition=n10] .onb.is-leaving { opacity: 0; transition: opacity .25s ease; pointer-events: none; }

/* ========== variant C «Истории»: story steps over Mira's living video ========== */
html[data-edition=n10] .onb-stories .ob { position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column;
  width: 100%; height: 100%; min-height: 0; background: #120d0a; color: var(--ink); }
@media (min-width: 900px) {
  html[data-edition=n10] .onb-stories .ob { width: 440px; max-width: 100%; height: min(860px, 100%); border-radius: 28px; border: 1px solid var(--line-2);
    box-shadow: 0 40px 120px -40px rgba(229, 180, 90, .45), 0 0 0 8px rgba(255, 255, 255, .02); }
}
@media (min-width: 1100px) { html[data-edition=n10] .onb-stories .ob { height: min(880px, 100%); } }

/* background: Mira, dimmed; darker while she listens to the choice and on the final screen */
html[data-edition=n10] .onb-stories .ob-bg { position: absolute; inset: 0; z-index: -1; }
html[data-edition=n10] .onb-stories .ob-bg .live { object-position: 50% 18%; filter: brightness(.78) saturate(.95); transition: filter .8s ease, transform 1.2s ease; }
html[data-edition=n10] .onb-stories .ob-bg::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11, 15, 36, .72) 0%, rgba(11, 15, 36, .1) 18%, rgba(11, 15, 36, .15) 30%, rgba(11, 15, 36, .78) 48%, rgba(11, 15, 36, .95) 66%, var(--bg) 100%); }
html[data-edition=n10] .onb-stories .ob-bg .sparkles { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
html[data-edition=n10] .onb-stories .ob[data-step="2"] .ob-bg .live, html[data-edition=n10] .onb-stories .ob[data-step="4"] .ob-bg .live { filter: brightness(.6); transform: scale(1.04); }
html[data-edition=n10] .onb-stories .ob[data-step="5"] .ob-bg .live { filter: brightness(.45) blur(2px); transform: scale(1.08); }

/* top: segmented progress + who */
html[data-edition=n10] .onb-stories .ob-top { position: relative; z-index: 2; padding: 10px 12px 0; }
html[data-edition=n10] .onb-stories .ob-bars { display: flex; gap: 4px; }
html[data-edition=n10] .onb-stories .ob-bars i { flex: 1; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .22); overflow: hidden; }
html[data-edition=n10] .onb-stories .ob-bars i b { display: block; height: 100%; width: 0; background: var(--gold-2); border-radius: inherit; }
html[data-edition=n10] .onb-stories .ob-bars i.done b { width: 100%; }
html[data-edition=n10] .onb-stories .ob-bars i.now b { width: 100%; animation: obs-fill .7s ease both; box-shadow: 0 0 8px rgba(246, 231, 196, .8); }
@keyframes obs-fill { from { width: 0; } }
html[data-edition=n10] .onb-stories .ob-who { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
html[data-edition=n10] .onb-stories .ob-who .mira-ava { --s: 34px; }
html[data-edition=n10] .onb-stories .ob-who-t { flex: 1; min-width: 0; line-height: 1.2; text-shadow: 0 1px 8px rgba(0, 0, 0, .5); }
html[data-edition=n10] .onb-stories .ob-who-t b { display: block; font-size: 14px; font-weight: 700; }
html[data-edition=n10] .onb-stories .ob-who-t span { display: block; font-size: 11.5px; color: var(--ink-2); }
html[data-edition=n10] .onb-stories .ob-skip { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 0; background: rgba(11, 15, 36, .4); color: var(--ink); font: 600 13px var(--sans); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
html[data-edition=n10] .onb-stories .ob-x { width: 36px; height: 36px; color: var(--ink); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
html[data-edition=n10] .onb-stories .ob-x svg { width: 18px; height: 18px; }

/* body: the step sits in the lower part */
html[data-edition=n10] .onb-stories .ob-body { position: relative; z-index: 2; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
  display: flex; flex-direction: column; padding: 0 var(--gutter) 4px; }
html[data-edition=n10] .onb-stories .ob-body::-webkit-scrollbar { display: none; }
html[data-edition=n10] .onb-stories .ob-step { margin-top: auto; padding-top: 24px; }
html[data-edition=n10] .onb-stories .ob-step > * { animation: obs-in .5s cubic-bezier(.2, .7, .2, 1) both; }
html[data-edition=n10] .onb-stories .ob-step > *:nth-child(2) { animation-delay: .06s; } html[data-edition=n10] .onb-stories .ob-step > *:nth-child(3) { animation-delay: .12s; }
html[data-edition=n10] .onb-stories .ob-step > *:nth-child(4) { animation-delay: .18s; } html[data-edition=n10] .onb-stories .ob-step > *:nth-child(n+5) { animation-delay: .24s; }
@keyframes obs-in { from { opacity: 0; transform: translateY(14px); } }

html[data-edition=n10] .onb-stories .ob-say { margin: 0 0 6px; font: italic 500 19px/1.3 var(--serif); color: var(--gold-2); text-shadow: 0 2px 14px rgba(0, 0, 0, .6); max-width: 34ch; }
html[data-edition=n10] .onb-stories .ob-q { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .03em; color: var(--ink);
  font-size: clamp(27px, 7.6vw, 34px); line-height: 1.06; margin: 0 0 16px; text-shadow: 0 2px 20px rgba(0, 0, 0, .5); outline: none; }
html[data-edition=n10] .onb-stories .ob-q label { font: inherit; color: inherit; letter-spacing: inherit; cursor: default; }
html[data-edition=n10] .onb-stories .ob-q .accent { text-transform: none; letter-spacing: normal; }
html[data-edition=n10] .onb-stories .ob-hint { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; }
html[data-edition=n10] .onb-stories .ob-hint svg { width: 14px; height: 14px; color: var(--gold); flex: none; }

/* inputs over video (background-color only: select.select keeps its arrow) */
html[data-edition=n10] .onb-stories .ob .input, html[data-edition=n10] .onb-stories .ob .select { background-color: rgba(11, 15, 36, .62); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
html[data-edition=n10] .onb-stories .ob input.ob-name { min-height: 58px; font: 600 20px/1.3 var(--serif); padding-left: 18px; }
html[data-edition=n10] .onb-stories .ob .datefield { grid-template-columns: 70px 1fr 92px; }
html[data-edition=n10] .onb-stories .ob .datefield .input, html[data-edition=n10] .onb-stories .ob .datefield .select { min-height: 56px; font-size: 17px; }
html[data-edition=n10] .onb-stories .ob .textarea { min-height: 84px; background-color: rgba(11, 15, 36, .7); }

/* card teaser after the date */
html[data-edition=n10] .onb-stories .ob-teaser { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px 14px 10px 10px; border-radius: 16px;
  border: 1px solid var(--line-2); background: linear-gradient(135deg, rgba(229, 196, 126, .16), rgba(11, 15, 36, .6)); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
html[data-edition=n10] .onb-stories .ob-teaser img { width: 46px; height: 46px; object-fit: contain; flex: none; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .5)); }
html[data-edition=n10] .onb-stories .ob-teaser b { display: block; font: 600 19px/1.15 var(--serif); color: var(--gold-2); }
html[data-edition=n10] .onb-stories .ob-teaser span { font-size: 12.5px; color: var(--ink-2); }

/* big answer cards */
html[data-edition=n10] .onb-stories .ob-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
html[data-edition=n10] .onb-stories .ob-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; width: 100%; margin: 0;
  padding: 12px 12px 11px; border-radius: 18px; border: 1px solid var(--line-2); color: var(--ink); font: inherit; letter-spacing: normal; text-transform: none;
  background: linear-gradient(180deg, rgba(27, 35, 80, .66), rgba(11, 15, 36, .72)); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  cursor: pointer; transition: transform .15s, border-color .2s, background .2s, box-shadow .2s; -webkit-tap-highlight-color: transparent; }
html[data-edition=n10] .onb-stories .ob-card:active { transform: scale(.97); }
html[data-edition=n10] .onb-stories .ob-card .ic { width: 38px; height: 38px; margin: 0 0 6px; }
html[data-edition=n10] .onb-stories .ob-card .ic svg { width: 19px; height: 19px; }
html[data-edition=n10] .onb-stories .ob-card b { font-size: 15px; font-weight: 700; line-height: 1.25; }
html[data-edition=n10] .onb-stories .ob-card span { font-size: 12.5px; line-height: 1.35; color: var(--ink-2); }
html[data-edition=n10] .onb-stories .ob-card small { margin-top: 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); opacity: .85; }
html[data-edition=n10] .onb-stories .ob-card[aria-pressed="true"] { border-color: var(--gold); background: linear-gradient(180deg, rgba(229, 196, 126, .26), rgba(27, 35, 80, .8)); box-shadow: 0 0 0 1px var(--gold), var(--gold-glow); }
html[data-edition=n10] .onb-stories .ob-card[aria-pressed="true"]::after { content: ""; position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; border-radius: 50%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231b1305' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 12px no-repeat, var(--gold-fill); }
html[data-edition=n10] .onb-stories .ob-list { display: grid; gap: 9px; }
html[data-edition=n10] .onb-stories .ob-list .ob-card { flex-direction: row; align-items: center; gap: 12px; padding: 15px 44px 15px 15px; min-height: 62px; }
html[data-edition=n10] .onb-stories .ob-list .ob-card[aria-pressed="true"]::after { top: 50%; margin-top: -11px; }
html[data-edition=n10] .onb-stories .ob-list .ob-card .emo { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(229, 196, 126, .12); color: var(--gold); }
html[data-edition=n10] .onb-stories .ob-list .ob-card .emo svg { width: 17px; height: 17px; }
html[data-edition=n10] .onb-stories .ob-list .ob-card b { font-weight: 600; font-size: 15px; }
html[data-edition=n10] .onb-stories .ob-own { border-style: dashed; }
html[data-edition=n10] .onb-stories .ob-own-box { margin-top: 9px; }

/* goal chips (multi-select, up to three) */
html[data-edition=n10] .onb-stories .ob-goals { display: flex; flex-wrap: wrap; gap: 8px; }
html[data-edition=n10] .onb-stories .ob-goal { min-height: 46px; margin: 0; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink); font: 600 14px var(--sans); letter-spacing: normal; text-transform: none;
  background: rgba(11, 15, 36, .62); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); display: inline-flex; align-items: center; gap: 7px; cursor: pointer; transition: transform .15s, background .2s; }
html[data-edition=n10] .onb-stories .ob-goal:active { transform: scale(.96); }
html[data-edition=n10] .onb-stories .ob-goal svg { width: 15px; height: 15px; }
html[data-edition=n10] .onb-stories .ob-goal:not([aria-pressed="true"]) .ob-tick { display: none; }
html[data-edition=n10] .onb-stories .ob-goal[aria-pressed="true"] { background: var(--gold-fill); color: var(--gold-ink); border-color: transparent; box-shadow: var(--gold-glow); }
html[data-edition=n10] .onb-stories .ob-goal[disabled] { opacity: .4; cursor: default; }
html[data-edition=n10] .onb-stories .ob-goal.add { border-style: dashed; color: var(--gold); }
html[data-edition=n10] .onb-stories .ob-goal.add[aria-pressed="true"] { color: var(--gold-ink); }
html[data-edition=n10] .onb-stories #obs-goal { margin-top: 10px; }
html[data-edition=n10] .onb-stories .ob-count { margin: 12px 0 0; font-size: 12.5px; color: var(--ink-2); }
html[data-edition=n10] .onb-stories .ob-count b { color: var(--gold); }

/* bottom nav + a failed save */
html[data-edition=n10] .onb-stories .ob-err { position: relative; z-index: 2; margin: 8px var(--gutter) 0; }
html[data-edition=n10] .onb-stories .ob-nav { position: relative; z-index: 2; display: flex; gap: 10px; align-items: center; padding: 10px var(--gutter) 14px; }
html[data-edition=n10] .onb-stories .ob-nav .btn-gold { flex: 1; }
html[data-edition=n10] .onb-stories .ob-back { min-height: 50px; padding: 0 16px 0 10px; }
html[data-edition=n10] .onb-stories .ob-back svg { width: 18px; height: 18px; }
html[data-edition=n10] .onb-stories .ob-back.off { visibility: hidden; }

/* final screen: «Ваш путь с Мирой» */
html[data-edition=n10] .onb-stories .ob[data-step="5"] .ob-q { font-size: clamp(26px, 7vw, 30px); margin-bottom: 12px; }
html[data-edition=n10] .onb-stories .ob[data-step="5"] .ob-step { padding-top: 14px; }
html[data-edition=n10] .onb-stories .ob-sum { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
html[data-edition=n10] .onb-stories .ob-sum .chip { min-height: 32px; max-width: 100%; font-size: 12.5px; background: rgba(11, 15, 36, .6); padding: 0 11px; }
html[data-edition=n10] .onb-stories .ob-sum .chip > span { overflow: hidden; text-overflow: ellipsis; }
html[data-edition=n10] .onb-stories .ob-sum .chip svg { width: 14px; height: 14px; color: var(--gold); flex: none; }
html[data-edition=n10] .onb-stories .ob-sum .chip [data-k="sum-topic-ic"] { display: inline-flex; }
html[data-edition=n10] .onb-stories .ob-path { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; counter-reset: p; }
html[data-edition=n10] .onb-stories .ob-path li { position: relative; display: grid; grid-template-columns: 30px 1fr; gap: 11px; margin: 0; padding: 11px 13px 11px 11px; border-radius: 18px;
  border: 1px solid var(--line); background: linear-gradient(180deg, rgba(27, 35, 80, .7), rgba(11, 15, 36, .78)); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
html[data-edition=n10] .onb-stories .ob-path li:first-child { border-color: var(--line-2); box-shadow: 0 20px 50px -30px rgba(229, 180, 90, .6); }
html[data-edition=n10] .onb-stories .ob-path li::before { counter-increment: p; content: counter(p); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font: 400 19px var(--display); color: var(--gold-ink); background: var(--gold-fill); }
html[data-edition=n10] .onb-stories .ob-path li:not(:first-child)::before { background: rgba(229, 196, 126, .12); color: var(--gold); border: 1px solid var(--line-2); }
html[data-edition=n10] .onb-stories .ob-path li > div { min-width: 0; }
html[data-edition=n10] .onb-stories .ob-path b { display: block; font-size: 14.5px; font-weight: 700; line-height: 1.3; }
html[data-edition=n10] .onb-stories .ob-path p { margin: 3px 0 0; font-size: 12.5px; line-height: 1.42; color: var(--ink-2); white-space: pre-line;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 7; overflow: hidden; }
html[data-edition=n10] .onb-stories .ob-path p em { font-style: normal; color: var(--gold-2); }
html[data-edition=n10] .onb-stories .ob-path q { display: block; margin-top: 6px; padding: 8px 11px; border-radius: 12px 12px 12px 4px; background: rgba(229, 196, 126, .1); border: 1px solid var(--line);
  font: italic 500 15.5px/1.3 var(--serif); color: var(--ink); quotes: "«" "»"; }
html[data-edition=n10] .onb-stories .ob-path img.ob-pcard { float: right; width: 40px; height: 56px; margin: 0 0 4px 10px; object-fit: contain; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .5)); }
html[data-edition=n10] .onb-stories .ob-calc { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--gold); text-decoration: none; }
html[data-edition=n10] .onb-stories .ob-calc svg { width: 14px; height: 14px; }
html[data-edition=n10] .onb-stories .ob-final-cta { position: sticky; bottom: -4px; z-index: 2; display: grid; gap: 6px; margin: 4px calc(-1 * var(--gutter)) 0; padding: 16px var(--gutter) 8px;
  background: linear-gradient(180deg, transparent, rgba(11, 15, 36, .92) 26%, var(--bg)); }
html[data-edition=n10] .onb-stories .ob-final-cta .btn-ghost { background: rgba(11, 15, 36, .55); }
html[data-edition=n10] .onb-stories .ob-final-cta .btn svg { width: 18px; height: 18px; }
html[data-edition=n10] .onb-stories .ob-final-cta .tiny { text-align: center; margin: 2px 0 0; }

/* «Собираю ваш путь…» while the answers are saved */
html[data-edition=n10] .onb-stories .ob-think { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; align-content: center; gap: 14px; text-align: center;
  background: rgba(11, 15, 36, .7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: obs-fade .3s ease both; }
html[data-edition=n10] .onb-stories .ob-think .mira-ava { --s: 84px; animation: obs-pulse 1.4s ease-in-out infinite; }
html[data-edition=n10] .onb-stories .ob-think p { margin: 0; font: italic 500 21px var(--serif); color: var(--gold-2); }
html[data-edition=n10] .onb-stories .ob-think .tiny { font-size: 12.5px; color: var(--ink-2); }
@keyframes obs-fade { from { opacity: 0; } }
@keyframes obs-pulse { 50% { box-shadow: 0 0 0 10px rgba(229, 196, 126, .08), 0 0 40px rgba(229, 180, 90, .7); } }

@media (prefers-reduced-motion: reduce) {
  html[data-edition=n10] .onb-stories .ob-step > *, html[data-edition=n10] .onb-stories .ob-bars i.now b,
  html[data-edition=n10] .onb-stories .ob-think, html[data-edition=n10] .onb-stories .ob-think .mira-ava { animation: none; }
  html[data-edition=n10] .onb-stories .ob-bg .live { transition: none; transform: none; }
  html[data-edition=n10] .onb.is-leaving { transition: none; }
}
