/* Ekran o'lchamiga moslashuv: telefon (asosiy), planshet (768px+) va kompyuter (1024px+).
   Telefonda ustunlar `display: contents` bilan yoyiladi va `order` orqali qulay tartibda turadi. */

/* ---------- Umumiy (telefon) ---------- */
.mini-brand, .form-aside, .chapter-list { display: none; }
.mini-brand { align-items: center; gap: 8px; text-decoration: none; color: var(--wine); font: 700 15px var(--serif); }
.mini-brand img { width: 30px; height: 31px; object-fit: contain; }

.home { display: flex; flex-direction: column; }
.home .intro { display: contents; }
.home .topbar { order: 0; }
.home .brand { order: 1; }
.home .title { order: 2; }
.home .divider { order: 3; }
.home .lead { order: 4; }
.home .visual { order: 5; }
.home .actions { order: 6; }
.home .how { order: 7; }
.home .footer { order: 8; }

.steps { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 12px; }
.steps li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; font-size: 14.5px; color: var(--ink); }
.steps li > b { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-family: var(--serif); background: radial-gradient(circle at 32% 28%, #c8475a, var(--wine) 60%); box-shadow: 0 4px 10px rgba(122, 22, 38, .25); }
.steps li > span { padding-top: 6px; }

.survey-side { display: contents; }

.result { display: flex; flex-direction: column; }
.result > .col-a, .result > .col-b { display: contents; }
.result > * > * { order: var(--o, 0); }
[data-print] { margin-top: 16px; }

/* So'rovnoma: umumiy progress va bob tugagach tugma ajralib turadi */
.q { scroll-margin-top: 12px; }
.bottom-bar .count { display: grid; gap: 5px; }
.meter { height: 5px; border-radius: 5px; background: rgba(122, 22, 38, .1); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--t)); transition: width .4s ease; }
.btn-theme.ready { animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: none; } 50% { transform: translateY(-3px); box-shadow: 0 7px 0 color-mix(in srgb, var(--t) 60%, black), 0 16px 26px color-mix(in srgb, var(--t) 40%, transparent); } }

/* Telefon: asosiy tugma birinchi ekranda ko'rinsin, shisha xiralashuvi yengilroq (tezroq aylantirish) */
@media (max-width: 767px) {
  .shell { padding-top: 10px; }
  .home .brand { margin: 0 0 10px; gap: 10px; }
  .home .brand img { width: 50px; height: 52px; }
  .home .brand .sep { height: 40px; }
  .home .brand b { font-size: 13px; }
  .home .title .script { font-size: clamp(54px, 16vw, 72px); }
  .home .title .big { font-size: clamp(36px, 11vw, 48px); }
  .home .divider { margin: 2px auto 8px; }
  .home .lead { font-size: 12px; margin-bottom: 12px; }
  .home .hero { aspect-ratio: 2 / 1; }
  .home .features { padding: 8px 4px; margin-top: -22px; }
  .home .feature { font-size: 11.5px; }
  .home .feature i { width: 36px; height: 36px; }
  .home .feature i svg { width: 20px; height: 20px; }
  .home .actions { margin-top: 16px; gap: 10px; }
  .home .actions .btn { min-height: 50px; padding: 12px 16px; }
  .chapter-head { min-height: 180px; }
  .chapter-head h2 { font-size: 24px; }
}
@media (hover: none) {
  :root { --blur: blur(12px) saturate(150%); }
}

/* Sichqoncha bilan ishlaganda (planshet klaviaturasi, kompyuter) */
@media (hover: hover) {
  .opt:hover { border-color: color-mix(in srgb, var(--t) 55%, white); }
  .btn:hover { filter: brightness(1.06); }
  .chapter-list button:not([disabled]):hover { background: rgba(255, 255, 255, .8); }
}

/* ---------- Planshet ---------- */
@media (min-width: 768px) {
  .shell { max-width: 760px; padding: 24px 28px calc(130px + env(safe-area-inset-bottom)); }
  .mini-brand { display: inline-flex; }
  .topbar { margin-bottom: 6px; }
  .home .topbar { margin-bottom: 0; }
  .lead { max-width: 520px; font-size: 14px; }
  .hero { aspect-ratio: 21 / 9; }
  .features { margin: -34px 40px 0; padding: 16px 10px; }
  .feature { font-size: 14px; }
  .actions { grid-template-columns: 1fr 1fr; }
  .actions .btn-primary, .actions .btn-gold { grid-column: 1 / -1; }
  .steps { grid-template-columns: 1fr 1fr; gap: 16px 22px; }

  .grid-fields { display: grid; grid-template-columns: 1fr 130px; gap: 0 14px; }
  .grid-fields .field:last-child { grid-column: 1 / -1; }

  .chapter-head { min-height: 300px; }
  .chapter-head h2 { font-size: 32px; }
  .opts { grid-template-columns: 1fr 1fr; }
  .q { padding: 22px; }
  .q-text { font-size: 20px; }
  .bottom-bar .inner { max-width: 704px; }

  .card { padding: 24px; }
  .ring { width: 170px; height: 170px; }
  .ring div { width: 134px; height: 134px; }
  .ring b { font-size: 44px; }
}

/* ---------- Kompyuter ---------- */
@media (min-width: 1024px) {
  .shell { max-width: 1200px; padding: 26px 40px 64px; }
  .toast { bottom: 40px; }

  /* Bosh sahifa: chapda matn va tugmalar, o'ngda rasm */
  .home { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 18px 56px; align-items: center; }
  .home .topbar, .home .how, .home .footer { grid-column: 1 / -1; }
  .home .intro { display: flex; flex-direction: column; }
  .home .brand { justify-content: flex-start; margin-top: 0; }
  .home .title, .home .lead { text-align: left; }
  .home .title .script { font-size: 96px; }
  .home .title .big { font-size: 60px; }
  .home .divider { justify-content: flex-start; margin-left: 0; }
  .home .divider::before { display: none; }
  .home .lead { margin-left: 0; max-width: 460px; }
  .home .actions { margin-top: 10px; }
  .hero { aspect-ratio: 16 / 11; }
  .home .actions .btn-ghost { font-size: 15px; padding: 12px 14px; }
  .features { margin: -40px 28px 0; }
  .home .how { margin-top: 30px; }
  .steps { grid-template-columns: repeat(4, 1fr); }

  /* Formalar: chapda rasm, o'ngda forma */
  .form-page { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; max-width: 1040px; margin: 0 auto; align-items: stretch; }
  .form-page > .card { margin-top: 0; padding: 32px; }
  .form-aside { display: block; position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); min-height: 460px; }
  .form-aside img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .form-aside::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(61, 10, 18, .88)); }
  .form-aside div { position: absolute; left: 28px; right: 28px; bottom: 26px; z-index: 1; color: #fff; }
  .form-aside .script { font: 64px/1 var(--script); display: block; }
  .form-aside b { font: 800 40px/1.05 var(--serif); letter-spacing: 1px; display: block; }
  .form-aside p { margin: 10px 0 0; opacity: .9; }

  /* So'rovnoma: chapda yopishqoq panel (bob rasmi, boblar ro'yxati, tugmalar) */
  .survey { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 32px; align-items: start; }
  .survey-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 20px; }
  .survey .chapter-head { min-height: 340px; }
  .survey .progress { display: none; }
  .chapter-list { display: grid; gap: 4px; list-style: none; margin: 0; padding: 8px; border-radius: var(--radius); background: var(--glass); border: 1px solid var(--glass-line); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
  .chapter-list button { width: 100%; display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: center; border: 0; background: none; padding: 8px 10px; border-radius: 12px; text-align: left; font: 600 14px var(--sans); color: var(--muted); cursor: pointer; }
  .chapter-list button[disabled] { cursor: default; }
  .chapter-list b { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid currentColor; font-size: 13px; }
  .chapter-list .done button { color: var(--t); }
  .chapter-list .done b { background: var(--t); border-color: var(--t); color: #fff; }
  .chapter-list .now button { background: #fff; color: var(--t); box-shadow: 0 4px 12px rgba(0, 0, 0, .06); }
  .chapter-list .now b { background: var(--t); border-color: var(--t); color: #fff; }
  .survey .pair-box { margin-top: 0; }
  .survey .bottom-bar { position: static; padding: 0; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .survey .bottom-bar .inner { max-width: none; }
  .survey-main > .q:first-child { margin-top: 0; }
  .opt { font-size: 15px; }

  /* Natijalar: chapda asosiy ko'rsatkich, o'ngda tafsilotlar */
  .result { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 0 32px; align-items: start; }
  .result > .col-a, .result > .col-b { display: flex; flex-direction: column; }
  .result > .col-a { position: sticky; top: 20px; }
  .result .col-b > :first-child { margin-top: 16px; }
  .result .col-a > .ready-banner { margin-top: 16px; }
  .couple .col-a .tabs { flex-direction: column; }
  .couple .col-a .tabs button { text-align: left; padding: 12px 16px; }
  .side { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1024px) and (max-height: 760px) {
  .survey .chapter-head { min-height: 220px; }
}
