:root {
  --blue: #1d6fe0;
  --blue-bright: #3b8bff;
  --white: #ffffff;
  --text: #0b1220;
  --muted: #5b6b82;
  --surface: #ffffff;
  --line: #dbe6f5;
  --shadow: 0 8px 24px rgba(29, 111, 224, 0.08);
  --bg: #f5f9ff;
}

body {
  background: var(--bg);
  color: var(--text);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 110px;
}

/* ===== RANG PALITRASI: OQ / QORA / YASHIL ===== */
:root {
  --blue: #16a34a;
  --blue-bright: #22c55e;
}

html[data-theme="dark"] {
  --blue: #22c55e;
  --blue-bright: #4ade80;
}

.page {
  position: relative;
  z-index: 1;
}

.page section:not(.hero--page) {
  max-width: 1180px;
  margin: 0 auto;
  padding: 64px 20px;
}

.section__head {
  max-width: 640px;
  margin-bottom: 28px;
}

.section__kicker {
  margin: 0 0 8px;
  color: var(--blue);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.section__head h2 {
  margin: 0 0 10px;
  font-size: clamp(1.5rem, 4vw, 2.4rem);
}

.section__head p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.login-btn {
  width: auto;
  min-width: 0;
  padding: 0 14px;
  color: var(--text);
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  transition: color 0.2s ease;
}

.login-btn:hover {
  color: var(--white);
}

.hero.hero--page {
  position: relative;
  z-index: 1;
  max-width: none;
  margin: 10px 12px 0;
  padding: 0;
  min-height: min(78vh, 620px);
  border-radius: 28px;
  overflow: hidden;
  display: grid;
  place-items: center;
  text-align: center;
  animation: none;
}

.hero__media,
.hero__overlay {
  position: absolute;
  inset: 0;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
  animation: kenburns 16s ease-in-out infinite alternate;
}

.hero__overlay {
  background:
    linear-gradient(180deg, rgba(10, 10, 10, 0.35), rgba(10, 10, 10, 0.72)),
    linear-gradient(90deg, color-mix(in srgb, var(--blue) 28%, transparent), transparent 55%);
}

.hero__content {
  position: relative;
  z-index: 1;
  width: min(820px, 100%);
  padding: 72px 20px 48px;
  animation: fadeUp 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero--page .hero__kicker {
  color: #86efac;
}

.hero--page h1 {
  color: var(--white);
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  animation: titleIn 0.9s 0.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero--page .hero__lead {
  color: rgba(255, 255, 255, 0.88);
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  color: var(--white);
  background: linear-gradient(180deg, var(--blue-bright), var(--blue));
  box-shadow: 0 10px 22px color-mix(in srgb, var(--blue) 40%, transparent);
}

.btn--primary:hover {
  box-shadow: 0 14px 28px color-mix(in srgb, var(--blue) 50%, transparent);
}

.btn--ghost {
  color: var(--text);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
}

.btn--ghost:hover {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 8%, var(--surface));
}

.btn--on-photo {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.btn--on-photo:hover {
  background: rgba(255, 255, 255, 0.2);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 720px;
  margin: 36px auto 0;
}

.stat {
  padding: 16px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background: rgba(10, 10, 10, 0.35);
  backdrop-filter: blur(12px);
  animation: fadeCard 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.stat:nth-child(2) {
  animation-delay: 0.08s;
}

.stat:nth-child(3) {
  animation-delay: 0.16s;
}

.stat strong {
  display: block;
  font-size: 1.4rem;
  color: #86efac;
}

.stat span {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.82rem;
}

.split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
  align-items: stretch;
}

.split__photo {
  overflow: hidden;
  border-radius: 22px;
  min-height: 240px;
}

.split__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: kenburns 14s ease-in-out infinite alternate;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: fadeCard 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px color-mix(in srgb, var(--blue) 14%, transparent);
}

.card__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--blue) 14%, transparent);
  color: var(--blue);
  font-weight: 800;
  font-size: 1.25rem;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.12rem;
}

.card p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.95rem;
}

.mock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.mock {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 12px 12px 16px;
}

.mock__photo {
  overflow: hidden;
  height: 150px;
  margin: 0 0 14px;
  border-radius: 16px;
}

.mock__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s ease;
}

.mock:hover .mock__photo img {
  transform: scale(1.08);
}

.mock__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue) 12%, transparent);
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 700;
}

.mock .btn {
  margin-top: auto;
  width: 100%;
}

.lock-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.course-hero {
  overflow: hidden;
  height: 220px;
  margin-bottom: 16px;
  border-radius: 22px;
}

.course-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: kenburns 18s ease-in-out infinite alternate;
}

.cta-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 20px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, color-mix(in srgb, var(--blue) 16%, transparent), var(--surface));
}

.cta-banner h3 {
  margin: 0 0 6px;
}

.cta-banner p {
  margin: 0;
  color: var(--muted);
}

@keyframes fadeCard {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes kenburns {
  from {
    transform: scale(1.05) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.16) translate3d(-2%, -1.5%, 0);
  }
}

@keyframes titleIn {
  from {
    opacity: 0;
    letter-spacing: 0.18em;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    letter-spacing: 0.04em;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  html {
    scroll-padding-top: 92px;
  }

  .header__inner {
    margin: 8px 10px 0;
    padding: 8px 10px;
    gap: 8px;
    justify-content: space-between;
  }

  .header__actions {
    margin-left: auto;
  }

  .nav {
    margin-left: 0;
    z-index: 60;
  }

  .logo__img {
    width: 42px;
    height: 42px;
  }

  .theme-toggle__track {
    width: 58px;
    height: 32px;
  }

  html[data-theme="dark"] .theme-toggle__thumb {
    transform: translateX(24px);
  }

  .hero.hero--page {
    margin: 8px 10px 0;
    min-height: 72vh;
    border-radius: 22px;
  }

  .hero__content {
    padding: 88px 16px 36px;
  }

  .hero--page h1 {
    font-size: clamp(2rem, 11vw, 3.2rem);
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .split,
  .cards {
    grid-template-columns: 1fr;
  }

  .split__photo {
    height: 200px;
  }

  .cta-banner .btn {
    width: 100%;
  }

  .page section:not(.hero--page) {
    padding: 48px 16px;
  }
}

@media (max-width: 420px) {
  .login-btn {
    padding: 0 10px;
    font-size: 0.8rem;
  }
}

/* ===== FOOTER ===== */

.site-foot {
  margin: 40px 12px 12px;
  border-radius: 28px 28px 0 0;
  border: 1px solid var(--line);
  border-bottom: none;
  background: var(--surface);
  overflow: hidden;
}

.site-foot__inner {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 32px 36px;
}

.site-foot__menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.site-foot__menu a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  width: fit-content;
  transition: color 0.2s ease;
}

.site-foot__menu a:hover {
  color: var(--blue);
}

.site-foot__telegram {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 20px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--blue) 8%, transparent);
}

.site-foot__telegram span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-foot__telegram a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.site-foot__telegram a:hover {
  color: var(--blue-bright);
  transform: translateX(2px);
}

.site-foot__brand {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 4px;
}

.site-foot__logo {
  display: inline-block;
  margin-bottom: 6px;
}

.site-foot__logo img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
}

.site-foot__brand-name {
  margin: 0;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
}

.site-foot__motto {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-foot__bottom {
  border-top: 1px solid var(--line);
  padding: 16px 32px;
  text-align: center;
}

.site-foot__bottom p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

@media (max-width: 780px) {
  .site-foot {
    margin: 32px 10px 0;
    border-radius: 22px 22px 0 0;
  }

  .site-foot__inner {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 36px 20px 28px;
    text-align: center;
  }

  .site-foot__menu {
    align-items: center;
  }

  .site-foot__brand {
    align-items: center;
    text-align: center;
  }
}


/* =====================================================
   YANGI HEADER — suzuvchi "kapsula" ko'rinish
   Eski .header / .nav / .theme-toggle qoidalari ishlatilmaydi.
   ===================================================== */

html {
  --sh-bg: rgba(255, 255, 255, 0.76);
  --sh-line: rgba(11, 18, 32, 0.09);
  --sh-text: #0b1220;
  --sh-muted: #52607a;
  --sh-chip: rgba(11, 18, 32, 0.055);
  --sh-shadow: 0 10px 30px rgba(11, 18, 32, 0.09);
  --sh-a: #15803d;
  --sh-b: #166534;
  --sh-solid: #ffffff;
}

html[data-theme="dark"] {
  --sh-bg: rgba(12, 17, 25, 0.74);
  --sh-line: rgba(255, 255, 255, 0.13);
  --sh-text: #ffffff;
  --sh-muted: #b6bfcc;
  --sh-chip: rgba(255, 255, 255, 0.08);
  --sh-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  --sh-solid: #0c1119;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 12px 12px 0;
  pointer-events: none; /* bo'sh joylar ostidagi kontentni bosishga xalaqit bermasin */
  animation: shDrop 0.85s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

@keyframes shDrop {
  from { opacity: 0; transform: translateY(-40px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sh {
  position: relative;
  pointer-events: auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 10px 8px 12px;
  border-radius: 999px;
  background: var(--sh-bg);
  border: 1px solid var(--sh-line);
  box-shadow: var(--sh-shadow);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
  color: var(--sh-text);
  transition: padding 0.35s ease, box-shadow 0.35s ease, background 0.35s ease, border-color 0.35s ease;
}

.site-header.is-scrolled .sh {
  padding-top: 5px;
  padding-bottom: 5px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.22);
}

/* ---------- Logo ---------- */
.sh-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.sh-logo__img {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--sh-line);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sh-logo:hover .sh-logo__img {
  transform: rotate(-12deg) scale(1.06);
}

.sh-logo__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
}

.sh-logo__name {
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.sh-logo__motto {
  font-weight: 600;
  font-size: 0.7rem;
  color: var(--sh-muted);
  white-space: nowrap;
}

/* ---------- Menyu (markazda, segmentli) ---------- */
.sh-nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: var(--sh-chip);
  justify-self: center;
}

.sh-link {
  position: relative;
  z-index: 1;
  padding: 9px 16px;
  border-radius: 999px;
  color: var(--sh-muted);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.25s ease;
  animation: shLink 0.7s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: calc(350ms + var(--i, 0) * 90ms);
}

@keyframes shLink {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sh-link:hover {
  color: var(--sh-text);
}

.sh-link.is-active {
  color: #ffffff;
}

.sh-indicator {
  position: absolute;
  top: 4px;
  left: 0;
  height: calc(100% - 8px);
  width: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--sh-a), var(--sh-b));
  box-shadow: 0 6px 16px rgba(21, 128, 61, 0.38);
  transition: left 0.42s cubic-bezier(0.22, 1, 0.36, 1), width 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

/* ---------- O'ng tomon ---------- */
.sh-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  justify-self: end;
}

/* Kun-tun tugmasi: bitta yumaloq tugma, ikon almashadi */
.sh-theme {
  position: relative;
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--sh-line);
  background: var(--sh-chip);
  color: var(--sh-text);
  cursor: pointer;
  transition: transform 0.3s ease, background 0.3s ease;
}

.sh-theme:hover {
  transform: rotate(18deg) scale(1.06);
}

.sh-theme:active {
  transform: scale(0.94);
}

.sh-theme svg {
  grid-area: 1 / 1;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

/* Kunduzi: quyosh ko'rinadi */
.sh-theme__moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.4);
}

html[data-theme="dark"] .sh-theme__sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.4);
}

html[data-theme="dark"] .sh-theme__moon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.sh-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 20px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--sh-a), var(--sh-b));
  color: #ffffff;
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(21, 128, 61, 0.32);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.sh-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(21, 128, 61, 0.45);
}

.sh-login:active {
  transform: translateY(0);
}

.sh-menu {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  align-content: center;
  gap: 5px;
  border-radius: 50%;
  border: 1px solid var(--sh-line);
  background: var(--sh-chip);
  cursor: pointer;
}

.sh-menu span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 99px;
  background: var(--sh-text);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.sh-menu.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sh-menu.is-open span:nth-child(2) { opacity: 0; }
.sh-menu.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Klaviatura fokusi */
.sh a:focus-visible,
.sh button:focus-visible {
  outline: 2px solid var(--sh-a);
  outline-offset: 2px;
}

/* ---------- Telefon / planshet ---------- */
@media (max-width: 900px) {
  .site-header {
    padding: 8px 10px 0;
  }

  .sh {
    grid-template-columns: 1fr auto;
    border-radius: 28px;
  }

  .sh-menu {
    display: grid;
  }

  .sh-nav {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    width: auto;
    justify-self: stretch;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 10px;
    border-radius: 24px;
    background: var(--sh-solid);
    border: 1px solid var(--sh-line);
    box-shadow: var(--sh-shadow);
  }

  .sh-nav.is-open {
    display: flex;
    animation: shPanel 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  @keyframes shPanel {
    from { opacity: 0; transform: translateY(-14px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
  }

  .sh-indicator {
    display: none;
  }

  .sh-link {
    padding: 13px 16px;
    animation: none;
    text-align: center;
  }

  .sh-link.is-active {
    background: linear-gradient(180deg, var(--sh-a), var(--sh-b));
  }
}

@media (max-width: 480px) {
  .sh-logo__motto {
    display: none;
  }

  .sh-login {
    padding: 0 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .sh-link,
  .sh-nav.is-open {
    animation: none !important;
  }

  .sh-indicator,
  .sh-theme svg {
    transition: none !important;
  }
}


/* ---------- Juda tor ekranlar (kichik telefonlar) ---------- */
.sh-logo__short {
  display: none;
}

@media (max-width: 420px) {
  .site-header {
    padding: 8px 8px 0;
  }

  .sh {
    gap: 8px;
    padding: 6px 8px;
  }

  .sh-logo {
    gap: 8px;
  }

  .sh-logo__img {
    width: 36px;
    height: 36px;
  }

  .sh-logo__full {
    display: none;
  }

  .sh-logo__short {
    display: inline;
  }

  .sh-actions {
    gap: 6px;
  }

  .sh-theme,
  .sh-menu {
    width: 38px;
    height: 38px;
  }

  .sh-login {
    min-height: 38px;
    padding: 0 14px;
    font-size: 0.82rem;
  }
}

@media (max-width: 340px) {
  .sh-logo__img {
    width: 32px;
    height: 32px;
  }

  .sh-actions {
    gap: 4px;
  }

  .sh-theme,
  .sh-menu {
    width: 34px;
    height: 34px;
  }

  .sh-theme svg {
    width: 17px;
    height: 17px;
  }

  .sh-login {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.78rem;
  }
}


/* ===== FIKRLAR: xabarlar slayderi ===== */
.msgs {
  --gap: 16px;
  --pv: 3;
}

@media (max-width: 999px) {
  .msgs { --pv: 2; }
}

@media (max-width: 639px) {
  .msgs { --pv: 1; }
}

.msgs__viewport {
  overflow: hidden;
  margin: 0 -12px;
  padding: 8px 12px 22px;
  touch-action: pan-y;
  cursor: grab;
}

.msgs__viewport:active {
  cursor: grabbing;
}

.msgs__track {
  display: flex;
  align-items: center; /* har bir karta matniga qarab o'lchanadi, o'rtada turadi */
  gap: var(--gap);
  transition: transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
  user-select: none;
  -webkit-user-select: none;
}

.msg {
  flex: 0 0 calc((100% - (var(--pv) - 1) * var(--gap)) / var(--pv));
  min-width: 0;
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.msg__ava {
  flex-shrink: 0;
  align-self: flex-start;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--c), color-mix(in srgb, var(--c) 65%, #000));
  color: #ffffff;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--c) 35%, transparent);
}

.msg__bubble {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 14px 16px 12px;
  border: 1px solid var(--line);
  border-radius: 6px 20px 20px 20px; /* chap-yuqori burchak "xabar dumi" */
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 6px 16px rgba(10, 10, 10, 0.07);
}

html[data-theme="dark"] .msg__bubble {
  background: #101720;
  border-color: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .msg__name {
  color: color-mix(in srgb, var(--c) 55%, #ffffff);
}

.msg__name {
  margin: 0 0 6px;
  font-weight: 800;
  font-size: 0.95rem;
  color: color-mix(in srgb, var(--c) 78%, var(--text));
}

.msg__text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
}

.msg__time {
  align-self: flex-end;
  margin-top: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}

html[data-theme="dark"] .msg__text {
  color: #e6e9ee;
}

html[data-theme="dark"] .msg__time {
  color: #c5cad3;
}

.msgs__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.msgs__btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.msgs__btn:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: #ffffff;
  transform: scale(1.08);
}

.msgs__btn:active {
  transform: scale(0.94);
}

.msgs__btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.msgs__dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.msgs__dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: color-mix(in srgb, var(--text) 25%, transparent);
  cursor: pointer;
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1), background 0.3s ease;
}

.msgs__dot.is-active {
  width: 26px;
  background: var(--blue);
}

.msgs__btn:focus-visible,
.msgs__dot:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

@media (max-width: 420px) {
  .msg {
    gap: 8px;
  }

  .msg__ava {
    width: 36px;
    height: 36px;
    font-size: 0.78rem;
  }

  .msg__bubble {
    padding: 12px 12px 10px;
    border-radius: 6px 16px 16px 16px;
  }

  .msg__text {
    font-size: 0.9rem;
  }

  .msgs__controls {
    gap: 8px;
  }

  .msgs__btn {
    width: 38px;
    height: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .msgs__track {
    transition: none;
  }
}