/* ==========================================================================
   Habiba teacher — platforma stillari (to'q ko'k + firuza)
   ========================================================================== */
:root {
  --bg: #061726;
  --bg-soft: #082238;
  --surface: rgba(13, 45, 66, 0.68);
  --surface-solid: #0c2c42;
  --surface-2: #0a2438;
  --line: rgba(148, 205, 220, 0.16);
  --line-strong: rgba(94, 234, 212, 0.34);
  --text: #eaf6fa;
  --muted: #9fbbc7;
  --primary: #12b5a6;
  --primary-soft: #5eead4;
  --gold: #f3c878;
  --danger: #fb7185;
  --ok: #34d399;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 26px 60px -30px rgba(0, 0, 0, 0.85);
  --font: "Manrope", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 600px at 8% -10%, rgba(18, 181, 166, 0.2), transparent 62%),
    radial-gradient(760px 520px at 102% 4%, rgba(56, 189, 248, 0.12), transparent 60%),
    radial-gradient(820px 600px at 50% 110%, rgba(13, 148, 136, 0.14), transparent 66%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2rem, 3.6vw, 3rem);
}

h2 {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
}

h3 {
  font-size: 1.05rem;
}

p {
  margin: 0;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--primary-soft);
  outline-offset: 3px;
}

::selection {
  background: rgba(18, 181, 166, 0.4);
  color: #fff;
}

.wrap {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 28px);
}

/* ------------------------------------------------------------------ topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(6, 23, 38, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--primary-soft));
  color: #032521;
  font-weight: 800;
}

.tag {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a,
.nav .who {
  padding: 8px 12px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.nav a:hover {
  color: var(--text);
  background: rgba(148, 205, 220, 0.08);
}

.bar-right {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.prefs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-toggle {
  display: none;
  place-items: center;
  gap: 4px;
  width: 38px;
  height: 38px;
  padding: 9px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(148, 205, 220, 0.05);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.mobile-menu {
  display: none;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(148, 205, 220, 0.05);
}

.lang-switch a {
  padding: 4px 7px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
}

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

html[lang="uz"] .lang-uz,
html[lang="ru"] .lang-ru,
html[lang="en"] .lang-en {
  background: rgba(18, 181, 166, 0.18);
  color: var(--primary-soft);
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(148, 205, 220, 0.05);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--line-strong);
  color: var(--primary-soft);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle span {
  display: grid;
  place-items: center;
}

html[data-theme="light"] .theme-sun,
html:not([data-theme="light"]) .theme-moon {
  display: none;
}

.nav .who {
  color: var(--primary-soft);
}

.link {
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.link:hover {
  color: var(--danger);
  background: rgba(251, 113, 133, 0.1);
}

/* -------------------------------------------------------------------- page */
.page {
  padding-block: 0 64px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.8rem;
}

.lead {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.05rem;
}

.back {
  display: inline-block;
  margin: 26px 0 14px;
  color: var(--primary-soft);
  font-size: 0.87rem;
  font-weight: 700;
}

.back:hover {
  color: #fff;
}

.center {
  text-align: center;
}

.center-actions {
  display: flex;
  justify-content: center;
  margin-top: 26px;
}

/* ------------------------------------------------------------------- hero */
.home-hero {
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(720px 460px at 88% 0%, rgba(18, 181, 166, 0.22), transparent 62%),
    radial-gradient(620px 420px at 0% 30%, rgba(56, 189, 248, 0.12), transparent 60%);
}

.hero-collage {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: 10px;
  height: clamp(300px, 32vw, 390px);
  margin-bottom: clamp(26px, 4vw, 44px);
}

.hero-collage.two {
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
}

.hero-collage-wide img {
  object-position: center 34%;
}

.hero-collage-wide figcaption {
  padding: 18px;
}

.hero-collage-wide figcaption .eyebrow {
  color: var(--primary-soft);
}

.hero-collage-wide figcaption b {
  display: block;
  margin-top: 4px;
  font-size: clamp(1rem, 1.6vw, 1.35rem);
}

.hero-collage figure {
  position: relative;
  min-height: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #0a2438;
  box-shadow: 0 26px 60px -40px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}

.hero-collage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-collage-main img {
  object-position: center 18%;
}

.hero-collage-side {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-height: 0;
}

.hero-collage-side figure img {
  object-position: center 32%;
}

.hero-collage-side figure:last-child img {
  object-position: 64% 30%;
}

.hero-collage figcaption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 18px;
  background: linear-gradient(0deg, rgba(4, 20, 32, 0.94), rgba(4, 20, 32, 0.12) 75%, transparent);
  color: #ffffff;
}

.hero-collage-main figcaption .eyebrow {
  color: var(--primary-soft);
}

.hero-collage-main figcaption b {
  display: block;
  margin: 4px 0;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  line-height: 1.15;
}

.hero-collage-main figcaption p {
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.8rem;
}

.hero-collage-side figcaption {
  padding: 10px 13px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero-banner {
  position: relative;
  min-height: 300px;
  margin-bottom: clamp(26px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 30px 70px -40px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}

.hero-banner img {
  display: block;
  width: 100%;
  height: clamp(260px, 30vw, 360px);
  object-fit: cover;
  object-position: center 42%;
  filter: saturate(0.94) contrast(1.04);
  transform: scale(1.01);
}

.hero-banner::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(4, 20, 32, 0.94) 0%, rgba(4, 20, 32, 0.7) 42%, rgba(4, 20, 32, 0.08) 100%),
    linear-gradient(0deg, rgba(4, 20, 32, 0.62), transparent 55%);
  pointer-events: none;
}

.hero-banner-copy {
  position: absolute;
  bottom: clamp(22px, 4vw, 42px);
  left: clamp(22px, 4vw, 46px);
  z-index: 1;
  max-width: 560px;
}

.hero-banner-copy .eyebrow {
  color: var(--primary-soft);
}

.hero-banner-copy b {
  display: block;
  margin: 8px 0 8px;
  color: #ffffff;
  font-size: clamp(1.5rem, 3vw, 2.3rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.hero-banner-copy p {
  color: rgba(234, 246, 250, 0.78);
  font-size: clamp(0.85rem, 1.2vw, 0.98rem);
}

.hero-banner-badges {
  position: absolute;
  top: clamp(18px, 3vw, 30px);
  right: clamp(18px, 3vw, 34px);
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 360px;
}

.hero-banner-badges span {
  padding: 7px 12px;
  border: 1px solid rgba(94, 234, 212, 0.28);
  border-radius: 999px;
  background: rgba(4, 20, 32, 0.55);
  color: #d7fbf5;
  font-size: 0.75rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(30px, 5vw, 64px);
  align-items: center;
  padding-block: clamp(40px, 6vw, 80px);
}

.hero-copy h1 {
  margin-block: 16px;
  font-size: clamp(2.3rem, 5vw, 4rem);
}

.accent {
  background: linear-gradient(100deg, var(--primary-soft), #7dd3fc 55%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-copy .lead {
  max-width: 52ch;
  font-size: clamp(1rem, 1.3vw, 1.12rem);
}

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.socials a:hover {
  color: var(--primary-soft);
}

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

.hero-card {
  width: min(100%, 420px);
  padding: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background:
    radial-gradient(420px 240px at 80% 0%, rgba(94, 234, 212, 0.25), transparent 62%),
    linear-gradient(150deg, rgba(16, 56, 78, 0.95), rgba(7, 28, 44, 0.96));
  box-shadow: var(--shadow);
  color: var(--text);
}

.hero-card-top {
  display: flex;
  justify-content: space-between;
  color: var(--primary-soft);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.hero-cta-card h2 {
  margin: 0 0 10px;
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  line-height: 1.22;
  letter-spacing: -0.01em;
}

.hero-cta-card p {
  margin: 0;
  max-width: 34ch;
  font-size: 0.9rem;
}

.hero-cta-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  margin-top: 22px;
}

.hero-cta-actions .btn {
  min-width: 172px;
}

.hero-score {
  margin-block: 18px 4px;
  font-size: clamp(3.2rem, 8vw, 5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
  background: linear-gradient(100deg, #fff, var(--primary-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-card p {
  color: var(--muted);
  font-size: 0.88rem;
}

.hero-lines {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.hero-lines i {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 205, 220, 0.18);
}

.hero-lines i:nth-child(2) {
  width: 76%;
}

.hero-lines i:nth-child(3) {
  width: 52%;
}

/* ----------------------------------------------------------------- sections */
.section {
  padding-block: clamp(48px, 6vw, 84px);
}

.section.tight {
  padding-block: 30px clamp(48px, 5vw, 64px);
}

.section-head {
  max-width: 720px;
  margin-bottom: 30px;
}

.section-head.center {
  margin-inline: auto;
}

.section-head h2 {
  margin-block: 12px 10px;
}

.eyebrow {
  display: inline-block;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(9, 33, 50, 0.6);
  color: var(--primary-soft);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-hero {
  padding-block: clamp(38px, 5vw, 64px) 10px;
}

.page-hero h1 {
  margin-block: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid rgba(94, 234, 212, 0.24);
  border-radius: 999px;
  background: rgba(18, 181, 166, 0.1);
  color: var(--primary-soft);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.about {
  background: rgba(8, 34, 56, 0.5);
  border-block: 1px solid var(--line);
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.about-grid h2 {
  margin-block: 12px 14px;
}

.about-art {
  padding: clamp(26px, 3vw, 38px);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background:
    radial-gradient(420px 260px at 90% 0%, rgba(94, 234, 212, 0.24), transparent 60%),
    linear-gradient(150deg, rgba(16, 56, 78, 0.96), rgba(7, 28, 44, 0.96));
  box-shadow: var(--shadow);
}

.about-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-soft));
  color: #032521;
  font-size: 1.4rem;
  font-weight: 800;
}

.about-art b {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.about-art p {
  color: var(--muted);
  font-size: 0.9rem;
}

.check-list {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.check-list li {
  position: relative;
  padding-left: 26px;
  color: #d6e8ef;
  font-size: 0.92rem;
}

.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--primary-soft);
  font-weight: 800;
}

.stats-band {
  padding-block: 34px;
  border-block: 1px solid var(--line);
  background: rgba(8, 34, 56, 0.45);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(10, 36, 52, 0.6);
  text-align: center;
}

.stat b {
  display: block;
  font-size: 1.8rem;
  color: var(--primary-soft);
  letter-spacing: -0.03em;
}

.stat span {
  color: var(--muted);
  font-size: 0.78rem;
}

.cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background:
    radial-gradient(480px 260px at 90% 0%, rgba(94, 234, 212, 0.22), transparent 62%),
    linear-gradient(135deg, rgba(16, 56, 78, 0.96), rgba(7, 28, 44, 0.96));
  box-shadow: var(--shadow);
}

.cta-band h2 {
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  margin-bottom: 6px;
}

.cta-band p {
  color: var(--muted);
  font-size: 0.92rem;
}

/* ------------------------------------------------------------------ cards */
.card {
  padding: clamp(18px, 2.4vw, 26px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(165deg, rgba(14, 45, 65, 0.74), rgba(8, 30, 46, 0.86));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.card + .card {
  margin-top: 18px;
}

.card h3 {
  margin-bottom: 6px;
}

.card p {
  font-size: 0.9rem;
}

.grid {
  display: grid;
  gap: 18px;
}

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

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

.ico,
.course-ico {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 12px;
  border: 1px solid rgba(94, 234, 212, 0.22);
  border-radius: 13px;
  background: rgba(18, 181, 166, 0.14);
  color: var(--primary-soft);
}

.ico svg,
.course-ico svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.course-card {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

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

.course-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 26px 50px -30px rgba(0, 0, 0, 0.9);
}

.course-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.course-top .course-ico {
  margin-bottom: 14px;
}

.course-card h3 {
  margin-bottom: 6px;
}

.course-card .muted {
  flex: 1 1 auto;
  margin-bottom: 14px;
}

.card-link {
  color: var(--primary-soft);
  font-size: 0.85rem;
  font-weight: 800;
}

.empty {
  text-align: center;
  color: var(--muted);
}

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(9, 33, 50, 0.55);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: rgba(18, 181, 166, 0.12);
}

.btn-primary {
  border-color: transparent;
  background: linear-gradient(120deg, var(--primary), var(--primary-soft));
  color: #032521;
  box-shadow: 0 14px 30px -16px rgba(18, 181, 166, 0.9);
}

.btn-primary:hover {
  background: linear-gradient(120deg, #14c2b2, #7ff5e3);
}

.btn-ghost {
  background: rgba(9, 33, 50, 0.55);
}

.btn-orange {
  border-color: transparent;
  background: linear-gradient(120deg, var(--gold), #fbbf24);
  color: #3b2503;
  box-shadow: 0 14px 28px -16px rgba(243, 200, 120, 0.75);
}

.btn-sm {
  padding: 8px 15px;
  font-size: 0.8rem;
}

.btn-danger {
  border-color: rgba(251, 113, 133, 0.3);
  background: rgba(251, 113, 133, 0.1);
  color: #fda4af;
}

.btn-danger:hover {
  background: rgba(251, 113, 133, 0.18);
  border-color: rgba(251, 113, 133, 0.5);
}

.inline {
  display: inline;
}

.ta-right {
  text-align: right !important;
  white-space: nowrap;
}

.ta-right form {
  display: inline-block;
  margin-left: 6px;
}

/* ------------------------------------------------------------------ forms */
.form .field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: #c6dde6;
  font-size: 0.82rem;
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(6, 23, 38, 0.62);
  color: var(--text);
  font-size: 0.92rem;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

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

.field input::placeholder,
.field textarea::placeholder {
  color: #6f8b98;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(18, 181, 166, 0.16);
}

.field select option {
  background: var(--surface-solid);
}

.field small {
  display: block;
  margin-top: 5px;
}

/* ------------------------------------------------------------------- auth */
.auth-card {
  max-width: 440px;
  margin: clamp(20px, 6vh, 60px) auto;
  padding: clamp(24px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(165deg, rgba(15, 49, 70, 0.9), rgba(8, 30, 46, 0.94));
  box-shadow: var(--shadow);
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.auth-back:hover {
  color: var(--primary-soft);
}

.auth-card h1 {
  font-size: 1.7rem;
  margin-bottom: 6px;
}

.auth-card > .muted {
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.auth-card .btn {
  width: 100%;
}

.alt {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.84rem;
  text-align: center;
}

.alt a {
  color: var(--primary-soft);
  font-weight: 700;
}

/* ------------------------------------------------------------------ alerts */
.alert {
  margin-bottom: 16px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 0.86rem;
}

.alert.error {
  border-color: rgba(251, 113, 133, 0.35);
  background: rgba(251, 113, 133, 0.1);
  color: #fecdd3;
}

.alert.success {
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.1);
  color: #a7f3d0;
}

/* ------------------------------------------------------------------ tables */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 0.88rem;
}

th {
  color: #b8d3dc;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: rgba(18, 181, 166, 0.05);
}

/* ------------------------------------------------------------------ badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 36, 52, 0.6);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge.done {
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.1);
  color: #a7f3d0;
}

.badge.type-pdf {
  border-color: rgba(251, 113, 133, 0.28);
  color: #fda4af;
}

.badge.type-video {
  border-color: rgba(56, 189, 248, 0.28);
  color: #7dd3fc;
}

.badge.type-test {
  border-color: rgba(243, 200, 120, 0.3);
  color: var(--gold);
}

/* ---------------------------------------------------------------- progress */
.progress {
  height: 7px;
  border-radius: 999px;
  background: rgba(148, 205, 220, 0.14);
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--primary-soft));
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.74rem;
}

/* ----------------------------------------------------------------- lessons */
.lesson-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.lesson-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(10, 36, 52, 0.6);
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.lesson-row:hover {
  transform: translateX(3px);
  border-color: var(--line-strong);
}

.lesson-row .num {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(18, 181, 166, 0.14);
  color: var(--primary-soft);
  font-size: 0.82rem;
  font-weight: 800;
}

.lesson-main {
  flex: 1 1 auto;
  min-width: 0;
}

.lesson-main b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.95rem;
}

.lesson-main small {
  color: var(--muted);
  font-size: 0.78rem;
}

.lesson-body {
  margin-top: 4px;
}

.prose {
  color: #d9eaf0;
  font-size: 0.96rem;
  line-height: 1.8;
}

/* --------------------------------------------------------------------- pdf */
.pdf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.pdf-frame {
  width: 100%;
  height: min(70vh, 720px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0a2033;
}

/* ------------------------------------------------------------------- video */
.video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
}

.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

video.video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
}

/* ------------------------------------------------------------------- tests */
.test-form {
  display: grid;
  gap: 16px;
}

.question {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(6, 23, 38, 0.4);
}

.question legend {
  padding: 0 6px;
  font-weight: 700;
  font-size: 0.93rem;
}

.opt {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  color: #d6e8ef;
  font-size: 0.9rem;
  cursor: pointer;
}

.opt:hover {
  background: rgba(18, 181, 166, 0.08);
}

.opt input {
  margin-top: 4px;
  accent-color: var(--primary);
}

.question-list {
  display: grid;
  gap: 10px;
}

.question-item {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(6, 23, 38, 0.4);
}

.question-item > div:first-child {
  margin-bottom: 4px;
}

.q-edit {
  margin: 10px 0;
}

.q-edit summary {
  cursor: pointer;
  color: var(--primary-soft);
  font-size: 0.8rem;
  font-weight: 700;
}

.q-edit .form {
  margin-top: 12px;
}

.range-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.range-row input {
  flex: 1 1 0;
  min-width: 0;
}

.section-item form + form {
  margin-top: 10px;
}

/* ------------------------------------------------------------------ plans */
.plans-wrap {
  max-width: 460px;
  text-align: center;
}

.plan-card {
  position: relative;
  padding: clamp(24px, 3vw, 34px);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background:
    radial-gradient(380px 220px at 90% 0%, rgba(94, 234, 212, 0.16), transparent 62%),
    linear-gradient(165deg, rgba(16, 56, 78, 0.94), rgba(7, 28, 44, 0.96));
  box-shadow: var(--shadow);
  text-align: left;
}

.plan-badge {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 14px;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--primary), var(--primary-soft));
  color: #032521;
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
}

.plan-card h2 {
  font-size: 1.4rem;
}

.plan-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-block: 18px;
  padding-block: 14px;
  border-block: 1px solid var(--line);
}

.plan-price s {
  color: var(--muted);
  font-size: 0.9rem;
}

.plan-price b {
  font-size: 2rem;
  letter-spacing: -0.03em;
}

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

.plan-card .btn {
  width: 100%;
  margin-top: 22px;
}

.plans-wrap > .muted {
  display: block;
  margin-top: 14px;
}

/* ----------------------------------------------------------------- footer */
.site-footer {
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
  background: rgba(5, 20, 33, 0.72);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 30px;
  padding-bottom: 30px;
}

.footer-brand p {
  max-width: 34ch;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-links {
  display: grid;
  gap: 9px;
  align-content: start;
}

.footer-links a,
.footer-contact a {
  color: var(--muted);
  font-size: 0.86rem;
}

.footer-links a:hover,
.footer-contact a:hover {
  color: var(--primary-soft);
}

.footer-contact {
  display: grid;
  gap: 9px;
  align-content: start;
}

.footer-bottom {
  padding-block: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}

/* =============================================================== TEST PAGE */
.test-body {
  background: #061726;
  height: 100vh;
  overflow: hidden;
  background-image:
    radial-gradient(700px 460px at 10% 0%, rgba(18, 181, 166, 0.16), transparent 62%),
    radial-gradient(600px 420px at 100% 10%, rgba(56, 189, 248, 0.1), transparent 60%);
}

.test-header {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 12px clamp(16px, 2.5vw, 28px);
  background: rgba(8, 34, 56, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.test-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.test-brand .mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.test-mid {
  display: grid;
  gap: 1px;
  min-width: 0;
  flex: 1 1 220px;
}

.test-mid b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.98rem;
}

.test-mid span {
  color: var(--muted);
  font-size: 0.76rem;
}

.test-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.font-tools {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(6, 23, 38, 0.6);
  font-size: 0.72rem;
}

.font-tools button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--primary-soft);
  font-weight: 800;
}

.font-tools button:hover {
  background: rgba(18, 181, 166, 0.14);
}

.font-tools span {
  min-width: 42px;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}

.test-exit {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.test-exit:hover {
  color: var(--primary-soft);
  border-color: var(--line-strong);
}

.test-timer {
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(18, 181, 166, 0.12);
  color: var(--primary-soft);
  font-size: 0.86rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.test-main {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 18px;
  height: calc(100vh - 69px);
  padding: 18px;
  max-width: 1440px;
  margin-inline: auto;
}

.test-main.single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 860px;
}

.passage,
.test-pane {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(14, 45, 65, 0.82), rgba(8, 30, 46, 0.9));
}

.passage {
  overflow: hidden;
}

.passage-inner {
  height: 100%;
  overflow-y: auto;
  padding: clamp(20px, 2.4vw, 30px);
  color: #d9eaf0;
  font-size: 16px;
  line-height: 1.8;
}

.test-pane {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#testForm {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.q-slide {
  display: none;
  padding: clamp(20px, 2.6vw, 34px);
  overflow-y: auto;
  flex: 1 1 auto;
}

.q-slide.is-active {
  display: block;
}

.q-label {
  color: var(--primary-soft);
  font-size: 0.85rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.q-title {
  margin-bottom: 20px;
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  color: var(--text);
}

.q-options {
  display: grid;
  gap: 12px;
}

.q-opt {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(6, 23, 38, 0.45);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.q-opt:hover {
  border-color: var(--line-strong);
  background: rgba(18, 181, 166, 0.06);
}

.q-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.q-letter {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(18, 181, 166, 0.12);
  color: var(--primary-soft);
  font-weight: 800;
  font-size: 0.9rem;
}

.q-text {
  font-size: 0.95rem;
  color: #d6e8ef;
  line-height: 1.5;
}

.q-opt:has(input:checked) {
  border-color: var(--primary);
  background: rgba(18, 181, 166, 0.12);
  box-shadow: 0 0 0 1px var(--primary) inset;
}

.q-opt:has(input:checked) .q-letter {
  background: linear-gradient(135deg, var(--primary), var(--primary-soft));
  color: #032521;
}

.test-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px clamp(16px, 2.4vw, 28px);
  border-top: 1px solid var(--line);
  background: rgba(8, 34, 56, 0.9);
}

.tbtn {
  padding: 11px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(9, 33, 50, 0.55);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
}

.tbtn:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: rgba(18, 181, 166, 0.12);
}

.tbtn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tbtn.primary {
  border-color: transparent;
  background: linear-gradient(120deg, var(--primary), var(--primary-soft));
  color: #032521;
  font-weight: 800;
}

.q-dots {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.q-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(148, 205, 220, 0.3);
}

.q-dot.active {
  background: var(--primary-soft);
  transform: scale(1.25);
}

.q-dot.answered {
  background: var(--primary);
}

/* test result */
.test-result {
  display: grid;
  place-items: center;
  height: calc(100vh - 69px);
  padding: 20px;
}

.result-card {
  width: min(100%, 520px);
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background:
    radial-gradient(380px 240px at 80% 0%, rgba(94, 234, 212, 0.16), transparent 62%),
    linear-gradient(165deg, rgba(16, 56, 78, 0.95), rgba(7, 28, 44, 0.96));
  box-shadow: var(--shadow);
  text-align: center;
}

.score-circle {
  width: 130px;
  height: 130px;
  display: grid;
  place-items: center;
  margin: 20px auto;
  border: 7px solid var(--primary);
  border-radius: 50%;
  background: rgba(18, 181, 166, 0.08);
  color: var(--primary-soft);
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.result-card h1 {
  font-size: 1.6rem;
  margin-bottom: 6px;
}

.result-card .actions {
  justify-content: center;
}

/* ------------------------------------------------------------- directions */
.directions {
  gap: 18px;
}

.direction-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: clamp(22px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(165deg, rgba(14, 45, 65, 0.74), rgba(8, 30, 46, 0.86));
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

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

.direction-card:nth-child(2)::before {
  background: linear-gradient(90deg, #7dd3fc, var(--gold));
}

.direction-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
}

.direction-card h3 {
  margin-top: 6px;
  font-size: 1.3rem;
}

.direction-card .card-link {
  margin-top: auto;
  padding-top: 8px;
}

/* -------------------------------------------------------------- test cards */
.tests-head {
  margin-bottom: 30px;
}

.tests-head .eyebrow {
  display: inline-block;
  margin-bottom: 8px;
}

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

.test-group {
  margin-top: 38px;
}

.test-group:first-child {
  margin-top: 0;
}

.test-group-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.test-group-head h2 {
  font-size: clamp(1.25rem, 2vw, 1.6rem);
}

.test-group-head p {
  margin-top: 4px;
  font-size: 0.88rem;
}

.test-group-head .pill {
  flex: 0 0 auto;
}

.plan-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 16px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  background: rgba(18, 181, 166, 0.08);
}

.plan-banner b {
  font-size: 0.95rem;
}

.plan-banner p {
  margin-top: 2px;
  font-size: 0.82rem;
}

.plan-banner .btn {
  flex: 0 0 auto;
}

.test-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 24px 22px 18px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--primary);
  border-radius: 18px;
  background: linear-gradient(165deg, rgba(14, 45, 65, 0.78), rgba(8, 30, 46, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 18px 40px -30px rgba(0, 0, 0, 0.85);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.test-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 24px 48px -30px rgba(0, 0, 0, 0.9);
}

.test-card.free {
  border-top-color: var(--ok);
}

.test-card.pro {
  border-top-color: #60a5fa;
}

.test-card h3 {
  min-height: 3em;
  padding-right: 56px;
  margin-bottom: 4px;
  font-size: 1.03rem;
  line-height: 1.35;
}

.test-flag {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.07em;
}

.free .test-flag {
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.16);
  color: #6ee7b7;
}

.pro .test-flag {
  border: 1px solid rgba(96, 165, 250, 0.35);
  background: rgba(96, 165, 250, 0.16);
  color: #93c5fd;
}

.test-params {
  margin: 12px 0 14px;
}

.test-params > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
}

.test-params > div:last-child {
  border-bottom: 1px solid var(--line);
}

.test-params span {
  color: var(--muted);
  white-space: nowrap;
}

.test-params b {
  text-align: right;
  white-space: nowrap;
}

.test-engagement {
  display: flex;
  gap: 16px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.8rem;
}

.test-engagement span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.test-engagement svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.test-price {
  display: block;
  margin-top: auto;
  padding: 10px 14px;
  border-radius: 12px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 800;
}

.free .test-price {
  background: rgba(52, 211, 153, 0.14);
  color: #6ee7b7;
}

.pro .test-price {
  background: rgba(96, 165, 250, 0.14);
  color: #bfdbfe;
}

.test-card:hover .test-price {
  filter: brightness(1.12);
}

.test-add {
  align-items: center;
  justify-content: center;
  min-height: 100%;
  border: 1px dashed var(--line-strong);
  border-top: 4px dashed var(--line-strong);
  background: rgba(18, 181, 166, 0.04);
  color: var(--muted);
  text-align: center;
}

.test-add:hover {
  border-color: var(--primary);
  background: rgba(18, 181, 166, 0.09);
  color: var(--text);
}

.test-add-plus {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: rgba(18, 181, 166, 0.14);
  color: var(--primary-soft);
  font-size: 1.5rem;
  font-weight: 700;
}

.test-add b {
  color: var(--text);
  font-size: 0.95rem;
}

.test-add small {
  font-size: 0.76rem;
}

/* ---------------------------------------------------------------- paywall */
.paywall-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.9fr);
  gap: 20px;
}

.paywall-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.paywall-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.paywall-meta > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(9, 32, 49, 0.5);
}

.paywall-meta span {
  color: var(--muted);
  font-size: 0.8rem;
}

.paywall-about {
  font-size: 1.2rem;
}

.paywall-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-self: start;
}

.paywall-side .btn {
  width: 100%;
  text-align: center;
}

.paywall-price {
  color: var(--primary-soft);
  font-size: 1.9rem;
  font-weight: 800;
}

.paywall-plan {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  padding: 14px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: rgba(18, 181, 166, 0.06);
}

.paywall-plan .card-link {
  color: var(--primary-soft);
  font-weight: 700;
}

/* ---------------------------------------------------------- test landing */
.test-detail {
  padding: 34px 0 64px;
}

.test-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 0.95fr);
  gap: 20px;
  margin-top: 18px;
  align-items: start;
}

.test-detail-main,
.test-detail-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.test-info h1 {
  margin: 10px 0 8px;
}

.test-social {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 0.85rem;
}

.test-social span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.test-social svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.test-meta4 > div {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(9, 32, 49, 0.5);
}

.test-meta4 svg {
  grid-row: 1 / 3;
  align-self: center;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--primary-soft);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.test-meta4 span {
  color: var(--muted);
  font-size: 0.8rem;
}

.test-meta4 b {
  font-size: 0.95rem;
}

.test-about {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.test-about h2 {
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.test-about .card-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--primary-soft);
  font-weight: 700;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-head h2 {
  font-size: 1.15rem;
}

.material-list,
.material-admin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.material-row,
.material-admin-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(9, 32, 49, 0.45);
}

.material-row {
  transition: border-color 0.2s ease, background 0.2s ease;
}

.material-row:hover {
  border-color: var(--line-strong);
  background: rgba(18, 181, 166, 0.06);
}

.material-ico {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(18, 181, 166, 0.12);
  color: var(--primary-soft);
}

.material-ico svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.material-main {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
}

.material-main b {
  font-size: 0.9rem;
}

.material-main small {
  color: var(--muted);
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}

.material-open {
  flex: 0 0 auto;
  color: var(--primary-soft);
  font-size: 0.8rem;
  font-weight: 700;
}

.dist-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0 12px;
}

.dist-row {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.dist-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 205, 220, 0.12);
}

.dist-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--primary-soft));
}

.dist-row b {
  color: var(--text);
  text-align: right;
}

.test-buy-price {
  margin-bottom: 8px;
  color: var(--primary-soft);
  font-size: 2rem;
  font-weight: 800;
}

.test-buy .btn {
  width: 100%;
  margin-top: 10px;
  text-align: center;
}

.test-plan {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 16px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: rgba(18, 181, 166, 0.06);
}

.test-plan-price {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
}

.test-plan-price span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.test-plan .card-link {
  color: var(--primary-soft);
  font-size: 0.85rem;
  font-weight: 700;
}

.test-top h2 {
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.top-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.top-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(9, 32, 49, 0.45);
  font-size: 0.85rem;
}

.top-row.me {
  border: 1px solid var(--line-strong);
  background: rgba(18, 181, 166, 0.1);
}

.top-rank {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(148, 205, 220, 0.12);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.top-rank.top {
  background: linear-gradient(135deg, var(--gold), #fbbf24);
  color: #3a2400;
}

.top-score {
  color: var(--primary-soft);
  font-weight: 800;
  white-space: nowrap;
}

/* ----------------------------------------------------------------- ranking */
.rank {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(148, 205, 220, 0.12);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.rank-top {
  background: linear-gradient(135deg, var(--primary), var(--primary-soft));
  color: #032521;
}

/* ------------------------------------------------------------------- duel */
.duel-hero {
  position: relative;
  padding: 46px 0 8px;
  overflow: hidden;
}

.duel-hero::before {
  position: absolute;
  top: -140px;
  right: -80px;
  width: 520px;
  height: 420px;
  content: "";
  background: radial-gradient(circle, rgba(18, 181, 166, 0.22), transparent 65%);
  pointer-events: none;
}

.duel-hero h1 {
  margin: 4px 0 10px;
  background: linear-gradient(100deg, var(--text), var(--primary-soft) 55%, #7dd3fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.duel-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.85fr);
  gap: 18px;
}

.duel-create,
.duel-join {
  position: relative;
  overflow: hidden;
}

.duel-create::after {
  position: absolute;
  top: -40px;
  right: -30px;
  width: 150px;
  height: 150px;
  content: "";
  border-radius: 50%;
  background: radial-gradient(circle, rgba(18, 181, 166, 0.2), transparent 68%);
  pointer-events: none;
}

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

.duel-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(14, 45, 65, 0.78), rgba(8, 30, 46, 0.9));
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.duel-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
}

.duel-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.duel-code-pill {
  padding: 4px 9px;
  border: 1px solid rgba(94, 234, 212, 0.32);
  border-radius: 999px;
  background: rgba(18, 181, 166, 0.12);
  color: var(--primary-soft);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.duel-vs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.duel-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 26px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(165deg, rgba(14, 45, 65, 0.72), rgba(8, 30, 46, 0.88));
  text-align: center;
}

.duel-player.me {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 1px rgba(18, 181, 166, 0.18) inset;
}

.duel-player.empty {
  opacity: 0.72;
}

.duel-avatar {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-soft));
  color: #032521;
  font-size: 1.5rem;
  font-weight: 800;
}

.duel-player small {
  color: var(--muted);
  font-size: 0.78rem;
}

.vs-badge {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #f59e0b);
  color: #3a2400;
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  box-shadow: 0 0 30px rgba(243, 200, 120, 0.28);
}

.duel-invite,
.duel-start,
.duel-result,
.duel-wait {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 26px;
  text-align: center;
}

.duel-code {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.duel-code b {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: 0.22em;
  color: var(--primary-soft);
}

.duel-result-ico {
  font-size: 3rem;
  line-height: 1;
}

.duel-result.win {
  border-color: rgba(52, 211, 153, 0.35);
  background: linear-gradient(160deg, rgba(52, 211, 153, 0.1), rgba(8, 30, 46, 0.9));
}

.duel-result.lose {
  border-color: rgba(251, 113, 133, 0.28);
}

.duel-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(94, 234, 212, 0.18);
  border-top-color: var(--primary-soft);
  border-radius: 50%;
  animation: duel-spin 0.9s linear infinite;
}

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

.duel-verdict {
  font-weight: 800;
}

.duel-verdict.win {
  color: #6ee7b7;
}

.duel-verdict.lose {
  color: var(--danger);
}

.duel-live {
  padding: 5px 10px;
  border: 1px solid rgba(243, 200, 120, 0.35);
  border-radius: 999px;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 800;
}

/* ------------------------------------------------------- daily tournament */
.tour-hero .lead {
  max-width: 720px;
}

.tour-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(420px 180px at 10% 0%, rgba(243, 200, 120, 0.14), transparent 70%),
    linear-gradient(120deg, rgba(18, 181, 166, 0.08), rgba(8, 30, 46, 0.7));
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.tour-banner:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.tour-banner-ico {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(243, 200, 120, 0.12);
  font-size: 1.7rem;
}

.tour-banner-copy {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
}

.tour-banner-copy .eyebrow {
  color: var(--gold);
}

.tour-banner-copy b {
  font-size: 1.05rem;
}

.tour-banner-arrow {
  flex: 0 0 auto;
  color: var(--primary-soft);
  font-size: 0.85rem;
  font-weight: 700;
}

.tour-participants {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.tour-chip {
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(148, 205, 220, 0.05);
  color: var(--muted);
  font-size: 0.78rem;
}

.tour-chip b {
  margin-right: 4px;
  color: var(--primary-soft);
}

.tour-join {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 8px;
}

.tour-champion {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 8px;
  border-color: rgba(243, 200, 120, 0.35);
  background: linear-gradient(120deg, rgba(243, 200, 120, 0.12), rgba(8, 30, 46, 0.85));
}

.tour-cup {
  font-size: 3rem;
  line-height: 1;
}

.tour-wait {
  margin-top: 10px;
  text-align: center;
}

.bracket-scroll {
  padding: 16px 4px 26px;
  overflow-x: auto;
}

.bracket {
  display: flex;
  gap: 36px;
  min-width: max-content;
  align-items: stretch;
}

.bracket-round {
  display: flex;
  flex-direction: column;
  min-width: 232px;
}

.bracket-title {
  margin-bottom: 12px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-align: center;
}

.bracket-title.final {
  font-size: 0.82rem;
}

.bracket-cup {
  display: inline-block;
  margin-left: 3px;
  font-size: 1.15rem;
  filter: drop-shadow(0 0 10px rgba(243, 200, 120, 0.55));
  animation: cup-float 2.8s ease-in-out infinite;
}

@keyframes cup-float {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-3px) scale(1.06);
  }
}

.bracket-time {
  margin: -6px 0 12px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
  white-space: nowrap;
}

.winner-round {
  min-width: 210px;
}

.winner-round .bracket-title {
  color: var(--gold);
}

.winner-round .bracket-list {
  justify-content: center;
}

.bracket-winner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: rgba(9, 32, 49, 0.45);
  text-align: center;
}

.bracket-winner b {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.95rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bracket-winner small {
  color: var(--muted);
  font-size: 0.64rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.bracket-winner.done {
  border-style: solid;
  border-color: rgba(243, 200, 120, 0.55);
  background:
    radial-gradient(220px 140px at 50% 0%, rgba(243, 200, 120, 0.22), transparent 70%),
    rgba(9, 32, 49, 0.65);
  box-shadow: 0 0 26px -6px rgba(243, 200, 120, 0.45);
}

.bracket-winner.done b {
  color: var(--gold);
  font-size: 1.05rem;
}

.bracket-trophy {
  font-size: 1.6rem;
  filter: drop-shadow(0 0 10px rgba(243, 200, 120, 0.5));
}

@media (max-width: 640px) {
  .bracket {
    gap: 26px;
  }

  .bracket-round {
    min-width: 190px;
  }

  .winner-round {
    min-width: 170px;
  }
}

.bracket-list {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: space-around;
  gap: 16px;
}

.bracket-match {
  position: relative;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(9, 32, 49, 0.55);
}

.bracket-match.ready {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 1px rgba(18, 181, 166, 0.12) inset;
}

.bracket-match.finished,
.bracket-match.bye {
  opacity: 0.92;
}

.bracket-player {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.82rem;
}

.bracket-player span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bracket-player.win {
  background: rgba(52, 211, 153, 0.12);
  color: #6ee7b7;
  font-weight: 700;
}

.bracket-player em {
  flex: 0 0 auto;
  color: var(--primary-soft);
  font-style: normal;
  font-weight: 800;
}

.bracket-play {
  display: block;
  margin-top: 4px;
  padding: 5px;
  border-radius: 7px;
  background: rgba(18, 181, 166, 0.16);
  color: var(--primary-soft);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
}

.bracket-tag {
  position: absolute;
  top: -7px;
  right: 8px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(148, 205, 220, 0.14);
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.bracket-tag.live {
  background: rgba(243, 200, 120, 0.14);
  color: var(--gold);
}

.bracket-round:not(:last-child) .bracket-match::after {
  position: absolute;
  top: 50%;
  right: -36px;
  width: 36px;
  content: "";
  border-top: 1px solid var(--line-strong);
}

.bracket-round:not(:first-child) .bracket-match::before {
  position: absolute;
  top: 50%;
  left: -36px;
  width: 36px;
  content: "";
  border-top: 1px solid var(--line-strong);
}

/* ------------------------------------------------------------- light theme */
html[data-theme="light"] {
  --bg: #f3f7fb;
  --bg-soft: #eaf2f8;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --surface-2: #f4f8fb;
  --line: rgba(15, 60, 80, 0.14);
  --line-strong: rgba(15, 118, 110, 0.4);
  --text: #0b2a3a;
  --muted: #55707e;
  --primary: #0f9f92;
  --primary-soft: #0f766e;
  --gold: #b7791f;
  --danger: #dc2626;
  --shadow: 0 24px 50px -32px rgba(10, 40, 60, 0.35);
}

html[data-theme="light"] body {
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 600px at 8% -10%, rgba(18, 181, 166, 0.12), transparent 62%),
    radial-gradient(760px 520px at 102% 4%, rgba(56, 189, 248, 0.12), transparent 60%),
    radial-gradient(820px 600px at 50% 110%, rgba(13, 148, 136, 0.08), transparent 66%);
}

html[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.88);
}

html[data-theme="light"] .card,
html[data-theme="light"] .test-card,
html[data-theme="light"] .duel-card,
html[data-theme="light"] .duel-player,
html[data-theme="light"] .direction-card,
html[data-theme="light"] .plan-card,
html[data-theme="light"] .test-meta4 > div,
html[data-theme="light"] .material-row,
html[data-theme="light"] .material-admin-row,
html[data-theme="light"] .top-row {
  background: #ffffff;
  border-color: var(--line);
  box-shadow: 0 16px 36px -30px rgba(10, 40, 60, 0.35);
}

html[data-theme="light"] .stats-band,
html[data-theme="light"] .cta-band {
  background: linear-gradient(120deg, rgba(15, 159, 146, 0.12), rgba(56, 189, 248, 0.12));
  border-color: var(--line);
}

html[data-theme="light"] .site-footer {
  background: #eaf2f8;
}

html[data-theme="light"] .hero-card,
html[data-theme="light"] .about-art {
  background: #ffffff;
  border-color: var(--line);
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  background: #ffffff;
  border-color: var(--line);
  color: var(--text);
}

html[data-theme="light"] .btn {
  background: #ffffff;
  border-color: var(--line);
  color: var(--text);
}

html[data-theme="light"] .btn:hover {
  background: rgba(15, 159, 146, 0.08);
}

html[data-theme="light"] .btn-primary {
  background: linear-gradient(120deg, #0f9f92, #0f766e);
  color: #ffffff;
}

html[data-theme="light"] .btn-primary:hover {
  background: linear-gradient(120deg, #12b5a6, #0f766e);
}

html[data-theme="light"] .hero-score {
  background: linear-gradient(100deg, #0b2a3a, #0f766e);
  -webkit-background-clip: text;
  background-clip: text;
}

html[data-theme="light"] .nav a:hover,
html[data-theme="light"] .lang-switch,
html[data-theme="light"] .theme-toggle {
  background: rgba(15, 60, 80, 0.05);
}

html[data-theme="light"] .test-card.free {
  border-top-color: #059669;
}

html[data-theme="light"] .test-card.pro {
  border-top-color: #2563eb;
}

html[data-theme="light"] .free .test-flag {
  border-color: rgba(5, 150, 105, 0.35);
  background: rgba(5, 150, 105, 0.1);
  color: #047857;
}

html[data-theme="light"] .pro .test-flag {
  border-color: rgba(37, 99, 235, 0.3);
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
}

html[data-theme="light"] .free .test-price {
  background: rgba(5, 150, 105, 0.1);
  color: #047857;
}

html[data-theme="light"] .pro .test-price {
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
}

html[data-theme="light"] .test-detail .prose,
html[data-theme="light"] .prose {
  color: var(--text);
}

html[data-theme="light"] .dist-bar {
  background: rgba(15, 60, 80, 0.1);
}

html[data-theme="light"] .duel-spinner {
  border-color: rgba(15, 118, 110, 0.18);
  border-top-color: #0f766e;
}

html[data-theme="light"] .test-body {
  color: var(--text);
  background-color: var(--bg);
}

html[data-theme="light"] .test-header,
html[data-theme="light"] .test-pane,
html[data-theme="light"] .passage {
  background: #ffffff;
}

/* ------------------------------------------------------------ solve page */
.solve {
  display: flex;
  flex-direction: column;
  height: 100vh;
  color: var(--text);
}

.solve-topbar {
  flex: 0 0 auto;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 34, 56, 0.92);
  backdrop-filter: blur(14px);
}

.solve-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 1500px;
  margin-inline: auto;
  padding: 9px 18px;
  flex-wrap: wrap;
}

.solve-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  white-space: nowrap;
}

.solve-brand .mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-soft));
  color: #032521;
  font-weight: 800;
}

.solve-head {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.solve-titles {
  display: flex;
  flex-direction: column;
  margin-right: 4px;
  line-height: 1.2;
}

.solve-titles b {
  max-width: 320px;
  overflow: hidden;
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.solve-titles span {
  color: var(--muted);
  font-size: 0.74rem;
}

.fs-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(148, 205, 220, 0.05);
}

.fs-group > span {
  margin-right: 2px;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.fs-group button {
  padding: 3px 5px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}

.fs-group button:hover {
  background: rgba(148, 205, 220, 0.1);
  color: var(--text);
}

.fs-group .fs-value {
  min-width: 39px;
  color: var(--primary-soft);
  text-align: center;
}

.solve-exit {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.solve-exit:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.solve-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.solve-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(148, 205, 220, 0.05);
  color: var(--muted);
  cursor: pointer;
}

.solve-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.solve-timer {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(18, 181, 166, 0.08);
  color: var(--primary-soft);
  font-size: 0.85rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.solve-timer svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.solve-progress {
  height: 3px;
  background: rgba(148, 205, 220, 0.1);
}

.solve-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-soft));
  transition: width 0.2s ease;
}

.solve-wrap {
  flex: 1 1 auto;
  padding: 14px 18px 26px;
  overflow-y: auto;
}

.solve-stack {
  max-width: 1440px;
  margin-inline: auto;
}

.q-row {
  display: grid;
  grid-template-columns: minmax(0, var(--split, 52%)) 10px minmax(0, 1fr);
  align-items: stretch;
  min-height: calc(100vh - 220px);
}

.q-row.single {
  grid-template-columns: minmax(0, 1fr);
}

.q-row.no-read {
  grid-template-columns: minmax(0, 1fr);
}

.q-row.no-read .q-reading-pane,
.q-row.no-read .q-resizer {
  display: none;
}

.q-passage-data {
  display: none;
}

.q-reading-pane {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(14, 45, 65, 0.82), rgba(8, 30, 46, 0.9));
  overflow: hidden;
}

.q-reading {
  height: 100%;
  max-height: calc(100vh - 220px);
  padding: clamp(18px, 2.4vw, 28px);
  overflow-y: auto;
  color: #d9eaf0;
  font-size: calc(16px * var(--fs-reading, 1));
  line-height: 1.8;
}

.q-resizer {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: col-resize;
  touch-action: none;
}

.q-resizer span {
  width: 4px;
  height: 44px;
  border-radius: 999px;
  background: var(--line-strong);
  opacity: 0.55;
}

.q-panel {
  max-height: calc(100vh - 220px);
  padding: clamp(18px, 2.4vw, 28px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(14, 45, 65, 0.82), rgba(8, 30, 46, 0.9));
  overflow-y: auto;
}

.q-panel .q-slide {
  display: none;
  padding: 0;
  overflow: visible;
}

.q-panel .q-slide.is-active {
  display: block;
}

.q-head {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.q-title {
  margin-bottom: 16px;
  font-size: calc(1.08rem * var(--fs, 1));
  line-height: 1.45;
}

.q-panel .q-options {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.q-panel .q-opt {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(9, 32, 49, 0.45);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.q-panel .q-opt:hover {
  border-color: var(--line-strong);
}

.q-panel .q-opt.selected {
  border-color: var(--primary);
  background: rgba(18, 181, 166, 0.12);
}

.q-panel .q-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.q-panel .q-letter {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(148, 205, 220, 0.12);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.q-panel .q-opt.selected .q-letter {
  background: var(--primary);
  color: #032521;
}

.q-panel .q-text {
  padding-top: 2px;
  font-size: calc(0.92rem * var(--fs, 1));
  line-height: 1.5;
}

.q-nav-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 16px 0;
}

.nav-pill {
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(148, 205, 220, 0.05);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.nav-pill:hover:not(:disabled) {
  border-color: var(--line-strong);
}

.nav-pill:disabled {
  opacity: 0.4;
  cursor: default;
}

.aside-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(14, 45, 65, 0.82), rgba(8, 30, 46, 0.9));
}

.step-block + .step-block {
  margin-top: 16px;
}

.step-title {
  margin-bottom: 8px;
  font-size: 0.82rem;
  font-weight: 700;
}

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

.pal {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(148, 205, 220, 0.05);
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.pal:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.pal.current {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-soft));
  color: #032521;
}

.pal.done:not(.current) {
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.12);
  color: #6ee7b7;
}

.solve-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-item i {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: rgba(148, 205, 220, 0.16);
}

.legend-item.done i {
  background: rgba(52, 211, 153, 0.45);
}

.legend-item.current i {
  background: var(--primary);
}

.btn-finish {
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(120deg, var(--primary), var(--primary-soft));
  color: #032521;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
}

.btn-finish:hover {
  filter: brightness(1.05);
}

.solve-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 12, 20, 0.74);
  backdrop-filter: blur(4px);
}

.solve-overlay[hidden] {
  display: none;
}

.solve-confirm {
  width: min(430px, 100%);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-solid);
  box-shadow: var(--shadow);
  text-align: center;
}

.solve-warn {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  margin: 0 auto 12px;
  border: 1px solid rgba(243, 200, 120, 0.4);
  border-radius: 50%;
  background: rgba(243, 200, 120, 0.12);
  color: var(--gold);
  font-size: 1.5rem;
  font-weight: 800;
}

.solve-confirm p {
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.solve-confirm-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.solve-confirm-actions .btn {
  flex: 1;
}

html[data-theme="light"] .solve-topbar,
html[data-theme="light"] .aside-card,
html[data-theme="light"] .q-panel,
html[data-theme="light"] .q-reading-pane,
html[data-theme="light"] .solve-confirm {
  background: #ffffff;
}

html[data-theme="light"] .q-reading {
  color: var(--text);
}

html[data-theme="light"] .q-panel .q-opt {
  background: #f7fafc;
}

html[data-theme="light"] .solve-icon,
html[data-theme="light"] .fs-group,
html[data-theme="light"] .nav-pill,
html[data-theme="light"] .pal {
  background: #f4f8fb;
}

/* --------------------------------------------------------------- responsive */
@media (max-width: 1280px) {
  .test-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1000px) {
  .hero-grid,
  .about-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-art {
    justify-content: flex-start;
  }

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

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

  .q-row {
    grid-template-columns: minmax(0, 1fr);
    min-height: auto;
  }

  .q-resizer {
    display: none;
  }

  .q-reading {
    max-height: 40vh;
  }

  .q-panel {
    max-height: none;
  }

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

  .test-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .test-detail-side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .hero-collage {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
  }

  .hero-collage.two {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
  }

  .hero-collage-main {
    height: 380px;
  }

  .hero-collage-side {
    height: 200px;
  }

  .hero-collage-wide {
    height: 230px;
  }

  .duel-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .duel-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .paywall-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .test-main {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    min-height: calc(100vh - 69px);
  }

  .passage {
    max-height: 40vh;
  }

  .q-slide {
    min-height: 420px;
  }

  .test-body {
    height: auto;
    overflow: auto;
  }
}

@media (max-width: 900px) {
  .nav,
  .prefs {
    display: none;
  }

  .menu-toggle {
    display: grid;
  }

  .bar {
    flex-wrap: nowrap;
    min-height: 64px;
  }

  .bar-right {
    flex: 0 0 auto;
    width: auto;
    margin-left: auto;
    justify-content: flex-end;
  }

  .mobile-menu {
    display: block;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    z-index: 70;
    height: calc(100vh - 64px);
    max-height: calc(100vh - 64px);
    padding: 4px 18px 20px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-solid);
    box-shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.75);
    overflow-y: auto;
  }

  .mobile-menu[hidden] {
    display: none;
  }

  .mobile-links a,
  .mobile-link-btn {
    display: block;
    width: 100%;
    padding: 15px 2px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: none;
    color: var(--text);
    font: inherit;
    font-size: 1.02rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
  }

  .mobile-links a:hover,
  .mobile-link-btn:hover {
    color: var(--primary-soft);
  }

  .mobile-user {
    padding: 16px 2px 12px;
    border-bottom: 1px solid var(--line);
    color: var(--primary-soft);
    font-weight: 700;
  }

  .mobile-login {
    color: var(--primary-soft) !important;
  }

  .mobile-prefs {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 18px;
  }

  .mobile-prefs .lang-switch {
    flex: 0 0 auto;
  }

  .bar .tag {
    display: none;
  }
}

@media (max-width: 720px) {
  .bar {
    flex-wrap: nowrap;
    padding-block: 10px;
  }

  .nav {
    width: 100%;
    justify-content: flex-start;
  }

  .grid.two,
  .grid.three,
  .test-grid,
  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .hero-copy h1 {
    font-size: clamp(2rem, 9vw, 2.8rem);
  }

  .lesson-row .badge {
    display: none;
  }

  .test-header {
    gap: 10px;
  }

  .test-mid {
    order: 3;
    flex-basis: 100%;
  }

  .test-tools {
    margin-left: auto;
  }

  .test-main {
    padding: 10px;
    gap: 10px;
  }

  .test-nav {
    padding: 12px;
  }

  .q-dots {
    display: none;
  }

  .test-timer {
    padding: 7px 12px;
    font-size: 0.8rem;
  }

  .test-group-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .solve-inner {
    gap: 8px;
    padding: 8px 12px;
  }

  .solve-titles {
    flex-basis: 100%;
    order: 3;
  }

  .solve-titles b {
    max-width: 220px;
  }

  .solve-right {
    margin-left: auto;
  }

  .solve-wrap {
    padding: 10px 12px 20px;
  }

  .pal {
    width: 31px;
    height: 31px;
  }

  .bar-right {
    width: auto;
    justify-content: flex-end;
  }

  .hero-banner img {
    height: 340px;
  }

  .hero-collage-main {
    height: 400px;
  }

  .hero-collage-side {
    height: 150px;
  }

  .hero-collage-wide {
    height: 220px;
  }

  .hero-collage-side figcaption {
    padding: 8px 10px;
    font-size: 0.66rem;
  }

  .hero-banner-badges {
    display: none;
  }

  .hero-banner-copy {
    max-width: calc(100% - 44px);
  }

  .duel-vs {
    grid-template-columns: minmax(0, 1fr);
  }

  .vs-badge {
    margin: 0 auto;
  }

  .duel-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .plan-banner {
    flex-direction: column;
    align-items: stretch;
  }

  .plan-banner .btn {
    text-align: center;
  }

  .paywall-meta {
    grid-template-columns: minmax(0, 1fr);
  }

  .test-detail-side {
    grid-template-columns: minmax(0, 1fr);
  }

  .test-meta4 {
    grid-template-columns: minmax(0, 1fr);
  }

  .dist-row {
    grid-template-columns: 92px minmax(0, 1fr) 24px;
    gap: 8px;
  }
}
