/* ============================================================
   БірБілім — Премиум минималистік дизайн жүйесі
   ============================================================ */

:root,
html[data-theme="night"] {
  --bg:        #060709;
  --bg-2:      #0b0c10;
  --surface:   #11131a;
  --surface-2: #171a24;
  --card:      #12141c;
  --line:      rgba(255, 255, 255, 0.05);
  --line-2:    rgba(255, 255, 255, 0.1);
  --text:      #f5f6f9;
  --text-2:    #9fa5b5;
  --text-3:    #5c6170;
  --accent:    #7b8cde;
  --accent-2:  #9c7bde;
  --accent-glow: rgba(123, 140, 222, 0.25);
  --pro:       #ffb300;
  --pro-glow:  rgba(255, 179, 0, 0.3);
  --danger:    #ff4a5a;
  --ok:        #29cc97;
  --shadow:    0 16px 48px rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.4);
  --radius:    20px;
  --radius-sm: 14px;
  --radius-xs: 8px;
  --grad:      linear-gradient(135deg, #7b8cde 0%, #9c7bde 100%);
  --panel-overlay: linear-gradient(180deg, rgba(6, 7, 9, 0) 0%, rgba(6, 7, 9, 0.9) 100%);
}

html[data-theme="day"] {
  --bg:        #f3f5f9;
  --bg-2: #ffffff;
  --surface:   #ffffff;
  --surface-2: #e9ecf4;
  --card:      #ffffff;
  --line:      rgba(15, 23, 42, 0.05);
  --line-2:    rgba(15, 23, 42, 0.09);
  --text:      #0f141d;
  --text-2:    #4e5666;
  --text-3:    #858e9f;
  --accent:    #5468ff;
  --accent-2:  #8c54ff;
  --accent-glow: rgba(84, 104, 255, 0.15);
  --pro:       #d98200;
  --pro-glow:  rgba(217, 130, 0, 0.2);
  --danger:    #e03342;
  --ok:        #0e9f6e;
  --shadow:    0 16px 40px rgba(30, 40, 70, 0.08);
  --shadow-sm: 0 8px 20px rgba(30, 40, 70, 0.04);
  --grad:      linear-gradient(135deg, #5468ff 0%, #8c54ff 100%);
  --panel-overlay: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(15, 20, 29, 0.4) 100%);
}

/* Base Styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  padding-bottom: 70px; /* Mobile navigation bar logic padding */
}
@media (min-width: 768px) {
  body { padding-bottom: 0; }
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
img, video { max-width: 100%; display: block; height: auto; }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* Layout Grid */
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* Splash Screen */
#splash {
  position: fixed; inset: 0; z-index: 9999;
  background: #060709; color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
#splash.hide { opacity: 0; visibility: hidden; pointer-events: none; }
#splash .splash-text {
  font-size: 24px; font-weight: 300; letter-spacing: 0.15em;
  opacity: 0; transform: translateY(6px);
  animation: splashIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes splashIn { to { opacity: 1; transform: translateY(0); } }

/* App Header */
.app-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(160%) blur(20px);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.app-header .bar { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand {
  font-weight: 850; font-size: 20px; letter-spacing: -0.02em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; white-space: nowrap;
}
.greeting { font-size: 13.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; font-weight: 500; }
.greeting strong { color: var(--text); font-weight: 700; }

.pro-badge {
  font-size: 9.5px; font-weight: 900; letter-spacing: 0.06em;
  padding: 2px 7px; border-radius: 99px; color: #110d00;
  background: linear-gradient(135deg, #ffe59e, var(--pro));
  box-shadow: 0 0 12px var(--pro-glow);
}

/* UI Elements */
.icon-btn {
  width: 36px; height: 36px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text); transition: transform 0.1s ease, background 0.2s, border-color 0.2s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line-2); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 18px; height: 18px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 14px;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--text);
  transition: transform 0.1s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(0.96); }
.btn-primary { background: var(--grad); color: #fff; border: none; box-shadow: 0 4px 16px var(--accent-glow); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger { background: transparent; border-color: color-mix(in srgb,var(--danger) 30%,transparent); color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 10px; }

/* Custom Section/Category Cards */
.hero { padding: 20px 0 10px; }
.hero h1 { font-size: clamp(22px, 5.5vw, 30px); font-weight: 800; letter-spacing: -0.02em; }
.hero p { color: var(--text-2); margin-top: 4px; font-size: 14px; }

.section-title {
  font-size: 17px; font-weight: 700; letter-spacing: -0.01em;
  margin: 20px 0 12px; display: flex; align-items: center; gap: 8px;
}
.section-title .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* Grid Cards with Parallax Tilt for Desktop and Smooth Layout for Mobile */
.panels {
  display: grid; gap: 12px;
  grid-template-columns: 1fr;
}
@media (min-width: 480px) { .panels { grid-template-columns: repeat(2, 1fr); gap: 14px; } }
@media (min-width: 840px) { .panels { grid-template-columns: repeat(3, 1fr); gap: 16px; } }

.panel {
  position: relative; border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 16/10; background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s;
}
.panel:hover { box-shadow: var(--shadow); transform: translateY(-4px); }
.panel .panel-media { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.panel .panel-media img,
.panel .panel-media video { width: 100%; height: 100%; object-fit: cover; }
.panel .panel-default {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(100% 100% at 0% 0%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%),
    radial-gradient(100% 100% at 100% 100%, color-mix(in srgb, var(--accent-2) 30%, transparent), transparent 70%),
    var(--surface-2);
}
.panel .panel-overlay { position: absolute; inset: 0; z-index: 1; background: var(--panel-overlay); }
.panel .panel-body {
  position: relative; z-index: 2; height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 14px;
}
.panel .panel-icon {
  width: 38px; height: 38px; border-radius: 10px; margin-bottom: auto;
  background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  border: 1px solid rgba(255, 255, 255, 0.15); color: #fff;
}
.panel .panel-title { font-size: 16px; font-weight: 800; color: #fff; letter-spacing: -0.01em; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); }
.panel .panel-meta { font-size: 12px; color: rgba(255, 255, 255, 0.7); margin-top: 2px; }
.panel .vis-tag {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  font-size: 9px; font-weight: 700; padding: 3px 8px;
  border-radius: 99px; background: rgba(0, 0, 0, 0.5); color: #fff; border: 1px solid rgba(255, 255, 255, 0.15);
}
.panel .vis-tag.pro { background: var(--pro); color: #110d00; border: none; }

/* Selection List component and cards */
.list { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 680px) { .list { grid-template-columns: repeat(2, 1fr); gap: 12px; } }

.card-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; box-shadow: var(--shadow-sm);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.card-row:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: var(--shadow); }
.card-thumb {
  width: 72px; height: 48px; border-radius: 8px; overflow: hidden; flex: none;
  background: var(--surface-2); position: relative;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-thumb .ph { position: absolute; inset: 0; background: var(--grad); opacity: 0.15; }
.card-row .meta { flex: 1; min-width: 0; }
.card-row .meta h3 { font-size: 14.5px; font-weight: 700; letter-spacing: -0.01em; }
.card-row .meta p { font-size: 12px; color: var(--text-2); margin-top: 1px; }

.lesson-card {
  display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.lesson-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-2); }
.lesson-card .cover { aspect-ratio: 16/9; background: var(--surface-2); position: relative; }
.lesson-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.lesson-card .cover .ph {
  position: absolute; inset: 0;
  background: radial-gradient(100% 100% at 30% 20%, color-mix(in srgb, var(--accent) 25%, transparent), transparent 70%), var(--surface-2);
}
.lesson-card .cover .play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.lesson-card .cover .play span {
  width: 40px; height: 40px; border-radius: 50%; background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; color: #fff; border: 1px solid rgba(255, 255, 255, 0.2);
}
.lesson-card .body { padding: 12px; }
.lesson-card .body h3 { font-size: 14px; font-weight: 700; line-height: 1.4; }
.lesson-card .body .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }

.tag {
  font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 99px;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line);
}
.tag.pro { background: var(--pro); color: #110d00; border: none; }
.tag.reg { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }

/* Navigation Breadcrumbs */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; color: var(--text-3); font-size: 12px; padding: 12px 0 4px; }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { opacity: 0.5; }

/* Lesson Page Components */
.lesson-hero { margin-top: 8px; }
.video-wrap {
  border-radius: var(--radius); overflow: hidden; background: #000;
  aspect-ratio: 16/9; box-shadow: var(--shadow); border: 1px solid var(--line);
}
.video-wrap video { width: 100%; height: 100%; display: block; object-fit: contain; }
.video-wrap .no-video { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--text-3); background: var(--surface); font-size: 13.5px; }
.lesson-title { font-size: clamp(19px, 4.5vw, 25px); font-weight: 800; letter-spacing: -0.02em; margin: 14px 0 3px; }

/* Clean Minimal Accordion */
.accordion { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.acc { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--card); }
.acc > button {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 14px; font-weight: 700; font-size: 14.5px; text-align: left;
  transition: background 0.2s;
}
.acc > button:hover { background: var(--surface-2); }
.acc > button .ic { transition: transform 0.2s ease; color: var(--text-3); }
.acc.open > button .ic { transform: rotate(180deg); }
.acc .acc-body { display: none; }
.acc.open .acc-body { display: block; }
.acc .acc-inner { padding: 4px 14px 14px; color: var(--text-2); font-size: 13.5px; line-height: 1.6; }

/* Prompts Cards */
.prompt-card {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-xs);
  padding: 10px 12px; margin-top: 8px; position: relative;
}
.prompt-card h4 { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.02em; }
.prompt-card pre { white-space: pre-wrap; word-break: break-all; font-size: 12.5px;
  color: var(--text); font-family: ui-monospace, Menlo, Monaco, Consolas, monospace; line-height: 1.5; }
.copy-btn { position: absolute; top: 10px; right: 10px; font-size: 11px; font-weight: 600;
  padding: 4px 8px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line-2); color: var(--text-2); }
.copy-btn:hover { color: var(--text); }
.copy-btn.done { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }

/* Material download buttons */
.lesson-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.lesson-btns a { display: inline-flex; align-items: center; gap: 5px; padding: 8px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line-2); font-weight: 600; font-size: 13px;
  transition: background 0.2s, transform 0.1s; }
.lesson-btns a:hover { background: var(--surface); }

/* Access Gates */
.gate {
  max-width: 420px; margin: 30px auto; text-align: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 20px; box-shadow: var(--shadow);
}
.gate .ic { width: 48px; height: 48px; border-radius: 14px; margin: 0 auto 12px;
  background: var(--grad); display: flex; align-items: center; justify-content: center; color: #fff; }
.gate h2 { font-size: 18px; font-weight: 800; }
.gate p { color: var(--text-2); margin: 6px 0 16px; font-size: 13.5px; }
.gate .pro-instruction { background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px; font-size: 13px; color: var(--text); white-space: pre-wrap; text-align: left; }

/* Forms input fields styles */
.auth-wrap { max-width: 380px; margin: 4vh auto; padding: 0 16px; }
.auth-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 20px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.auth-card .sub { color: var(--text-2); font-size: 13px; margin: 4px 0 18px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; font-size: 14px;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Empty notifications / Footer */
.empty { text-align: center; color: var(--text-3); padding: 40px 16px; font-size: 13.5px; }
.app-footer { margin-top: 40px; padding: 20px 0; border-top: 1px solid var(--line);
  color: var(--text-3); font-size: 12px; text-align: center; }

/* Bottom Tab Navigation Bar for Mobiles (Feels like app) */
.mobile-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 990;
  height: 60px; background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 768px) {
  .mobile-nav { display: none; }
}

.mobile-nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--text-2); font-size: 10px; font-weight: 500; height: 100%; width: 20%;
  transition: color 0.2s;
}
.mobile-nav-item.active { color: var(--accent); }
.mobile-nav-item svg { width: 18px; height: 18px; margin-bottom: 2px; }

/* reveal, animations and others */
.reveal { opacity: 0; transform: translateY(8px); transition: opacity 0.4s ease, transform 0.4s ease; }
.reveal.in { opacity: 1; transform: none; }
.page { animation: pageIn 0.25s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ============================================================
   Responsive hardening — mobile/desktop adaptive layout
   Бұл блок телефонда горизонталь scroll шықпауын және desktop-та
   бөлімдердің экранға жинақы сыйып тұруын қамтамасыз етеді.
   ============================================================ */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}
#app,
.page,
.app-header,
.app-footer {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}
.container {
  width: min(100%, 1180px);
  max-width: 1180px;
  padding-left: clamp(12px, 3.5vw, 24px);
  padding-right: clamp(12px, 3.5vw, 24px);
}
.app-header .bar {
  gap: 8px;
  min-width: 0;
}
.header-spacer { flex: 1 1 auto; min-width: 4px; }
.brand,
.greeting,
.btn,
.icon-btn,
.mobile-nav-item span {
  min-width: 0;
}
.greeting {
  flex: 0 1 auto;
  max-width: 38vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Desktop-та пән/бөлім карточкалары экранға өздері бейімделеді */
.panels {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  align-items: stretch;
}
.list {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  align-items: stretch;
}
.panel,
.card-row,
.lesson-card,
.gate,
.auth-card,
.acc,
.prompt-card,
.video-wrap {
  max-width: 100%;
}
.panel-title,
.card-row .meta h3,
.lesson-card .body h3,
.lesson-title,
.hero h1,
.acc > button,
.gate .pro-instruction,
.prompt-card pre,
.lesson-btns a {
  overflow-wrap: anywhere;
  word-break: normal;
}
.card-row .chev { flex: 0 0 auto; }

/* Формалар үшін бұрын жетіспеген layout */
.row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
.btn-xs {
  padding: 5px 9px;
  font-size: 11.5px;
  border-radius: 9px;
  line-height: 1.2;
}
.form-msg {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  margin: 10px 0 14px;
  border: 1px solid var(--line-2);
}
.form-msg.err {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
}
.auth-foot {
  margin-top: 16px;
  text-align: center;
  color: var(--text-2);
  font-size: 13px;
}
.auth-foot a { color: var(--accent); font-weight: 700; }

/* Кестелер ұзын URL/email/text болғанда экраннан шықпасын */
.tbl {
  table-layout: fixed;
}
.tbl th,
.tbl td {
  overflow-wrap: anywhere;
  word-break: normal;
  vertical-align: top;
}

@media (min-width: 1180px) {
  .hero { padding-top: 24px; }
  .panels { gap: 18px; }
  .list { gap: 14px; }
  .panel { aspect-ratio: 16 / 9.4; }
  .lesson-hero { max-width: 980px; margin-left: auto; margin-right: auto; }
  .accordion { max-width: 980px; margin-left: auto; margin-right: auto; }
}

@media (max-width: 767px) {
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .container {
    padding-left: 12px;
    padding-right: 12px;
  }
  .app-header .bar {
    height: 54px;
  }
  .brand { font-size: 18px; }
  .greeting {
    max-width: 82px;
    font-size: 12px;
  }
  .greeting strong,
  .pro-badge { display: none; }
  .icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    flex: 0 0 34px;
  }
  .btn-sm {
    padding: 7px 10px;
    font-size: 12px;
    white-space: nowrap;
  }
  .hero { padding: 16px 0 8px; }
  .section-title { margin: 16px 0 10px; }
  .panels,
  .list,
  .row-2 {
    grid-template-columns: 1fr;
  }
  .panel {
    aspect-ratio: 16 / 10.8;
    border-radius: 18px;
    transform: none !important;
  }
  .panel:hover,
  .card-row:hover,
  .lesson-card:hover {
    transform: none;
  }
  .panel .panel-body { padding: 12px; }
  .panel .panel-title { font-size: 15.5px; }
  .card-row {
    padding: 10px;
    gap: 10px;
  }
  .card-thumb {
    width: 60px;
    height: 42px;
  }
  .lesson-card .body { padding: 11px; }
  .crumbs {
    gap: 3px;
    font-size: 11.5px;
  }
  .video-wrap { border-radius: 16px; }
  .acc > button { padding: 12px; }
  .acc .acc-inner { padding: 4px 12px 12px; }
  .prompt-card { padding: 10px; }
  .copy-btn {
    position: static;
    margin-bottom: 8px;
  }
  .lesson-btns { flex-direction: column; }
  .lesson-btns a,
  .gate .btn,
  .auth-card .btn {
    width: 100%;
  }
  .gate {
    margin: 22px auto;
    padding: 22px 16px;
  }
  .auth-wrap {
    max-width: 100%;
    margin: 2vh auto;
    padding-left: 12px;
    padding-right: 12px;
  }
  .auth-card { padding: 22px 16px; }
  .mobile-nav {
    min-width: 0;
    height: calc(60px + env(safe-area-inset-bottom));
    padding-left: max(6px, env(safe-area-inset-left));
    padding-right: max(6px, env(safe-area-inset-right));
  }
  .mobile-nav-item {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    padding: 0 2px;
  }
  .mobile-nav-item span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 420px) {
  .container {
    padding-left: 10px;
    padding-right: 10px;
  }
  .brand { font-size: 17px; }
  .greeting { display: none; }
  .panel { aspect-ratio: 16 / 11.5; }
  .panel .vis-tag { top: 10px; right: 10px; }
  .mobile-nav-item { font-size: 9.5px; }
}

/* Section cards use the same visual language as home cards */
.section-panels .panel {
  min-height: 150px;
}
.panel .panel-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.panel video.panel-video {
  background: #000;
}
@media (min-width: 1180px) {
  .section-panels {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  }
}
@media (max-width: 767px) {
  .section-panels .panel {
    aspect-ratio: 16 / 10.6;
  }
}

/* ============================================================
   V3 mobile stability + registration success
   ============================================================ */
html, body {
  min-width: 0;
  overflow-x: hidden;
}
body {
  position: relative;
}
.site-toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: min(100%, 720px);
  margin: 14px auto 18px;
  padding: 14px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--ok) 12%, var(--card));
  border: 1px solid color-mix(in srgb, var(--ok) 36%, transparent);
  box-shadow: var(--shadow-sm);
}
.site-toast .toast-icon {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--ok);
  color: #04110d;
  font-weight: 900;
}
.site-toast strong { display: block; font-size: 14px; margin-bottom: 2px; }
.site-toast span { display: block; color: var(--text-2); font-size: 13px; }
.panel video.panel-video,
.panel .panel-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
}
.panel video.needs-tap + .video-fallback-note { display: block; }
@media (max-width: 767px) {
  .page {
    padding-top: 2px;
  }
  .panels,
  .section-panels,
  .list {
    gap: 12px;
    width: 100%;
  }
  .panel {
    width: 100%;
    min-height: clamp(168px, 46vw, 210px);
    aspect-ratio: auto;
  }
  .panel .panel-body {
    min-height: inherit;
  }
  .lesson-card,
  .card-row,
  .acc,
  .gate,
  .auth-card,
  .site-toast {
    border-radius: 17px;
  }
  .site-toast {
    margin-top: 10px;
    padding: 12px;
  }
  input, select, textarea, button {
    font-size: 16px; /* iPhone zoom болмауы үшін */
  }
  .btn, .btn-sm {
    min-height: 40px;
  }
}
@media (max-width: 380px) {
  .container {
    padding-left: 9px;
    padding-right: 9px;
  }
  .panel { min-height: 158px; }
  .panel .panel-title { font-size: 15px; }
  .mobile-nav-item span { font-size: 9px; }
}
@media (min-width: 768px) and (max-width: 1179px) {
  .panels { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
  .panel { aspect-ratio: 16 / 9.8; }
}

/* V7 PRO badge + YouTube embed fixes */
.greeting .pro-badge,
.pro-badge {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-left: 4px;
  white-space: nowrap;
}
.lesson-youtube {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  border-radius: inherit;
  background: #000;
}
@media (max-width: 767px) {
  .greeting {
    max-width: 58vw;
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  .greeting strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }
  .greeting .pro-badge,
  .pro-badge {
    display: inline-flex !important;
    padding: 4px 7px;
    font-size: 9.5px;
  }
}

/* V8 visibility + Ultimate status */
.pro-badge.ultimate,
.account-status-mobile.ultimate span {
  background: linear-gradient(135deg, #b58cff, #5ee7ff) !important;
  color: #070713 !important;
  border-color: rgba(181, 140, 255, .55) !important;
}
.vis-tag.ultimate,
.tag.ultimate {
  color: #070713 !important;
  background: linear-gradient(135deg, #b58cff, #5ee7ff) !important;
  border-color: rgba(181, 140, 255, .55) !important;
}
.vis-tag.hidden,
.tag.hidden {
  color: #fff !important;
  background: rgba(255, 77, 109, .22) !important;
  border-color: rgba(255, 77, 109, .42) !important;
}
.account-status-mobile {
  pointer-events: none;
}
.account-status-mobile svg {
  stroke: currentColor;
}
.account-status-mobile span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  padding: 2px 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffe59e, #ffbd2e);
  color: #160f00;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}
@media (max-width: 767px) {
  .bar .greeting .pro-badge {
    display: inline-flex !important;
  }
}

/* Platform v2: profile + progress */
.progress-widget {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, .6fr) auto;
  gap: 14px;
  align-items: center;
  margin: 16px 0 22px;
  padding: 14px;
  border: 1px solid var(--line, rgba(255,255,255,.12));
  border-radius: 20px;
  background: rgba(255,255,255,.045);
}
.progress-widget strong { display:block; font-size: 15px; }
.progress-widget span { display:block; color: var(--text-2); font-size: 12px; margin-top: 3px; }
.progress-line { height: 10px; background: rgba(255,255,255,.08); border-radius: 999px; overflow: hidden; }
.progress-line i { display:block; height:100%; border-radius: inherit; background: linear-gradient(90deg, #7c5cff, #36b7ff); }
.lesson-progress-box {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line, rgba(255,255,255,.12));
  border-radius: 20px;
  background: rgba(41,204,151,.08);
  display:flex; justify-content:space-between; align-items:center; gap:14px; flex-wrap:wrap;
}
.lesson-progress-box strong { display:block; }
.lesson-progress-box span { display:block; color: var(--text-2); font-size:13px; margin-top:3px; }
.tag.done { color:#29cc97; border-color: rgba(41,204,151,.35); background: rgba(41,204,151,.1); }
.profile-page { padding-bottom: 80px; }
.profile-hero { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:22px; border:1px solid var(--line, rgba(255,255,255,.12)); border-radius:26px; background:linear-gradient(135deg, rgba(124,92,255,.18), rgba(54,183,255,.10)); margin-bottom:16px; }
.profile-hero h1 { margin:4px 0; font-size:32px; }
.profile-hero p { margin:0; color:var(--text-2); }
.profile-kicker { color:var(--accent,#7c5cff); font-size:12px; font-weight:900; text-transform:uppercase; letter-spacing:.08em; }
.profile-status { display:inline-flex; padding:10px 14px; border-radius:999px; font-weight:900; border:1px solid var(--line); background:rgba(255,255,255,.08); }
.profile-status.pro { color:#fff; background:rgba(124,92,255,.2); border-color:rgba(124,92,255,.4); }
.profile-status.ultimate { color:#fff; background:linear-gradient(90deg, rgba(255,181,71,.35), rgba(255,71,161,.25)); border-color:rgba(255,181,71,.45); }
.profile-grid { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:14px; margin-bottom:14px; }
.profile-card { padding:18px; border:1px solid var(--line, rgba(255,255,255,.12)); border-radius:22px; background:rgba(255,255,255,.045); }
.profile-card.full { margin-top:14px; }
.profile-card h2 { margin:0 0 12px; font-size:18px; }
.big-percent { font-size:48px; font-weight:900; line-height:1; margin:8px 0; }
.profile-lessons { display:grid; gap:8px; }
.profile-lesson-row { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:10px; align-items:center; text-decoration:none; color:inherit; padding:12px; border-radius:16px; border:1px solid var(--line, rgba(255,255,255,.10)); background:rgba(255,255,255,.035); }
.profile-lesson-row span:last-child { color:var(--text-2); font-size:12px; }
.lesson-dot { width:26px; height:26px; display:grid; place-items:center; border-radius:10px; background:rgba(255,255,255,.08); color:var(--text-2); }
.lesson-dot.done { background:rgba(41,204,151,.15); color:#29cc97; }
@media (max-width: 760px) {
  .progress-widget { grid-template-columns:1fr; }
  .profile-hero { align-items:flex-start; flex-direction:column; }
  .profile-grid { grid-template-columns:1fr; }
  .profile-lesson-row { grid-template-columns:auto minmax(0,1fr); }
  .profile-lesson-row span:last-child { grid-column:2; }
}

/* Access v3: mobile progress + expiring PRO / ULTIMATE status */
.pro-badge.pro,
.account-status-mobile.pro span {
  background: linear-gradient(135deg, #ffe59e, #ffbd2e) !important;
  color: #160f00 !important;
  border-color: rgba(255,189,46,.55) !important;
}
.pro-badge small,
.account-status-mobile small,
.profile-status small {
  display: block;
  font-size: 9px;
  line-height: 1.1;
  opacity: .82;
  font-weight: 800;
  margin-top: 2px;
}
.pro-badge {
  max-width: min(260px, 44vw);
  white-space: normal !important;
  line-height: 1.15;
}
.progress-widget.progress-widget-mobile {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "text percent"
    "line line"
    "btn btn";
  gap: 12px;
}
.progress-widget .progress-main-text { grid-area: text; min-width: 0; }
.progress-widget .progress-percent-chip {
  grid-area: percent;
  min-width: 58px;
  min-height: 42px;
  padding: 8px 12px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(124,92,255,.16);
  border: 1px solid rgba(124,92,255,.35);
  font-size: 18px;
  font-weight: 900;
}
.progress-widget .progress-line { grid-area: line; width: 100%; }
.progress-widget .btn { grid-area: btn; justify-self: start; }
.account-status-mobile span {
  flex-direction: column;
  gap: 1px;
  min-width: 58px;
}
.profile-status {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
}
.access-days-box {
  margin: 12px 0;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid var(--line, rgba(255,255,255,.12));
  background: rgba(255,255,255,.055);
}
.access-days-box strong {
  display: block;
  font-size: 42px;
  line-height: 1;
  font-weight: 950;
}
.access-days-box span {
  display: block;
  margin-top: 5px;
  color: var(--text-2);
  font-size: 13px;
}
.access-days-box.pro {
  background: rgba(255,189,46,.12);
  border-color: rgba(255,189,46,.28);
}
.access-days-box.ultimate {
  background: linear-gradient(135deg, rgba(181,140,255,.2), rgba(94,231,255,.1));
  border-color: rgba(181,140,255,.34);
}
@media (max-width: 760px) {
  .progress-widget {
    margin: 12px 0 18px;
    padding: 14px;
    border-radius: 22px;
  }
  .progress-widget strong { font-size: 14px; }
  .progress-widget span { font-size: 12px; }
  .progress-widget .btn {
    width: 100%;
    justify-self: stretch;
    justify-content: center;
  }
  .progress-line { height: 12px; }
  .profile-hero .profile-status {
    width: 100%;
    justify-content: center;
  }
  .profile-card .big-percent { font-size: 40px; }
  .account-status-mobile span { font-size: 9px; padding: 4px 6px; }
}
@media (max-width: 420px) {
  .progress-widget.progress-widget-mobile {
    grid-template-columns: 1fr;
    grid-template-areas: "text" "percent" "line" "btn";
  }
  .progress-widget .progress-percent-chip {
    width: 100%;
  }
}

/* V8: compact header access badge */
.pro-badge.compact-access {
  display:inline-flex;
  align-items:center;
  gap:6px;
  max-width:none;
  white-space:nowrap !important;
  padding:6px 9px;
  border-radius:999px;
  line-height:1;
}
.pro-badge.compact-access b { font-size:11px; letter-spacing:.02em; }
.pro-badge.compact-access small {
  display:inline;
  margin:0;
  font-size:10px;
  opacity:.9;
}
@media (max-width: 820px) {
  .app-header .container.bar { gap:8px; }
  .app-header .brand { max-width:110px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .app-header .greeting { display:none; }
  .app-header .btn.btn-sm[href$="profile.php"] { display:none; }
  .app-header .icon-btn { width:38px; height:38px; min-width:38px; }
}
@media (max-width: 430px) {
  .app-header .brand { max-width:96px; }
}

/* Profile hierarchy map */
.profile-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}
.profile-section-head h2 { margin: 4px 0 0; }
.profile-total-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(124,92,255,.35);
  background: rgba(124,92,255,.13);
  font-size: 12px;
  font-weight: 900;
}
.profile-tree {
  display: grid;
  gap: 14px;
}
.profile-subject-node {
  position: relative;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 22px;
  background: rgba(255,255,255,.035);
}
.profile-node-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.profile-node-header.subject {
  padding-bottom: 10px;
}
.profile-node-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.profile-node-title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-node-type {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 900;
}
.profile-node-meta {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 800;
}
.progress-line.mini {
  height: 7px;
  margin: 0 0 12px;
  background: rgba(255,255,255,.065);
}
.profile-sections {
  display: grid;
  gap: 10px;
  padding-left: 18px;
  border-left: 1px solid rgba(255,255,255,.10);
}
.profile-section-node {
  padding: 12px;
  border-radius: 18px;
  background: rgba(0,0,0,.14);
  border: 1px solid rgba(255,255,255,.08);
}
.profile-section-node .profile-node-type {
  min-width: 64px;
  background: rgba(54,183,255,.10);
  border-color: rgba(54,183,255,.20);
}
.section-progress {
  margin-top: 10px !important;
}
.profile-lessons.nested {
  margin-top: 10px;
  padding-left: 18px;
  border-left: 1px dashed rgba(255,255,255,.12);
}
.profile-lesson-row.is-done {
  background: rgba(41,204,151,.055);
  border-color: rgba(41,204,151,.16);
}
.profile-lesson-status {
  white-space: nowrap;
}
.access-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.07);
  color: var(--text-2);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .02em;
  white-space: nowrap;
}
.access-chip.pro {
  color: #160f00;
  background: linear-gradient(135deg, #ffe59e, #ffbd2e);
  border-color: rgba(255,189,46,.55);
}
.access-chip.ultimate {
  color: #fff;
  background: linear-gradient(135deg, rgba(181,140,255,.75), rgba(94,231,255,.38));
  border-color: rgba(181,140,255,.48);
}
.access-chip.hidden {
  color: #fff;
  background: rgba(255,77,109,.18);
  border-color: rgba(255,77,109,.35);
}
.access-chip.reg {
  color: #d7ecff;
  background: rgba(54,183,255,.12);
  border-color: rgba(54,183,255,.30);
}
.access-chip.lesson {
  justify-self: end;
}
@media (max-width: 760px) {
  .profile-section-head {
    flex-direction: column;
    align-items: stretch;
  }
  .profile-total-chip {
    width: 100%;
  }
  .profile-subject-node {
    padding: 12px;
    border-radius: 20px;
  }
  .profile-node-header,
  .profile-node-header.section {
    align-items: flex-start;
    flex-direction: column;
  }
  .profile-node-title {
    width: 100%;
    align-items: flex-start;
  }
  .profile-node-title strong {
    white-space: normal;
  }
  .profile-node-meta {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .profile-sections,
  .profile-lessons.nested {
    padding-left: 10px;
  }
  .profile-lesson-row {
    grid-template-columns: auto minmax(0,1fr) auto;
  }
  .profile-lesson-status {
    grid-column: 2;
    font-size: 12px;
  }
  .access-chip.lesson {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
  }
}
@media (max-width: 430px) {
  .profile-lessons.nested {
    padding-left: 0;
    border-left: 0;
  }
  .profile-lesson-row {
    grid-template-columns: auto minmax(0,1fr);
  }
  .access-chip.lesson {
    grid-column: 2;
    grid-row: auto;
    justify-self: start;
    margin-top: 2px;
  }
}

/* Lesson check + clearer profile hierarchy v2 */
.lesson-hero {
  position: relative;
}
.lesson-complete-top {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 10px;
}
.lesson-complete-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 7px 10px 7px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.075);
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.lesson-complete-toggle label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lesson-complete-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.complete-checkmark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.28);
  background: rgba(0,0,0,.22);
  color: rgba(255,255,255,.54);
  font-weight: 1000;
  line-height: 1;
  transition: .18s ease;
}
.lesson-complete-toggle:hover .complete-checkmark,
.lesson-complete-toggle input:focus-visible + .complete-checkmark {
  border-color: rgba(41,204,151,.75);
  color: #fff;
  transform: scale(1.04);
}
.lesson-complete-toggle input:checked + .complete-checkmark,
.lesson-complete-toggle.is-done .complete-checkmark {
  background: linear-gradient(135deg, #29cc97, #3be7b0);
  border-color: rgba(41,204,151,.9);
  color: #06140f;
  box-shadow: 0 0 0 5px rgba(41,204,151,.12);
}
.complete-mini-text {
  font-size: 12px;
  font-weight: 900;
  color: var(--text-2);
}
.lesson-complete-toggle.is-done .complete-mini-text {
  color: #8df1cb;
}

.profile-hierarchy-card .profile-subject-node {
  padding: 16px;
  background: rgba(255,255,255,.03);
}
.profile-hierarchy-card .profile-node-header.subject .profile-node-title strong {
  font-size: 18px;
}
.profile-hierarchy-card .profile-section-node {
  padding: 7px 0 0 14px;
  border-radius: 0;
  border: 0;
  border-left: 1px solid rgba(255,255,255,.10);
  background: transparent;
}
.profile-hierarchy-card .profile-node-header.section {
  gap: 8px;
  min-height: 24px;
  opacity: .72;
}
.profile-hierarchy-card .profile-node-header.section .profile-node-type {
  min-width: auto;
  height: 20px;
  padding: 0 7px;
  font-size: 9px;
  background: rgba(255,255,255,.045);
  border-color: rgba(255,255,255,.08);
}
.profile-hierarchy-card .profile-node-header.section .profile-node-title {
  gap: 7px;
}
.profile-hierarchy-card .profile-node-header.section .profile-node-title strong {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-2);
}
.profile-hierarchy-card .profile-node-header.section .profile-node-meta,
.profile-hierarchy-card .section-progress {
  display: none;
}
.profile-hierarchy-card .profile-lessons.nested {
  margin-top: 7px;
  padding-left: 0;
  border-left: 0;
}
.profile-hierarchy-card .profile-lesson-row {
  grid-template-columns: auto minmax(0,1fr) auto auto;
  gap: 10px;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.13);
  border-left: 4px solid rgba(124,92,255,.9);
  background: linear-gradient(135deg, rgba(255,255,255,.075), rgba(255,255,255,.035));
}
.profile-hierarchy-card .profile-lesson-row:hover {
  transform: translateY(-1px);
  border-color: rgba(124,92,255,.36);
  background: linear-gradient(135deg, rgba(124,92,255,.14), rgba(255,255,255,.045));
}
.profile-hierarchy-card .profile-lesson-row strong {
  font-size: 15px;
  font-weight: 950;
  color: var(--text);
}
.profile-hierarchy-card .profile-lesson-row.is-done {
  border-left-color: rgba(41,204,151,.95);
  background: linear-gradient(135deg, rgba(41,204,151,.105), rgba(255,255,255,.035));
}
.profile-hierarchy-card .lesson-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}
.profile-hierarchy-card .profile-lesson-status {
  font-size: 11px;
  font-weight: 900;
  color: var(--text-2);
}
@media (max-width: 760px) {
  .lesson-complete-top {
    justify-content: flex-start;
  }
  .lesson-complete-toggle {
    min-height: 40px;
    padding: 6px 9px 6px 6px;
  }
  .complete-checkmark {
    width: 30px;
    height: 30px;
  }
  .profile-hierarchy-card .profile-subject-node {
    padding: 12px;
  }
  .profile-hierarchy-card .profile-section-node {
    padding-left: 10px;
  }
  .profile-hierarchy-card .profile-node-header.section {
    flex-direction: row;
    align-items: center;
  }
  .profile-hierarchy-card .profile-lesson-row {
    grid-template-columns: auto minmax(0,1fr) auto;
    padding: 12px;
  }
  .profile-hierarchy-card .profile-lesson-status {
    grid-column: 2;
  }
  .profile-hierarchy-card .access-chip.lesson {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
}
@media (max-width: 430px) {
  .complete-mini-text {
    display: none;
  }
  .lesson-complete-toggle {
    padding-right: 6px;
  }
  .profile-hierarchy-card .profile-lesson-row {
    grid-template-columns: auto minmax(0,1fr);
  }
  .profile-hierarchy-card .access-chip.lesson,
  .profile-hierarchy-card .profile-lesson-status {
    grid-column: 2;
    grid-row: auto;
    justify-self: start;
  }
}

/* Lesson previous/next navigation above video */
.lesson-top-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
}
.lesson-step-btn {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 9px 12px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.13);
  background: linear-gradient(135deg, rgba(255,255,255,.075), rgba(255,255,255,.035));
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 14px 34px rgba(0,0,0,.16);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.lesson-step-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(124,92,255,.35);
  background: linear-gradient(135deg, rgba(124,92,255,.16), rgba(255,255,255,.04));
}
.lesson-step-btn.disabled {
  opacity: .42;
  cursor: not-allowed;
  box-shadow: none;
}
.lesson-step-btn.disabled:hover { transform: none; border-color: rgba(255,255,255,.13); }
.lesson-step-btn.next { justify-content: flex-end; text-align: right; }
.lesson-step-btn.prev { justify-content: flex-start; text-align: left; }
.lesson-step-btn .step-arrow {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: var(--accent);
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
}
.lesson-step-btn .step-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.lesson-step-btn small {
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.lesson-step-btn b {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 950;
}
.lesson-center-tools {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}
.lesson-position-chip {
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.18);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}
@media (max-width: 760px) {
  .lesson-top-bar {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .lesson-center-tools {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-content: space-between;
    width: 100%;
    padding: 0 2px;
  }
  .lesson-step-btn {
    grid-row: 2;
    min-height: 44px;
    padding: 8px 9px;
    border-radius: 15px;
    gap: 7px;
  }
  .lesson-step-btn .step-arrow {
    flex-basis: 28px;
    width: 28px;
    height: 28px;
    font-size: 22px;
  }
  .lesson-step-btn small { font-size: 9px; }
  .lesson-step-btn b { font-size: 11.5px; max-width: 30vw; }
  .lesson-position-chip { height: 32px; font-size: 11px; }
}
@media (max-width: 430px) {
  .lesson-step-btn {
    min-height: 42px;
  }
  .lesson-step-btn b { display: none; }
  .lesson-step-btn small {
    font-size: 10px;
    text-transform: none;
    letter-spacing: 0;
  }
  .lesson-step-btn.next .step-text { order: 1; }
  .lesson-step-btn.next .step-arrow { order: 2; }
}

/* V11: clean lesson nav labels + auto-complete next form */
.lesson-step-form {
  margin: 0;
  min-width: 0;
  width: 100%;
  display: flex;
}
.lesson-step-form.next { justify-content: stretch; }
.lesson-step-form .lesson-step-btn {
  width: 100%;
  font: inherit;
  cursor: pointer;
}
.lesson-step-btn .step-text small {
  color: var(--text);
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
}
.lesson-step-btn b { display: none !important; }
.lesson-step-btn.prev,
.lesson-step-btn.next { min-height: 46px; }
@media (max-width: 760px) {
  .lesson-step-form { grid-row: 2; }
  .lesson-step-btn .step-text small { font-size: 12.5px; }
}
@media (max-width: 430px) {
  .lesson-step-btn .step-arrow {
    flex-basis: 26px;
    width: 26px;
    height: 26px;
  }
  .lesson-step-btn .step-text small { font-size: 12px; }
}
