@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("../fonts/manrope-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("../fonts/manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("../fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F;
}

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --line: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --accent: #1d6fe8;
  --accent-soft: #eef4ff;
  --blue: #1d6fe8;
  --blue-dark: #1258c4;
  --blue-soft: #eef4ff;
  --sky: #1d6fe8;
  --header: #1d6fe8;
  --card: #ffffff;
  --ok: #16a34a;
  --warn: #6b7280;
  --danger: #dc2626;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  --radius: 12px;
  --max: 1280px;
  --ai: #1d6fe8;
  --gold: #6b7280;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Manrope", "Inter", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.55;
}

img { max-width: 100%; }
button, input { font-family: inherit; }
a { color: inherit; text-decoration: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(248, 250, 252, 0.92);
  color: var(--text);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}
.topbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: nowrap;
  min-height: 72px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.04em;
  flex-shrink: 0;
  color: var(--text);
}
.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  object-fit: contain;
  display: block;
  background: transparent;
  filter: none;
}
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  background: rgba(255,255,255,0.55);
  padding: 5px 6px;
  border-radius: 999px;
  overflow-x: visible;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.7);
}
.nav button,
.nav .nav-a {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 650;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  text-decoration: none;
}
.nav button:hover,
.nav .nav-a:hover {
  color: #3d5d78;
}
.nav button.active,
.nav .nav-a.on {
  background: #eef6fb;
  color: #3f5f7a;
  box-shadow: 0 1px 0 rgba(255,255,255,0.9);
}
.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}
.xp-chip { display: none !important; }
.ghost, .primary {
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
}
.ghost {
  background: rgba(255,255,255,0.14);
  color: #fff;
  white-space: nowrap;
  height: 36px;
  line-height: 1;
}
.primary {
  background: #fff;
  color: var(--blue-dark);
}
.primary.solid {
  background: var(--blue);
  color: #fff;
}

.hero {
  background: var(--bg);
  padding: 32px 20px 16px;
}
.hero-inner { max-width: 900px; margin: 0 auto; text-align: center; }
.badge {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  background: rgba(255,255,255,0.75);
  color: var(--blue-dark);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.12;
  color: var(--text);
  letter-spacing: -0.04em;
  font-weight: 700;
}
.hero p {
  margin: 12px auto 20px;
  max-width: 560px;
  color: var(--muted);
  font-size: 16px;
}

.search-wrap {
  background: var(--surface);
  border-radius: 16px;
  display: flex;
  align-items: center;
  padding: 8px 8px 8px 16px;
  box-shadow: none;
  border: 1px solid var(--line);
  gap: 8px;
}
.search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.search-ico { color: var(--muted); flex-shrink: 0; display: grid; place-items: center; }
.search-wrap input {
  flex: 1;
  border: 0;
  outline: none;
  font-size: 16px;
  min-width: 0;
  background: transparent;
}
.lang-toggle {
  display: flex;
  background: #eef4ff;
  border-radius: 999px;
  padding: 3px;
}
.lang-toggle button {
  border: 0;
  background: transparent;
  padding: 7px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.lang-toggle button.on {
  background: var(--blue);
  color: #fff;
}
.search-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.quick-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.chip {
  border: 0;
  background: rgba(255,255,255,0.75);
  color: var(--blue-dark);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
}
.chip.on { background: var(--blue); color: #fff; }

.page { display: none; }
.page.on { display: block; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px 20px 96px;
}
.page-title {
  font-size: 28px;
  letter-spacing: -0.03em;
  margin: 0 0 6px;
}
.page-lead { margin-bottom: 22px; }
.block {
  margin: 28px 0 8px;
}
.block-title {
  font-size: 15px;
  font-weight: 800;
  margin: 0 0 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
#level-card { margin-bottom: 18px; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 0 0 8px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.stat b { display: block; font-size: 24px; color: var(--blue); }
.stat span { color: var(--muted); font-size: 13px; font-weight: 600; }

.grid-2 {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card h3 { font-size: 18px; margin-bottom: 8px; }
.muted { color: var(--muted); }
.daily {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.daily-emoji {
  width: 64px; height: 64px;
  border-radius: 18px;
  background: var(--blue-soft);
  display: grid; place-items: center;
  font-size: 32px;
  flex-shrink: 0;
}
.word-title {
  font-size: 28px;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.phon { color: var(--muted); font-weight: 600; font-size: 15px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 10px; }
.tag {
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
}
.tag.green { background: #e8f8ee; color: #15803d; }
.row-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.icon-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
}
.icon-btn:hover { border-color: var(--blue); color: var(--blue); }
.icon-btn.loved { background: #fff1f2; border-color: #fecdd3; color: #e11d48; }

.suggest {
  margin-top: 18px;
}
.suggest h3 { margin-bottom: 10px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
}
.pill:hover { border-color: var(--blue); color: var(--blue); }

.result-empty, .hint {
  text-align: center;
  padding: 40px 16px;
  color: var(--muted);
}

.word-sheet { display: grid; gap: 14px; }
.meta-line { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.section-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 6px;
}
.def { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.def:last-child { border-bottom: 0; }
.ex {
  background: var(--accent-soft);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 6px 0;
}
.list-inline { display: flex; flex-wrap: wrap; gap: 6px; }
.mini {
  background: var(--accent-soft);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 700;
}

.lessons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.lesson {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow);
}
.lesson:hover { border-color: var(--blue); }
.lesson h4 { margin: 6px 0 4px; }
.grammar-detail .form-box {
  background: var(--blue-soft);
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 800;
  margin: 10px 0 14px;
}

.flash-area { max-width: 560px; margin: 0 auto; }
.flash-card {
  background: #fff;
  border-radius: 24px;
  min-height: 280px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 32px 20px;
  cursor: pointer;
  user-select: none;
}
.flash-card .big { font-size: 40px; letter-spacing: -0.03em; }
.flash-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.quiz-q { font-size: 20px; font-weight: 800; margin: 8px 0 16px; }
.option {
  display: block;
  width: 100%;
  text-align: left;
  margin: 8px 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-weight: 650;
}
.option.correct { background: #e8f8ee; border-color: #86efac; }
.option.wrong { background: #fef2f2; border-color: #fecaca; }

.fav-list { display: grid; gap: 8px; }
.fav-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
}

.progress-bar {
  height: 10px;
  background: #e8eef8;
  border-radius: 99px;
  overflow: hidden;
  margin: 8px 0 16px;
}
.progress-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), #60a5fa);
  width: 0%;
}

footer {
  text-align: center;
  color: var(--muted);
  padding: 10px 16px 30px;
  font-size: 13px;
}

@media (max-width: 860px) {
  .nav { display: none; }
  .stats, .grid-2, .lessons, .home-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 34px; }
  .mobile-nav {
    display: flex !important;
  }
}
.mobile-nav {
  display: none;
  position: sticky;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  justify-content: space-around;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  z-index: 40;
}
.mobile-nav button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 64px;
}
.mobile-nav button svg { width: 20px; height: 20px; }
.mobile-nav button.active { color: var(--accent); }
.mobile-nav b { display: block; font-size: 18px; }

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.plan {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px 18px;
  box-shadow: var(--shadow);
  position: relative;
  display: flex;
  flex-direction: column;
}
.plan.blue { border-color: #93c5fd; transform: translateY(-6px); }
.plan.gold { border-color: #f6d47c; background: linear-gradient(#fff, #fffaf0); }
.plan-badge {
  position: absolute;
  top: -10px;
  right: 14px;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
}
.plan.gold .plan-badge { background: #c27803; }
.plan .price { font-size: 30px; letter-spacing: -0.04em; margin: 8px 0 2px; }
.plan ul { list-style: none; margin: 14px 0 18px; }
.plan li { padding: 6px 0; font-size: 14px; }
.ok { color: #15803d; }
.no { color: #94a3b8; }
.lock-note {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: 14px;
  padding: 12px 14px;
  margin: 12px 0;
  font-weight: 650;
}
.banner-pro {
  background: var(--accent-soft);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  border: 1px solid var(--line);
}
.banner-pro .primary { white-space: nowrap; }
[hidden] { display: none !important; }
.form { display: grid; gap: 10px; }
.form label { font-size: 13px; font-weight: 800; color: var(--muted); }
.form input, .form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font-size: 15px;
  outline: none;
}
.form input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px #e0edff; }
.pay-card {
  background: linear-gradient(135deg, #1e3a8a, #2563eb 55%, #38bdf8);
  color: #fff;
  border-radius: 18px;
  padding: 20px;
  min-height: 150px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.pay-card .num { letter-spacing: 0.18em; font-size: 20px; margin-top: 28px; font-weight: 700; }
.warn-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 12px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 78px;
  transform: translateX(-50%);
  background: #111827;
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  z-index: 80;
  font-weight: 700;
  font-size: 14px;
  display: none;
}
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  place-items: center;
  z-index: 70;
  padding: 16px;
}
.modal-bg.on { display: grid; }
.modal {
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  width: min(420px, 100%);
  box-shadow: 0 20px 50px rgba(0,0,0,.2);
}
.ad-modal { width: min(460px, 100%); text-align: left; }
.ad-modal h2 { margin: 8px 0 8px; letter-spacing: -0.03em; }
.ad-tag {
  display: inline-block;
  background: #fff7ed;
  color: #c2410c;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
}
.ad-plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}
.ad-plans div {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
}
.ad-plans b { display: block; }
.ad-plans span { font-size: 12px; color: var(--muted); }
.user-chip {
  background: var(--accent);
  border: 0;
  color: #fff;
  border-radius: 10px;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
  height: 40px;
  max-width: 148px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 40px;
  box-shadow: none;
}
.topbar .ghost {
  background: transparent;
  color: var(--muted);
}
.topbar .ghost:hover {
  background: rgba(255,255,255,0.55);
}
.pay-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.history { display: grid; gap: 8px; }
.history .item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}
@media (max-width: 860px) {
  .plan-grid { grid-template-columns: 1fr; }
  .plan.blue { transform: none; }
}

.xp-chip {
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
}
.chat-log {
  max-height: 460px;
  overflow: auto;
  display: grid;
  gap: 12px;
  margin-bottom: 10px;
  padding: 2px;
}
.bubble {
  max-width: 86%;
  padding: 10px 12px;
  border-radius: 14px;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.45;
}
.bubble.me {
  background: var(--blue);
  color: #fff;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}
.ai-frame {
  width: 100%;
  max-width: none;
  margin: 0;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.ai-frame-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.ai-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #bbf7d0;
  box-shadow: 0 0 0 4px rgba(187, 247, 208, 0.25);
}
.ai-frame-body {
  padding: 14px 16px 16px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}
.ai-frame-text { white-space: pre-wrap; }
.ai-frame-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  color: var(--text);
}
.ai-frame-meta {
  display: inline-block;
  background: #e8f1ff;
  color: #1258c4;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 10px;
}
.chat-form { display: flex; gap: 8px; }
.chat-form input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font-size: 15px;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.chips button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.task {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}
.task.done { opacity: 0.75; background: #f0fdf4; }
.task-xp { color: var(--blue); font-weight: 800; white-space: nowrap; }

/* Natija ramkasi — lug'at kartasi */
.dict-frame {
  background: var(--card);
  color: var(--text);
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.dict-frame-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}
.dict-frame-top .src {
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  letter-spacing: 0.04em;
}
.dict-frame-body {
  padding: 20px 20px 22px;
  background: var(--card);
  color: var(--text);
}
.dict-loading {
  text-align: center;
  padding: 36px 16px;
  color: var(--muted);
  font-weight: 700;
}
.dict-loading .spin {
  width: 28px;
  height: 28px;
  border: 3px solid #dbe7ff;
  border-top-color: var(--blue);
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.gpt-mark {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: #10a37f;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
}
.ai-frame-top.gpt {
  background: linear-gradient(90deg, #0d8a6a, #10a37f 55%, #3cc8a4);
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.8fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 8px;
}
.featured-word {
  min-height: 240px;
}
.featured-word .block-title { margin-bottom: 16px; }
.home-side { display: flex; flex-direction: column; gap: 12px; }
.side-panel .block-title { margin-bottom: 14px; }
.mini-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.mini-stats div {
  background: #f4f8fd;
  border-radius: 14px;
  padding: 12px;
}
.mini-stats b { display: block; font-size: 22px; color: var(--blue); }
.mini-stats span { color: var(--muted); font-size: 12px; font-weight: 700; }
.side-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 10px;
}
.word-tile {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 14px 14px 12px;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
  display: grid;
  gap: 4px;
}
.word-tile i { font-style: normal; font-size: 22px; }
.word-tile b { font-size: 16px; letter-spacing: -0.02em; }
.word-tile span { color: var(--muted); font-size: 13px; font-weight: 600; }
.word-tile:hover { border-color: var(--blue); color: var(--blue); }

@media (max-width: 1100px) {
  .nav button { padding: 7px 8px; font-size: 12px; }
}

html[data-theme="dark"] {
  --bg: #0f1724;
  --surface: #162033;
  --line: #2a3d58;
  --text: #e8eef8;
  --muted: #9aabc2;
  --accent: #5aa2ff;
  --accent-soft: #1b2d4a;
  --blue: #5aa2ff;
  --blue-dark: #9ec5ff;
  --blue-soft: #1b2d4a;
  --header: #16365f;
  --card: #162033;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
html[data-theme="dark"] body { background: var(--bg); color: var(--text); }
html[data-theme="dark"] .topbar {
  background: rgba(18, 28, 42, 0.88);
  color: #d5e4f2;
  border-bottom-color: #24344a;
}
html[data-theme="dark"] .logo { color: #c5d6e6; }
html[data-theme="dark"] .nav {
  background: rgba(255,255,255,0.06);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}
html[data-theme="dark"] .nav button,
html[data-theme="dark"] .nav .nav-a { color: #8aa0b5; }
html[data-theme="dark"] .nav button.active,
html[data-theme="dark"] .nav .nav-a.on {
  background: #24384f;
  color: #e7eef6;
}
html[data-theme="dark"] .user-chip {
  background: #2a4a6a;
  color: #dbeaf8;
}
html[data-theme="dark"] .icon-btn,
html[data-theme="dark"] .pill,
html[data-theme="dark"] .option,
html[data-theme="dark"] .word-tile,
html[data-theme="dark"] input,
html[data-theme="dark"] .search-wrap { background: #1b2940; color: var(--text); border-color: var(--line); }

.icon-only { width: 36px; padding: 0; display: grid; place-items: center; }
.mic-btn {
  border: 0;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  width: 36px;
  height: 36px;
}
.mic-btn.on { filter: saturate(2); }

.study-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 0 16px;
}
.study-tabs button {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 12px;
  font-weight: 700;
  cursor: pointer;
}
.study-tabs button.on { background: var(--blue); color: #fff; border-color: var(--blue); }

.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.game-card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  text-align: left;
}
.match-board { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.match-board button {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  font-weight: 700;
}
.match-board button.on { outline: 2px solid var(--blue); }
.match-board button.ok { background: #e8f8ee; }
.match-board button.bad { background: #fff1f2; }

.plan-row { display: grid; gap: 10px; }
.plan-item { padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ach {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
  background: var(--card);
}
.ach.on { background: #fff7d6; border-color: #f5c84c; }

.talk-bubble { background: var(--blue-soft); border-radius: 16px; padding: 14px; margin-bottom: 10px; }
.league li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.league .me { font-weight: 800; color: var(--blue); }

:root {
  --ok: #16a34a;
  --warn: #6b7280;
  --danger: #dc2626;
  --ai: #1d6fe8;
  --gold: #6b7280;
}
.streak-head { font-weight: 800; font-size: 18px; }
.streak-days { display: flex; gap: 8px; margin-top: 12px; }
.streak-day {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  font-weight: 800; font-size: 13px;
}
.streak-day.on { background: #e8f8ee; border-color: #16a34a; color: #15803d; }
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.topic-card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 16px;
  padding: 14px;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 6px;
}
.topic-card span { color: var(--muted); font-size: 13px; font-weight: 700; }
.topic-card:hover { border-color: var(--blue); }
.ai-teacher, .ai-frame-top.gpt {
  border-color: var(--line);
}
.ai-frame-top.gpt {
  background: var(--accent);
}
.gpt-mark { background: #1258c4; }
.talk-bubble { background: var(--accent-soft); }
html[data-theme="dark"] .talk-bubble { background: var(--blue-soft); }
html[data-theme="dark"] .streak-day.on { background: #163528; color: #86efac; }
.chat-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.chat-toolbar select {
  flex: 1;
  min-width: 140px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  background: var(--card);
  color: var(--text);
  font-weight: 700;
}
.nav-more { display: none; }
.report-pre {
  white-space: pre-wrap;
  font-family: Manrope, sans-serif;
  font-weight: 700;
  line-height: 1.6;
  margin-bottom: 12px;
}
body.locked header.topbar,
body.locked main,
body.locked footer,
body.locked .mobile-nav { }
#app-root { }
body.locked #app-root { display: none !important; }
.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #fff;
  padding: 24px;
}
.gate-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  padding: 28px 24px;
  box-shadow: 0 12px 40px rgba(15,23,42,.06);
  text-align: center;
}
.gate-card h1 { margin: 0 0 6px; }
.gate-card .form { text-align: left; margin-top: 16px; }
.text-link {
  margin-top: 16px;
  background: none;
  border: 0;
  color: #64748b;
  cursor: pointer;
  font-weight: 700;
}
.site-note {
  background: var(--accent-soft);
  color: var(--text);
  text-align: center;
  padding: 10px 16px;
  font-weight: 700;
}
.admin-wrap { min-height: 100vh; background: #f8fafc; }
.admin-wrap { min-height: 100vh; background: #eef3f9; }
.admin-bar { background: #123E7A; color: #fff; }
.admin-bar-in {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-bar-in span { display: block; font-size: 12px; opacity: .75; font-weight: 600; }
.admin-bar-in .ghost { margin-left: auto; background: rgba(255,255,255,.12); color: #fff; border-color: transparent; }
.admin-main { max-width: 1100px; margin: 0 auto; padding: 24px 20px 48px; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.as { background: #fff; border-radius: 16px; padding: 16px 18px; box-shadow: 0 8px 24px rgba(18,62,122,.06); }
.as b { display: block; font-size: 28px; line-height: 1.1; }
.as span { color: #64748b; font-weight: 700; font-size: 12px; }
.as-blue { border-left: 5px solid #1d6fe8; }
.as-green { border-left: 5px solid #16a34a; }
.as-navy { border-left: 5px solid #123E7A; }
.as-gold { border-left: 5px solid #d97706; }
.as-purple { border-left: 5px solid #1d6fe8; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.admin-wide { grid-column: 1 / -1; }
.admin-card h3 { margin: 0 0 8px; }
.admin-card textarea { width: 100%; border: 1px solid #dbe4f0; border-radius: 12px; padding: 10px; min-height: 90px; }
.admin-help { margin: 8px 0 0; padding-left: 18px; color: #475569; }
.admin-row {
  display: grid;
  grid-template-columns: 1.2fr 1.4fr auto;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid #eef2f7;
  font-size: 14px;
}
.admin-row em { color: #64748b; font-style: normal; font-size: 12px; }
@media (max-width: 800px) {
  .admin-grid { grid-template-columns: 1fr; }
  .admin-row { grid-template-columns: 1fr; }
}
.x-tools { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; margin-top:12px; }
.recent-box { margin-top:10px; text-align:center; }
.offline-banner { background:#fee2e2; color:#991b1b; text-align:center; padding:8px; font-weight:800; }
.timer-box { text-align:center; background:#123E7A; color:#fff; padding:8px; font-weight:800; }
.goal-bar { margin:12px 0; padding:14px 16px; }
.goal-top { display:flex; justify-content:space-between; font-weight:800; margin-bottom:8px; }
.goal-track { height:10px; background:#e2e8f0; border-radius:99px; overflow:hidden; }
.goal-track i { display:block; height:100%; background:#16a34a; }
.fb-fab {
  position:fixed; right:16px; bottom:96px; z-index:35;
  width:48px; height:48px; border-radius:50%; border:0;
  background:var(--accent); color:#fff; font-size:20px; cursor:pointer;
  box-shadow:0 1px 2px rgba(0,0,0,.08);
  display:grid; place-items:center;
}
#issue-text { width:100%; border:1px solid #dbe4f0; border-radius:12px; padding:10px; }

.nav-a{display:inline-flex;align-items:center;}
#admin-pw-old,#admin-pw-new,#admin-pw-new2{width:100%;margin:6px 0 10px;padding:10px 12px;border:1px solid #dbe3f0;border-radius:10px}
#admin-chart{display:block;max-width:100%}

.colo-search{width:100%;max-width:420px;margin:8px 0 16px;padding:12px 14px;border:1px solid var(--line);border-radius:14px;background:#fff}
.colo-tags{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:16px}
.colo-tags button{border:0;background:#e8f1f8;color:#3d5d78;border-radius:999px;padding:7px 12px;font-weight:700;cursor:pointer}
.colo-tags button.on{background:#d5e8f6;color:#1e3a5f}
.colo-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px}
.colo-card{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:14px 16px;cursor:pointer;box-shadow:var(--shadow)}
.colo-card:hover{border-color:#b9d4ea}
.colo-cat{font-size:11px;font-weight:800;color:#5b7c96;text-transform:lowercase}
.colo-card h3{margin:6px 0 4px;font-size:16px}
.colo-card p{color:var(--muted);margin:0}
.colo-card small{color:#8aa0b3}
html[data-theme="dark"] .colo-search,
html[data-theme="dark"] .colo-card{background:var(--card);color:var(--text);border-color:var(--line)}
html[data-theme="dark"] .colo-tags button{background:#1b2940;color:#c5d6e6}

.home-extra, .x-tools { display: none; }
.hero .ghost { color: #1e3a5f; background: rgba(255,255,255,.8); }
.gate-skip { margin-top: 12px; background: none; border: 0; color: #35536d; font-weight: 700; cursor: pointer; text-decoration: underline; }
.mobile-nav button b { display: none; }

#plan-ad{display:none !important}

/* —— UI tuzatishlar —— */
.hello-name { margin-top: 24px; font-size: 13px; }
.pro-note {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.text-link.inline {
  margin: 0;
  padding: 0;
  color: var(--accent);
  display: inline;
  font-weight: 700;
}
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.8fr);
  gap: 16px;
  align-items: stretch;
}
.featured-word { min-width: 0; }
.more-words { margin-top: 12px; }
.nav-more-wrap { position: relative; }
.nav-more-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 650;
  font-size: 14px;
  cursor: pointer;
}
.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
  min-width: 180px;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  z-index: 50;
  display: grid;
}
.nav-dropdown button {
  width: 100%;
  text-align: left;
  border-radius: 8px !important;
}
.chat-menu-wrap { position: relative; }
.chat-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-width: 200px;
  display: grid;
  z-index: 20;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
}
.chat-menu button {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
  color: var(--text);
  font-weight: 650;
}
.chat-menu button:hover { background: var(--accent-soft); }
.chat-log { max-width: 720px; margin-left: auto; margin-right: auto; }
.bubble { max-width: 100%; }
.bubble.me { max-width: 86%; }
#theme-toggle .ico-sun { display: none; }
html[data-theme="dark"] #theme-toggle .ico-sun { display: block; }
html[data-theme="dark"] #theme-toggle .ico-moon { display: none; }
html[data-theme="dark"] .hero,
html[data-theme="dark"] .hero h1 { background: var(--bg); color: var(--text); }
html[data-theme="dark"] .hero p,
html[data-theme="dark"] .hello-name { color: var(--muted); }
html[data-theme="dark"] .user-chip { background: var(--accent); color: #fff; }
html[data-theme="dark"] .mobile-nav { background: var(--card); }
html[data-theme="dark"] .mini-stats div { background: var(--blue-soft); }
html[data-theme="dark"] .hero .ghost { color: var(--text); background: var(--card); }
html[data-theme="dark"] .ai-frame { background: var(--card); }
html[data-theme="dark"] .ai-frame-title { color: var(--text); }
html[data-theme="dark"] .chips button,
html[data-theme="dark"] .icon-btn { background: var(--card); color: var(--text); border-color: var(--line); }
html[data-theme="dark"] .chat-form input { background: var(--card); color: var(--text); }
.chat-log { max-width: none; margin-left: 0; margin-right: 0; }
.daily-emoji { display: none; }
.word-title { flex-wrap: wrap; }
.nav-dropdown { z-index: 60; }
html[data-theme="dark"] .nav-dropdown,
html[data-theme="dark"] .chat-menu { background: var(--card); }
@media (max-width: 860px) {
  .fb-fab { bottom: calc(72px + env(safe-area-inset-bottom)); }
  .wrap { padding-bottom: 120px; }
  .search-wrap { align-items: stretch; }
}

@media (max-width: 860px) {
  .search-wrap {
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    border-radius: 12px;
  }
  .search-row { width: 100%; }
  .search-wrap input { font-size: 16px; min-width: 0; flex: 1; }
  .mic-btn { display: none; }
  .lang-toggle { align-self: flex-start; }
  .daily { flex-direction: column; align-items: stretch; }
  .daily-emoji { width: 48px; height: 48px; font-size: 22px; }
  .word-title { flex-wrap: wrap; font-size: 22px; }
  .home-grid { grid-template-columns: 1fr; }
  .fb-fab { bottom: 88px; }
  .banner-pro .primary,
  [data-page-go="plans"].primary { white-space: nowrap; }
}
.word-tile i { display: none; }
.ach.on { background: var(--accent-soft); border-color: var(--accent); }
.plan.gold { border-color: var(--line); background: var(--surface); }
.plan.gold .plan-badge { background: var(--accent); }
.ad-tag { background: var(--accent-soft); color: var(--blue-dark); }

html[data-theme="dark"] .dict-frame,
html[data-theme="dark"] .dict-frame-body,
html[data-theme="dark"] .card,
html[data-theme="dark"] .featured-word,
html[data-theme="dark"] .lesson,
html[data-theme="dark"] .flash-card,
html[data-theme="dark"] .plan,
html[data-theme="dark"] .modal,
html[data-theme="dark"] .fav-item,
html[data-theme="dark"] .task,
html[data-theme="dark"] .history .item {
  background: var(--card);
  color: var(--text);
  border-color: var(--line);
}
html[data-theme="dark"] .word-title,
html[data-theme="dark"] .def,
html[data-theme="dark"] .def b,
html[data-theme="dark"] .phon,
html[data-theme="dark"] .section-label,
html[data-theme="dark"] .daily,
html[data-theme="dark"] .wrap,
html[data-theme="dark"] main {
  color: var(--text);
}
html[data-theme="dark"] .muted,
html[data-theme="dark"] .phon,
html[data-theme="dark"] .section-label {
  color: var(--muted);
}
html[data-theme="dark"] .ex {
  background: var(--blue-soft);
  color: var(--text);
}
html[data-theme="dark"] .mini,
html[data-theme="dark"] .tag {
  background: var(--blue-soft);
  color: var(--blue-dark);
}
html[data-theme="dark"] .lock-note {
  background: #2a2418;
  border-color: #5b4a28;
  color: #f3d19a;
}
html[data-theme="dark"] .icon-btn {
  background: var(--blue-soft);
  color: var(--text);
  border-color: var(--line);
}
