:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f0f2f8;
  --text: #121527;
  --muted: #5d6478;
  --line: #e3e6ef;
  --accent: #e5484d;
  --accent-ink: #ffffff;
  --accent-soft: #fde8e8;
  --ok: #1f9d55;
  --ok-soft: #e3f6ea;
  --warn: #b7791f;
  --warn-soft: #fdf3dc;
  --hero: #10142b;
  --hero-text: #f4f5fb;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(18, 21, 39, .04), 0 8px 24px rgba(18, 21, 39, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1020;
    --surface: #161a2e;
    --surface-2: #1d2238;
    --text: #eef0f7;
    --muted: #a2a8bd;
    --line: #2a3048;
    --accent: #ff5c61;
    --accent-soft: #3a1a20;
    --ok: #4ccf86;
    --ok-soft: #14301f;
    --warn: #f0b85a;
    --warn-soft: #33270f;
    --hero: #080b18;
    --shadow: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: inherit; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.inline { display: inline; }
.mt-12 { margin-top: 12px; }
.card-title { font-size: 1.2rem; }

/* top bar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; text-decoration: none; font-size: 1.1rem; }
.logo-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink); font-size: .8rem;
}
.topbar nav { display: flex; align-items: center; gap: 16px; }
.topbar nav a { text-decoration: none; color: var(--muted); font-weight: 600; }
.topbar nav a:hover { color: var(--text); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 20px; border-radius: 12px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink) !important; font: inherit; font-weight: 700;
  text-decoration: none; transition: transform .08s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 8px 14px; font-size: .9rem; }
.btn-ghost { background: var(--surface-2); color: var(--text) !important; }
.btn-light { background: #fff; color: #1f1f1f !important; }
.btn-danger { background: transparent; color: var(--accent) !important; border: 1px solid var(--accent); }
.btn-block { width: 100%; }
button.link { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
button.link:hover { color: var(--text); }
.g-icon { width: 20px; height: 20px; flex: none; }

/* flash */
.flashes { padding-top: 16px; display: grid; gap: 8px; }
.flash { padding: 12px 16px; border-radius: 12px; background: var(--surface-2); }
.flash-success { background: var(--ok-soft); color: var(--ok); }
.flash-error { background: var(--accent-soft); color: var(--accent); }

/* hero */
.hero { background: var(--hero); color: var(--hero-text); padding: 72px 0 80px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -.02em; max-width: 760px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead { font-size: 1.15rem; max-width: 640px; color: #c4c8db; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 28px; }
.hero-note { color: #9aa0b8; font-size: .9rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 36px; }
.chip { padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: #d9dcea; font-size: .875rem; }

/* sections */
.section { padding: 64px 0; }
.section h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.section-head { margin-bottom: 28px; max-width: 640px; }
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.step-num {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent); font-weight: 800; margin-bottom: 14px;
}

/* plans */
.plan { display: flex; flex-direction: column; }
.plan-name { font-size: 1.25rem; font-weight: 800; }
.plan-audience { color: var(--muted); margin-bottom: 18px; }
.plan-price { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
.plan-price span { font-size: 1rem; font-weight: 600; color: var(--muted); }
.plan ul { list-style: none; padding: 0; margin: 18px 0 24px; display: grid; gap: 10px; flex: 1; }
.plan li { padding-left: 28px; position: relative; }
.plan li::before {
  content: "✓"; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 6px;
  background: var(--ok-soft); color: var(--ok); font-size: .75rem; font-weight: 800; display: grid; place-items: center;
}
.plan.current { border-color: var(--accent); }
.disclaimer { font-size: .85rem; color: var(--muted); margin-top: 16px; }

/* ypp box */
.ypp { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.ypp-item { background: var(--surface-2); border-radius: 12px; padding: 16px; }
.ypp-item strong { display: block; font-size: 1.4rem; }

/* faq */
details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; }
details + details { margin-top: 10px; }
summary { cursor: pointer; font-weight: 700; }
details p { margin: 10px 0 0; color: var(--muted); }

/* page */
.page { padding: 40px 0 64px; }
.page-narrow { max-width: 760px; }
.page h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }

/* onboarding */
.niches { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin: 24px 0; }
.niche input { position: absolute; opacity: 0; pointer-events: none; }
.niche label {
  display: block; height: 100%; padding: 16px; border-radius: 14px; cursor: pointer;
  background: var(--surface); border: 2px solid var(--line); transition: border-color .15s ease, background .15s ease;
}
.niche label strong { display: block; }
.niche label span { font-size: .875rem; color: var(--muted); }
.niche input:checked + label { border-color: var(--accent); background: var(--accent-soft); }
.niche input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 2px; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 600; }
input[type=text], input[type=number], select, input[type=file] {
  width: 100%; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit;
}
.other-field[hidden] { display: none; }

/* dashboard */
.dash-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 24px; }
.avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--surface-2); flex: none; }
.dash-title { flex: 1; min-width: 200px; }
.dash-title h1 { margin: 0; font-size: 1.6rem; }
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700;
  background: var(--surface-2); color: var(--muted);
}
.badge-active, .badge-published { background: var(--ok-soft); color: var(--ok); }
.badge-pending, .badge-rendering { background: var(--warn-soft); color: var(--warn); }
.badge-cancelled { background: var(--accent-soft); color: var(--accent); }
.badge-draft { background: var(--accent-soft); color: var(--accent); }
.stats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.stat-label { color: var(--muted); font-size: .875rem; }
.stat-value { font-size: 1.8rem; font-weight: 800; letter-spacing: -.02em; }
.progress-row { margin-bottom: 18px; }
.progress-top { display: flex; justify-content: space-between; gap: 12px; font-size: .95rem; margin-bottom: 6px; }
/* CSP inline style'ga ruxsat bermaydi, shuning uchun foiz <progress> orqali */
progress.bar {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 10px;
  border: 0; border-radius: 999px; background: var(--surface-2); overflow: hidden; color: var(--accent);
}
progress.bar::-webkit-progress-bar { background: var(--surface-2); border-radius: 999px; }
progress.bar::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
progress.bar::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
progress.bar.done { color: var(--ok); }
progress.bar.done::-webkit-progress-value { background: var(--ok); }
progress.bar.done::-moz-progress-bar { background: var(--ok); }
.or { text-align: center; color: var(--muted); font-size: .8rem; font-weight: 700; margin: -6px 0 12px; }
.notice { padding: 14px 16px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); margin-bottom: 16px; }
.notice a { font-weight: 700; }
.pay { background: var(--surface-2); border-radius: 12px; padding: 16px; margin-top: 14px; }
.pay strong { font-size: 1.1rem; }
.videos { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.video-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.video-card video, .video-ph { display: block; width: 100%; aspect-ratio: 9 / 16; background: #000; object-fit: contain; }
.video-card.long video, .video-card.long .video-ph { aspect-ratio: 16 / 9; }
.video-ph { display: grid; place-items: center; color: #aab; font-size: .9rem; background: var(--surface-2); }
.video-meta { padding: 12px 14px; display: grid; gap: 6px; }
.video-title { font-weight: 700; font-size: .95rem; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 36px 0 14px; }
.section-title h2 { margin: 0; font-size: 1.3rem; }
.danger { margin-top: 48px; border-top: 1px solid var(--line); padding-top: 24px; }

/* admin */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* prose */
.prose h2 { font-size: 1.2rem; margin-top: 28px; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 6px; }

/* footer */
.footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: .9rem; }
.footer-in { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer a { color: var(--muted); }

@media (max-width: 560px) {
  .hero { padding: 48px 0 56px; }
  .section { padding: 44px 0; }
  .card { padding: 18px; }
  .topbar nav { gap: 12px; }
}
