:root {
  --bg: #f5f7ff;
  --bg-strong: #eef3ff;
  --card: #ffffff;
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --secondary: #7c3aed;
  --text: #1f2937;
  --muted: #6b7280;
  --line: rgba(79, 70, 229, 0.12);
  --shadow: 0 20px 45px rgba(79, 70, 229, 0.12);
  --success: #16a34a;
  --warning: #f59e0b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  font-family: "Inter", sans-serif;
  background:
    radial-gradient(circle at 10% 15%, rgba(79, 70, 229, 0.14), transparent 22%),
    radial-gradient(circle at 80% 18%, rgba(96, 165, 250, 0.12), transparent 18%),
    radial-gradient(circle at 85% 72%, rgba(124, 58, 237, 0.14), transparent 24%),
    linear-gradient(180deg, #f7f8ff 0%, #eef4ff 42%, #f7f9ff 100%);
  color: var(--text);
  overflow-x: hidden;
  background-attachment: fixed;
}

/* ---------- Kinematik media fon (background.js) ---------- */

/*
 * Qatlamlar (pastdan yuqoriga):
 *   .bg-media   video va rasm sahnalari, bir-biriga turli effektlar bilan o'tadi
 *   .bg-aurora  harakatlanuvchi brend ranglari bilan rang tuzatish
 *   .bg-field   yorug' zarrachalar to'ri
 *   ::after     nozik donadorlik
 */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #14123a;
}

.bg-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 20%, rgba(79, 70, 229, 0.55), transparent 55%),
    radial-gradient(circle at 80% 70%, rgba(124, 58, 237, 0.45), transparent 50%),
    #14123a;
}

/* Sahna chekkalari harakat paytida ko'rinmasligi uchun ekrandan kattaroq */
.bg-scene {
  position: absolute;
  inset: -6%;
  z-index: 1;
  overflow: hidden;
  will-change: opacity, transform, clip-path, filter;
}

.bg-scene-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  will-change: transform;
}

/* Kino uslubidagi chekka qorong'ilashuvi */
.bg-media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  background:
    radial-gradient(130% 95% at 50% 45%, transparent 55%, rgba(10, 8, 32, 0.55) 100%),
    linear-gradient(180deg, rgba(10, 8, 32, 0.25), transparent 22%, transparent 78%, rgba(10, 8, 32, 0.3));
}

.bg-layer canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.bg-aurora {
  mix-blend-mode: soft-light;
  opacity: 0;
  transition: opacity 1.6s ease;
}

.bg-field {
  opacity: 0;
  transition: opacity 1.2s ease 0.15s;
}

.bg-layer.ready .bg-aurora {
  opacity: 0.95;
}

.bg-layer.ready .bg-field {
  opacity: 1;
}

/* Nozik donadorlik: kino plyonkasi hissi beradi va gradient pog'onalarini yashiradi */
.bg-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.16 0 0 0 0 0.14 0 0 0 0 0.38 0.55 0 0 0 -0.22'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

@media print {
  .bg-layer {
    display: none;
  }
}

main,
header,
footer,
section {
  position: relative;
  z-index: 1;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px) saturate(1.4);
  background: rgba(248, 249, 255, 0.86);
  border-bottom: 1px solid rgba(79, 70, 229, 0.08);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.04);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-size: 1.2rem;
}

.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: var(--shadow);
}

.nav {
  display: flex;
  align-items: center;
  gap: 26px;
  color: var(--muted);
  font-weight: 500;
}

.nav-toggle {
  display: none;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(79, 70, 229, 0.15);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  padding: 10px 8px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
  margin: 5px 0;
}

.nav a {
  transition: color 0.2s ease;
}

.nav a:hover {
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  padding: 0.9rem 1.5rem;
  border-radius: 14px;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.btn:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 20px 30px rgba(79, 70, 229, 0.18);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  box-shadow: 0 16px 28px rgba(79, 70, 229, 0.28);
}

.btn-secondary {
  background: #fff;
  border-color: rgba(79, 70, 229, 0.15);
  color: var(--text);
}

.hero {
  position: relative;
  padding: 78px 0 52px;
  overflow: hidden;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(18px);
  opacity: 0.7;
  z-index: -1;
}

.hero::before {
  width: 220px;
  height: 220px;
  background: rgba(79, 70, 229, 0.14);
  right: 8%;
  top: 8%;
  animation: floatGlow 9s ease-in-out infinite;
}

.hero::after {
  width: 180px;
  height: 180px;
  background: rgba(124, 58, 237, 0.12);
  left: 8%;
  bottom: 12%;
  animation: floatGlow 11s ease-in-out infinite reverse;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.06fr 0.94fr;
  align-items: center;
  gap: 40px;
}

.pill,
.eyebrow,
.badge,
.mini-label-box {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-weight: 600;
}

.pill {
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
  padding: 0.55rem 0.9rem;
  margin-bottom: 20px;
}

.hero-copy h1 {
  font-size: clamp(2.8rem, 4vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.06em;
  max-width: 600px;
}

.hero-copy p {
  margin-top: 22px;
  max-width: 600px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

.cta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 42px;
  margin-top: 34px;
  flex-wrap: wrap;
}

.hero-stats div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hero-stats strong {
  font-size: 1.6rem;
  letter-spacing: -0.05em;
}

.hero-stats span {
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-visual {
  display: flex;
  justify-content: center;
}

.dashboard-card {
  width: min(100%, 490px);
  border: 1px solid rgba(79, 70, 229, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 248, 255, 0.96));
  box-shadow: var(--shadow);
  border-radius: 28px;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 18px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.dot-red { background: #ff5f57; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #28c840; }

.slide-window {
  background: linear-gradient(180deg, #fff, #f6f8ff);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px 22px 18px;
}

.slide-header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.badge {
  padding: 0.5rem 0.8rem;
  background: rgba(79, 70, 229, 0.08);
  color: var(--primary-dark);
  font-size: 0.78rem;
}

.badge.soft {
  background: rgba(124, 58, 237, 0.08);
  color: var(--secondary);
}

.slide-window h3 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.2;
  letter-spacing: -0.05em;
}

.chart-box {
  display: flex;
  align-items: end;
  gap: 12px;
  height: 120px;
  margin-top: 32px;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(79, 70, 229, 0.04), rgba(124, 58, 237, 0.08));
}

.bar {
  width: 22%;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(180deg, #6d7bff, #3b82f6);
}

.bar-one { height: 44%; }
.bar-two { height: 60%; }
.bar-three { height: 82%; }
.bar-four { height: 96%; }

.slide-insights {
  display: flex;
  gap: 1rem;
  margin-top: 20px;
}

.slide-insights > div {
  flex: 1;
  padding: 14px 12px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
}

.mini-label {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  margin-bottom: 8px;
}

.section {
  padding: 34px 0 90px;
}

.section-heading h2,
.feature-card h3,
.step-item h3 {
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.section-heading {
  text-align: center;
  margin-bottom: 36px;
}

.section-heading.left {
  text-align: left;
}

.eyebrow {
  background: rgba(79, 70, 229, 0.08);
  color: var(--primary);
  padding: 0.58rem 0.9rem;
  margin-bottom: 18px;
  font-size: 0.8rem;
}

.section-heading h2 {
  font-size: clamp(2rem, 3vw, 3rem);
  letter-spacing: -0.05em;
}

.features-grid,
.steps-grid,
.showcase-grid {
  display: grid;
  gap: 24px;
}

.features-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.feature-card, .step-item, .showcase-card, .testimonial-card, .faq-item {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(79, 70, 229, 0.08);
  border-radius: 22px;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.05);
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.feature-card:hover,
.step-item:hover,
.showcase-card:hover,
.testimonial-card:hover,
.faq-item:hover {
  transform: translateY(-6px);
  border-color: rgba(79, 70, 229, 0.18);
  box-shadow: 0 24px 46px rgba(79, 70, 229, 0.12);
}

.feature-card {
  padding: 28px 22px;
}

.icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(124, 58, 237, 0.12));
  margin-bottom: 18px;
  font-size: 1.6rem;
}

.feature-card h3 {
  font-size: 1.32rem;
  margin-bottom: 10px;
}

.feature-card p {
  color: var(--muted);
  line-height: 1.7;
}

.steps-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.step-item {
  padding: 32px 26px;
}

.step-number {
  display: inline-flex;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(124, 58, 237, 0.12));
  color: var(--primary);
  align-items: center;
  justify-content: center;
  font-weight: 800;
  margin-bottom: 18px;
}

.step-item h3 {
  margin-bottom: 12px;
  font-size: 1.5rem;
}

.step-item p {
  color: var(--muted);
  line-height: 1.7;
}

.showcase-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.showcase-card {
  padding: 26px 22px;
  min-height: 240px;
}

@media (max-width: 980px) {
  
  .showcase-grid,
  .features-grid,
  .steps-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  
  .showcase-grid,
  .features-grid,
  .steps-grid {
    grid-template-columns: 1fr;
  }
}

.mini-label-box {
  padding: 0.5rem 0.8rem;
  font-size: 0.74rem;
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
  margin-bottom: 18px;
}

.mini-label-box.alt { background: rgba(124, 58, 237, 0.1); color: var(--secondary); }
.mini-label-box.soft { background: rgba(22, 163, 74, 0.1); color: var(--success); }

.showcase-card h3 {
  font-size: 1.6rem;
  letter-spacing: -0.05em;
}

.showcase-card ul {
  list-style: none;
  margin-top: 16px;
  color: var(--muted);
  display: grid;
  gap: 10px;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.testimonial-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(79, 70, 229, 0.08);
  border-radius: 22px;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.05);
  padding: 28px 22px;
}

.stars {
  color: #fbbf24;
  letter-spacing: 0.15em;
  font-size: 1.1rem;
  margin-bottom: 18px;
}

.testimonial-card blockquote {
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 20px;
}

.author {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.author span {
  color: var(--muted);
  font-size: 0.82rem;
}

.cta-banner {
  padding-top: 0;
}

.banner-box {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(124, 58, 237, 0.12));
  border: 1px solid rgba(79, 70, 229, 0.12);
  border-radius: 28px;
  padding: 28px 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.banner-box h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: -0.05em;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.faq-item {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(79, 70, 229, 0.08);
  border-radius: 20px;
  padding: 22px 20px;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.04);
}

.faq-item strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.faq-item p {
  color: var(--muted);
  line-height: 1.8;
}

.site-footer {
  border-top: 1px solid rgba(79, 70, 229, 0.08);
  background: rgba(255, 255, 255, 0.82);
}

.scroll-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 24px 32px rgba(79, 70, 229, 0.28);
  font-size: 1.4rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  z-index: 50;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@keyframes floatGlow {
  0%, 100% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-18px) scale(1.05); }
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-field.full {
  grid-column: 1 / -1;
}

.form-field label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  border: 1px solid rgba(79, 70, 229, 0.15);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  font: inherit;
  color: var(--text);
  background: #fff;
}

.form-field textarea {
  min-height: 120px;
  resize: vertical;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 980px) {
  
.hero-grid,
  .features-grid,
  .showcase-grid,
  .steps-grid,
  .testimonials-grid,
  .faq-grid {
    grid-template-columns: 1fr 1fr;
  }

  
.hero-grid {
    grid-template-columns: 1fr;
  }

  .nav {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 72px;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(79, 70, 229, 0.1);
    border-radius: 18px;
    padding: 18px 16px;
    box-shadow: var(--shadow);
  }

  .nav.open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .banner-box {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  
.features-grid,
  .showcase-grid,
  .steps-grid,
  .testimonials-grid,
  .faq-grid {
    grid-template-columns: 1fr;
  }

  .cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }

}

/* ---------- Kino oynalari va shisha bo'limlar ---------- */

/*
 * .cinema: fon videolari yorqin ko'rinadigan to'q "oyna" bo'limlar, matn oq.
 * Qolgan bo'limlar yorug' shisha sirt: fon ular ortida xira va loyqa harakatlanadi.
 */
.cinema {
  position: relative;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(10, 8, 32, 0.35), transparent 16%, transparent 84%, rgba(10, 8, 32, 0.4)),
    linear-gradient(100deg, rgba(14, 12, 42, 0.86) 0%, rgba(22, 19, 66, 0.64) 48%, rgba(30, 27, 75, 0.34) 100%);
}

.cinema.process,
.cinema.testimonials {
  background:
    linear-gradient(180deg, rgba(10, 8, 32, 0.4), transparent 18%, transparent 82%, rgba(10, 8, 32, 0.45)),
    rgba(16, 14, 48, 0.6);
}

.cinema h1,
.cinema h2,
.cinema .section-heading h2,
.cinema .banner-box h2 {
  color: #fff;
  text-shadow: 0 2px 28px rgba(8, 6, 30, 0.45);
}

.cinema .hero-copy p {
  color: rgba(232, 235, 255, 0.86);
}

.cinema .pill,
.cinema .eyebrow {
  background: rgba(255, 255, 255, 0.12);
  color: #e0e7ff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.cinema .hero-stats strong {
  color: #fff;
}

.cinema .hero-stats span {
  color: rgba(224, 231, 255, 0.75);
}

.cinema .btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.cinema .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* Kino bo'limidagi oq kartalar o'z to'q matn rangini saqlaydi */
.cinema .dashboard-card,
.cinema .step-item,
.cinema .testimonial-card,
.cinema .feature-card,
.cinema .faq-item {
  color: var(--text);
}

/* Kino bo'limidagi kartalar: yarim shaffof shisha */
.cinema .step-item,
.cinema .testimonial-card {
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

/* Footer */
.site-footer.cinema {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(12, 10, 36, 0.78);
}

/* Yorug' shisha bo'limlar */
main > section:not(.cinema) {
  background: rgba(246, 247, 255, 0.92);
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  main > section:not(.cinema) {
    background: rgba(246, 247, 255, 0.84);
    -webkit-backdrop-filter: blur(26px) saturate(1.35);
    backdrop-filter: blur(26px) saturate(1.35);
  }
}

@media (max-width: 980px) {
  .cinema {
    background:
      linear-gradient(180deg, rgba(10, 8, 32, 0.4), transparent 20%, transparent 80%, rgba(10, 8, 32, 0.45)),
      rgba(14, 12, 42, 0.72);
  }
}

/* Telefonlarda loyqalash o'chiriladi: tejamkor va silliq */
@media (max-width: 640px) {
  main > section:not(.cinema) {
    background: rgba(246, 247, 255, 0.92);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* ==========================================================
   Qo'shimcha komponentlar va qulaylik
   ========================================================== */

/* ---------- Qulaylik (accessibility) ---------- */
[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 0.75rem 1.1rem;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid rgba(124, 58, 237, 0.55);
  outline-offset: 3px;
  border-radius: 10px;
}

.cinema :focus-visible {
  outline-color: rgba(196, 181, 253, 0.9);
}

section[id],
main[id] {
  scroll-margin-top: 92px;
}

/* ---------- Header va menyu ---------- */
.site-header {
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

.site-header.scrolled {
  background: rgba(248, 249, 255, 0.94);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.1);
}

.nav a {
  position: relative;
}

.nav a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

.nav a.active,
.nav a[aria-current="page"] {
  color: var(--primary);
}

.nav a.active::after,
.nav a[aria-current="page"]::after,
.nav a:not(.btn):hover::after {
  transform: scaleX(1);
}

.nav-toggle span {
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Hero ---------- */
.rotator {
  display: inline-block;
  background: linear-gradient(100deg, #c4b5fd, #a5b4fc 45%, #7dd3fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: opacity 0.38s ease, transform 0.38s ease, filter 0.38s ease;
}

.rotator.out {
  opacity: 0;
  transform: translateY(-0.25em);
  filter: blur(6px);
}

.rotator.in {
  opacity: 0;
  transform: translateY(0.25em);
  filter: blur(6px);
  transition: none;
}

.chart-box .bar {
  transform-origin: bottom;
  animation: growBar 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.chart-box .bar-two { animation-delay: 0.12s; }
.chart-box .bar-three { animation-delay: 0.24s; }
.chart-box .bar-four { animation-delay: 0.36s; }

@keyframes growBar {
  from { transform: scaleY(0.05); }
  to { transform: scaleY(1); }
}

/* ---------- Paydo bo'lish ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.75s cubic-bezier(0.2, 0.7, 0.2, 1) var(--reveal-delay, 0s),
    transform 0.75s cubic-bezier(0.2, 0.7, 0.2, 1) var(--reveal-delay, 0s);
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ---------- Narxlar ---------- */

/* ---------- Sharhlar ---------- */
.testimonial-card blockquote {
  font-style: normal;
}

/* ---------- FAQ akkordeon ---------- */
.faq-grid {
  align-items: start;
}

.faq-item {
  padding: 0;
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  font-weight: 700;
  font-size: 1.04rem;
  letter-spacing: -0.02em;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
  font-size: 1.2rem;
  font-weight: 600;
  transition: transform 0.25s ease, background 0.25s ease;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
}

.faq-item p {
  padding: 0 22px 20px;
  animation: faqOpen 0.3s ease;
}

@keyframes faqOpen {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Xizmatlar ---------- */

/* ---------- Shaxsiy kabinet ---------- */

.btn-sm {
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  border-radius: 12px;
}

.btn:disabled {
  opacity: 0.65;
  cursor: progress;
  transform: none;
}

/* ---------- Forma ---------- */

.form-field input,
.form-field textarea,
.form-field select {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.14);
}

.form-field .invalid {
  border-color: #dc2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.field-error {
  min-height: 1em;
  color: #dc2626;
  font-size: 0.78rem;
  font-weight: 600;
}

.field-error:empty {
  min-height: 0;
}

/* ---------- Footer ---------- */
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
  padding: 48px 0 28px;
}

.footer-brand p {
  margin-top: 14px;
  max-width: 320px;
  line-height: 1.7;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 18px 0 26px;
  border-top: 1px solid rgba(79, 70, 229, 0.1);
  font-size: 0.88rem;
}

.site-footer.cinema {
  color: rgba(224, 231, 255, 0.72);
}

.site-footer.cinema .logo,
.site-footer.cinema .footer-title {
  color: #fff;
}

.site-footer.cinema a:not(.logo) {
  transition: color 0.2s ease;
}

.site-footer.cinema a:not(.logo):hover {
  color: #fff;
}

.site-footer.cinema .footer-bottom {
  border-top-color: rgba(255, 255, 255, 0.1);
}

/* ---------- Bildirishnomalar ---------- */
.toast-region {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 60;
  display: grid;
  gap: 10px;
  max-width: min(380px, calc(100vw - 44px));
  pointer-events: none;
}

.toast {
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  background: #1e1b4b;
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.3);
  border-left: 4px solid #a5b4fc;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: none;
}

.toast-success { border-left-color: #4ade80; }
.toast-error { border-left-color: #f87171; }

/* ---------- 404 ---------- */
.not-found {
  min-height: calc(100vh - 78px);
  display: grid;
  place-items: center;
  padding: 80px 0;
}

.not-found-box {
  text-align: center;
  max-width: 640px;
}

.not-found-box h1 {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  letter-spacing: -0.06em;
  margin-bottom: 14px;
}

.not-found-box p {
  color: rgba(232, 235, 255, 0.86);
  line-height: 1.8;
}

.not-found-box .cta-row {
  justify-content: center;
}

/* ---------- Chop etish ---------- */

@media print {
  body {
    background: #fff !important;
  }
}

/* ---------- Moslashuvchanlik ---------- */
@media (max-width: 980px) {

  .nav {
    background: #fff;
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.28);
    max-height: calc(100vh - 96px);
    overflow-y: auto;
  }

  .nav a:not(.btn) {
    width: 100%;
    padding: 4px 0;
  }

  .nav a:not(.btn)::after {
    display: none;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-bottom {
    padding-right: 64px;
  }

  .toast-region {
    left: 12px;
    right: 12px;
    bottom: 84px;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================
   Ilova: kirish, studiya, slaydlar, hujjatlar, kutubxona
   ========================================================== */

/* ---------- Slayd dizayn mavzulari ---------- */
.theme-indigo { --s-dark: #1e1b4b; --s-accent: #6366f1; --s-accent2: #a78bfa; --s-light: #f8f9ff; --s-title: #312e81; --s-text: #1f2937; --s-muted: #6b7280; --s-soft: #cbd5e1; }
.theme-ocean { --s-dark: #0c2a4a; --s-accent: #0ea5e9; --s-accent2: #22d3ee; --s-light: #f0f9ff; --s-title: #075985; --s-text: #1f2937; --s-muted: #64748b; --s-soft: #bae6fd; }
.theme-emerald { --s-dark: #052e2b; --s-accent: #10b981; --s-accent2: #6ee7b7; --s-light: #f0fdf4; --s-title: #065f46; --s-text: #1f2937; --s-muted: #6b7280; --s-soft: #a7f3d0; }
.theme-sunset { --s-dark: #431407; --s-accent: #f97316; --s-accent2: #fbbf24; --s-light: #fff7ed; --s-title: #9a3412; --s-text: #292524; --s-muted: #78716c; --s-soft: #fed7aa; }
.theme-graphite { --s-dark: #0f172a; --s-accent: #38bdf8; --s-accent2: #818cf8; --s-light: #ffffff; --s-title: #0f172a; --s-text: #1f2937; --s-muted: #64748b; --s-soft: #cbd5e1; }

/* ---------- Header: yangi ish va foydalanuvchi menyusi ---------- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-new {
  padding: 0.7rem 1.1rem;
  gap: 6px;
}

.user-menu {
  position: relative;
}

.user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(79, 70, 229, 0.15);
  background: #fff;
  border-radius: 999px;
  padding: 4px 14px 4px 4px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  color: var(--text);
  transition: box-shadow 0.2s ease;
}

.user-btn:hover {
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.15);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-weight: 800;
}

.user-name {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.18);
  padding: 10px;
  z-index: 40;
  display: grid;
  gap: 2px;
}

.user-dropdown-label {
  font-size: 0.7rem;
  color: var(--muted);
  padding: 4px 10px 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.user-dropdown-name {
  font-weight: 800;
  padding: 0 10px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

.user-dropdown a,
.user-dropdown button {
  text-align: left;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--text);
}

.user-dropdown a:hover,
.user-dropdown button:hover {
  background: rgba(79, 70, 229, 0.08);
}

.user-dropdown button {
  color: #dc2626;
}

/* ---------- Kirish sahifasi ---------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 48px 0;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

.auth-logo {
  color: #fff;
  margin-bottom: 34px;
}

.auth-intro h1 {
  font-size: clamp(2.3rem, 4.4vw, 3.8rem);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.auth-intro p {
  color: rgba(232, 235, 255, 0.86);
  line-height: 1.8;
  margin-top: 18px;
  max-width: 520px;
  font-size: 1.05rem;
}

.auth-points {
  list-style: none;
  display: grid;
  gap: 12px;
  margin-top: 26px;
}

.auth-points li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
}

.auth-points span {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.14);
  color: #c7d2fe;
}

.auth-card {
  background: rgba(255, 255, 255, 0.97);
  color: var(--text);
  border-radius: 28px;
  padding: 32px 30px;
  box-shadow: 0 40px 80px rgba(8, 6, 30, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.cinema .auth-card h2 {
  color: var(--text);
  text-shadow: none;
  font-size: 1.6rem;
  letter-spacing: -0.03em;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #f1f2fb;
  padding: 5px;
  border-radius: 14px;
  margin-bottom: 24px;
}

.auth-tab {
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  padding: 0.65rem;
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.auth-tab.active {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.auth-sub {
  color: var(--muted);
  margin: 6px 0 22px;
}

#authForm .form-field {
  margin-bottom: 16px;
}

.password-field {
  position: relative;
}

.form-field .password-field input {
  padding-right: 50px;
}

.toggle-pass {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 10px;
  color: var(--muted);
  display: grid;
  place-items: center;
}

.toggle-pass svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.toggle-pass.on {
  color: var(--primary);
}

.toggle-pass:not(.on)::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 2px;
  background: currentColor;
  transform: rotate(-45deg);
}

.caps-warning {
  color: #b45309;
  font-size: 0.78rem;
  font-weight: 600;
}

.strength {
  display: flex;
  align-items: center;
  gap: 10px;
}

.strength-bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: #eceef7;
  overflow: hidden;
}

.strength-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: #dc2626;
  transition: width 0.3s ease, background 0.3s ease;
}

.strength-bar span[data-level="2"] { background: #f59e0b; }
.strength-bar span[data-level="3"] { background: #eab308; }
.strength-bar span[data-level="4"] { background: #22c55e; }
.strength-bar span[data-level="5"] { background: #16a34a; }

.strength small {
  font-size: 0.75rem;
  color: var(--muted);
  min-width: 70px;
  text-align: right;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
  margin: 4px 0 16px;
  cursor: pointer;
}

.check input {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

.auth-error {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.2);
  color: #b91c1c;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.auth-submit {
  width: 100%;
  padding: 1rem;
  font-size: 1.02rem;
}

.auth-switch {
  text-align: center;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-switch button {
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  padding: 0 2px;
}

.auth-switch button:hover {
  text-decoration: underline;
}

/* ---------- Bosh sahifa: asbob kartalari ---------- */
.tool-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 30px 26px 26px;
  border-radius: 24px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tool-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.tool-referat::before { background: linear-gradient(90deg, #0ea5e9, #22d3ee); }
.tool-kursishi::before { background: linear-gradient(90deg, #10b981, #6ee7b7); }

.tool-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 50px rgba(79, 70, 229, 0.16);
}

.tool-icon {
  font-size: 2rem;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(79, 70, 229, 0.08);
}

.tool-card h3 {
  font-size: 1.5rem;
  letter-spacing: -0.04em;
}

.tool-card p {
  color: var(--muted);
  line-height: 1.7;
  flex: 1;
}

.tool-formats {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--secondary);
  letter-spacing: 0.08em;
}

.tool-go {
  font-weight: 800;
  color: var(--primary);
  display: inline-flex;
  gap: 6px;
}

.tool-go span {
  transition: transform 0.2s ease;
}

.tool-card:hover .tool-go span {
  transform: translateX(4px);
}

/* ---------- Bosh sahifa: ish turlari karuseli ---------- */
.tool-carousel {
  overflow: hidden;
  padding-bottom: 72px;
}

.tc-slides { --acc: #6366f1; --acc2: #a78bfa; }
.tc-referat { --acc: #0ea5e9; --acc2: #67e8f9; }
.tc-mustaqil { --acc: #f59e0b; --acc2: #fde047; }
.tc-kursishi { --acc: #10b981; --acc2: #6ee7b7; }
.tc-maqola { --acc: #f43f5e; --acc2: #fda4af; }
.tc-test { --acc: #8b5cf6; --acc2: #e879f9; }

.tc-viewport {
  container-type: inline-size;
}

.tc-track {
  --tc-w: min(960px, calc(100cqw - 160px));
  position: relative;
  display: flex;
  gap: 28px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  /* Soya qirqilmasligi uchun keng ichki joy, tashqi oraliq manfiy margin bilan qaytariladi */
  padding: 30px calc((100cqw - var(--tc-w)) / 2) 90px;
  margin: -12px 0 -60px;
  outline: none;
}

.tc-track::-webkit-scrollbar {
  display: none;
}

.tc-slide {
  position: relative;
  isolation: isolate;
  flex: 0 0 var(--tc-w);
  height: 430px;
  scroll-snap-align: center;
  border-radius: 30px;
  overflow: hidden;
  color: #fff;
  text-decoration: none;
  background: #0f0d2e;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 30px 70px rgba(5, 4, 25, 0.4);
  opacity: 0.45;
  transform: scale(0.9);
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.6s ease, box-shadow 0.6s ease;
}

.tc-slide.is-active {
  opacity: 1;
  transform: none;
  box-shadow: 0 36px 90px rgba(5, 4, 25, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.tc-slide:focus-visible {
  outline: 3px solid var(--acc2);
  outline-offset: 4px;
}

.tc-photo {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.14);
  transition: transform 7s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.tc-slide.is-active .tc-photo {
  transform: scale(1.02);
}

/* Matn o'qilishi uchun qorong'i parda */
.tc-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: linear-gradient(
    95deg,
    rgba(10, 9, 32, 0.95) 0%,
    rgba(10, 9, 32, 0.84) 40%,
    rgba(10, 9, 32, 0.3) 74%,
    rgba(10, 9, 32, 0.08) 100%
  );
}

/* Ish turining rangidagi nur */
.tc-slide::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: -160px;
  bottom: -240px;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: var(--acc);
  filter: blur(100px);
  opacity: 0.5;
}

.tc-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  height: 100%;
  max-width: 560px;
  padding: 44px 52px;
}

.tc-count {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--acc2);
}

.tc-count i {
  font-style: normal;
  color: rgba(255, 255, 255, 0.45);
}

.tc-icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  font-size: 1.8rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 14px 34px -12px var(--acc);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.tc-slide h3 {
  font-size: clamp(2rem, 3.4vw, 2.8rem);
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.tc-slide p {
  max-width: 44ch;
  color: rgba(232, 235, 255, 0.82);
  line-height: 1.7;
}

.tc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

.tc-tags li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0.42rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.tc-tags li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--acc2);
  box-shadow: 0 0 10px var(--acc2);
}

.tc-cta {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding: 0.55rem 0.6rem 0.55rem 1.2rem;
  font-weight: 800;
  color: #111827;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 34px -14px var(--acc);
}

.tc-cta span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: #fff;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--acc), var(--acc2));
  transition: transform 0.25s ease;
}

.tc-slide:hover .tc-cta span {
  transform: translateX(4px);
}

.tc-format {
  position: absolute;
  top: 26px;
  right: 26px;
  padding: 0.5rem 0.9rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  border-radius: 999px;
  background: rgba(10, 9, 32, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.tc-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
}

.tc-arrow {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.tc-arrow:hover {
  color: var(--primary);
  background: #fff;
  transform: scale(1.06);
}

.tc-arrow svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tc-dots {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tc-dot {
  position: relative;
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  cursor: pointer;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  transition: width 0.4s ease, background 0.3s ease;
}

.tc-dot:hover {
  background: rgba(255, 255, 255, 0.6);
}

.tc-dot.is-active {
  width: 48px;
  background: rgba(255, 255, 255, 0.25);
}

/* Faol nuqta ichidagi chiziq: avtomatik aylanish vaqti */
.tc-dot span {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left;
}

.tc-dot.is-active span {
  transform: scaleX(1);
}

.tool-carousel.is-playing .tc-dot.is-active span {
  animation: tc-fill 5.5s linear forwards;
}

.tool-carousel.is-paused .tc-dot.is-active span,
.tool-carousel.is-offscreen .tc-dot.is-active span {
  animation-play-state: paused;
}

@keyframes tc-fill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@media (max-width: 980px) {
  .tc-track {
    --tc-w: calc(100cqw - 96px);
    gap: 18px;
  }

  .tc-slide {
    height: 450px;
  }

  .tc-body {
    padding: 36px 36px;
  }
}

@media (max-width: 640px) {
  .tc-track {
    --tc-w: calc(100cqw - 44px);
    gap: 12px;
    padding-top: 22px;
    padding-bottom: 70px;
    margin: -12px 0 -50px;
  }

  .tc-slide {
    height: 540px;
    border-radius: 24px;
    transform: scale(0.94);
  }

  .tc-slide::before {
    background: linear-gradient(
      180deg,
      rgba(10, 9, 32, 0.1) 0%,
      rgba(10, 9, 32, 0.7) 34%,
      rgba(10, 9, 32, 0.95) 62%
    );
  }

  .tc-body {
    justify-content: flex-end;
    gap: 12px;
    padding: 24px 22px;
  }

  .tc-icon {
    width: 52px;
    height: 52px;
    font-size: 1.5rem;
    border-radius: 15px;
  }

  .tc-format {
    top: 18px;
    right: 18px;
  }

  .tc-arrow {
    width: 44px;
    height: 44px;
  }

  .tc-dots {
    gap: 7px;
  }

  .tc-dot.is-active {
    width: 32px;
  }
}

.mock-slide {
  margin-top: 18px;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  background: linear-gradient(135deg, #1e1b4b, #4338ca);
  position: relative;
  padding: 16px;
  display: grid;
  gap: 8px;
  align-content: start;
}

.mock-slide span {
  display: block;
  border-radius: 6px;
}

.mock-title { height: 12px; width: 50%; background: rgba(255, 255, 255, 0.85); margin-bottom: 6px; }
.mock-line { height: 7px; width: 46%; background: rgba(255, 255, 255, 0.4); }
.mock-line.short { width: 32%; }
.mock-image {
  position: absolute;
  right: 14px;
  top: 16px;
  bottom: 16px;
  width: 36%;
  background: linear-gradient(135deg, #a78bfa, #22d3ee);
}

.showcase-card ul {
  list-style: none;
  margin-top: 16px;
  color: var(--muted);
  display: grid;
  gap: 10px;
}

.showcase-card li::before {
  content: "• ";
  color: var(--primary);
  font-weight: 800;
}

/* ---------- Sahifa sarlavhasi (studiya, kutubxona) ---------- */
.page-hero {
  padding: 54px 0 46px;
}

.page-hero-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}

.page-hero h1 {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  letter-spacing: -0.05em;
  margin: 4px 0 10px;
}

.page-hero p {
  color: rgba(232, 235, 255, 0.86);
  max-width: 640px;
  line-height: 1.7;
}

.studio,
.library {
  padding: 32px 0 90px;
}

/* ---------- Studiya: sozlamalar ---------- */
.studio-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.studio-panel {
  position: sticky;
  top: 96px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  box-shadow: var(--shadow);
  max-height: calc(100vh - 116px);
  overflow: auto;
}

.type-picker {
  border: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.type-picker legend,
.field-label {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.type-option {
  position: relative;
}

.type-option input {
  position: absolute;
  opacity: 0;
  inset: 0;
}

.type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 3px;
  padding: 12px 6px;
  border: 1.5px solid rgba(79, 70, 229, 0.15);
  border-radius: 16px;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.type-card:hover {
  transform: translateY(-2px);
}

.type-option input:checked + .type-card {
  border-color: var(--primary);
  background: linear-gradient(180deg, rgba(79, 70, 229, 0.08), rgba(124, 58, 237, 0.1));
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.16);
}

.type-option input:focus-visible + .type-card {
  outline: 3px solid rgba(124, 58, 237, 0.5);
  outline-offset: 2px;
}

.type-icon { font-size: 1.5rem; }
.type-card strong { font-size: 0.92rem; }
.type-card small { font-size: 0.7rem; color: var(--muted); }

.studio-panel .form-field {
  margin-bottom: 14px;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -4px 0 16px;
}

.chip {
  border: 1px solid rgba(79, 70, 229, 0.16);
  background: #fff;
  color: var(--primary-dark);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.chip:hover {
  background: rgba(79, 70, 229, 0.08);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-field input[type="range"] {
  padding: 0;
  border: 0;
  accent-color: var(--primary);
  height: 44px;
  background: transparent;
}

.form-field input[type="range"]:focus {
  box-shadow: none;
}

.form-field output {
  font-weight: 800;
  color: var(--primary);
}

.theme-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.swatch {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  border: 2px solid transparent;
  cursor: pointer;
  background: linear-gradient(135deg, var(--s-dark) 0 50%, var(--s-accent) 50% 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4), 0 4px 10px rgba(15, 23, 42, 0.12);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.swatch:hover {
  transform: scale(1.08);
}

.swatch.active {
  border-color: var(--text);
  transform: scale(1.08);
}

.theme-swatches.small .swatch {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.titul {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: #fff;
}

.titul summary {
  cursor: pointer;
  font-weight: 700;
}

.titul summary small {
  color: var(--muted);
  font-weight: 500;
}

.titul .hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 8px 0 12px;
}

.titul .form-grid {
  gap: 10px;
}

.titul .form-field {
  margin-bottom: 0;
}

.titul .form-field input {
  padding: 0.65rem 0.8rem;
  border-radius: 11px;
}

.btn-generate {
  width: 100%;
  padding: 1rem;
  font-size: 1.05rem;
  gap: 6px;
}

/* ---------- Studiya: natija ---------- */
.studio-output {
  min-width: 0;
}

.empty-state,
.gen-progress {
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px dashed rgba(79, 70, 229, 0.25);
  border-radius: 24px;
  padding: 52px 32px;
  text-align: center;
}

.gen-progress {
  border-style: solid;
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.empty-state h2,
.gen-progress h2 {
  font-size: 1.5rem;
  letter-spacing: -0.03em;
  margin: 20px 0 8px;
}

.empty-state p {
  color: var(--muted);
  max-width: 470px;
  margin: 0 auto;
  line-height: 1.7;
}

.empty-tips {
  list-style: none;
  display: grid;
  gap: 8px;
  margin: 22px auto 0;
  max-width: 440px;
  text-align: left;
  color: var(--muted);
  font-size: 0.92rem;
}

.empty-tips li::before {
  content: "💡 ";
}

.empty-art {
  position: relative;
  width: 150px;
  height: 104px;
  margin: 0 auto;
}

.empty-art span {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  box-shadow: 0 14px 30px rgba(79, 70, 229, 0.18);
  animation: cardBob 5s ease-in-out infinite;
}

.empty-art span:nth-child(1) {
  background: linear-gradient(135deg, #1e1b4b, #6366f1);
  transform: rotate(-9deg) translateX(-24px);
}

.empty-art span:nth-child(2) {
  background: linear-gradient(180deg, #fff, #eef1fb);
  border: 1px solid var(--line);
  transform: rotate(7deg) translateX(24px);
  animation-delay: 0.6s;
}

.empty-art span:nth-child(3) {
  background: linear-gradient(135deg, #7c3aed, #22d3ee);
  transform: scale(0.82);
  animation-delay: 1.2s;
}

.progress-orb {
  width: 76px;
  height: 76px;
  margin: 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--primary), var(--secondary), #22d3ee, var(--primary));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 9px), #000 calc(100% - 8px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 9px), #000 calc(100% - 8px));
  animation: spin 1.3s linear infinite;
}

.progress-list {
  list-style: none;
  display: grid;
  gap: 12px;
  max-width: 320px;
  margin: 24px auto 0;
  text-align: left;
}

.progress-list li {
  position: relative;
  padding-left: 34px;
  color: var(--muted);
  line-height: 22px;
  transition: color 0.3s ease;
}

.progress-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(79, 70, 229, 0.22);
  box-sizing: border-box;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
}

.progress-list li.active {
  color: var(--text);
  font-weight: 700;
}

.progress-list li.active::before {
  border-color: var(--primary);
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}

.progress-list li.done {
  color: var(--success);
}

.progress-list li.done::before {
  content: "✓";
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.result {
  display: grid;
  gap: 16px;
}

.result-toolbar {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
}

.result-heading {
  display: flex;
  align-items: center;
  gap: 8px 10px;
  flex-wrap: wrap;
  flex: 1 1 320px;
  min-width: 0;
}

.kind-badge {
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: rgba(79, 70, 229, 0.12);
  color: var(--primary-dark);
}

.kind-badge[data-kind="referat"] { background: rgba(14, 165, 233, 0.14); color: #0369a1; }
.kind-badge[data-kind="kursishi"] { background: rgba(16, 185, 129, 0.14); color: #047857; }

.doc-title-input {
  font: inherit;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.3rem 0.5rem;
  background: transparent;
  min-width: 0;
  flex: 1 1 200px;
  color: var(--text);
}

.doc-title-input:hover,
.doc-title-input:focus {
  border-color: var(--line);
  background: #fff;
  outline: none;
}

.result-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.82rem;
  color: var(--muted);
  flex-basis: 100%;
  padding-left: 4px;
}

.save-state {
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.74rem;
}

.save-state[data-state="saved"] { color: var(--success); background: rgba(22, 163, 74, 0.1); }
.save-state[data-state="pending"] { color: #b45309; background: rgba(245, 158, 11, 0.12); }
.save-state[data-state="saving"] { color: var(--primary); background: rgba(79, 70, 229, 0.1); }
.save-state[data-state="error"] { color: #dc2626; background: rgba(220, 38, 38, 0.1); }

.result-toolbar .result-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.result-toolbar .btn {
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
}

.notice {
  background: rgba(79, 70, 229, 0.07);
  border: 1px solid rgba(79, 70, 229, 0.18);
  color: var(--primary-dark);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 0.9rem;
  line-height: 1.6;
}

.notice::before {
  content: "ℹ️ ";
}

.notice.warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: #92400e;
}

.deck-hint {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

/* ---------- Slaydlar paneli ---------- */
.deck {
  display: grid;
  gap: 14px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  min-width: 0;
}

.deck-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.deck-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tool-chip {
  border: 1px solid rgba(79, 70, 229, 0.18);
  background: #fff;
  color: var(--primary-dark);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.45rem 0.8rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.tool-chip:hover {
  background: rgba(79, 70, 229, 0.08);
}

.tool-chip.danger {
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.25);
}

.tool-chip.danger:hover {
  background: rgba(220, 38, 38, 0.08);
}

.deck-stage {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 8px;
}

.stage-frame {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.18);
  min-width: 0;
}

.stage-nav {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--primary-dark);
  transition: background 0.2s ease;
}

.stage-nav:hover:not(:disabled) {
  background: rgba(79, 70, 229, 0.08);
}

.stage-nav:disabled {
  opacity: 0.3;
  cursor: default;
}

.notes label {
  font-weight: 700;
  font-size: 0.85rem;
  display: block;
  margin-bottom: 6px;
}

.deck-counter {
  color: var(--muted);
  font-weight: 600;
}

.notes textarea {
  width: 100%;
  border: 1px solid rgba(79, 70, 229, 0.15);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.6;
  resize: vertical;
  min-height: 74px;
  color: var(--text);
}

.notes textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.14);
}

.thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scroll-snap-type: x proximity;
}

.thumb {
  flex: 0 0 150px;
  position: relative;
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 0;
  background: none;
  cursor: pointer;
  overflow: hidden;
  scroll-snap-align: center;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.1);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.thumb:hover {
  transform: translateY(-2px);
}

.thumb.active {
  border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}

.thumb .slide {
  pointer-events: none;
}

.thumb-num {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 3;
  background: rgba(15, 23, 42, 0.68);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  border-radius: 6px;
  padding: 1px 6px;
}

/* ---------- Slayd (container query birliklari bilan masshtablanadi) ---------- */
.slide {
  container-type: inline-size;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--s-light);
  color: var(--s-text);
  font-family: "Inter", sans-serif;
  text-align: left;
}

.slide-inner {
  position: absolute;
  inset: 0;
  padding: 5.4cqw 6cqw 3.4cqw 7cqw;
  display: flex;
  flex-direction: column;
}

.slide::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1.35cqw;
  background: var(--s-accent);
  z-index: 1;
}

.slide.layout-title,
.slide.layout-summary,
.slide.layout-end {
  background: var(--s-dark);
  color: #fff;
}

.slide.layout-title::before,
.slide.layout-summary::before,
.slide.layout-end::before {
  display: none;
}

.slide-title {
  font-size: 3.4cqw;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--s-title);
  margin: 0;
  position: relative;
  z-index: 2;
}

.layout-title .slide-title,
.layout-summary .slide-title,
.layout-end .slide-title {
  color: #fff;
}

.slide-rule {
  display: block;
  width: 6.5cqw;
  height: 0.55cqw;
  border-radius: 1cqw;
  background: var(--s-accent);
  margin: 1.5cqw 0 2.3cqw;
  position: relative;
  z-index: 2;
}

.slide-subtitle {
  font-size: 2cqw;
  color: var(--s-accent2);
  margin: 0;
  position: relative;
  z-index: 2;
}

.slide-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.slide-orb.one {
  width: 46cqw;
  height: 46cqw;
  right: -8cqw;
  top: -14cqw;
  background: var(--s-accent);
  opacity: 0.22;
}

.slide-orb.two {
  width: 25cqw;
  height: 25cqw;
  right: 6cqw;
  bottom: -10cqw;
  background: var(--s-accent2);
  opacity: 0.18;
}

.layout-title .slide-inner {
  justify-content: center;
}

.layout-title .slide-title-block {
  max-width: 72%;
  position: relative;
  z-index: 2;
}

.layout-title.has-image .slide-title-block {
  max-width: 50%;
}

.layout-title .slide-title {
  font-size: 4.8cqw;
  line-height: 1.08;
}

.layout-title.has-image .slide-orb {
  display: none;
}

.slide-cover {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 41%;
  z-index: 1;
}

.slide-cover::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0.7cqw;
  background: var(--s-accent);
  z-index: 2;
}

.slide-cover .slide-figure,
.slide-cover img {
  width: 100%;
  height: 100%;
  margin: 0;
}

.slide-cover img {
  object-fit: cover;
  border-radius: 0;
  aspect-ratio: auto;
}

.slide-cover figcaption {
  display: none;
}

.slide-byline {
  list-style: none;
  color: var(--s-soft);
  font-size: 1.5cqw;
  margin-top: 2.4cqw;
  padding: 0;
}

.slide-body {
  display: flex;
  gap: 3cqw;
  flex: 1;
  min-height: 0;
}

.slide-bullets,
.slide-checks,
.slide-sources {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.4cqw;
  font-size: 1.8cqw;
  line-height: 1.42;
  min-width: 0;
  overflow: hidden;
}

.slide-bullets li,
.slide-checks li,
.slide-sources li {
  position: relative;
  padding-left: 2.6cqw;
}

.slide-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75cqw;
  width: 0.95cqw;
  height: 0.95cqw;
  border-radius: 0.2cqw;
  background: var(--s-accent);
}

.slide-checks li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--s-accent2);
  font-weight: 800;
}

.slide-sources {
  font-size: 1.25cqw;
  gap: 0.9cqw;
  overflow-wrap: anywhere;
}

.slide-sources li::before {
  content: "•";
  position: absolute;
  left: 0.6cqw;
  color: var(--s-accent);
  font-weight: 800;
}

.slide-figure {
  flex: 0 0 37%;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6cqw;
}

.slide-figure img {
  width: 100%;
  aspect-ratio: 1.1;
  object-fit: cover;
  border-radius: 1.2cqw;
  display: block;
  background: rgba(0, 0, 0, 0.05);
}

.slide-figure figcaption {
  font-size: 0.85cqw;
  color: var(--s-muted);
  font-style: italic;
}

.slide-agenda {
  list-style: none;
  counter-reset: agenda;
  padding: 0;
  margin: 2.4cqw 0 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.8cqw 4cqw;
  font-size: 1.7cqw;
  flex: 1;
  align-content: start;
}

.slide-agenda:has(li:nth-child(5)) {
  grid-template-columns: 1fr 1fr;
}

.slide-agenda li {
  counter-increment: agenda;
  display: flex;
  align-items: center;
  gap: 1.6cqw;
  min-height: 4.4cqw;
}

.slide-agenda li::before {
  content: counter(agenda);
  flex: 0 0 4.4cqw;
  height: 4.4cqw;
  border-radius: 50%;
  background: var(--s-accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.5cqw;
}

.layout-end .slide-inner {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.layout-end .slide-title {
  font-size: 4.8cqw;
}

.layout-end .slide-rule {
  margin: 1.8cqw auto 2cqw;
}

.layout-summary .slide-checks {
  color: #fff;
  position: relative;
  z-index: 2;
  max-width: 82%;
}

.slide-footer {
  display: flex;
  justify-content: space-between;
  gap: 2cqw;
  font-size: 0.9cqw;
  color: var(--s-muted);
  margin-top: auto;
  padding-top: 1.2cqw;
}

/* Tahrirlash holati */
.slide [contenteditable],
.paper [contenteditable] {
  outline: 1px dashed transparent;
  outline-offset: 0.3em;
  border-radius: 4px;
  transition: outline-color 0.2s ease, background 0.2s ease;
  cursor: text;
}

.slide [contenteditable]:hover,
.paper [contenteditable]:hover {
  outline-color: rgba(99, 102, 241, 0.45);
}

.slide [contenteditable]:focus,
.paper [contenteditable]:focus {
  outline: 2px solid rgba(99, 102, 241, 0.75);
  background: rgba(99, 102, 241, 0.06);
}

[data-placeholder].is-empty::after {
  content: attr(data-placeholder);
  opacity: 0.45;
  pointer-events: none;
}

/* ---------- Hujjat varag'i ---------- */
.paper-wrap {
  background: linear-gradient(180deg, #e7e9f4, #dfe2f0);
  border-radius: 22px;
  padding: 18px 24px 30px;
  display: grid;
  gap: 14px;
}

.paper {
  max-width: 794px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  gap: 26px;
  font-family: "Times New Roman", Times, serif;
  color: #111;
}

.paper-page {
  background: #fff;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.14);
  padding: 76px 57px 76px 113px;
  font-size: 18.6px;
  line-height: 1.5;
}

.title-page {
  aspect-ratio: 210 / 297;
  display: flex;
  flex-direction: column;
  text-align: center;
}

.tp-uni {
  font-weight: bold;
  text-transform: uppercase;
}

.tp-fac {
  margin-top: 6px;
}

.tp-hint {
  font-family: "Inter", sans-serif;
  font-size: 13px;
  color: var(--primary-dark);
  background: rgba(79, 70, 229, 0.08);
  padding: 8px 12px;
  border-radius: 10px;
}

.tp-center {
  margin: auto 0;
}

.tp-kind {
  font-size: 2em;
  font-weight: bold;
  letter-spacing: 0.08em;
}

.tp-subject {
  font-style: italic;
  margin-top: 6px;
}

.tp-topic {
  font-weight: bold;
  font-size: 1.12em;
  margin-top: 10px;
}

.tp-right {
  align-self: flex-end;
  text-align: left;
  width: 46%;
  margin-bottom: 3em;
}

.plan-list {
  list-style: none;
  padding: 0;
}

.plan-list li {
  margin-bottom: 4px;
}

.plan-l2 {
  padding-left: 47px;
}

.paper-h1 {
  text-align: center;
  font-weight: bold;
  font-size: 1em;
  margin: 0 0 0.8em;
}

.paper-h2 {
  font-weight: bold;
  font-size: 1em;
  margin: 1em 0 0.4em;
  text-indent: 47px;
}

.paper-p {
  text-indent: 47px;
  text-align: justify;
  margin: 0;
}

.paper-p.source {
  text-indent: 0;
  text-align: left;
  margin-bottom: 0.3em;
  overflow-wrap: anywhere;
}

.page-break {
  position: relative;
  border-top: 2px dashed #c7cbe0;
  margin: 34px -57px 34px -113px;
  text-align: center;
}

.page-break span {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  font-family: "Inter", sans-serif;
  font-size: 11px;
  color: #8b90b0;
  padding: 0 8px;
}

.paper-figure {
  position: relative;
  text-align: center;
  margin: 0.8em 0;
}

.paper-figure img {
  max-width: 62%;
  max-height: 360px;
  border-radius: 4px;
  display: inline-block;
}

.paper-figure figcaption {
  font-style: italic;
  font-size: 0.85em;
}

.figure-remove {
  position: absolute;
  top: 6px;
  right: 19%;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  background: rgba(15, 23, 42, 0.7);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.paper-figure:hover .figure-remove,
.figure-remove:focus-visible {
  opacity: 1;
}

/* ---------- Taqdimot rejimi ---------- */
.presenter {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: #05040f;
  display: flex;
  align-items: center;
  justify-content: center;
}

.presenter-stage {
  width: min(100vw, 177.78vh);
  cursor: pointer;
}

.presenter-bar {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(20, 18, 58, 0.78);
  color: #fff;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  opacity: 0.2;
  transition: opacity 0.3s ease;
}

.presenter:hover .presenter-bar,
.presenter-bar:focus-within {
  opacity: 1;
}

.presenter-bar button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
}

.presenter-bar button:hover {
  background: rgba(255, 255, 255, 0.24);
}

.presenter-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
}

.presenter-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #6366f1, #a78bfa);
  transition: width 0.3s ease;
}

body.presenting {
  overflow: hidden;
}

/* ---------- Kutubxona ---------- */
.library-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.filter-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.9);
  padding: 5px;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.filter-tab {
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--muted);
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  cursor: pointer;
}

.filter-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
}

.filter-tab .count {
  margin-left: 4px;
  font-size: 0.72rem;
  padding: 0.05rem 0.42rem;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.1);
}

.filter-tab.active .count {
  background: rgba(255, 255, 255, 0.25);
}

.library-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.library-controls input,
.library-controls select {
  border: 1px solid rgba(79, 70, 229, 0.15);
  border-radius: 12px;
  padding: 0.65rem 0.9rem;
  font: inherit;
  font-size: 0.9rem;
  background: #fff;
  color: var(--text);
}

.library-controls input {
  min-width: 260px;
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.doc-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.doc-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 44px rgba(79, 70, 229, 0.14);
}

.doc-cover {
  position: relative;
  aspect-ratio: 16 / 8.5;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px 18px;
  color: #fff;
  background:
    radial-gradient(circle at 85% 10%, color-mix(in srgb, var(--s-accent) 70%, transparent), transparent 55%),
    linear-gradient(135deg, var(--s-dark), color-mix(in srgb, var(--s-dark) 60%, var(--s-accent)));
  overflow: hidden;
}

.kind-referat .doc-cover,
.kind-kursishi .doc-cover {
  color: #111;
  font-family: "Times New Roman", Times, serif;
  background:
    repeating-linear-gradient(180deg, transparent 0 15px, rgba(79, 70, 229, 0.07) 15px 16px),
    linear-gradient(180deg, #fff, #f1f3fb);
  border-bottom: 1px solid var(--line);
}

.doc-cover-icon {
  position: absolute;
  top: 14px;
  left: 16px;
  font-size: 1.5rem;
}

.doc-cover-title {
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.doc-body {
  padding: 14px 16px 6px;
  flex: 1;
}

.doc-kind {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.kind-referat .doc-kind { color: #0369a1; }
.kind-kursishi .doc-kind { color: #047857; }

.doc-title {
  font-size: 1.05rem;
  margin: 4px 0;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.doc-meta {
  font-size: 0.82rem;
  color: var(--muted);
}

.doc-actions {
  display: flex;
  gap: 6px;
  padding: 10px 16px 16px;
  align-items: center;
}

.doc-actions .icon-btn:first-of-type {
  margin-left: auto;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text);
}

.icon-btn:hover {
  background: rgba(79, 70, 229, 0.08);
}

.icon-btn.danger:hover {
  background: rgba(220, 38, 38, 0.1);
}

.btn-danger {
  background: #dc2626;
  color: #fff;
}

.doc-skeleton {
  height: 290px;
  border-radius: 20px;
  background: linear-gradient(90deg, #eef0fa 25%, #f8f9fe 50%, #eef0fa 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

.confirm-dialog {
  border: 0;
  border-radius: 20px;
  padding: 26px;
  max-width: 420px;
  width: calc(100% - 32px);
  box-shadow: 0 40px 80px rgba(15, 23, 42, 0.35);
  color: var(--text);
}

.confirm-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.confirm-dialog h2 {
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}

.confirm-dialog p {
  color: var(--muted);
  margin: 8px 0 20px;
  line-height: 1.6;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ---------- Chop etish (PDF) ---------- */
.print-area {
  display: none;
}

@media print {
  body.printing > *:not(.print-area) {
    display: none !important;
  }

  body.printing .print-area {
    display: block !important;
  }

  .print-area * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-slides .print-slide {
    width: 297mm;
    height: 167.1mm;
    overflow: hidden;
    break-after: page;
  }

  .print-slides .slide {
    width: 297mm;
    height: 167.1mm;
    aspect-ratio: auto;
  }

  .print-paper .paper {
    max-width: none;
    display: block;
  }

  .print-paper .paper-page {
    box-shadow: none;
    width: 210mm;
    padding: 20mm 15mm 20mm 30mm;
    font-size: var(--paper-size, 18.6px);
    line-height: var(--paper-line, 1.5);
    break-after: page;
  }

  .print-paper .title-page {
    height: 297mm;
    aspect-ratio: auto;
  }

  .print-paper .page-break {
    border: 0;
    margin: 0;
    height: 0;
    break-before: page;
  }

  .print-paper .page-break span,
  .print-paper .tp-hint {
    display: none;
  }
}

/* ---------- Moslashuvchanlik (ilova) ---------- */
@media (max-width: 1100px) {
  .studio-layout {
    grid-template-columns: 320px minmax(0, 1fr);
  }
}

@media (max-width: 980px) {
  .auth-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .auth-page {
    align-items: flex-start;
  }

  .tool-cards {
    grid-template-columns: 1fr;
  }

  .studio-layout {
    grid-template-columns: 1fr;
  }

  .studio-panel {
    position: static;
    max-height: none;
  }

  .page-hero-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .paper-page {
    padding: 48px 32px 48px 56px;
    font-size: 16px;
  }

  .page-break {
    margin: 30px -32px 30px -56px;
  }
}

@media (max-width: 640px) {
  .header-actions .btn,
  .result-toolbar .btn,
  .doc-actions .btn,
  .dialog-actions .btn,
  .page-hero .btn,
  .empty-state .btn {
    width: auto;
  }

  .btn-new-text,
  .user-name {
    display: none;
  }

  .btn-new {
    padding: 0.6rem 0.85rem;
  }

  .user-btn {
    padding: 3px;
  }

  .auth-card {
    padding: 24px 18px;
  }

  .auth-intro p,
  .auth-points {
    display: none;
  }

  .auth-logo {
    margin-bottom: 18px;
  }

  .type-card small {
    display: none;
  }

  .form-row,
  .titul .form-grid {
    grid-template-columns: 1fr;
  }

  .deck {
    padding: 10px;
  }

  .deck-stage {
    grid-template-columns: 1fr;
  }

  .stage-nav {
    display: none;
  }

  .thumb {
    flex-basis: 110px;
  }

  .paper-wrap {
    padding: 10px;
  }

  .paper-page {
    padding: 28px 18px;
    font-size: 15px;
  }

  .paper-p,
  .paper-h2 {
    text-indent: 24px;
  }

  .page-break {
    margin: 26px -18px;
  }

  .library-controls,
  .library-controls label,
  .library-controls input {
    width: 100%;
    min-width: 0;
  }
}

@keyframes cardBob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -8px; }
}

/* ---------- Studiya: kengaytirilgan sozlamalar (v3.1) ---------- */
.theme-rose { --s-dark: #4c0519; --s-accent: #f43f5e; --s-accent2: #fda4af; --s-light: #fff1f2; --s-title: #9f1239; --s-text: #1f2937; --s-muted: #6b7280; --s-soft: #fecdd3; }
.theme-violet { --s-dark: #2e1065; --s-accent: #8b5cf6; --s-accent2: #e879f9; --s-light: #faf5ff; --s-title: #5b21b6; --s-text: #1f2937; --s-muted: #6b7280; --s-soft: #ddd6fe; }
.theme-forest { --s-dark: #1a2e05; --s-accent: #65a30d; --s-accent2: #facc15; --s-light: #f7fee7; --s-title: #365314; --s-text: #1c1917; --s-muted: #57534e; --s-soft: #d9f99d; }
.theme-crimson { --s-dark: #1c1917; --s-accent: #dc2626; --s-accent2: #f59e0b; --s-light: #fafaf9; --s-title: #7f1d1d; --s-text: #1c1917; --s-muted: #78716c; --s-soft: #e7e5e4; }
.theme-minimal { --s-dark: #18181b; --s-accent: #18181b; --s-accent2: #a1a1aa; --s-light: #ffffff; --s-title: #18181b; --s-text: #27272a; --s-muted: #71717a; --s-soft: #d4d4d8; }
.swatch.theme-minimal { background: linear-gradient(135deg, #18181b 0 50%, #e4e4e7 50% 100%); }

[data-kinds][hidden] { display: none !important; }

.type-picker {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.type-picker .type-option { grid-column: span 2; }
.type-picker .type-option:nth-of-type(4),
.type-picker .type-option:nth-of-type(5) { grid-column: span 3; }
.type-picker .type-option:nth-of-type(4) .type-card,
.type-picker .type-option:nth-of-type(5) .type-card {
  flex-direction: row;
  justify-content: center;
  gap: 8px;
  padding: 10px 8px;
}
.type-picker .type-option:nth-of-type(4) .type-card small,
.type-picker .type-option:nth-of-type(5) .type-card small { display: none; }
.type-picker .type-option:nth-of-type(4) .type-icon,
.type-picker .type-option:nth-of-type(5) .type-icon { font-size: 1.2rem; }

.chip-random {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(124, 58, 237, 0.14));
}

.segmented {
  display: flex;
  background: rgba(79, 70, 229, 0.06);
  border: 1px solid rgba(79, 70, 229, 0.14);
  border-radius: 12px;
  padding: 3px;
  gap: 3px;
}
.segmented label {
  flex: 1;
  position: relative;
  margin: 0;
}
.segmented input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.segmented span {
  display: block;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.55rem 0.3rem;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}
.segmented input:checked + span {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.18);
}
.segmented input:focus-visible + span {
  outline: 2px solid rgba(124, 58, 237, 0.55);
  outline-offset: 1px;
}
.segmented .f-classic { font-family: Georgia, "Times New Roman", serif; }
.segmented .f-strict { font-family: Arial, Helvetica, sans-serif; }

.form-row.three {
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 8px;
}
.form-row.three select {
  padding-left: 0.6rem;
  padding-right: 0.4rem;
}

.options-box {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: #fff;
}
.options-box summary {
  cursor: pointer;
  font-weight: 700;
  margin-bottom: 4px;
}
.options-box[open] summary { margin-bottom: 12px; }
.options-box .form-field { margin-bottom: 12px; }

.check-group {
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.check-group legend {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.check-group .check {
  position: relative;
  display: inline-flex;
}
.check-group .check input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.check-group .check span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(79, 70, 229, 0.18);
  color: var(--muted);
  background: #fff;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.check-group .check span::before {
  content: "+";
  font-weight: 800;
}
.check-group .check input:checked + span {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.check-group .check input:checked + span::before { content: "✓"; }
.check-group .check input:focus-visible + span {
  outline: 2px solid rgba(124, 58, 237, 0.55);
  outline-offset: 2px;
}

/* Slayd shriftlari */
.slide.font-classic { font-family: Georgia, "Times New Roman", serif; }
.slide.font-strict { font-family: Arial, Helvetica, sans-serif; }
.slide.font-classic .slide-title,
.slide.font-strict .slide-title { letter-spacing: 0; }

/* Nazorat savollari slaydi */
.slide.layout-questions {
  background: var(--s-dark);
  color: #fff;
}
.slide.layout-questions::before { display: none; }
.layout-questions .slide-title { color: #fff; }
.layout-questions .slide-checks {
  color: #fff;
  position: relative;
  z-index: 2;
  max-width: 82%;
}
.slide-questions li::before { content: "?"; }

/* Hujjat: shrift, o'lcham, interval sozlamalari */
.paper { font-family: var(--paper-font, "Times New Roman", Times, serif); }
.paper-page {
  font-size: var(--paper-size, 18.6px);
  line-height: var(--paper-line, 1.5);
}

/* Maqola ko'rinishi */
.article-head {
  text-align: center;
  margin-bottom: 1.2em;
}
.article-title {
  font-weight: bold;
  margin: 0 0 0.4em;
}
.article-author {
  font-weight: bold;
  font-style: italic;
  margin: 0;
}
.article-place {
  font-style: italic;
  margin: 0;
}
.paper-h-article {
  font-weight: bold;
  font-size: 1em;
  margin: 0.9em 0 0.3em;
}
.paper-h-article.sub { text-indent: 47px; }

.kind-badge[data-kind="mustaqil"] { background: rgba(245, 158, 11, 0.16); color: #b45309; }
.kind-badge[data-kind="maqola"] { background: rgba(236, 72, 153, 0.14); color: #be185d; }

@media (max-width: 520px) {
  .form-row.three { grid-template-columns: 1fr 1fr; }
  .form-row.three .form-field:first-child { grid-column: 1 / -1; }
  .paper-h-article.sub { text-indent: 24px; }
  .paper-page { font-size: calc(var(--paper-size, 18.6px) * 0.8); }
}
.type-card strong { white-space: nowrap; }
.type-picker .type-option:nth-of-type(3) .type-card strong { font-size: 0.86rem; }

/* ---------- Rasmli dizaynlar (v3.2) ---------- */
.design-kino { --d-base: #0b0f19; --d-accent: #f5b700; --d-accent2: #ffd86b; --d-title: #fff; --d-text: #f3f4f6; --d-muted: #cbd5e1; }
.design-jurnal { --d-base: #fbf8f3; --d-accent: #c2410c; --d-accent2: #f59e0b; --d-title: #1f2937; --d-text: #292524; --d-muted: #78716c; }
.design-banner { --d-base: #f8fafc; --d-accent: #2563eb; --d-accent2: #60a5fa; --d-title: #0f172a; --d-text: #1e293b; --d-muted: #64748b; }
.design-galereya { --d-base: #121212; --d-accent: #22d3ee; --d-accent2: #a78bfa; --d-title: #fff; --d-text: #e5e7eb; --d-muted: #9ca3af; }
.design-shisha { --d-base: #0f172a; --d-accent: #7c3aed; --d-accent2: #c4b5fd; --d-title: #1e1b4b; --d-text: #1f2937; --d-muted: #4b5563; }
.design-akademik { --d-base: #fff; --d-accent: #b08d57; --d-accent2: #d6bc8a; --d-title: #13294b; --d-text: #1f2937; --d-muted: #6b7280; }

.slide.sd {
  background: var(--d-base);
  color: var(--d-text);
}
.slide.sd::before { display: none; }
.sd .slide-title {
  color: var(--d-title);
  font-size: 3.1cqw;
  line-height: 1.15;
}
.sd .slide-rule {
  background: var(--d-accent);
  width: 6.75cqw;
  height: 0.5cqw;
  margin: 1.1cqw 0 1.6cqw;
}
.sd .slide-subtitle { color: var(--d-accent2); }

.sd-bg,
.sd-ph {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
}
.sd-bg {
  position: absolute;
  inset: 0;
}
.sd-empty {
  background: linear-gradient(135deg, var(--d-base), var(--d-accent));
  opacity: 0.9;
}
.sd-shade {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.sd-text {
  position: absolute;
  top: 7.3%;
  bottom: 8%;
  left: 6%;
  width: 54%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  z-index: 2;
}
.sd .slide-bullets,
.sd .slide-checks,
.sd .slide-sources {
  gap: 0.6em;
  line-height: 1.2;
  color: inherit;
}
.sd .slide-bullets li { padding-left: 1.3em; }
.sd .slide-bullets li::before {
  top: 0.38em;
  width: 0.5em;
  height: 0.5em;
  background: var(--d-accent);
}
.sd .slide-checks li { padding-left: 1.3em; }
.sd .slide-checks li::before { color: var(--d-accent2); }

.sd-media {
  position: absolute;
  z-index: 2;
}
.sd-collage {
  display: grid;
  gap: 0.9cqw;
  overflow: hidden;
}
.sd-collage.n1 { grid-template: 1fr / 1fr; }
.sd-collage.n2 { grid-template: 1fr 1fr / 1fr; }
.sd-collage.n3 {
  grid-template: 58fr 42fr / 1fr 1fr;
}
.sd-collage.n3 > :first-child { grid-column: 1 / -1; }
.sd-collage > * { min-height: 0; min-width: 0; }

.sd-num {
  position: absolute;
  left: 6%;
  bottom: 3%;
  font-size: 0.8cqw;
  color: var(--d-muted);
  z-index: 3;
}

/* Kinematik: butun slayd rasm, chapda to'q panel */
.design-kino .sd-shade {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.82) 0 63%, rgba(0, 0, 0, 0.35) 63% 100%);
}
.design-kino .sd-media { left: 66.75%; top: 12%; width: 29.25%; height: 74.7%; }

/* Jurnal: o'ngda rasm ustuni */
.design-jurnal .sd-media { left: 59.25%; top: 0; width: 40.75%; height: 100%; gap: 0.6cqw; }
.design-jurnal .sd-text { width: 50%; }

/* Banner: tepada rasmli lenta */
.sd-banner {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 28%;
  border-bottom: 0.5cqw solid var(--d-accent);
  overflow: hidden;
}
.sd-banner .sd-shade { background: rgba(0, 0, 0, 0.5); }
.sd-banner .slide-title {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 12%;
  color: #fff;
  font-size: 3.3cqw;
  z-index: 2;
}
.sd-text.sd-below { top: 33.3%; width: 87.75%; }
.design-banner.has-extra .sd-text.sd-below { width: 57.75%; }
.design-banner .sd-media { left: 66.75%; top: 33.3%; width: 29.25%; height: 56%; }

/* Galereya: to'q fon, o'ngda rasmlar kollaji */
.design-galereya .sd-media { left: 57%; top: 6.7%; width: 39.4%; height: 86.7%; }
.design-galereya .sd-text { width: 48%; }

/* Shisha: xira rasm ustida oq shaffof panel */
.design-shisha .sd-shade { background: rgba(0, 0, 0, 0.3); }
.sd-glass {
  left: 3.75%;
  top: 6.7%;
  bottom: 6.7%;
  width: 60%;
  padding: 2cqw 3.4cqw;
  border-radius: 2cqw;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
}
.design-shisha .sd-media { left: 66.75%; top: 12%; width: 29.25%; height: 76%; }
.design-shisha .sd-num { color: #fff; }

/* Akademik: chapda rasm ustuni, oltin chiziq */
.design-akademik .sd-media { left: 0; top: 0; width: 36.75%; height: 100%; gap: 0.6cqw; border-right: 0.6cqw solid var(--d-accent); }
.design-akademik .sd-text { left: 41.25%; }
.design-akademik .sd-num { left: 41.25%; }

/* Titul slayd */
.sd.layout-title .sd-shade {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.75));
}
.sd-title-block {
  position: absolute;
  left: 6.75%;
  right: 8%;
  bottom: 9%;
  z-index: 2;
}
.sd.layout-title .slide-title {
  font-size: 5.6cqw;
  line-height: 1.05;
  color: #fff;
}
.sd.layout-title .slide-subtitle { font-size: 2cqw; }
.sd.layout-title .slide-byline { color: rgba(255, 255, 255, 0.85); }
.sd-side {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 48%;
  border-left: 0.75cqw solid var(--d-accent);
}
.design-jurnal.layout-title .sd-title-block,
.design-akademik.layout-title .sd-title-block {
  right: 54%;
  bottom: auto;
  top: 50%;
  transform: translateY(-50%);
}
.design-jurnal.layout-title .slide-title,
.design-akademik.layout-title .slide-title { color: var(--d-title); font-size: 4.6cqw; }
.design-jurnal.layout-title .slide-subtitle,
.design-akademik.layout-title .slide-subtitle { color: var(--d-accent); }
.design-jurnal.layout-title .slide-byline,
.design-akademik.layout-title .slide-byline { color: var(--d-muted); }

/* Reja */
.sd.layout-agenda .sd-text { width: 58%; }
.sd .sd-agenda-photo { left: 65.25%; top: 0; width: 34.75%; height: 100%; }
.sd .slide-agenda {
  grid-template-columns: 1fr !important;
  gap: 1.4cqw;
  font-size: 2.2cqw;
  margin-top: 2cqw;
}
.sd .slide-agenda li::before { background: var(--d-accent); color: #fff; }
.design-shisha.layout-agenda { background: #f8fafc; }

/* Xulosa, savollar, yakun: to'liq rasm fon */
.sd.layout-summary .sd-shade,
.sd.layout-questions .sd-shade { background: rgba(0, 0, 0, 0.68); }
.sd-text.sd-wide { width: 85%; }
.sd.layout-summary .slide-title,
.sd.layout-questions .slide-title,
.sd.layout-end .slide-title { color: #fff; }
.sd.layout-summary .slide-checks,
.sd.layout-questions .slide-checks { color: #fff; max-width: none; }
.sd-end {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 2;
}
.sd.layout-end .sd-shade { background: rgba(0, 0, 0, 0.55); }
.sd.layout-end .slide-title { font-size: 5cqw; }
.sd-end .slide-rule { margin: 1.6cqw auto; }

/* Manbalar */
.sd.layout-sources { background: #fff; color: var(--d-text); }
.design-kino.layout-sources,
.design-galereya.layout-sources { background: var(--d-base); color: var(--d-text); }
.sd.layout-sources .sd-banner { height: 21%; }
.sd.layout-sources .sd-text.sd-below { top: 26%; }

/* Dizayn tanlash kartalari */
.design-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.design-card {
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 4px 4px 6px;
  background: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  font: inherit;
  min-width: 0;
}
.design-card:hover { transform: translateY(-2px); }
.design-card.active {
  border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.25);
}
.design-thumb {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  pointer-events: none;
}
.design-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}
.design-picker.small {
  grid-template-columns: repeat(6, minmax(70px, 1fr));
  flex: 1;
  min-width: 0;
}
.field-label small { font-weight: 500; }
.deck-tools .design-picker.small {
  flex: 1 1 100%;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
@media (max-width: 640px) {
  .deck-tools .design-picker.small { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Vizual ko'rinishlar (v3.3) ---------- */
.sd .vz-shade { background: rgba(0, 0, 0, 0.74) !important; }
.vz-dark { --vz-text: #f3f4f6; --vz-muted: #cbd5e1; --vz-card: rgba(255, 255, 255, 0.1); --vz-title: #fff; }
.vz-light { --vz-text: var(--d-text); --vz-muted: var(--d-muted); --vz-card: #fff; --vz-title: var(--d-title); }
.design-akademik.vz-light,
.design-banner.vz-light { --vz-card: #f4f5f7; }
.vz-dark .slide-title { color: #fff; }
.vz-head {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 5.3%;
  height: 14.4%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  z-index: 2;
}
.vz-head .slide-title { color: var(--vz-title); }
.vz-head .slide-rule { margin: 0.9cqw 0 0; }
.sd-banner + .vz-area,
.vz-area.below { top: 33.3%; bottom: 9.3%; }
.vz-area {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 23.3%;
  bottom: 10%;
  z-index: 2;
  display: grid;
  gap: 1.65cqw;
  color: var(--vz-text);
  min-height: 0;
}
.vz-area.row {
  display: flex;
  gap: 2.25cqw;
}
.vz-area .vz-text,
.vz-area .vz-quote-text {
  line-height: 1.22;
  overflow: hidden;
  min-height: 0;
}
.vz-text.center { text-align: center; }
.vz-card {
  position: relative;
  background: var(--vz-card);
  border-radius: 1.1cqw;
  padding: 1.5cqw;
  display: flex;
  flex-direction: column;
  gap: 1cqw;
  min-height: 0;
  overflow: hidden;
  box-shadow: 0 0.4cqw 1.4cqw rgba(15, 23, 42, 0.08);
}
.vz-dark .vz-card { box-shadow: none; }
.vz-card.with-photo { padding-top: 0; }
.vz-card-photo {
  margin: 0 -1.5cqw;
  height: 42%;
  flex: 0 0 42%;
  border-bottom: 0.45cqw solid var(--d-accent);
}
.vz-badge {
  flex: 0 0 auto;
  width: 4.6cqw;
  height: 4.6cqw;
  border-radius: 50%;
  background: var(--d-accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.6cqw;
}
.vz-card.with-photo .vz-badge { margin-top: -3.2cqw; position: relative; }
.vz-badge.big {
  width: 6cqw;
  height: 6cqw;
  font-size: 2.1cqw;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Jarayon */
.vz-steps {
  flex: 1;
  display: grid;
  gap: 2.6cqw;
  min-width: 0;
}
.vz-step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2cqw;
  min-height: 0;
}
.vz-step::before {
  content: "";
  position: absolute;
  top: 2.75cqw;
  left: 50%;
  width: calc(100% + 2.6cqw);
  height: 0.45cqw;
  background: var(--d-accent2);
}
.vz-step:last-child::before { display: none; }
.vz-arrow {
  position: absolute;
  top: 0.6cqw;
  right: -2.2cqw;
  color: var(--d-accent);
  font-size: 4cqw;
  font-weight: 800;
  line-height: 1;
  z-index: 1;
}
.vz-step .vz-card { flex: 1; justify-content: flex-start; }
.vz-side-photo {
  flex: 0 0 28%;
  border-radius: 1.1cqw;
  overflow: hidden;
  min-height: 0;
}
.vz-side-photo.sd-collage { flex-basis: 32%; }
.vz-side-photo.left { flex-basis: 36%; }

/* Vaqt chizig'i */
.vz-area.timeline { gap: 1.9cqw; }
.vz-area.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: var(--line-top, 4.5cqw);
  height: 0.45cqw;
  background: var(--d-accent2);
}
.vz-area.timeline:has(.vz-thumb) { --line-top: 14.9cqw; }
.vz-event {
  display: flex;
  flex-direction: column;
  gap: 0.6cqw;
  min-height: 0;
}
.vz-thumb {
  height: 9.75cqw;
  flex: 0 0 9.75cqw;
  border-radius: 0.8cqw;
  overflow: hidden;
}
.vz-year {
  font-size: 2.5cqw;
  font-weight: 800;
  color: var(--d-accent);
  min-height: 3.2cqw;
  margin-top: 0.6cqw;
}
.vz-dot {
  width: 2cqw;
  height: 2cqw;
  border-radius: 50%;
  background: var(--d-accent);
  margin: -0.4cqw 0 1cqw 0.3cqw;
  position: relative;
  z-index: 1;
}

/* Raqamlar */
.vz-stats {
  flex: 1;
  display: grid;
  gap: 1.5cqw;
  min-width: 0;
}
.vz-stat {
  padding-left: 2.6cqw;
  justify-content: center;
}
.vz-stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 0.6cqw;
  background: var(--d-accent);
}
.vz-value {
  font-weight: 800;
  line-height: 1.1;
  color: var(--d-accent);
  overflow-wrap: normal;
}
.vz-dark .vz-value { color: var(--d-accent2); }
.vz-label {
  font-size: 1.3cqw;
  color: var(--vz-muted);
}
.vz-raw {
  font-size: 0.95cqw !important;
  opacity: 0.6;
  margin-top: auto;
}

/* Iqtibos */
.vz-quote {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  position: relative;
  padding-top: 5.7cqw;
}
.vz-qmark {
  position: absolute;
  top: -2.4cqw;
  left: -0.4cqw;
  font-size: 8.3cqw;
  font-weight: 800;
  color: var(--d-accent);
  line-height: 1;
}
.vz-quote-text {
  font-weight: 800;
  color: var(--vz-title);
  max-height: 50%;
}
.vz-quote-text:only-of-type { max-height: none; }
.vz-rest {
  display: flex;
  flex-direction: column;
  gap: 0.8cqw;
  margin-top: 1.6cqw;
  padding-top: 1.4cqw;
  border-top: 0.4cqw solid var(--d-accent2);
  min-height: 0;
  overflow: hidden;
}

.visual-pick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}
.visual-pick select {
  border: 1px solid rgba(79, 70, 229, 0.25);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font: inherit;
  font-weight: 600;
  color: var(--primary-dark);
  background: #fff;
}

/* Hujjat jadvallari */
.paper-table {
  margin: 0.6em 0 1em;
}
.paper-table-num {
  text-align: right;
  font-style: italic;
  margin: 0;
  text-indent: 0;
}
.paper-table-name {
  text-align: center;
  font-weight: bold;
  margin: 0 0 0.3em;
  text-indent: 0;
}
.paper-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86em;
  line-height: 1.25;
}
.paper-table th,
.paper-table td {
  border: 1px solid #333;
  padding: 0.25em 0.45em;
  text-align: left;
  vertical-align: top;
}
.paper-table th {
  background: #d9e2f3;
  font-weight: bold;
}
.paper-table td:first-child {
  width: 27%;
}

/* Rasm tanlash oynasi */
.image-dialog {
  width: min(860px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  border: 0;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.35);
}
.image-dialog::backdrop { background: rgba(15, 23, 42, 0.55); }
.image-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.image-dialog-head h2 { margin: 0; font-size: 1.2rem; }
.image-dialog-hint { color: var(--muted); font-size: 0.9rem; margin: 6px 0 12px; }
.image-dialog-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.upload-btn { cursor: pointer; }
.upload-btn.loading, .own-file.loading { opacity: 0.6; pointer-events: none; }
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}
.image-option {
  border: 3px solid transparent;
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  background: #eef0f6;
}
.image-option img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-option:hover { border-color: rgba(79, 70, 229, 0.5); }
.image-option.current { border-color: var(--primary); }
.image-empty { color: var(--muted); grid-column: 1 / -1; }
#stage .sd-ph,
#stage .sd-bg,
#stage .sd-empty,
#stage .slide-figure img,
.paper img.pickable { cursor: pointer; }
#stage .sd-ph:hover,
.paper img.pickable:hover { filter: brightness(1.08); outline: 3px solid rgba(99, 102, 241, 0.7); outline-offset: -3px; }
.add-figure {
  display: block;
  margin: 0.4em auto 0.8em;
  border: 1.5px dashed rgba(79, 70, 229, 0.45);
  background: rgba(79, 70, 229, 0.05);
  color: var(--primary-dark);
  font: 600 13px "Inter", sans-serif;
  border-radius: 10px;
  padding: 6px 14px;
  cursor: pointer;
}
.add-figure:hover { background: rgba(79, 70, 229, 0.12); }

/* Bekor qilish tugmalari va slaydlarni sudrash */
.history-btns { display: inline-flex; gap: 4px; }
.history-btns .icon-btn { font-size: 1.15rem; }
.history-btns .icon-btn:disabled { opacity: 0.35; cursor: default; }
.thumb[draggable="true"] { cursor: grab; }
.thumb.dragging { opacity: 0.45; }
.thumb.drop-target { outline: 3px dashed var(--primary); outline-offset: 2px; }

/* Telefon: natija formadan yuqorida, taqdimot rejimida yotqizish maslahati */
@media (max-width: 980px) {
  body.has-result .studio-output { order: -1; }
  body.has-result .studio-layout { display: flex; flex-direction: column; }
}
.rotate-hint { display: none; }
@media (orientation: portrait) and (max-width: 700px) {
  .rotate-hint {
    display: block;
    position: absolute;
    top: 18px;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    margin: 0;
  }
}
@media (max-width: 640px) {
  .deck-buttons { gap: 6px; }
  .deck-buttons .tool-chip { padding: 0.4rem 0.7rem; }
  .result-actions { gap: 6px; }
  .image-dialog { padding: 14px; }
  .image-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .notes textarea { font-size: 16px; }
}

/* 6 ta ish turi: 3 + 3 */
.type-picker .type-option:nth-of-type(n) { grid-column: span 2; }
.type-picker .type-option:nth-of-type(4) .type-card,
.type-picker .type-option:nth-of-type(5) .type-card,
.type-picker .type-option:nth-of-type(6) .type-card {
  flex-direction: column;
  padding: 12px 6px;
  gap: 3px;
}
.type-picker .type-option:nth-of-type(4) .type-card small,
.type-picker .type-option:nth-of-type(5) .type-card small { display: block; }
.type-picker .type-option:nth-of-type(4) .type-icon,
.type-picker .type-option:nth-of-type(5) .type-icon { font-size: 1.5rem; }
.kind-badge[data-kind="test"] { background: rgba(20, 184, 166, 0.15); color: #0f766e; }
.test-only { display: none; font-weight: 500; }
#genForm:has(input[value="test"]:checked) .test-only { display: inline; }
@media (max-width: 640px) {
  .type-picker .type-option:nth-of-type(4) .type-card small,
  .type-picker .type-option:nth-of-type(5) .type-card small { display: none; }
}

/* Ulashish va faqat ko'rish rejimi */
.share-dialog { width: min(560px, calc(100vw - 32px)); }
.share-row { display: flex; gap: 8px; margin-bottom: 12px; }
.share-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 0.85rem;
}
body.readonly .deck-tools .deck-buttons,
body.readonly #deckThemes,
body.readonly .visual-pick,
body.readonly .history-btns,
body.readonly .deck-hint,
body.readonly .studio-panel { display: none !important; }
body.readonly .studio-layout { grid-template-columns: 1fr; }
body.readonly #stage .sd-ph,
body.readonly #stage .sd-bg { cursor: default; outline: none; }

/* Kutubxona: rasmli muqova */
.doc-cover.has-photo { color: #fff; background: #111; }
.doc-cover-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.doc-cover.has-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 30%, rgba(0, 0, 0, 0.75));
}
.doc-cover.has-photo > span { position: relative; z-index: 1; }
.doc-cover.has-photo .doc-cover-icon { position: absolute; }
.doc-cover.has-photo .doc-cover-title { font-family: "Inter", sans-serif; color: #fff; }
.doc-shared {
  position: absolute !important;
  top: 12px;
  right: 12px;
  z-index: 1;
  background: rgba(255, 255, 255, 0.92);
  color: var(--primary-dark);
  font: 700 0.7rem "Inter", sans-serif;
  padding: 3px 8px;
  border-radius: 999px;
}

/* Parolni tiklash */
.auth-forgot {
  display: block;
  margin: 10px auto 0;
  background: none;
  border: 0;
  color: var(--primary);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
.auth-forgot:hover { text-decoration: underline; }
.key-dialog {
  width: min(460px, calc(100vw - 32px));
  border: 0;
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.35);
}
.key-dialog::backdrop { background: rgba(15, 23, 42, 0.6); }
.key-dialog h2 { margin: 0 0 8px; font-size: 1.2rem; }
.key-dialog p { color: var(--muted); font-size: 0.9rem; }
.key-value {
  display: block;
  margin: 14px 0;
  padding: 14px;
  text-align: center;
  font: 800 1.35rem/1.2 ui-monospace, "Cascadia Mono", Consolas, monospace;
  letter-spacing: 0.08em;
  background: rgba(79, 70, 229, 0.08);
  border: 2px dashed rgba(79, 70, 229, 0.4);
  border-radius: 12px;
  color: var(--primary-dark);
  user-select: all;
}
.key-actions { display: flex; gap: 8px; justify-content: center; margin-bottom: 12px; flex-wrap: wrap; }
.key-form { display: grid; gap: 8px; }
.key-form input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  font: inherit;
}
#recoveryKey { text-transform: uppercase; letter-spacing: 0.06em; }

/* Bosh sahifa: ochiq manbalar */
.sources-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.sources-grid .stars { font-size: 1.6rem; letter-spacing: 0; }

.tp-ministry { font-weight: bold; font-size: 0.9em; margin: 0 0 0.6em; }

/* Modal oynalar ekran markazida (umumiy margin: 0 qoidasini bekor qiladi) */
dialog.key-dialog,
dialog.image-dialog { margin: auto; }

/* Aloqa: ikonkali havolalar */
.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.contact-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  word-break: break-all;
}
.contact-link small {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.6;
  margin-bottom: 1px;
}
.contact-icon {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}
.contact-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.contact-link:hover .contact-icon { transform: translateY(-2px) scale(1.05); }
.icon-mail { background: linear-gradient(135deg, #ea4335, #c5221f); }
.icon-telegram { background: linear-gradient(135deg, #37aee2, #1e96c8); }
.icon-instagram { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.icon-phone { background: linear-gradient(135deg, #22c55e, #15803d); }

/* ---------- Orqa fon musiqasi tugmasi (music.js) ---------- */
.music-toggle {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 80;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  cursor: pointer;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.92), rgba(124, 58, 237, 0.92));
  box-shadow: 0 18px 32px rgba(79, 70, 229, 0.3);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: transform 0.2s ease, background 0.3s ease;
}

.music-toggle:hover {
  transform: scale(1.07);
}

.music-toggle:focus-visible {
  outline: 3px solid #a5b4fc;
  outline-offset: 3px;
}

.music-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
}

.music-bars i {
  display: block;
  width: 3px;
  height: 5px;
  border-radius: 2px;
  background: currentColor;
  transition: height 0.3s ease;
}

.music-toggle.is-playing .music-bars i {
  animation: music-eq 1.1s ease-in-out infinite alternate;
}

.music-toggle.is-playing .music-bars i:nth-child(2) { animation-delay: -0.4s; }
.music-toggle.is-playing .music-bars i:nth-child(3) { animation-delay: -0.8s; }
.music-toggle.is-playing .music-bars i:nth-child(4) { animation-delay: -0.2s; }

@keyframes music-eq {
  from { height: 4px; }
  to { height: 18px; }
}

.music-off {
  display: none;
  font-size: 1.35rem;
  line-height: 1;
}

/* O'chirilgan holat: nota ustidan chizilgan chiziq */
.music-toggle.is-off {
  background: rgba(30, 27, 75, 0.78);
}

.music-toggle.is-off .music-bars {
  display: none;
}

.music-toggle.is-off .music-off {
  display: block;
  position: relative;
}

.music-toggle.is-off .music-off::after {
  content: "";
  position: absolute;
  left: -4px;
  right: -4px;
  top: 50%;
  height: 2px;
  background: currentColor;
  transform: rotate(-40deg);
}

/* Bildirishnomalar musiqa tugmasining ustida chiqadi */
body:has(.music-toggle) .toast-region {
  bottom: 86px;
}

.footer-replay {
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-replay:hover {
  color: #fff;
}

@media (max-width: 640px) {
  .music-toggle {
    left: 14px;
    bottom: 14px;
    width: 46px;
    height: 46px;
  }

  body:has(.music-toggle) .toast-region {
    bottom: 84px;
  }
}

@media print {
  .music-toggle,
  .intro {
    display: none !important;
  }
}

/* ---------- Sahifadan sahifaga o'tish (transition.js) ---------- */

/* Yangi sahifa birinchi kadrdanoq yopiq: parda elementi paydo bo'lguncha */
html.ss-pt-cover::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  background:
    radial-gradient(900px 620px at 18% 8%, #4338ca 0%, transparent 62%),
    radial-gradient(820px 620px at 92% 100%, #0e7490 0%, transparent 60%),
    #120f35;
}

.page-veil {
  --x: 50vw;
  --y: 50vh;
  position: fixed;
  inset: 0;
  z-index: 2147483001;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: #fff;
  font-family: "Inter", sans-serif;
  background:
    radial-gradient(900px 620px at 18% 8%, #4338ca 0%, transparent 62%),
    radial-gradient(820px 620px at 92% 100%, #0e7490 0%, transparent 60%),
    #120f35;
  clip-path: circle(0 at var(--x) var(--y));
  transition: clip-path 0.43s cubic-bezier(0.7, 0, 0.3, 1);
}

.page-veil.is-closing,
.page-veil.is-full {
  clip-path: circle(150vmax at var(--x) var(--y));
}

.page-veil.is-full {
  transition: none;
}

/* Kelish: parda egilgan pastki cheti bilan yuqoriga ko'tariladi */
.page-veil.is-opening {
  transform: translateY(-104%);
  border-radius: 0 0 50% 50% / 0 0 14vh 14vh;
  transition: transform 0.78s cubic-bezier(0.76, 0, 0.24, 1), border-radius 0.78s ease;
}

.pv-mark {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  font-size: 2.5rem;
  font-weight: 800;
  border-radius: 22px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6 55%, #e879f9);
  box-shadow: 0 22px 60px -10px rgba(168, 85, 247, 0.85), inset 0 2px 0 rgba(255, 255, 255, 0.35);
  animation: pv-pop 0.55s cubic-bezier(0.2, 1.5, 0.3, 1) 0.08s both;
}

.pv-name {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  animation: pv-rise 0.45s ease 0.16s both;
}

.pv-dest {
  min-height: 1.2em;
  font-size: 0.98rem;
  font-weight: 600;
  color: #c7d2fe;
  animation: pv-rise 0.45s ease 0.24s both;
}

.pv-bar {
  position: relative;
  width: 150px;
  height: 3px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.pv-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, #fff, transparent);
  animation: pv-load 0.9s ease-in-out infinite;
}

/* Kelishda logotip turgan joyida qoladi, qayta "sakramaydi" */
.page-veil.is-full .pv-mark,
.page-veil.is-full .pv-name,
.page-veil.is-full .pv-dest {
  animation: none;
}

@keyframes pv-pop {
  from { opacity: 0; transform: scale(0.4) rotate(-14deg); }
  to { opacity: 1; transform: none; }
}

@keyframes pv-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@keyframes pv-load {
  from { transform: translateX(-110%); }
  to { transform: translateX(260%); }
}

/* Parda ko'tarilayotganda sahifa mayin suzib chiqadi */
html.ss-pt-enter main,
html.ss-pt-enter .site-header {
  animation: ss-page-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.12s both;
}

html.ss-pt-enter .site-header {
  animation-name: ss-header-in;
  animation-delay: 0.2s;
}

@keyframes ss-page-in {
  from { opacity: 0; transform: translateY(34px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

@keyframes ss-header-in {
  from { opacity: 0; transform: translateY(-18px); }
  to { opacity: 1; transform: none; }
}

@media print {
  .page-veil {
    display: none !important;
  }
}

/* ---------- Studiya: o'z matnidan yaratish ---------- */
.own-text textarea {
  min-height: 12rem;
  resize: vertical;
  font-size: 0.9rem;
  line-height: 1.5;
}
.own-text-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
.own-file {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.own-file input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.own-file:focus-within {
  outline: 2px solid rgba(124, 58, 237, 0.55);
  outline-offset: 2px;
}
.own-text-count {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.own-text-count.over {
  color: #dc2626;
  font-weight: 600;
}
.own-text .hint {
  margin: 0.4rem 0 0;
}

/* ---------- Boshqaruv paneli ---------- */
.admin {
  padding: 32px 0 90px;
}
.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.admin-wide,
.stat-row {
  grid-column: 1 / -1;
}
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.stat-tile,
.admin-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
  min-width: 0;
}
.stat-tile {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 112px;
}
.stat-tile.skeleton {
  background: linear-gradient(90deg, #eef0fa 25%, #f8f9fe 50%, #eef0fa 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
  border: 0;
}
.stat-label {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}
.stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
}
.stat-note {
  font-size: 0.82rem;
  color: var(--muted);
}
.admin-card {
  padding: 20px 22px;
}
.admin-card h2 {
  font-size: 1.05rem;
  margin: 0;
}
.admin-sub {
  margin: 2px 0 14px;
  font-size: 0.85rem;
  color: var(--muted);
}
.admin-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.admin-empty {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Kunlik ustunli grafik: bitta qator, ingichka ustunlar, yumaloq uchi, nozik chiziqlar */
.day-chart {
  position: relative;
  height: 220px;
  padding: 0 0 26px 34px;
}
.day-grid {
  position: absolute;
  inset: 0 0 26px 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}
.day-gridline {
  position: relative;
  border-top: 1px solid #eceef5;
  height: 0;
}
.day-gridline span {
  position: absolute;
  right: calc(100% + 8px);
  top: -0.6em;
  font-size: 0.72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.day-cols {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  align-items: end;
}
.day-col {
  position: relative;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: default;
  font: inherit;
}
.day-col:hover,
.day-col:focus-visible {
  background: rgba(79, 70, 229, 0.05);
  border-radius: 8px 8px 0 0;
  outline: none;
}
.day-bar {
  position: relative;
  display: block;
  width: min(24px, 62%);
  background: var(--primary);
  border-radius: 4px 4px 0 0;
}
.day-peak {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.day-x {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
}
.chart-tip {
  position: fixed;
  z-index: 60;
  background: #111827;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 8px;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
}
.mini-table,
.user-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.mini-table th,
.mini-table td,
.user-table th,
.user-table td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid #eef0f6;
}
.mini-table th,
.user-table th {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}
.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.day-table {
  max-height: 260px;
  overflow: auto;
}

/* Gorizontal ustunlar: ish turlari */
.hbars {
  display: grid;
  gap: 10px;
}
.hbar {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
}
.hbar-label {
  color: var(--text);
}
.hbar-track {
  display: block;
  height: 14px;
}
.hbar-fill {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: 0 4px 4px 0;
}
.hbar-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 2ch;
  text-align: right;
}
.topic-list {
  margin: 0;
  padding-left: 1.3rem;
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
}
.topic-list li {
  padding-left: 2px;
}
.topic-list li::marker {
  color: var(--muted);
}
.topic-name {
  font-weight: 500;
  word-break: break-word;
}
.topic-count {
  color: var(--muted);
  margin-left: 6px;
  white-space: nowrap;
}
.admin-facts {
  margin: 12px 0 0;
  display: grid;
  gap: 4px 0;
  font-size: 0.88rem;
}
.admin-facts dt {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 6px;
}
.admin-facts dd {
  margin: 0;
  font-weight: 500;
  word-break: break-word;
}
.admin-facts dd.warn {
  color: #b45309;
}

/* Foydalanuvchilar jadvali */
.admin-search input {
  border: 1px solid rgba(79, 70, 229, 0.15);
  border-radius: 12px;
  padding: 0.6rem 0.9rem;
  font: inherit;
  font-size: 0.9rem;
  background: #fff;
  color: var(--text);
  min-width: 240px;
}
.user-table-wrap {
  margin-top: 8px;
  overflow-x: auto;
}
.user-table tr.is-blocked td {
  color: var(--muted);
}
.me-tag {
  color: var(--muted);
  font-weight: 400;
}
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-ok { background: #ecfdf3; color: #15803d; }
.badge-admin { background: #eef2ff; color: var(--primary-dark); }
.badge-blocked { background: #fef2f2; color: #b91c1c; }
.row-action {
  text-align: right;
  white-space: nowrap;
}
.btn-danger-soft {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.btn-danger-soft:hover {
  background: #fee2e2;
}

@media (max-width: 980px) {
  .admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .admin-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .stat-row { gap: 12px; }
  .stat-tile { padding: 14px 16px; min-height: 96px; }
  .stat-value { font-size: 1.6rem; }
  .admin-card { padding: 16px; }
  .day-chart { height: 190px; padding-left: 28px; }
  .day-grid { left: 28px; }
  .day-x.minor { display: none; }
  .admin-search, .admin-search input { width: 100%; min-width: 0; }
  /* Telefonda jadval kartochkalarga aylanadi */
  .user-table thead { display: none; }
  .user-table, .user-table tbody, .user-table tr, .user-table td { display: block; width: 100%; }
  .user-table tr {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 8px 12px;
    margin-bottom: 10px;
  }
  .user-table td {
    border: 0;
    padding: 4px 0;
    display: flex;
    justify-content: space-between;
    gap: 12px;
  }
  .user-table td[data-label]::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.8rem;
  }
  .user-table td.row-action { justify-content: flex-end; padding-top: 8px; }
  .user-table td.row-action:empty { display: none; }
}
@media (max-width: 640px) {
  .admin-card-head .btn { width: auto; flex: none; }
  .admin-card-head > div { flex: 1 1 0; min-width: 0; }
  .admin-card-head { flex-wrap: nowrap; }
  .admin-card-head:has(.admin-search) { flex-wrap: wrap; }
  .user-table td .login-cell { text-align: right; }
}

/* ---------- Originallik tekshiruvi ---------- */
.orig-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}
.orig-head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.orig-score {
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}
.orig-score strong {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
}
.orig-score span {
  color: var(--muted);
  font-size: 0.85rem;
}
.orig-meter {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: #fde7c7;
  overflow: hidden;
}
.orig-meter span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #d97706;
}
.orig-meter span[data-level="good"] { background: #16a34a; }
.orig-meter span[data-level="low"] { background: #dc2626; }
.orig-meter:has(span[data-level="good"]) { background: #dcfce7; }
.orig-meter:has(span[data-level="low"]) { background: #fee2e2; }
.orig-text {
  margin: 10px 0 6px;
  font-size: 0.9rem;
  line-height: 1.5;
}
.orig-legend {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.orig-key {
  display: inline-block;
  width: 14px;
  height: 10px;
  border-radius: 3px;
  margin-left: 6px;
}
.orig-key.orig-high,
.orig-high {
  background-color: rgba(250, 204, 21, 0.45) !important;
  box-shadow: inset 3px 0 0 #ca8a04;
}
.orig-key.orig-mid,
.orig-mid {
  background-color: rgba(250, 204, 21, 0.18) !important;
  box-shadow: inset 3px 0 0 #facc15;
}
.orig-high,
.orig-mid {
  border-radius: 4px;
}
@media print {
  .orig-high,
  .orig-mid {
    background: none !important;
    box-shadow: none !important;
  }
}

/* ---------- Shartlar va maxfiylik ---------- */
.auth-terms {
  margin: 12px 0 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}
.auth-terms a {
  color: var(--primary);
  font-weight: 600;
}
.user-dropdown .danger-item[hidden] {
  display: none;
}
.legal {
  padding: 36px 0 90px;
}
.legal-wrap {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.legal-toc {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 2px;
  font-size: 0.88rem;
}
.legal-toc a {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
}
.legal-toc a:hover {
  color: var(--primary-dark);
  background: rgba(79, 70, 229, 0.06);
}
.legal-body {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 34px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
  max-width: 760px;
  line-height: 1.65;
  color: var(--text);
}
.legal-body h2 {
  font-size: 1.15rem;
  margin: 28px 0 8px;
  scroll-margin-top: 96px;
}
.legal-body h2:first-child {
  margin-top: 0;
}
.legal-body p,
.legal-body li {
  font-size: 0.95rem;
}
.legal-body ul {
  padding-left: 1.2rem;
  display: grid;
  gap: 6px;
}
.legal-body a {
  color: var(--primary);
  font-weight: 600;
  overflow-wrap: anywhere;
}
@media (max-width: 860px) {
  .legal-wrap { grid-template-columns: minmax(0, 1fr); }
  .legal-toc { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legal-body { padding: 20px 18px; }
}
/* Slaydda fon bo'yalmaydi (dizayn ranglari buziladi): faqat sariq ramka */
#stage .orig-high,
#stage .orig-mid {
  background-color: transparent !important;
  box-shadow: none;
  outline: 3px solid #facc15;
  outline-offset: 2px;
}
#stage .orig-mid {
  outline-style: dashed;
  outline-width: 2px;
}

/* Xatolar jurnali (boshqaruv paneli) */
.error-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.error-item details {
  border: 1px solid #eef0f6;
  border-radius: 12px;
  padding: 10px 12px;
}
.error-item summary {
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 0.88rem;
}
.error-msg {
  font-weight: 600;
  word-break: break-word;
  flex: 1 1 260px;
}
.error-meta {
  color: var(--muted);
  font-size: 0.8rem;
}
.error-detail {
  margin: 10px 0 0;
  max-height: 260px;
  overflow: auto;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.75rem;
  white-space: pre-wrap;
  word-break: break-word;
}
.badge-warn { background: #fffbeb; color: #b45309; }
/* Hisob menyusidagi oddiy (qizil bo'lmagan) bandlar */
.user-dropdown button.plain-item,
.user-dropdown button#recoveryBtn {
  color: var(--text);
}
.key-form .field-error:empty {
  display: none;
}

/* ---------- Ilovani o'rnatish taklifi ---------- */
.install-banner {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 70;
  width: min(460px, calc(100% - 32px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
  animation: ss-install-in 0.4s ease both;
}
.install-banner img {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  flex: none;
}
.install-text {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.install-text strong {
  color: var(--text);
  font-size: 0.92rem;
}
.install-banner .btn {
  flex: none;
  width: auto;
}
.install-close {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
}
.install-close:hover {
  background: rgba(79, 70, 229, 0.08);
}
@keyframes ss-install-in {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@media print {
  .install-banner { display: none !important; }
}

/* ---------- Mavzular katalogi ---------- */
.chip-catalog {
  font-weight: 700;
}
.catalog-dialog {
  width: min(760px, calc(100vw - 24px));
  max-height: min(86vh, 760px);
  border: 0;
  border-radius: 22px;
  padding: 22px 22px 18px;
  box-shadow: 0 40px 80px rgba(15, 23, 42, 0.35);
  color: var(--text);
  display: none;
  flex-direction: column;
  gap: 12px;
}
.catalog-dialog[open] {
  display: flex;
}
.catalog-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
}
.catalog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.catalog-head h2 {
  margin: 0;
  font-size: 1.2rem;
}
.catalog-hint {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.catalog-search {
  border: 1px solid rgba(79, 70, 229, 0.18);
  border-radius: 12px;
  padding: 0.65rem 0.9rem;
  font: inherit;
  font-size: 0.95rem;
}
.catalog-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.catalog-tab {
  flex: none;
  border: 1px solid rgba(79, 70, 229, 0.16);
  background: #fff;
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.catalog-tab .count {
  color: var(--muted);
  font-weight: 500;
  margin-left: 2px;
}
.catalog-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.catalog-tab.active .count {
  color: rgba(255, 255, 255, 0.8);
}
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
  overflow-y: auto;
  min-height: 120px;
  padding: 2px;
}
.catalog-item {
  text-align: left;
  border: 1px solid #eceef6;
  background: #fafbff;
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  font: inherit;
  cursor: pointer;
  display: grid;
  gap: 2px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.catalog-item:hover,
.catalog-item:focus-visible {
  border-color: var(--primary);
  background: #eef2ff;
  outline: none;
}
.catalog-title {
  font-weight: 600;
  font-size: 0.92rem;
}
.catalog-item small {
  color: var(--muted);
  font-size: 0.75rem;
}
.catalog-empty {
  color: var(--muted);
  grid-column: 1 / -1;
}
@media (max-width: 640px) {
  .catalog-dialog { padding: 16px 14px 12px; max-height: 90vh; }
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.catalog-dialog {
  margin: auto;
}
