:root {
  --bg: #111214;
  --bg-sidebar: #18191a;
  --bg-card: #1d1f22;
  --bg-elev: #242628;
  --border: rgba(206, 175, 120, 0.16);
  --border-soft: rgba(255, 255, 255, 0.08);
  --text: #f7f5f1;
  --muted: #a6aab2;
  --gold: #bc9657;
  --gold-bright: #ceaf78;
  --gold-soft: rgba(188, 150, 87, 0.14);
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 14px;
}

[data-theme="light"] {
  --bg: #f7f5f1;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-elev: #efeae0;
  --border: rgba(188, 150, 87, 0.28);
  --border-soft: rgba(24, 25, 26, 0.09);
  --text: #18191a;
  --muted: #5a6069;
  --gold: #9f7a3c;
  --gold-bright: #bc9657;
  --gold-soft: rgba(188, 150, 87, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', system-ui, sans-serif; }
html, body { overflow-x: clip; }
body { background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.5; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

/* Theme logo switcher */
.brand-img-light { display: none; }
.brand-img-dark { display: block; height: 34px; width: auto; object-fit: contain; }
[data-theme="light"] .brand-img-dark { display: none; }
[data-theme="light"] .brand-img-light { display: block; height: 34px; width: auto; object-fit: contain; }
.brand-lockup { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.brand-lockup.sm img { height: 28px; }
.brand-pill {
  font-size: 10px; font-weight: 800; letter-spacing: 0.12em;
  padding: 3px 8px; border-radius: 99px;
  background: var(--gold-soft); border: 1px solid var(--border); color: var(--gold-bright);
}

/* Buttons & Inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid transparent;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.16s ease;
}
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 13px 22px; font-size: 14.5px; border-radius: 11px; }
.btn-block { width: 100%; }
.btn-primary {
  background: linear-gradient(135deg, var(--gold), #a98245);
  color: #111214; font-weight: 700;
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--gold-bright); color: var(--gold-bright); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); }
.btn-ok { background: rgba(16, 185, 129, 0.16); border-color: rgba(16, 185, 129, 0.4); color: #34d399; }
.btn-ok:hover { background: rgba(16, 185, 129, 0.24); }
[data-theme="light"] .btn-ok { color: #047857; }
.icon-btn {
  background: transparent; border: 1px solid transparent; color: var(--muted);
  font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 8px;
}
.icon-btn:hover { color: var(--text); background: var(--bg-elev); }

.input, .select, .textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  background: var(--bg-elev); border: 1px solid var(--border-soft);
  color: var(--text); font-size: 13.5px; outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--gold-bright); }
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ================= LANDING ================= */
.landing { max-width: 1200px; margin: 0 auto; padding: 18px 22px 64px; }
.land-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 10px 0 28px; flex-wrap: wrap; border-bottom: 1px solid var(--border-soft);
}
.land-links { display: flex; align-items: center; gap: 18px; font-size: 13.5px; font-weight: 500; color: var(--muted); }
.land-links a:hover { color: var(--gold-bright); }
.land-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.hero { text-align: center; max-width: 820px; margin: 44px auto 52px; }
.hero-badge {
  display: inline-block; padding: 6px 14px; border-radius: 99px;
  background: var(--gold-soft); border: 1px solid var(--border);
  color: var(--gold-bright); font-size: 12px; font-weight: 600; margin-bottom: 18px;
}
.hero h1 { font-size: clamp(28px, 4.4vw, 44px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; margin-bottom: 16px; }
.hero-sub { font-size: 15.5px; color: var(--muted); margin-bottom: 16px; }
.universal-pill {
  display: inline-block; max-width: 720px; padding: 10px 16px; border-radius: 12px;
  background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--text); font-size: 13px; margin-bottom: 24px;
}
.hero-cta { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }
.hero-stats { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.stat-pill {
  background: var(--bg-card); border: 1px solid var(--border-soft);
  border-radius: 12px; padding: 10px 18px; display: flex; align-items: baseline; gap: 8px;
}
.stat-pill strong { color: var(--gold-bright); font-size: 18px; font-weight: 800; }
.stat-pill span { color: var(--muted); font-size: 12.5px; }

.section { margin-top: 52px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.section-head.center { flex-direction: column; align-items: center; text-align: center; }
.kicker { font-size: 11px; font-weight: 800; letter-spacing: 0.12em; color: var(--gold-bright); display: block; margin-bottom: 6px; }
.section-head h2 { font-size: clamp(21px, 3vw, 28px); font-weight: 800; letter-spacing: -0.02em; }

.cat-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.cat-tab {
  padding: 6px 12px; border-radius: 99px; border: 1px solid var(--border-soft);
  background: var(--bg-card); color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer;
}
.cat-tab.active, .cat-tab:hover { border-color: var(--gold); background: var(--gold-soft); color: var(--gold-bright); }

/* Courses Grid */
.courses-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 18px; }
.course-card {
  background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column; gap: 12px;
  transition: transform 0.16s, border-color 0.16s;
}
.course-card:hover { transform: translateY(-3px); border-color: var(--border); }
.cc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cc-icon {
  width: 42px; height: 42px; border-radius: 11px; background: var(--bg-elev);
  display: inline-flex; align-items: center; justify-content: center; font-size: 21px;
  border: 1px solid var(--border-soft);
}
.cc-badge {
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 99px;
  background: var(--gold-soft); color: var(--gold-bright); border: 1px solid var(--border);
}
.cc-badge.radio { background: rgba(225, 29, 72, 0.14); color: #fb7185; border-color: rgba(225, 29, 72, 0.35); }
[data-theme="light"] .cc-badge.radio { color: #be123c; }
.cc-title { font-size: 16.5px; font-weight: 700; line-height: 1.3; }
.cc-sub { font-size: 13px; color: var(--muted); flex: 1; }
.cc-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--muted); }
.cc-meta span { background: var(--bg-elev); padding: 3px 8px; border-radius: 7px; }
.cc-price-row { display: flex; align-items: baseline; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--border-soft); }
.cc-price { font-size: 18px; font-weight: 800; color: var(--gold-bright); }
.cc-price small { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.cc-actions { display: flex; gap: 8px; }
.cc-actions .btn { flex: 1; }

.progress-bar { height: 7px; background: var(--bg-elev); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--ok)); border-radius: 99px; transition: width 0.25s; }

/* Pricing */
.cycle-toggle {
  display: inline-flex; background: var(--bg-card); border: 1px solid var(--border-soft);
  border-radius: 99px; padding: 4px; margin-top: 12px; gap: 4px;
}
.cycle-btn {
  padding: 7px 16px; border-radius: 99px; border: none; background: transparent;
  color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.cycle-btn.active { background: var(--gold); color: #111214; }
.save-badge { font-size: 10px; background: rgba(17,18,20,0.2); padding: 2px 6px; border-radius: 99px; margin-left: 4px; }

.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(270px, 100%), 1fr)); gap: 18px; }
.plan-card {
  background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 24px; display: flex; flex-direction: column; gap: 14px;
}
.plan-card.featured { border: 1.5px solid var(--gold); box-shadow: 0 12px 34px rgba(188, 150, 87, 0.14); }
.plan-price { font-size: 30px; font-weight: 800; color: var(--gold-bright); }
.plan-price span { font-size: 13px; color: var(--muted); font-weight: 500; }
.plan-list { list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted); flex: 1; }
.plan-list li::before { content: "✔ "; color: var(--ok); font-weight: 700; }

/* Legal Strip */
.legal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 16px; }
.legal-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px;
}
.legal-card h3 { font-size: 15px; margin-bottom: 8px; color: var(--gold-bright); }
.legal-card p { font-size: 13px; color: var(--muted); }

.land-footer {
  margin-top: 52px; padding-top: 20px; border-top: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: 12.5px; color: var(--muted);
}
.footer-links { display: flex; gap: 8px; }

/* ================= APP SHELL (LOGADO) ================= */
.app-shell { display: grid; grid-template-columns: 268px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--bg-sidebar); border-right: 1px solid var(--border-soft);
  padding: 18px 14px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sb-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sb-top-actions { display: flex; align-items: center; gap: 4px; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.mobile-menu-btn, .mobile-close-btn, .sb-backdrop { display: none; }
.btn-install-pwa {
  border-color: rgba(147, 51, 234, 0.48);
  background: rgba(147, 51, 234, 0.12);
  color: #d8b4fe;
}
.btn-install-pwa:hover {
  border-color: #a855f7;
  background: rgba(147, 51, 234, 0.22);
  color: #f3e8ff;
}
[data-theme="light"] .btn-install-pwa {
  border-color: rgba(126, 34, 206, 0.42);
  background: rgba(147, 51, 234, 0.08);
  color: #7e22ce;
}
[data-theme="light"] .btn-install-pwa:hover {
  background: rgba(147, 51, 234, 0.16);
  color: #581c87;
}
.pwa-modal-hero {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px;
  border-radius: 12px; background: var(--bg-elev); border: 1px solid var(--border);
  margin-bottom: 14px;
}
.pwa-modal-icon {
  width: 56px; height: 56px; border-radius: 14px; flex-shrink: 0;
  border: 1px solid rgba(147, 51, 234, 0.45); box-shadow: 0 6px 18px rgba(147, 51, 234, 0.25);
}
.pwa-step-card {
  background: var(--bg-elev); border: 1px solid var(--border-soft);
  border-radius: 11px; padding: 12px 14px; margin-bottom: 10px; font-size: 13px;
}
.pwa-step-card.recommended {
  border-color: rgba(147, 51, 234, 0.55); background: rgba(147, 51, 234, 0.08);
}
.pwa-step-card strong { display: block; margin-bottom: 6px; color: var(--gold-bright); font-size: 13.5px; }
.pwa-step-card ol { padding-left: 18px; display: flex; flex-direction: column; gap: 5px; color: var(--muted); }
.pwa-step-card li b { color: var(--text); }
.student-card {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; padding: 12px;
}
.student-name { font-size: 13.5px; font-weight: 700; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.student-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.plan-pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--gold-soft); color: var(--gold-bright); }
.xp-pill { font-size: 11px; font-weight: 700; color: var(--ok); }

.sb-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px;
  border-radius: 10px; border: none; background: transparent; color: var(--muted);
  font-size: 13.5px; font-weight: 600; cursor: pointer; text-align: left;
}
.nav-item:hover { background: var(--bg-elev); color: var(--text); }
.nav-item.active { background: var(--gold-soft); color: var(--gold-bright); border: 1px solid var(--border); }
.nav-badge { margin-left: auto; background: var(--gold); color: #111214; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 99px; }

.sb-apps { border-top: 1px solid var(--border-soft); padding-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.sb-label { font-size: 10.5px; font-weight: 800; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 2px; }
.app-shortcut {
  display: flex; align-items: center; justify-content: space-between; padding: 7px 10px;
  border-radius: 8px; background: var(--bg-elev); font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--border-soft);
}
.app-shortcut:hover { border-color: var(--gold); color: var(--gold-bright); }
.app-shortcut span { font-size: 11px; color: var(--muted); }
.sb-footer { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 62px; padding: 0 24px; border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--bg-sidebar); position: sticky; top: 0; z-index: 10;
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-left h2 { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.content { padding: 24px; max-width: 1180px; width: 100%; margin: 0 auto; }

/* ================= PLAYER DE CURSO ================= */
.course-banner {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; margin-bottom: 18px; display: flex; flex-direction: column; gap: 12px;
}
.cb-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cb-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.legal-banner {
  background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.35);
  border-left: 4px solid var(--warn); border-radius: 10px; padding: 10px 14px;
  font-size: 12.5px; color: var(--text);
}

.player-grid { display: grid; grid-template-columns: 295px 1fr; gap: 18px; align-items: start; }
.lesson-list {
  background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 12px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 80px;
}
.les-btn {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 10px;
  border-radius: 10px; border: 1px solid transparent; background: transparent;
  color: var(--text); text-align: left; cursor: pointer; font-size: 13px;
}
.les-btn:hover { background: var(--bg-elev); }
.les-btn.active { background: var(--gold-soft); border-color: var(--gold); }
.les-btn.locked { opacity: 0.65; }
.les-num { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.les-info strong { display: block; font-size: 12.8px; line-height: 1.3; }
.les-info small { color: var(--muted); font-size: 11.5px; }

.lesson-stage {
  background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 26px; display: flex; flex-direction: column; gap: 18px;
}
.stage-kicker { font-size: 11.5px; font-weight: 800; color: var(--gold-bright); letter-spacing: 0.08em; }
.stage-title { font-size: 22px; font-weight: 800; line-height: 1.25; }
.stage-summary { font-size: 14.5px; color: var(--muted); }
.lesson-sec h3 { font-size: 16px; color: var(--gold-bright); margin-bottom: 8px; }
.lesson-sec p { font-size: var(--lesson-font, 15px); margin-bottom: 10px; line-height: 1.72; }
.lesson-sec ul { padding-left: 20px; display: flex; flex-direction: column; gap: 7px; font-size: var(--lesson-font, 14.5px); line-height: 1.65; }

.practical-box {
  background: var(--gold-soft); border: 1px solid var(--border); border-left: 4px solid var(--gold);
  border-radius: 12px; padding: 16px;
}
.practical-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.practical-head strong { font-size: 14px; color: var(--gold-bright); }
.practical-pre {
  white-space: pre-wrap; font-family: 'Inter', system-ui, sans-serif;
  font-size: 13.5px; line-height: 1.6; color: var(--text);
}

.takeaway-box {
  background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.35);
  border-left: 4px solid var(--ok); border-radius: 12px; padding: 14px 16px; font-size: 13.8px;
}
.stage-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding-top: 14px; border-top: 1px solid var(--border-soft);
}

/* Quiz */
.quiz-card {
  background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: 12px; padding: 16px;
}
.quiz-q { font-weight: 700; font-size: 14.5px; margin-bottom: 10px; }
.quiz-opt {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; margin-bottom: 8px;
  border-radius: 10px; border: 1px solid var(--border-soft); cursor: pointer; font-size: 14px;
  line-height: 1.45; transition: border-color 0.14s, background 0.14s;
}
.quiz-opt input[type="radio"] { margin-top: 3px; width: 17px; height: 17px; flex-shrink: 0; accent-color: var(--gold); }
.quiz-opt:hover { border-color: var(--gold); }
.quiz-opt:has(input:checked) {
  border-color: var(--gold);
  background: var(--gold-soft);
}
.quiz-fb { margin-top: 8px; padding: 9px 12px; border-radius: 8px; font-size: 12.8px; }
.quiz-fb.ok { background: rgba(16, 185, 129, 0.14); color: #34d399; }
.quiz-fb.bad { background: rgba(239, 68, 68, 0.14); color: #fca5a5; }
[data-theme="light"] .quiz-fb.ok { color: #047857; }
[data-theme="light"] .quiz-fb.bad { color: #b91c1c; }

/* Certificates & Tables */
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); gap: 16px; }
.cert-card {
  background: var(--bg-card); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column; gap: 10px;
}
.cert-code {
  font-family: monospace; font-size: 14px; font-weight: 700; color: var(--gold-bright);
  background: var(--bg-elev); padding: 6px 10px; border-radius: 8px; display: inline-block;
}
.card { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border-soft); }
th { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; }

/* Modal & Toast */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.68); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 100;
}
.modal {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px;
  width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto; padding: 22px;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-head h3 { font-size: 17px; font-weight: 700; }

.toast {
  position: fixed; bottom: 22px; right: 22px; z-index: 200;
  background: var(--bg-elev); border: 1px solid var(--gold); color: var(--text);
  padding: 12px 18px; border-radius: 12px; font-size: 13.5px; font-weight: 600;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

/* v2 Additions: Referral Banner, Labs, Exercise, Notes, Stars, Security Alerts */
.ref-banner {
  background: linear-gradient(90deg, rgba(188, 150, 87, 0.22), rgba(16, 185, 129, 0.18));
  border-bottom: 1px solid var(--border); padding: 9px 18px; text-align: center;
  font-size: 13px; font-weight: 600; color: var(--text);
}
.referral-hero {
  background: linear-gradient(135deg, rgba(188, 150, 87, 0.14), rgba(16, 185, 129, 0.08));
  border: 1.5px solid var(--border); border-radius: 18px; padding: 26px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.student-credit {
  margin-top: 7px; font-size: 11px; font-weight: 700; color: #34d399;
  background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 7px; padding: 3px 8px; text-align: center;
}
[data-theme="light"] .student-credit { color: #047857; }
.lab-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.lab-kpi {
  background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: 10px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 4px;
}
.lab-kpi small { font-size: 11.5px; color: var(--muted); }
.lab-kpi strong { font-size: 18px; font-weight: 800; color: var(--gold-bright); }
.lab-meter {
  background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: 10px; padding: 12px 14px;
}
.exercise-box {
  background: var(--bg-elev); border: 1px solid var(--border-soft); border-left: 4px solid var(--gold-bright);
  border-radius: 12px; padding: 14px 16px; font-size: 13.5px;
}
.notes-box {
  background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: 12px; padding: 14px 16px;
}
.mod-divider {
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--gold-bright); padding: 8px 8px 3px; margin-top: 4px;
}
.star-row { display: flex; gap: 6px; margin: 8px 0 10px; }
.star-btn {
  font-size: 22px; background: transparent; border: none; cursor: pointer; opacity: 0.35; transition: all 0.12s;
}
.star-btn.active, .star-btn:hover { opacity: 1; transform: scale(1.12); }
.danger-banner {
  background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.4);
  border-left: 4px solid var(--danger); border-radius: 10px; padding: 12px 14px; font-size: 13px; margin-bottom: 16px;
}
.admin-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.status-chip {
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px; display: inline-block;
}
.status-chip.ok { background: rgba(16, 185, 129, 0.16); color: #34d399; }
.status-chip.warn { background: rgba(245, 158, 11, 0.16); color: #fbbf24; }
[data-theme="light"] .status-chip.ok { color: #047857; }
[data-theme="light"] .status-chip.warn { color: #b45309; }

/* ================= MOBILE-FIRST & NATIVE APP UX COMPONENTS ================= */
.show-xs-text { display: none; }
.back-short { display: none; }
.mobile-theme-btn { display: none; }
.sb-cert-name-btn { margin-top: 9px; display: none; }

.catalog-controls {
  display: flex; flex-direction: column; gap: 10px; width: 100%;
}
.course-search-wrap {
  position: relative; width: 100%; max-width: 460px;
}
.course-search-wrap .search-ico {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 14px; opacity: 0.7; pointer-events: none;
}
.course-search-input {
  padding-left: 36px; border-radius: 12px;
}

/* Single Course Sales Page responsive helpers */
.sc-banner { padding: 26px; }
.sc-hero-col { flex: 1 1 360px; max-width: 720px; min-width: 0; }
.sc-title { font-size: clamp(22px, 3.4vw, 34px); margin: 12px 0 10px; line-height: 1.18; }
.sc-sub { font-size: 15px; color: var(--muted); margin-bottom: 14px; }
.sc-buy-card { min-width: 270px; max-width: 330px; flex: 0 1 320px; }
.sc-syllabus-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr)); gap: 10px; }

/* Portal Welcome Card */
.portal-welcome-card {
  display: flex; flex-direction: column; gap: 12px;
}
.pw-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.pw-hi { font-size: 16px; display: block; }
.pw-stats { font-size: 13px; color: var(--muted); margin-top: 2px; }
.pw-ref-btn { white-space: nowrap; }

/* Reading Comfort Toolbar & Anti-Skip Reading Bar */
.lesson-read-track {
  width: 100%; height: 4px; border-radius: 99px;
  background: var(--bg-elev); overflow: hidden; margin-bottom: -4px;
}
.lesson-read-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #9333ea, var(--gold-bright), var(--ok));
  transition: width 0.2s ease;
}
.read-gate-hint {
  font-size: 12px; font-weight: 600; color: var(--muted);
  background: var(--bg-elev); border: 1px solid var(--border-soft);
  border-radius: 9px; padding: 7px 11px;
}
.read-gate-hint.ok {
  color: #34d399; border-color: rgba(16, 185, 129, 0.35); background: rgba(16, 185, 129, 0.08);
}
[data-theme="light"] .read-gate-hint.ok { color: #047857; }
.btn-locked-read {
  opacity: 0.72; cursor: not-allowed;
  background: var(--bg-elev) !important; color: var(--muted) !important;
  border: 1px solid var(--border-soft) !important;
}
.reading-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.font-controls {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: 9px; padding: 2px;
}
.font-btn {
  background: transparent; border: none; color: var(--text);
  font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 7px; cursor: pointer;
}
.font-btn:hover { background: var(--gold-soft); color: var(--gold-bright); }

/* Mobile-only Player & Navigation components (hidden on desktop) */
.cb-mobile-compact { display: none; }
.player-mobile-bar { display: none; }
.lesson-sheet-head { display: none; }
.lesson-sheet-backdrop { display: none; }
.mobile-bottom-nav { display: none; }
.mobile-player-dock { display: none; }
.mobile-sales-dock { display: none; }
.lesson-list-scroll { display: flex; flex-direction: column; gap: 6px; }

.btn:active { transform: scale(0.98); }

@media (max-width: 920px) {
  .app-shell { grid-template-columns: 1fr; padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
  .desktop-cert-btn { display: none; }
  .sb-cert-name-btn { display: inline-flex; }
  .mobile-theme-btn { display: inline-flex; align-items: center; justify-content: center; }
  .mobile-menu-btn {
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 19px; padding: 6px 10px;
    border: 1px solid var(--border-soft); background: var(--bg-elev); color: var(--text);
  }
  .app-shell.in-course-player .mobile-menu-btn { display: none; }
  .back-full { display: none; }
  .back-short { display: inline; font-weight: 700; color: var(--gold-bright); white-space: nowrap; }
  #btnBackToCatalog { white-space: nowrap; flex-shrink: 0; padding: 6px 8px; }
  .mobile-close-btn { display: inline-flex; align-items: center; justify-content: center; }

  .sb-backdrop {
    display: block; position: fixed; inset: 0; z-index: 50;
    background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(3px);
  }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 60;
    width: min(300px, 86vw); height: 100dvh;
    border-right: 1px solid var(--border);
    box-shadow: 14px 0 36px rgba(0, 0, 0, 0.52);
    transform: translateX(-108%);
    transition: transform 0.22s ease;
    padding-top: max(18px, env(safe-area-inset-top));
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }
  .sidebar.open { transform: translateX(0); }

  /* Compact Collapsible Course Banner on Mobile */
  .course-banner { padding: 12px 14px; margin-bottom: 10px; gap: 10px; }
  .cb-mobile-compact {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
  }
  .cb-mc-left { flex: 1; min-width: 0; }
  .cb-mc-meta {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px;
  }
  .cb-mc-toggle { flex-shrink: 0; white-space: nowrap; }
  .cb-full-details { display: none; flex-direction: column; gap: 12px; padding-top: 8px; border-top: 1px solid var(--border-soft); }
  .course-banner.info-open .cb-full-details { display: flex; }
  .cb-desktop-progress { display: none; }

  /* Sticky Player Quick Bar (Aulas sheet + Aula/Lab/Quiz tabs) */
  .player-mobile-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    position: sticky; top: 56px; z-index: 15;
    background: rgba(24, 25, 26, 0.92); backdrop-filter: blur(12px);
    border: 1px solid var(--border-soft); border-radius: 13px;
    padding: 6px; margin-bottom: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  }
  [data-theme="light"] .player-mobile-bar {
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  }
  .pmb-sheet-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 8px 11px; border-radius: 9px;
    background: var(--gold-soft); border: 1px solid var(--border);
    color: var(--gold-bright); font-size: 12.5px; font-weight: 700;
    cursor: pointer; white-space: nowrap; flex-shrink: 0;
  }
  .pmb-tabs {
    display: flex; align-items: center; gap: 4px; flex: 1;
    background: var(--bg-elev); border-radius: 9px; padding: 3px;
  }
  .pmb-tab {
    flex: 1; border: none; background: transparent; color: var(--muted);
    font-size: 12px; font-weight: 700; padding: 7px 6px; border-radius: 7px;
    cursor: pointer; white-space: nowrap; transition: all 0.14s;
  }
  .pmb-tab.active {
    background: var(--bg-card); color: var(--gold-bright);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  }

  /* Lessons List becomes Native Slide-Up Bottom Sheet on Mobile */
  .player-grid { grid-template-columns: 1fr; gap: 0; }
  .lesson-sheet-backdrop {
    display: block; position: fixed; inset: 0; z-index: 75;
    background: rgba(0, 0, 0, 0.64); backdrop-filter: blur(3px);
  }
  .lesson-list {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 80;
    max-height: 80dvh; border-radius: 20px 20px 0 0;
    border: 1px solid var(--border); border-bottom: none;
    padding: 12px 14px max(18px, env(safe-area-inset-bottom));
    box-shadow: 0 -14px 40px rgba(0, 0, 0, 0.55);
    transform: translateY(105%);
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex; flex-direction: column; gap: 8px;
  }
  .lesson-list.sheet-open { transform: translateY(0); }
  .lesson-sheet-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 4px 4px 10px; border-bottom: 1px solid var(--border-soft);
    flex-shrink: 0;
  }
  .lesson-sheet-head strong { display: block; font-size: 15px; }
  .lesson-sheet-head small { font-size: 12px; color: var(--muted); }
  .lesson-list-scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 8px; }
  .les-btn { padding: 12px 11px; }

  /* Hide duplicate stage-footer in player on mobile since sticky bottom dock handles it */
  .app-shell.in-course-player .lesson-stage .stage-footer { display: none; }

  /* Native App Bottom Navigation Bar */
  .mobile-bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: rgba(24, 25, 26, 0.94); backdrop-filter: blur(14px);
    border-top: 1px solid var(--border-soft);
    padding: 6px 4px max(8px, env(safe-area-inset-bottom));
  }
  [data-theme="light"] .mobile-bottom-nav {
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
  }
  .app-shell.in-course-player .mobile-bottom-nav { display: none; }
  .mbn-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; border: none; background: transparent; color: var(--muted);
    padding: 5px 2px; border-radius: 10px; cursor: pointer; position: relative;
  }
  .mbn-item.active { color: var(--gold-bright); }
  .mbn-ico { font-size: 19px; line-height: 1.1; position: relative; display: inline-block; }
  .mbn-lbl { font-size: 10.5px; font-weight: 700; letter-spacing: 0.01em; }
  .mbn-badge {
    position: absolute; top: -4px; right: -10px;
    background: var(--gold); color: #111214; font-size: 9.5px; font-weight: 800;
    padding: 1px 5px; border-radius: 99px; line-height: 1.2;
  }

  /* Sticky Player Bottom Action Dock */
  .mobile-player-dock {
    display: flex; align-items: center; gap: 8px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    background: rgba(24, 25, 26, 0.95); backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
    padding: 9px 12px max(10px, env(safe-area-inset-bottom));
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
  }
  [data-theme="light"] .mobile-player-dock {
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.08);
  }
  .mobile-player-dock .btn { min-height: 44px; font-size: 13px; border-radius: 11px; }
  .mpd-icon-btn { width: 44px; padding: 0; flex-shrink: 0; font-size: 16px !important; }
  .mpd-icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }
  .mpd-main { flex: 1.35; }
  .mpd-next-btn, .mpd-side { flex: 0.85; white-space: nowrap; }

  /* Sticky Mobile Sales Dock on /curso/<slug> */
  .mobile-sales-dock {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    background: rgba(24, 25, 26, 0.96); backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
    padding: 10px 14px max(10px, env(safe-area-inset-bottom));
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.38);
  }
  [data-theme="light"] .mobile-sales-dock {
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.08);
  }
  .msd-price { display: flex; flex-direction: column; line-height: 1.2; }
  .msd-price strong { font-size: 18px; font-weight: 800; color: var(--gold-bright); }
  .msd-price small { font-size: 11px; color: var(--ok); font-weight: 600; }
  .msd-actions { display: flex; gap: 7px; flex-shrink: 0; }
  .msd-actions .btn { min-height: 42px; padding: 8px 12px; font-size: 13px; }
  body.has-sales-dock .landing { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }

  .form-grid { grid-template-columns: 1fr; }
  .input, .select, .textarea { font-size: 16px; }
  .toast { bottom: calc(78px + env(safe-area-inset-bottom)); }
}

@media (max-width: 640px) {
  .show-xs-text { display: inline; }
  .hide-xs-text, .hide-xs-btn, .hide-xs-chip { display: none; }

  .landing { padding: 0 14px max(52px, env(safe-area-inset-bottom)); }
  .land-nav {
    position: sticky; top: 0; z-index: 30;
    margin: 0 -14px; padding: max(10px, env(safe-area-inset-top)) 14px 10px;
    background: rgba(17, 18, 20, 0.92); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-soft);
    gap: 8px;
  }
  [data-theme="light"] .land-nav { background: rgba(247, 245, 241, 0.94); }
  .land-nav .brand-img-dark, .land-nav .brand-img-light { height: 22px; }
  .land-nav .brand-lockup { gap: 6px; min-width: 0; flex-shrink: 1; }
  .brand-pill { display: none; }
  .land-actions { width: auto; gap: 5px; flex-wrap: nowrap; flex-shrink: 0; }
  .land-actions .icon-btn { padding: 4px 6px; font-size: 16px; }
  .land-actions .btn { padding: 6px 10px; font-size: 12px; min-height: 34px; white-space: nowrap; }
  .land-links {
    order: 3; width: 100%;
    overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch;
    gap: 14px; font-size: 12.5px; padding: 4px 2px 2px;
    border-top: 1px solid var(--border-soft);
    scrollbar-width: none;
  }
  .land-links::-webkit-scrollbar { display: none; }
  .land-links a, .land-links button { white-space: nowrap; flex-shrink: 0; padding: 3px 0; }

  /* Horizontal Swipeable Category Chips (1 clean line) */
  .cat-tabs {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: 4px; gap: 7px; scrollbar-width: none;
    scroll-snap-type: x proximity;
  }
  .cat-tabs::-webkit-scrollbar { display: none; }
  .cat-tab { white-space: nowrap; flex-shrink: 0; padding: 8px 13px; font-size: 12.5px; scroll-snap-align: start; }

  .hero { margin: 18px auto 26px; text-align: left; }
  .hero-badge { font-size: 11px; padding: 5px 11px; margin-bottom: 12px; }
  .hero h1 { font-size: 25px; line-height: 1.18; margin-bottom: 12px; }
  .hero-sub { font-size: 14px; margin-bottom: 14px; }
  .universal-pill { font-size: 12.5px; padding: 10px 12px; margin-bottom: 18px; width: 100%; text-align: left; }
  .hero-cta { flex-direction: column; gap: 9px; margin-bottom: 20px; }
  .hero-cta .btn { width: 100%; min-height: 46px; }
  .hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-pill { padding: 10px 12px; flex-direction: column; gap: 2px; align-items: flex-start; }
  .stat-pill strong { font-size: 19px; }

  .section { margin-top: 34px; }
  .section-head { margin-bottom: 16px; }
  .course-card { padding: 16px; gap: 10px; }
  .cc-actions { flex-direction: row; gap: 8px; }
  .cc-actions .btn { min-height: 42px; font-size: 13px; }

  .sc-banner { padding: 16px; }
  .sc-buy-card { min-width: 0; max-width: 100%; width: 100%; flex: 1 1 100%; padding: 18px; }

  .topbar {
    padding: max(8px, env(safe-area-inset-top)) 10px 8px;
    height: auto; min-height: 54px; gap: 6px; flex-wrap: nowrap;
  }
  .topbar-left { gap: 6px; }
  .topbar-left h2 { font-size: 14.5px; }
  .topbar-right { gap: 5px; }
  .content { padding: 10px 12px 22px; }
  .lesson-stage { padding: 16px 14px 20px; gap: 15px; border-radius: 14px; }
  .stage-title { font-size: 20px; line-height: 1.26; }
  .stage-summary { font-size: 14px; }
  .practical-box { padding: 13px 14px; }
  .practical-pre { font-size: 13px; overflow-x: auto; }
  .plan-card { padding: 18px; }
  .referral-hero { padding: 18px; }
  .card { padding: 16px; }

  /* Native Bottom-Sheet Modals on Mobile */
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%; border-radius: 20px 20px 0 0; border-bottom: none;
    padding: 14px 16px max(20px, env(safe-area-inset-bottom));
    max-height: 92dvh;
  }
  .modal::before {
    content: ""; display: block; width: 40px; height: 4px;
    border-radius: 99px; background: var(--border);
    margin: 0 auto 12px;
  }
  .modal .btn { min-height: 44px; }

  .toast { left: 14px; right: 14px; text-align: center; }
}
