/* =============================================================
   ZHENIS ORDA INSIDE — premium dark / gold design system
   ============================================================= */

:root {
  /* --- backgrounds --- */
  --bg: #07090E;
  --bg-soft: #0A0D13;
  --surface: #11151D;
  --surface-2: #151922;
  --surface-3: #1A1D24;
  --surface-glass: rgba(17, 21, 29, 0.78);

  /* --- gold / bronze accents (muted premium) --- */
  --gold: #C8A24A;
  --gold-soft: #D6B66A;
  --gold-bright: #E8CE8C;
  --bronze: #A9843A;
  --brown: #3A2D16;

  /* --- text --- */
  --text: #F5F1E8;
  --text-soft: #D7CFBE;
  --muted: #B9B4AA;
  --muted-2: #817B70;

  /* --- borders --- */
  --border: rgba(200, 162, 74, 0.22);
  --border-soft: rgba(200, 162, 74, 0.12);
  --border-strong: rgba(214, 182, 106, 0.5);

  /* --- semantic --- */
  --danger: #ff6b6b;
  --danger-bg: rgba(214, 80, 70, 0.14);
  --success: #70d99e;
  --success-bg: rgba(112, 217, 158, 0.12);
  --warning: #f2c96b;

  /* --- shadows --- */
  --shadow-gold: 0 24px 80px rgba(200, 162, 74, 0.10);
  --shadow-dark: 0 24px 80px rgba(0, 0, 0, 0.6);
  --shadow-card: 0 18px 50px rgba(0, 0, 0, 0.55);

  /* --- radii --- */
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;

  /* --- layout --- */
  --page-max: 1180px;
  --admin-max: 1320px;
  --page-gutter: 18px;

  /* --- viewport / Telegram safe area (overridden by JS) --- */
  --browser-viewport-height: 100dvh;
  --viewport-width: 100%;
  --viewport-height: 100dvh;
  --viewport-stable-height: 100dvh;
  --tg-safe-area-inset-top: 0px;
  --tg-safe-area-inset-bottom: 0px;
  --tg-content-safe-area-inset-top: 0px;
  --tg-content-safe-area-inset-bottom: 0px;
  --app-top-padding: 16px;
  --app-bottom-padding: 14px;

  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

*::selection {
  background: rgba(200, 162, 74, 0.32);
  color: #fff;
}

html,
body {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    "Inter", "SF Pro Text", "Segoe UI", -apple-system, BlinkMacSystemFont, ui-sans-serif,
    system-ui, sans-serif;
  font-feature-settings: "ss01" on, "cv11" on;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 16% 8%, rgba(200, 162, 74, 0.06), transparent 36%),
    radial-gradient(circle at 78% 12%, rgba(120, 145, 200, 0.04), transparent 40%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 12px);
  opacity: 0.9;
}

body > * {
  position: relative;
}

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

button {
  cursor: pointer;
  border: 0;
  background: transparent;
  color: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--gold-soft);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

a {
  color: var(--gold-soft);
  text-decoration: none;
}

a:hover {
  color: var(--gold-bright);
}

a.link {
  border-bottom: 1px dashed rgba(200, 162, 74, 0.4);
}

fieldset {
  margin: 0;
  border: 0;
  padding: 0;
  min-width: 0;
}

ul,
ol {
  margin: 0;
  padding: 0 0 0 18px;
}

ul li,
ol li {
  margin-bottom: 4px;
  color: var(--text-soft);
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  color: #F5F1E8;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

h2 {
  color: #F5F1E8;
  font-size: 21px;
  line-height: 1.18;
  margin-bottom: 10px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

h3 {
  color: #F5F1E8;
  font-size: 16px;
  line-height: 1.22;
  margin-bottom: 8px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

p,
li,
td,
th,
label {
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--gold);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

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

.muted.small {
  font-size: 12px;
}

.hidden {
  display: none !important;
}

/* =============================================================
   TELEGRAM MINI APP MODE
   ============================================================= */

html.telegram-miniapp-mode,
body.telegram-miniapp-mode {
  width: 100%;
  max-width: var(--viewport-width);
  height: var(--viewport-stable-height);
  min-height: var(--viewport-stable-height);
  overflow: hidden;
  position: fixed;
  inset: 0;
  overscroll-behavior: none;
  background:
    radial-gradient(circle at 18% 0%, rgba(200, 162, 74, 0.08), transparent 38%),
    radial-gradient(circle at 82% 22%, rgba(120, 145, 200, 0.05), transparent 42%),
    linear-gradient(180deg, #0A0D14 0%, #06080C 100%);
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-y;
}

/* Browser admin / landing modes use natural document scroll */
html.browser-admin-mode,
body.browser-admin-mode,
html.landing-mode,
body.landing-mode {
  height: auto;
  min-height: 100dvh;
  overflow: auto;
  position: static;
  background:
    radial-gradient(circle at 12% -10%, rgba(200, 162, 74, 0.06), transparent 42%),
    radial-gradient(circle at 92% 0%, rgba(120, 145, 200, 0.05), transparent 46%),
    linear-gradient(180deg, #0A0D14 0%, #07090E 60%, #05070A 100%);
}

/* =============================================================
   APP SHELL (mini app)
   ============================================================= */

.app-shell {
  width: 100%;
  max-width: var(--viewport-width);
  min-width: 0;
  height: var(--viewport-stable-height);
  min-height: var(--viewport-stable-height);
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding-top: var(--app-top-padding);
  padding-bottom: var(--app-bottom-padding);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  background:
    radial-gradient(circle at 20% 0%, rgba(200, 162, 74, 0.08), transparent 36%),
    radial-gradient(circle at 80% 18%, rgba(120, 145, 200, 0.06), transparent 42%),
    linear-gradient(180deg, #0A0D14 0%, #06080C 100%);
  position: relative;
  overflow: hidden;
}

.app-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      115deg,
      rgba(255, 255, 255, 0.018) 0 1px,
      transparent 1px 9px
    );
  mix-blend-mode: screen;
  opacity: 0.6;
}

.app-shell > * {
  position: relative;
  z-index: 1;
}

.content {
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 8px max(var(--page-gutter), env(safe-area-inset-left, 0px))
    calc(120px + var(--app-bottom-padding))
    max(var(--page-gutter), env(safe-area-inset-right, 0px));
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  scroll-behavior: smooth;
}

.content.with-summary {
  padding-bottom: calc(170px + var(--app-bottom-padding));
}

/* =============================================================
   USER HEADER (Telegram profile)
   ============================================================= */

.user-header {
  width: 100%;
  max-width: var(--page-max);
  min-width: 0;
  margin: 0 auto;
  min-height: 64px;
  padding: 8px max(var(--page-gutter), env(safe-area-inset-left, 0px)) 12px
    max(var(--page-gutter), env(safe-area-inset-right, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border-soft);
}

.brand-mini {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.avatar-wrap {
  position: relative;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
}

.avatar,
.avatar-fallback {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  flex: 0 0 46px;
  display: block;
}

.avatar {
  object-fit: cover;
  border: 1px solid rgba(214, 182, 106, 0.45);
  box-shadow: 0 0 0 4px rgba(200, 162, 74, 0.08);
}

.avatar-fallback {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(232, 206, 140, 0.32), transparent 45%),
    linear-gradient(145deg, #161A24, #07090E);
  color: var(--gold-soft);
  border: 1px solid rgba(200, 162, 74, 0.55);
  box-shadow: 0 0 0 4px rgba(200, 162, 74, 0.08);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.user-meta {
  min-width: 0;
  flex: 1;
}

.user-name {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-login {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.02em;
}

.header-action {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(200, 162, 74, 0.08);
  color: var(--gold-soft);
  font-weight: 800;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.header-action:hover,
.header-action:focus-visible {
  background: rgba(200, 162, 74, 0.16);
  border-color: var(--border-strong);
}

.header-action:active {
  transform: scale(0.97);
}

.header-action-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-soft);
  box-shadow: 0 0 8px rgba(214, 182, 106, 0.7);
}

/* =============================================================
   BRAND MARK
   ============================================================= */

.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  color: var(--gold-bright);
  border-radius: 14px;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.06em;
  background:
    radial-gradient(circle at 30% 20%, rgba(232, 206, 140, 0.22), transparent 50%),
    linear-gradient(145deg, rgba(200, 162, 74, 0.18), rgba(0, 0, 0, 0.5)),
    #0E1219;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.brand-mark.big {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  font-size: 16px;
  border-radius: 18px;
}

/* =============================================================
   BUTTONS
   ============================================================= */

.gold-btn,
.ghost-btn,
.danger-btn,
.tool-btn {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  background: rgba(26, 30, 38, 0.86);
  padding: 12px 16px;
  min-height: 44px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    box-shadow 220ms ease;
  position: relative;
}

.gold-btn {
  background:
    linear-gradient(135deg, #D6B66A 0%, #C8A24A 45%, #A9843A 100%);
  color: #0A0D13;
  border-color: rgba(255, 225, 160, 0.85);
  font-weight: 900;
  box-shadow:
    0 14px 35px rgba(135, 105, 50, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.gold-btn:hover,
.gold-btn:focus-visible {
  transform: translateY(-1px);
  box-shadow:
    0 18px 40px rgba(135, 105, 50, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.gold-btn:active {
  transform: translateY(0);
  filter: brightness(0.96);
}

.ghost-btn {
  background: rgba(20, 23, 31, 0.72);
  color: var(--text-soft);
}

.ghost-btn:hover,
.ghost-btn:focus-visible {
  border-color: var(--border-strong);
  color: #F5F1E8;
  background: rgba(24, 27, 34, 0.85);
}

.ghost-btn.active,
.tool-btn.active {
  border-color: var(--border-strong);
  color: var(--gold-bright);
  background:
    linear-gradient(180deg, rgba(200, 162, 74, 0.18), rgba(200, 162, 74, 0.06));
}

.tool-btn {
  background: transparent;
  border-color: transparent;
  color: var(--text-soft);
  padding: 10px 14px;
  border-radius: 12px;
  justify-content: flex-start;
  text-align: left;
}

.tool-btn:hover {
  background: rgba(200, 162, 74, 0.06);
  color: #F5F1E8;
}

.danger-btn {
  border-color: rgba(255, 107, 107, 0.55);
  color: #ffd7d2;
  background: rgba(73, 26, 22, 0.55);
}

.danger-btn:hover,
.danger-btn:focus-visible {
  border-color: rgba(255, 107, 107, 0.8);
  background: rgba(95, 32, 28, 0.7);
}

.gold-btn.lg,
.ghost-btn.lg,
.danger-btn.lg {
  min-height: 52px;
  padding: 14px 20px;
  font-size: 15px;
  border-radius: 16px;
}

.gold-btn.block,
.ghost-btn.block,
.danger-btn.block,
.tool-btn.block {
  width: 100%;
}

.icon-only {
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 16px;
}

/* button loading state */
.gold-btn.is-loading,
.ghost-btn.is-loading,
.danger-btn.is-loading {
  pointer-events: none;
}

.gold-btn.is-loading .btn-label,
.ghost-btn.is-loading .btn-label,
.danger-btn.is-loading .btn-label {
  opacity: 0.4;
}

.btn-spinner {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.3);
  border-top-color: rgba(0, 0, 0, 0.8);
  animation: spin 720ms linear infinite;
  display: none;
}

.is-loading .btn-spinner {
  display: inline-block;
}

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

/* =============================================================
   CARDS / SURFACES
   ============================================================= */

.card,
.metric,
.lesson-card,
.tariff-card,
.admin-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(160deg, rgba(30, 34, 42, 0.92), rgba(13, 16, 23, 0.95)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.012) 0 1px,
      transparent 1px 9px
    );
  box-shadow: var(--shadow-card);
  padding: 18px;
  position: relative;
  overflow: hidden;
}

@media (hover: hover) {
  .card:hover,
  .metric:hover,
  .lesson-card:hover,
  .tariff-card:hover,
  .admin-card:hover {
    border-color: rgba(200, 162, 74, 0.3);
    box-shadow:
      0 24px 70px rgba(0, 0, 0, 0.55),
      0 0 0 1px rgba(200, 162, 74, 0.05);
  }
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    160deg,
    rgba(200, 162, 74, 0.06) 0%,
    transparent 30%,
    transparent 70%,
    rgba(0, 0, 0, 0.3) 100%
  );
}

.card > *,
.metric > *,
.lesson-card > *,
.tariff-card > * {
  position: relative;
  z-index: 1;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.card-header > div {
  min-width: 0;
}

/* metric */
.metric {
  display: grid;
  gap: 6px;
  min-height: 110px;
  padding: 16px;
}

.metric strong {
  color: var(--gold-bright);
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  letter-spacing: 0;
}

.metric .muted {
  font-size: 12px;
}

/* hero */
.hero {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  position: relative;
  min-height: 220px;
  display: grid;
  align-content: end;
  gap: 12px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.78)),
    radial-gradient(circle at 80% 0%, rgba(214, 182, 106, 0.18), transparent 55%),
    repeating-linear-gradient(
      100deg,
      rgba(255, 255, 255, 0.02) 0 1px,
      transparent 1px 10px
    ),
    linear-gradient(135deg, #171A22, #07090E 70%);
  box-shadow: var(--shadow-dark), var(--shadow-gold);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(200, 162, 74, 0.18);
  border-radius: calc(var(--radius-xl) - 6px);
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 28px;
}

/* =============================================================
   GRIDS
   ============================================================= */

.grid {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: grid;
  gap: 12px;
  margin: 14px 0;
}

.grid.tight {
  gap: 10px;
  margin: 10px 0;
}

.grid.two,
.grid.three,
.grid.four {
  grid-template-columns: 1fr;
}

@media (min-width: 600px) {
  .grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 760px) {
  .grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .grid.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .grid.four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* =============================================================
   PILLS / STATUSES
   ============================================================= */

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill,
.status,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 11px;
  color: var(--gold-bright);
  background: rgba(200, 162, 74, 0.08);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.status.ok,
.chip.ok {
  color: var(--success);
  border-color: rgba(112, 217, 158, 0.42);
  background: var(--success-bg);
}

.status.bad,
.chip.bad {
  color: #ffb1ab;
  border-color: rgba(255, 107, 107, 0.42);
  background: var(--danger-bg);
}

.status.warn,
.chip.warn {
  color: var(--warning);
  border-color: rgba(242, 201, 107, 0.42);
  background: rgba(242, 201, 107, 0.1);
}

/* =============================================================
   PROGRESS
   ============================================================= */

.progress-track {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(200, 162, 74, 0.24);
  background: rgba(0, 0, 0, 0.45);
  position: relative;
}

.progress-fill {
  height: 100%;
  width: var(--progress, 0%);
  border-radius: inherit;
  background:
    linear-gradient(90deg, var(--bronze), var(--gold-bright));
  transition: width 480ms cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 12px rgba(214, 182, 106, 0.45);
}

.progress-track.thin {
  height: 6px;
}

.progress-row {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.progress-row strong {
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
}

/* =============================================================
   LEVEL JOURNEY
   ============================================================= */

.level-strip {
  max-width: 100%;
  min-width: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(110px, 1fr);
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.level-strip::-webkit-scrollbar {
  height: 6px;
}

.level-strip::-webkit-scrollbar-thumb {
  background: rgba(200, 162, 74, 0.3);
  border-radius: 4px;
}

.level-token {
  scroll-snap-align: start;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  min-height: 86px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  color: var(--muted);
  background:
    linear-gradient(160deg, rgba(15, 18, 25, 0.95), rgba(11, 14, 20, 0.88));
  text-align: center;
  font-weight: 700;
  font-size: 11px;
  padding: 12px 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.level-token b {
  display: block;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: none;
}

.level-token.open {
  color: var(--gold-soft);
  border-color: var(--border-strong);
  background:
    linear-gradient(160deg, rgba(200, 162, 74, 0.2), rgba(11, 14, 20, 0.92));
}

.level-token.open b {
  color: #F5F1E8;
}

.level-token.current {
  color: #0A0D13;
  border-color: rgba(232, 206, 140, 0.85);
  background:
    linear-gradient(135deg, #D6B66A 0%, #C8A24A 60%, #A9843A 100%);
  box-shadow: 0 14px 32px rgba(135, 105, 50, 0.32);
}

.level-token.current b {
  color: #0A0D13;
}

.level-token.completed {
  color: var(--success);
  border-color: rgba(112, 217, 158, 0.5);
}

/* =============================================================
   LESSON / TARIFF CARDS
   ============================================================= */

.lesson-card {
  display: grid;
  gap: 12px;
}

.lesson-card.locked {
  opacity: 0.55;
}

.lesson-card .lesson-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tariff-card {
  display: grid;
  gap: 12px;
}

.tariff-card header {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.tariff-card.featured {
  border-color: rgba(214, 182, 106, 0.62);
  background:
    linear-gradient(145deg, rgba(200, 162, 74, 0.16), rgba(13, 16, 23, 0.98)),
    radial-gradient(circle at 80% 0%, rgba(214, 182, 106, 0.18), transparent 60%),
    #0E1219;
}

.tariff-card .price {
  font-size: 22px;
  font-weight: 900;
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.tariff-card .price small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-left: 4px;
}

.tariff-card ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 6px;
  margin: 0;
}

.tariff-card li {
  position: relative;
  padding-left: 22px;
  color: var(--text-soft);
  font-size: 13px;
}

.tariff-card li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 7px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--gold-bright) 0 30%, transparent 32%),
    rgba(200, 162, 74, 0.16);
  border: 1px solid var(--border);
}

/* =============================================================
   FORMS
   ============================================================= */

.form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

input,
textarea,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(10, 13, 19, 0.78);
  color: var(--text);
  padding: 14px 14px;
  min-height: 50px;
  outline: none;
  transition: border-color 180ms ease, background 180ms ease;
}

input::placeholder,
textarea::placeholder {
  color: rgba(185, 180, 170, 0.6);
}

textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.5;
}

input:hover,
textarea:hover,
select:hover {
  border-color: rgba(200, 162, 74, 0.42);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--border-strong);
  background: rgba(13, 17, 24, 0.9);
  box-shadow: 0 0 0 4px rgba(200, 162, 74, 0.08);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
}

.input-wrap input {
  flex: 1;
  padding-right: 70px;
}

.input-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: rgba(20, 23, 31, 0.6);
  color: var(--gold-soft);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 10px;
}

.input-toggle:hover {
  background: rgba(200, 162, 74, 0.14);
}

.form-error {
  color: #ffb1ab;
  background: var(--danger-bg);
  border: 1px solid rgba(255, 107, 107, 0.4);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
}

.test-option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: rgba(10, 13, 19, 0.5);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease;
}

.test-option:hover {
  border-color: var(--border);
  background: rgba(200, 162, 74, 0.06);
}

.test-option input {
  width: auto;
  min-height: 0;
  margin: 6px 0 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--gold);
}

.test-option span {
  flex: 1;
  min-width: 0;
  color: var(--text-soft);
  line-height: 1.4;
}

/* =============================================================
   BOTTOM CTA / TABBAR
   ============================================================= */

.bottom-cta {
  width: calc(100% - (var(--page-gutter) + var(--page-gutter)));
  max-width: calc(var(--page-max) - (var(--page-gutter) + var(--page-gutter)));
  min-width: 0;
  margin: 0 auto;
  padding: 8px;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: rgba(13, 17, 24, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 -16px 45px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.tabbar {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}

.tab-btn {
  width: 100%;
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 8px 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  min-width: 0;
  letter-spacing: 0.02em;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease;
}

.tab-btn .tab-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(200, 162, 74, 0.22);
  border-radius: 50%;
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  background: rgba(200, 162, 74, 0.05);
  transition: inherit;
}

.tab-btn span:not(.tab-icon) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.tab-btn:hover {
  color: var(--text-soft);
}

.tab-btn:hover .tab-icon {
  border-color: var(--border);
}

.tab-btn.active {
  color: var(--gold-bright);
}

.tab-btn.active .tab-icon {
  border-color: var(--border-strong);
  color: var(--gold-bright);
  background:
    linear-gradient(135deg, rgba(200, 162, 74, 0.32), rgba(200, 162, 74, 0.12));
  box-shadow: 0 6px 18px rgba(200, 162, 74, 0.18);
}

/* =============================================================
   SUMMARY / FIXED FOOTER ACTIONS
   ============================================================= */

.summary {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px var(--page-gutter)
    max(14px, calc(var(--app-bottom-padding) + 10px));
  background:
    linear-gradient(180deg, transparent 0%, rgba(7, 9, 14, 0.92) 60%, rgba(7, 9, 14, 0.98) 100%);
  z-index: 5;
}

.summary-inner {
  width: min(var(--page-max), 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* =============================================================
   BROWSER GATE / LANDING
   ============================================================= */

.landing-shell {
  min-height: 100dvh;
  display: grid;
  position: relative;
  overflow: hidden;
}

.landing-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 25% 10%, rgba(200, 162, 74, 0.10), transparent 42%),
    radial-gradient(circle at 80% 60%, rgba(120, 145, 200, 0.08), transparent 46%),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.015) 0 1px, transparent 1px 10px);
  z-index: 0;
}

.landing-main {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100% - 32px));
  margin: clamp(40px, 10vh, 80px) auto;
  display: grid;
  gap: 28px;
  padding: 0 var(--page-gutter);
}

.landing-brand {
  display: grid;
  gap: 6px;
  justify-items: start;
}

.landing-brand h1 {
  font-size: 52px;
  letter-spacing: 0;
  margin: 0;
  background: linear-gradient(135deg, #F5F1E8 0%, #C8A24A 80%, #A9843A 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.landing-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  background:
    linear-gradient(160deg, rgba(30, 34, 42, 0.85), rgba(13, 16, 23, 0.96)),
    radial-gradient(circle at 80% 0%, rgba(214, 182, 106, 0.12), transparent 60%);
  box-shadow: var(--shadow-card);
  display: grid;
  gap: 16px;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.landing-foot {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* =============================================================
   ADMIN AUTH (login)
   ============================================================= */

.auth-shell {
  min-height: 100dvh;
  display: grid;
  position: relative;
  overflow: hidden;
}

.auth-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 22% 20%, rgba(200, 162, 74, 0.10), transparent 42%),
    radial-gradient(circle at 78% 70%, rgba(120, 145, 200, 0.08), transparent 46%),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.015) 0 1px, transparent 1px 11px),
    linear-gradient(180deg, #07090E 0%, #0A0D14 100%);
  z-index: 0;
}

.auth-main {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100% - 32px));
  margin: auto;
  padding: clamp(32px, 8vh, 72px) 16px;
  display: grid;
  gap: 24px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-brand-title {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(22px, 4vw, 32px);
  background:
    linear-gradient(160deg, rgba(30, 34, 42, 0.94), rgba(11, 14, 20, 0.98)),
    radial-gradient(circle at 80% -20%, rgba(214, 182, 106, 0.18), transparent 60%);
  box-shadow: var(--shadow-card), var(--shadow-gold);
  display: grid;
  gap: 18px;
}

.auth-card-title {
  margin: 0;
  font-size: 26px;
}

.auth-card-sub {
  margin: 0;
  font-size: 13px;
}

.auth-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.auth-hint code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  background: rgba(200, 162, 74, 0.1);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 2px 6px;
  color: var(--gold-soft);
}

.auth-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth-foot .dot {
  opacity: 0.5;
}

/* =============================================================
   ADMIN SHELL (authenticated)
   ============================================================= */

.admin-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  background:
    linear-gradient(180deg, rgba(200, 162, 74, 0.04), transparent 240px),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.014) 0 1px, transparent 1px 8px),
    #07090E;
  color: var(--text);
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  border-right: 1px solid var(--border-soft);
  padding: 20px 16px 16px;
  background:
    linear-gradient(180deg, rgba(20, 23, 31, 0.96), rgba(10, 13, 19, 0.96));
  overflow-y: auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-soft);
  min-width: 0;
}

.admin-brand-meta {
  min-width: 0;
}

.admin-brand strong {
  display: block;
  color: #F5F1E8;
  font-weight: 900;
  letter-spacing: 0.04em;
  font-size: 14px;
}

.admin-brand span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.admin-nav {
  display: grid;
  gap: 4px;
  align-content: start;
  overflow-y: auto;
}

.admin-nav button {
  text-align: left;
  justify-content: flex-start;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  letter-spacing: 0.01em;
  font-weight: 700;
}

.admin-side-foot {
  border-top: 1px solid var(--border-soft);
  padding-top: 12px;
  display: grid;
  gap: 8px;
}

.admin-main {
  min-width: 0;
  padding: 24px;
  width: 100%;
  max-width: var(--admin-max);
  margin: 0 auto;
}

.admin-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 22px;
}

.admin-title-block {
  flex: 1;
  min-width: 0;
}

.admin-title-block h1 {
  margin: 0;
  font-size: 26px;
}

.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-who {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

#adminNavToggle {
  display: none;
}

.admin-content {
  display: grid;
  gap: 18px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.admin-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.admin-toolbar.stacked {
  margin: 14px 0;
}

.admin-toolbar input,
.admin-toolbar select {
  min-height: 42px;
  padding: 10px 12px;
  flex: 1 1 200px;
  min-width: 160px;
}

/* =============================================================
   TABLES
   ============================================================= */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: rgba(10, 13, 19, 0.6);
  -webkit-overflow-scrolling: touch;
}

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

th,
td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(200, 162, 74, 0.1);
  vertical-align: top;
  font-size: 13px;
}

th {
  color: var(--gold);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(200, 162, 74, 0.06);
  font-weight: 800;
}

td {
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}

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

tr:hover td {
  background: rgba(200, 162, 74, 0.03);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-row.end {
  justify-content: flex-end;
}

.icon-mini {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.switch-field {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(10, 13, 19, 0.72);
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.switch-field input {
  width: 18px;
  height: 18px;
  min-height: 0;
  accent-color: var(--gold);
}

.upload-drop {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 150px;
  padding: 22px;
  border: 1px dashed rgba(200, 162, 74, 0.45);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 50% 0%, rgba(200, 162, 74, 0.1), transparent 55%),
    rgba(10, 13, 19, 0.62);
  text-align: center;
  cursor: pointer;
}

.upload-drop:hover {
  border-color: var(--border-strong);
  background:
    radial-gradient(circle at 50% 0%, rgba(200, 162, 74, 0.16), transparent 55%),
    rgba(13, 17, 24, 0.82);
}

.upload-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-title {
  color: var(--gold-bright);
  font-weight: 900;
  font-size: 18px;
}

.upload-drop small,
.upload-drop strong {
  color: var(--muted);
}

.receipt-validation {
  display: grid;
  gap: 4px;
  min-width: 220px;
}

.receipt-validation span:not(.status),
.receipt-validation small {
  color: var(--muted);
  font-size: 12px;
}

.builder-head,
.builder-question-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.builder-list {
  display: grid;
  gap: 14px;
}

.builder-question {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(160deg, rgba(22, 25, 33, 0.88), rgba(10, 13, 19, 0.9));
}

.builder-question-head strong {
  color: var(--gold-bright);
}

.builder-options {
  display: grid;
  gap: 10px;
}

.builder-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(200, 162, 74, 0.12);
  border-radius: var(--radius-md);
  background: rgba(7, 9, 14, 0.48);
}

.builder-option .correct-radio {
  width: 20px;
  min-height: 20px;
  margin-bottom: 15px;
  accent-color: var(--gold);
}

/* =============================================================
   SKELETONS / EMPTY / LOADING
   ============================================================= */

.skeleton {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(30, 34, 42, 0.7), rgba(13, 16, 23, 0.85));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  min-height: 120px;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 30%,
    rgba(200, 162, 74, 0.08) 50%,
    transparent 70%
  );
  animation: shimmer 1400ms linear infinite;
}

.skeleton-row {
  height: 14px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(200, 162, 74, 0.08), rgba(200, 162, 74, 0.02));
  position: relative;
  overflow: hidden;
}

.skeleton-row + .skeleton-row {
  margin-top: 10px;
}

.skeleton-row::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 30%,
    rgba(200, 162, 74, 0.12) 50%,
    transparent 70%
  );
  animation: shimmer 1400ms linear infinite;
}

.skeleton-row.w-50 {
  width: 50%;
}
.skeleton-row.w-70 {
  width: 70%;
}
.skeleton-row.w-90 {
  width: 90%;
}

@keyframes shimmer {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

.empty-state {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 8px;
  padding: 32px 18px;
  border: 1px dashed var(--border-soft);
  border-radius: var(--radius-lg);
  color: var(--muted);
  background: rgba(10, 13, 19, 0.4);
}

.empty-state .icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  color: var(--gold-soft);
  font-size: 20px;
  font-weight: 900;
  background: rgba(200, 162, 74, 0.06);
}

.error-card {
  border: 1px solid rgba(255, 107, 107, 0.45);
  background: linear-gradient(160deg, rgba(73, 26, 22, 0.55), rgba(20, 12, 10, 0.95));
  border-radius: var(--radius-lg);
  padding: 18px;
  display: grid;
  gap: 10px;
  color: #ffd7d2;
}

/* =============================================================
   TOAST
   ============================================================= */

.toast-stack {
  position: fixed;
  left: 50%;
  bottom: max(16px, calc(var(--app-bottom-padding) + 10px));
  transform: translateX(-50%);
  display: grid;
  gap: 10px;
  z-index: 1000;
  width: min(420px, calc(100% - 32px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background:
    linear-gradient(160deg, rgba(26, 30, 38, 0.96), rgba(13, 16, 23, 0.98));
  box-shadow: var(--shadow-card);
  color: var(--text);
  font-size: 13.5px;
  animation: toast-in 220ms ease;
}

.toast.success {
  border-color: rgba(112, 217, 158, 0.45);
}

.toast.error {
  border-color: rgba(255, 107, 107, 0.5);
}

.toast .toast-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  flex: 0 0 8px;
}

.toast.success .toast-dot {
  background: var(--success);
}

.toast.error .toast-dot {
  background: var(--danger);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =============================================================
   MODAL
   ============================================================= */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 2, 1, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 900;
}

.modal {
  width: min(480px, 100%);
  max-height: min(
    100dvh,
    calc(var(--browser-viewport-height) - var(--app-top-padding) - var(--app-bottom-padding) - 16px)
  );
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(160deg, rgba(26, 30, 38, 0.98), rgba(11, 14, 20, 0.98));
  box-shadow: var(--shadow-card), var(--shadow-gold);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.modal.modal-wide {
  width: min(920px, 100%);
}

.modal-head {
  padding: 18px 22px 8px;
}

.modal-body {
  padding: 4px 22px 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-foot {
  padding: 12px 22px 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border-soft);
}

/* =============================================================
   SCREEN LAYOUT
   ============================================================= */

.screen {
  width: 100%;
  max-width: 100%;
  display: grid;
  gap: 16px;
  min-width: 0;
}

.section-head {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.section-head > * {
  min-width: 0;
}

.section-head h1,
.section-head h2 {
  margin: 0;
}

.referral-link {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  word-break: break-all;
  background: rgba(10, 13, 19, 0.5);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 12px;
  color: var(--gold-soft);
  margin-bottom: 12px;
}

/* =============================================================
   RESPONSIVE
   ============================================================= */

@media (max-width: 960px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    position: fixed;
    inset: 0;
    height: 100dvh;
    width: min(320px, 86vw);
    transform: translateX(-100%);
    transition: transform 240ms ease;
    z-index: 200;
    border-right: 1px solid var(--border);
  }
  .admin-shell.nav-open .admin-sidebar {
    transform: translateX(0);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.65);
  }
  .admin-shell.nav-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(2, 2, 1, 0.6);
    backdrop-filter: blur(2px);
    z-index: 150;
  }
  #adminNavToggle {
    display: grid;
  }
  .admin-main {
    padding: 20px var(--page-gutter);
  }
}

@media (max-width: 720px) {
  .admin-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
  .admin-who {
    display: none;
  }
  .builder-option {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .builder-option .action-row {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  :root {
    --page-gutter: 14px;
  }
  h1 {
    font-size: 27px;
  }
  h2 {
    font-size: 19px;
  }
  .hero {
    min-height: 200px;
    padding: 20px;
  }
  .hero h1 {
    font-size: 26px;
  }
  .card,
  .metric,
  .lesson-card,
  .tariff-card,
  .admin-card {
    padding: 16px;
  }
  .tab-btn {
    font-size: 10.5px;
  }
  .tab-btn .tab-icon {
    width: 26px;
    height: 26px;
    font-size: 12px;
  }
  .auth-card {
    padding: 22px;
  }
  .landing-brand h1 {
    font-size: 42px;
  }
  .auth-card-title,
  .admin-title-block h1 {
    font-size: 24px;
  }
  .level-strip {
    grid-auto-columns: minmax(96px, 1fr);
  }
}

@media (max-width: 360px) {
  .header-action span:not(.header-action-dot) {
    display: none;
  }
  .header-action {
    padding: 0 10px;
  }
}

@media (min-width: 1180px) {
  .content {
    padding-top: 14px;
  }
}

/* =============================================================
   FULLSCREEN STATE (Telegram requestFullscreen succeeded)
   ============================================================= */

html.telegram-fullscreen .app-shell {
  /* keep header below Telegram's floating buttons */
}

/* =============================================================
   PRINT (avoid printing)
   ============================================================= */

@media print {
  body {
    background: #fff;
    color: #000;
  }
  .app-shell,
  .admin-shell,
  .auth-shell,
  .landing-shell {
    display: none;
  }
}
