/* ============================================================
   XGATE GLOBAL — Members Area
   White fintech identity (Figma vars: Base/White, Base/Black,
   primary teal #17BFA3, Gray/200, Gray/400, Gray/500, LineBox).
   Typography: Inter (Medium / SemiBold / Bold).
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Brand */
  --xg-primary: #17BFA3;          /* XGate teal — buttons (Figma node 1:31953) */
  --xg-primary-dim: #0FA88E;      /* hover / pressed */
  --xg-primary-soft: #DFF6F0;     /* badge/icon background tint */
  --xg-primary-tint: #F1FAF7;     /* very light surface tint */
  --xg-secondary: #242424;        /* Base/Black */

  /* Surfaces */
  --xg-bg: #FFFFFF;               /* Base/White */
  --xg-bg-soft: #FAFAFB;
  --xg-bg-alt: #F7F8FA;
  --xg-card: #FFFFFF;
  --xg-card-hover: #FAFAFB;
  --xg-border: #EFF0F6;           /* LineBox */
  --xg-border-strong: #E4E6EE;
  --xg-border-active: #242424;
  --xg-divider: #F2F2F2;          /* Gray/200 */

  /* Text */
  --xg-text: #000000;             /* FontColor — headings */
  --xg-text-strong: #242424;      /* Base/Black — body strong */
  --xg-text-body: #464646;        /* Gray/500 — body */
  --xg-text-soft: #636363;        /* TextPopNoDestaque */
  --xg-text-mute: #7A7A7A;        /* Gray/400 */
  --xg-text-faint: #959595;       /* IconNoActive */

  /* Status */
  --xg-success: #17BFA3;
  --xg-success-soft: #DFF6F0;
  --xg-warning: #B45309;
  --xg-warning-soft: #FEF3C7;
  --xg-danger: #B12F30;           /* Red/400 */
  --xg-danger-soft: #FEECEB;      /* Red/100 */
  --xg-info: #1E40AF;
  --xg-info-soft: #DBEAFE;

  /* Sizing */
  --xg-sidebar: 240px;
  --xg-radius-sm: 8px;
  --xg-radius: 12px;
  --xg-radius-lg: 16px;
  --xg-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --xg-shadow: 0 1px 3px rgba(16, 24, 40, 0.04), 0 1px 2px rgba(16, 24, 40, 0.03);
  --xg-shadow-md: 0 4px 12px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.04);
  --xg-shadow-lg: 0 12px 28px rgba(16, 24, 40, 0.08), 0 4px 12px rgba(16, 24, 40, 0.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

/* ===== Smooth page transitions =====
   Modern Chromium: cross-document View Transitions (declared via the
   <meta name="view-transition" content="same-origin"> on each page).
   Other browsers: subtle CSS fade-in on every page load. */
@keyframes xg-page-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
body { animation: xg-page-in 220ms ease-out both; }
@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 240ms;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--xg-bg);
  color: var(--xg-text-body);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--xg-border-strong); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #c9cdda; }

/* ===== Typography ===== */
h1, h2, h3, h4, h5 {
  font-family: 'Inter', sans-serif;
  color: var(--xg-text);
  font-weight: 600;
  letter-spacing: -0.02em;
}
h1 { font-size: 28px; line-height: 1.2; letter-spacing: -0.03em; }
h2 { font-size: 22px; line-height: 1.25; }
h3 { font-size: 16px; line-height: 1.35; }
h4 { font-size: 14px; line-height: 1.35; font-weight: 600; letter-spacing: -0.01em; }

.muted { color: var(--xg-text-mute); }
.soft  { color: var(--xg-text-soft); }
.eyebrow {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--xg-text-mute);
  font-weight: 600;
}
/* Tiny brand dot before the eyebrow — keeps a hint of teal without
   shouting it on every section title. */
.eyebrow::before {
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--xg-primary);
  margin-right: 7px;
  vertical-align: 1px;
}

.mono { font-family: 'JetBrains Mono', 'Consolas', monospace; }

.strong-text { color: var(--xg-text); }
.text-green { color: var(--xg-primary); }

/* ===== Layout shell ===== */
.app {
  display: grid;
  grid-template-columns: var(--xg-sidebar) 1fr;
  min-height: 100vh;
  background: var(--xg-bg-soft);
}

/* Sidebar */
.sidebar {
  background: var(--xg-bg);
  border-right: 1px solid var(--xg-border);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  z-index: 20;
}

.sidebar__logo {
  display: flex;
  align-items: center;
  padding: 4px 8px 28px;
  color: var(--xg-text);
}
.sidebar__logo svg {
  height: 22px;
  width: auto;
  display: block;
}

.sidebar__section {
  margin-top: 12px;
  padding: 0 8px;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--xg-text-faint);
  margin-bottom: 8px;
  font-weight: 600;
}

.sidebar__nav { display: flex; flex-direction: column; gap: 2px; }

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--xg-text-mute);
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.12s ease;
  position: relative;
}
.sidebar__link:hover {
  background: var(--xg-bg-alt);
  color: var(--xg-text);
}
.sidebar__link.is-active {
  background: var(--xg-bg-alt);
  color: var(--xg-text);
  font-weight: 600;
}
.sidebar__link.is-active::before {
  content: '';
  position: absolute;
  left: -16px; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--xg-text);
  border-radius: 0 3px 3px 0;
}
.sidebar__link svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.85; }
.sidebar__link.is-active svg { color: var(--xg-text); opacity: 1; }

/* Footer CTA card — neutral surface with a thin teal left accent so it
   reads as "promo" without drowning the sidebar in color. */
.sidebar__footer {
  margin-top: auto;
  padding: 16px;
  border-radius: 12px;
  background: var(--xg-bg-alt);
  border: 1px solid var(--xg-border);
  border-left: 2px solid var(--xg-primary);
  position: relative;
  overflow: hidden;
}
.sidebar__footer-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--xg-text); }
.sidebar__footer-desc { font-size: 12px; color: var(--xg-text-soft); margin-bottom: 12px; line-height: 1.5; }

/* Main */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--xg-bg);
}

.topbar {
  height: 64px;
  border-bottom: 1px solid var(--xg-border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 32px;
  background: var(--xg-bg);
  position: sticky; top: 0; z-index: 10;
}
.topbar__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px 7px 9px;
  border-radius: 8px;
  /* Preto sólido sobre o topbar branco — invisível antes (#F7F8FA + borda
     #E4E6EE não destacavam contra o background branco). */
  background: var(--xg-secondary);
  border: 1px solid var(--xg-secondary);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.topbar__back:hover {
  background: var(--xg-primary);
  border-color: var(--xg-primary);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(23, 191, 163, 0.25);
}
.topbar__back svg { width: 16px; height: 16px; transition: transform 0.15s ease; }
.topbar__back:hover svg { transform: translateX(-2px); }
.topbar__back-label { /* hide label on small screens */ }
@media (max-width: 768px) { .topbar__back-label { display: none; } }

.topbar__title { font-size: 15px; font-weight: 600; color: var(--xg-text); }
.topbar__crumbs { font-size: 13px; color: var(--xg-text-mute); }
.topbar__crumbs strong { color: var(--xg-text); font-weight: 600; }
.topbar__spacer { flex: 1; }
.topbar__user {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px 4px 4px;
  border-radius: 100px;
  background: var(--xg-bg);
  border: 1px solid var(--xg-border-strong);
}
.topbar__avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--xg-text);
  color: var(--xg-bg);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600;
}
.topbar__user-name { font-size: 13px; font-weight: 600; color: var(--xg-text); line-height: 1.2; }
.topbar__user-role { font-size: 11px; color: var(--xg-text-mute); line-height: 1.2; }

.content {
  padding: 32px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}
.content--wide { max-width: none; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: all 0.12s ease;
  border: 1px solid transparent;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
}
.btn svg { width: 16px; height: 16px; }

.btn--primary {
  background: var(--xg-text);
  color: var(--xg-bg);
}
.btn--primary:hover {
  background: var(--xg-text-strong);
  transform: translateY(-1px);
  box-shadow: var(--xg-shadow-md);
}

.btn--green {
  background: var(--xg-primary);
  color: #fff;
}
.btn--green:hover {
  background: var(--xg-primary-dim);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(23, 191, 163, 0.25);
}

.btn--ghost {
  background: var(--xg-bg);
  color: var(--xg-text);
  border-color: var(--xg-border-strong);
}
.btn--ghost:hover { background: var(--xg-bg-alt); border-color: var(--xg-text-faint); }

.btn--outline { background: transparent; border-color: var(--xg-border-strong); color: var(--xg-text); }
.btn--outline:hover { border-color: var(--xg-text); }

.btn--lg { padding: 14px 22px; font-size: 14px; border-radius: 10px; }
.btn--sm { padding: 7px 12px; font-size: 12px; border-radius: 7px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* ===== Cards ===== */
.card {
  background: var(--xg-card);
  border: 1px solid var(--xg-border);
  border-radius: var(--xg-radius);
  padding: 22px;
  position: relative;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}
.card--hover:hover {
  border-color: var(--xg-border-strong);
  box-shadow: var(--xg-shadow-md);
}
.card--accent {
  background: var(--xg-primary-tint);
  border-color: #B7E8DD;
}
.card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 16px; }
.card__title { font-size: 15px; font-weight: 600; color: var(--xg-text); }
.card__sub { font-size: 12px; color: var(--xg-text-mute); margin-top: 2px; }

/* ===== Badges & Pills ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  background: var(--xg-bg-alt);
  color: var(--xg-text-soft);
  border: 1px solid var(--xg-border-strong);
}
.badge--success { background: var(--xg-success-soft); color: var(--xg-success); border-color: #B7E8DD; }
.badge--warn    { background: var(--xg-warning-soft); color: var(--xg-warning); border-color: #FCD9A1; }
.badge--info    { background: var(--xg-info-soft); color: var(--xg-info); border-color: #C7D8F7; }
.badge--danger  { background: var(--xg-danger-soft); color: var(--xg-danger); border-color: #F8C9C9; }
.badge--mute    { background: var(--xg-bg-alt); color: var(--xg-text-mute); border-color: var(--xg-border); }
.badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ===== Form ===== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 12.5px; font-weight: 500; color: var(--xg-text-strong); }
.input, .textarea, .select {
  width: 100%;
  background: var(--xg-bg);
  border: 1px solid var(--xg-border-strong);
  border-radius: 8px;
  padding: 11px 14px;
  color: var(--xg-text);
  font-size: 14px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
  font-family: 'Inter', sans-serif;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--xg-text);
  box-shadow: 0 0 0 3px rgba(36, 36, 36, 0.06);
}
.input::placeholder, .textarea::placeholder { color: var(--xg-text-faint); }
.input-group { position: relative; }
.input-group .input { padding-left: 40px; }
.input-group__icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--xg-text-mute); width: 16px; height: 16px; }

/* ===== Progress ===== */
.progress {
  width: 100%;
  height: 6px;
  background: var(--xg-divider);
  border-radius: 100px;
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  background: var(--xg-primary);
  border-radius: 100px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-ring { transform: rotate(-90deg); }
.progress-ring__bg { stroke: var(--xg-divider); }
.progress-ring__fg {
  stroke: var(--xg-primary);
  transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Login screen ===== */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--xg-bg);
}
.auth__brand {
  position: relative;
  background: var(--xg-bg-alt);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 56px;
  overflow: hidden;
  border-right: 1px solid var(--xg-border);
}
.auth__brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--xg-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--xg-border) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black, transparent);
  pointer-events: none;
  opacity: 0.7;
}
.auth__logo { display: flex; align-items: center; position: relative; z-index: 1; color: var(--xg-text); }
.auth__logo svg { height: 26px; width: auto; display: block; }

.auth__hero { position: relative; z-index: 1; max-width: 480px; }
.auth__hero h1 {
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  color: var(--xg-text);
}
/* Hero highlight — bold black with a thin teal underline accent. */
.auth__hero h1 em {
  font-style: normal;
  color: var(--xg-text);
  background-image: linear-gradient(to top, var(--xg-primary) 0, var(--xg-primary) 3px, transparent 3px);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  padding-bottom: 1px;
}
.auth__hero p { color: var(--xg-text-soft); font-size: 16px; line-height: 1.6; }

.auth__features { position: relative; z-index: 1; display: grid; gap: 10px; max-width: 480px; }
.auth__feature {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--xg-bg);
  border: 1px solid var(--xg-border);
  box-shadow: var(--xg-shadow-sm);
}
.auth__feature-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--xg-primary-soft);
  color: var(--xg-primary);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.auth__feature-icon svg { width: 18px; height: 18px; }
.auth__feature h4 { font-size: 14px; margin-bottom: 2px; color: var(--xg-text); }
.auth__feature p { font-size: 12.5px; color: var(--xg-text-mute); }

.auth__panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px;
  background: var(--xg-bg);
}
.auth__form {
  width: 100%;
  max-width: 420px;
}
.auth__form h2 { font-size: 28px; margin-bottom: 8px; letter-spacing: -0.02em; }
.auth__form > p.soft { margin-bottom: 28px; }
.auth__form .field + .field { margin-top: 16px; }
.auth__form .btn { margin-top: 24px; }
.auth__divider {
  display: flex; align-items: center; gap: 12px;
  margin: 24px 0;
  color: var(--xg-text-mute);
  font-size: 12px;
}
.auth__divider::before, .auth__divider::after { content: ''; flex: 1; height: 1px; background: var(--xg-border); }
.auth__forgot { display: flex; justify-content: flex-end; margin-top: 8px; }
.auth__forgot a { font-size: 12.5px; color: var(--xg-primary); font-weight: 500; }
.auth__forgot a:hover { text-decoration: underline; }
.auth__footer { margin-top: 32px; font-size: 13px; color: var(--xg-text-mute); text-align: center; }
.auth__footer a { color: var(--xg-primary); font-weight: 600; }

/* ===== Dashboard primitives ===== */
.welcome {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.welcome h1 { font-size: 30px; }
/* Subtle highlight on the company greeting — black with a tiny teal
   accent underline. Less "look at me", more "fintech". */
.welcome h1 em {
  font-style: normal;
  color: var(--xg-text);
  background-image: linear-gradient(to top, var(--xg-primary) 0, var(--xg-primary) 2px, transparent 2px);
  background-repeat: no-repeat;
  padding-bottom: 1px;
}
.welcome p { color: var(--xg-text-soft); margin-top: 6px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.stat {
  background: var(--xg-card);
  border: 1px solid var(--xg-border);
  border-radius: var(--xg-radius);
  padding: 18px 20px;
  position: relative;
}
.stat__icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--xg-bg-alt);
  border: 1px solid var(--xg-border);
  color: var(--xg-text);
  display: grid; place-items: center;
  margin-bottom: 14px;
}
.stat__icon svg { width: 18px; height: 18px; }
.stat__label { font-size: 12px; color: var(--xg-text-mute); margin-bottom: 4px; font-weight: 500; }
.stat__value { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--xg-text); }
.stat__value small { font-size: 12px; color: var(--xg-text-mute); font-weight: 500; margin-left: 4px; }

.action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.action {
  background: var(--xg-card);
  border: 1px solid var(--xg-border);
  border-radius: var(--xg-radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  transition: all 0.15s ease;
  position: relative;
}
.action:hover {
  border-color: var(--xg-border-strong);
  box-shadow: var(--xg-shadow-md);
  transform: translateY(-2px);
}
.action__icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: var(--xg-bg-alt);
  border: 1px solid var(--xg-border);
  color: var(--xg-text);
  display: grid; place-items: center;
  margin-bottom: 16px;
}
.action__icon svg { width: 20px; height: 20px; }
.action h3 { font-size: 15px; margin-bottom: 6px; color: var(--xg-text); font-weight: 600; }
.action p { font-size: 13px; color: var(--xg-text-mute); margin-bottom: 18px; line-height: 1.5; }
.action__cta {
  margin-top: auto;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--xg-text);
}
.action__cta svg { width: 14px; height: 14px; transition: transform 0.15s ease; }
.action:hover .action__cta svg { transform: translateX(3px); }

.section { margin-bottom: 36px; }
.section__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.section__head h2 { font-size: 20px; }

/* Onboarding hero card */
.onboarding-hero {
  background: var(--xg-card);
  border: 1px solid var(--xg-border);
  border-radius: var(--xg-radius-lg);
  padding: 28px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 32px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--xg-shadow-sm);
}
.onboarding-hero::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 240px;
  background:
    radial-gradient(ellipse 280px 200px at 100% 50%, rgba(23, 191, 163, 0.05), transparent 70%);
  pointer-events: none;
}
.onboarding-hero > * { position: relative; z-index: 1; }
.onboarding-hero__title { font-size: 22px; margin-bottom: 8px; }
.onboarding-hero__sub { color: var(--xg-text-soft); margin-bottom: 18px; max-width: 540px; }
.onboarding-hero__bar { display: flex; align-items: center; gap: 14px; max-width: 540px; }
.onboarding-hero__bar .progress { flex: 1; }
.onboarding-hero__pct { font-weight: 700; font-size: 14px; color: var(--xg-text); min-width: 50px; text-align: right; }

.ring-wrap {
  position: relative;
  width: 130px; height: 130px;
}
.ring-wrap__center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.ring-wrap__pct { font-size: 26px; font-weight: 700; color: var(--xg-text); letter-spacing: -0.02em; }
.ring-wrap__label { font-size: 10.5px; color: var(--xg-text-mute); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600; }

/* ===== Onboarding trail ===== */
.trail { display: flex; flex-direction: column; gap: 10px; }
.trail__step {
  background: var(--xg-card);
  border: 1px solid var(--xg-border);
  border-radius: var(--xg-radius);
  padding: 20px 22px;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 18px;
  align-items: center;
  transition: all 0.15s ease;
}
.trail__step:hover { border-color: var(--xg-border-strong); box-shadow: var(--xg-shadow-sm); }
.trail__step.is-done {
  background: var(--xg-primary-tint);
  border-color: #B7E8DD;
}
.trail__step.is-current {
  border-color: var(--xg-text);
  box-shadow: 0 0 0 3px rgba(36, 36, 36, 0.04);
}
.trail__num {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--xg-bg-alt);
  border: 1px solid var(--xg-border-strong);
  display: grid; place-items: center;
  font-size: 17px; font-weight: 700;
  color: var(--xg-text-mute);
}
.trail__step.is-done .trail__num {
  background: var(--xg-primary);
  color: #fff;
  border-color: var(--xg-primary);
}
.trail__step.is-done .trail__num svg { width: 18px; height: 18px; }
.trail__step.is-current .trail__num {
  background: var(--xg-text);
  color: #fff;
  border-color: var(--xg-text);
}
.trail__body h3 { font-size: 16px; margin-bottom: 4px; color: var(--xg-text); }
.trail__body p { font-size: 13.5px; color: var(--xg-text-mute); margin-bottom: 8px; line-height: 1.5; }
.trail__meta { display: flex; gap: 12px; font-size: 12px; color: var(--xg-text-mute); flex-wrap: wrap; align-items: center; }
.trail__meta span { display: inline-flex; align-items: center; gap: 4px; }
.trail__meta svg { width: 12px; height: 12px; }
.trail__actions { display: flex; gap: 8px; }

.checklist { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--xg-border); }
.check {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s ease;
  font-size: 13px;
  color: var(--xg-text-strong);
}
.check:hover { background: var(--xg-bg-alt); }
.check__box {
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--xg-border-strong);
  background: var(--xg-bg);
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: all 0.12s ease;
}
.check__box svg { width: 11px; height: 11px; color: #fff; opacity: 0; }
.check.is-done .check__box {
  background: var(--xg-primary);
  border-color: var(--xg-primary);
}
.check.is-done .check__box svg { opacity: 1; }
.check.is-done .check__label { text-decoration: line-through; color: var(--xg-text-mute); }

/* ===== Trail summary (top of tutorials.html) ===== */
.trail-summary {
  background: var(--xg-card);
  border: 1px solid var(--xg-border);
  border-radius: var(--xg-radius-lg);
  padding: 22px 24px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}
.trail-summary::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 240px;
  background: radial-gradient(ellipse 280px 200px at 100% 50%, rgba(23, 191, 163, 0.05), transparent 70%);
  pointer-events: none;
}
.trail-summary > * { position: relative; z-index: 1; }
.trail-summary__head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 24px; margin-bottom: 16px; flex-wrap: wrap;
}
.trail-summary__head h2 { font-size: 18px; }
.trail-summary__pct {
  text-align: right;
  display: flex; flex-direction: column; align-items: flex-end;
}
.trail-summary__pct-num {
  font-size: 32px; font-weight: 700; color: var(--xg-text);
  letter-spacing: -0.02em; line-height: 1;
}
/* The "%" symbol is the one tiny moment of teal in the whole hero. */
.trail-summary__pct-num small { font-size: 16px; font-weight: 600; margin-left: 2px; color: var(--xg-primary); }

.trail-summary__steps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.trail-pill {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--xg-border);
  border-radius: var(--xg-radius);
  background: var(--xg-bg);
  transition: all 0.15s ease;
  cursor: pointer;
  min-width: 0;
}
.trail-pill:hover {
  border-color: var(--xg-border-strong);
  box-shadow: var(--xg-shadow-sm);
  transform: translateY(-1px);
}
.trail-pill.is-done {
  background: var(--xg-primary-tint);
  border-color: #B7E8DD;
}
.trail-pill.is-current {
  border-color: var(--xg-text);
  box-shadow: 0 0 0 3px rgba(36, 36, 36, 0.04);
}
.trail-pill__num {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--xg-bg-alt);
  border: 1px solid var(--xg-border-strong);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
  color: var(--xg-text-mute);
  flex-shrink: 0;
}
.trail-pill__num svg { width: 14px; height: 14px; }
.trail-pill.is-done .trail-pill__num {
  background: var(--xg-primary);
  color: #fff;
  border-color: var(--xg-primary);
}
.trail-pill.is-current .trail-pill__num {
  background: var(--xg-text);
  color: #fff;
  border-color: var(--xg-text);
}
.trail-pill__body { min-width: 0; flex: 1; }
.trail-pill__title {
  font-size: 13.5px; font-weight: 600; color: var(--xg-text);
  margin-bottom: 4px; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.trail-pill__meta {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  font-size: 11.5px;
}
.trail-pill__meta .badge { font-size: 10.5px; padding: 2px 7px; }

/* ===== Tutorials ===== */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  padding: 4px;
  background: var(--xg-bg-alt);
  border: 1px solid var(--xg-border);
  border-radius: 10px;
  width: fit-content;
}
.tab {
  padding: 8px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--xg-text-mute);
  display: inline-flex; align-items: center; gap: 8px;
  transition: all 0.12s ease;
  font-family: 'Inter', sans-serif;
}
.tab:hover { color: var(--xg-text); }
.tab.is-active {
  background: var(--xg-bg);
  color: var(--xg-text);
  font-weight: 600;
  box-shadow: var(--xg-shadow-sm);
}
.tab svg { width: 14px; height: 14px; }

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.lesson-card {
  background: var(--xg-card);
  border: 1px solid var(--xg-border);
  border-radius: var(--xg-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.18s ease;
  cursor: pointer;
}
.lesson-card:hover {
  border-color: var(--xg-border-strong);
  transform: translateY(-2px);
  box-shadow: var(--xg-shadow-md);
}
.lesson-card__thumb {
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(ellipse 260px 150px at 30% 30%, rgba(0, 0, 0, 0.025), transparent 70%),
    linear-gradient(135deg, #FAFAFB 0%, #EFF1F4 100%);
  background-size: cover;
  background-position: center;
  position: relative;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--xg-border);
  overflow: hidden;
}
/* When a banner is set, the inline style supplies the image. The
   color underneath shows for the few hundred ms before the image
   downloads — keep it neutral cinza so the card never flashes black. */
.lesson-card__thumb.has-banner {
  background-color: #FAFAFB;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
.lesson-card__thumb.has-banner::after { display: none; }

.lesson-card__thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,0,0,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent);
  pointer-events: none;
}

/* "Glass" play button — XGate UX. Light frost on placeholder thumbs,
   readable over photo banners, white triangle, subtle ring. */
.lesson-card__play {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
          backdrop-filter: blur(8px) saturate(140%);
  color: #fff;
  display: grid; place-items: center;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 8px 24px rgba(0, 0, 0, 0.18);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.lesson-card:hover .lesson-card__play {
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.55);
}
.lesson-card__play svg { width: 22px; height: 22px; margin-left: 3px; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3)); }

/* For light placeholder thumbs (no banner), use a neutral dark glass.
   On hover the button transitions to teal as a small affordance pop. */
.lesson-card__thumb:not(.has-banner) .lesson-card__play {
  background: rgba(0, 0, 0, 0.04);
  border-color: var(--xg-border-strong);
  color: var(--xg-text);
  box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset, 0 6px 16px rgba(16, 24, 40, 0.06);
}
.lesson-card__thumb:not(.has-banner) .lesson-card__play svg { filter: none; }
.lesson-card:hover .lesson-card__thumb:not(.has-banner) .lesson-card__play {
  background: var(--xg-primary);
  border-color: var(--xg-primary);
  color: #fff;
}

.lesson-card__duration {
  position: absolute; bottom: 10px; right: 10px;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  border-radius: 6px;
  z-index: 1;
  letter-spacing: 0.02em;
}
/* On non-banner placeholders, keep the duration pill light/airy */
.lesson-card__thumb:not(.has-banner) .lesson-card__duration {
  background: var(--xg-bg);
  border-color: var(--xg-border-strong);
  color: var(--xg-text);
}
.lesson-card__body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.lesson-card__cat { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--xg-text-mute); margin-bottom: 6px; font-weight: 600; }
.lesson-card__title { font-size: 14.5px; font-weight: 600; color: var(--xg-text); margin-bottom: 8px; line-height: 1.35; }
.lesson-card__desc { font-size: 12.5px; color: var(--xg-text-mute); line-height: 1.5; flex: 1; }
.lesson-card__foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--xg-border);
  font-size: 12px;
  color: var(--xg-text-mute);
}

/* ===== Video Player Page ===== */
.player-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
}
@media (max-width: 1200px) { .player-layout { grid-template-columns: 1fr; } }

.player-stage { display: flex; flex-direction: column; gap: 24px; }
.player-frame {
  aspect-ratio: 16 / 9;
  /* Cinza neutro de fundo — o video fica em cima quando carrega, mas
     enquanto a thumb/banner não chegou, o frame não pisca em preto. */
  background:
    radial-gradient(ellipse 600px 400px at 30% 30%, rgba(0,0,0,0.03), transparent 70%),
    linear-gradient(135deg, #FAFAFB 0%, #EFF1F4 100%);
  border-radius: var(--xg-radius);
  overflow: hidden;
  border: 1px solid var(--xg-border);
  position: relative;
}
/* Quando um <video> de fato é renderizado, o player vira preto naturalmente
   pelo background do elemento <video>. Aqui só cobrimos o caso
   "banner-only" (Vídeo em breve) e o brief flash antes do poster. */
.player-frame video,
.player-frame iframe { background: #000; }
.player-frame video, .player-frame iframe { width: 100%; height: 100%; display: block; }
.player-fallback {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background:
    radial-gradient(ellipse 400px 260px at 30% 30%, rgba(0,0,0,0.03), transparent 70%),
    linear-gradient(135deg, #FAFAFB 0%, #EFF1F4 100%);
  text-align: center;
  color: var(--xg-text-soft);
}
.player-fallback__icon {
  width: 76px; height: 76px;
  border-radius: 50%;
  background: var(--xg-text);
  color: #fff;
  display: grid; place-items: center;
  margin: 0 auto 14px;
  box-shadow: 0 12px 28px rgba(36, 36, 36, 0.2);
}
.player-fallback__icon svg { width: 28px; height: 28px; margin-left: 3px; }
.player-fallback p { font-size: 13px; }

.player-meta h1 { font-size: 26px; margin-bottom: 8px; }
.player-meta__row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--xg-text-mute); font-size: 13px; }
.player-meta__actions { display: flex; gap: 10px; margin: 20px 0; flex-wrap: wrap; }

.player-tabs {
  display: flex; gap: 24px;
  border-bottom: 1px solid var(--xg-border);
  margin-bottom: 18px;
}
.player-tab {
  padding: 12px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--xg-text-mute);
  position: relative;
  cursor: pointer;
  transition: color 0.12s ease;
}
.player-tab:hover { color: var(--xg-text); }
.player-tab.is-active { color: var(--xg-text); }
.player-tab.is-active::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 2px;
  background: var(--xg-text);
}

.player-pane > * + * { margin-top: 14px; }
.player-pane p { color: var(--xg-text-soft); line-height: 1.7; font-size: 14px; }
.player-pane h3 { margin-top: 24px; color: var(--xg-text); }

.player-side {
  background: var(--xg-card);
  border: 1px solid var(--xg-border);
  border-radius: var(--xg-radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: fit-content;
  position: sticky; top: 96px;
  max-height: calc(100vh - 120px);
}
.player-side__head { padding: 16px; border-bottom: 1px solid var(--xg-border); }
.player-side__head h3 { font-size: 14px; margin-bottom: 4px; }
.player-side__progress { font-size: 12px; color: var(--xg-text-mute); }
.player-side__list { flex: 1; overflow-y: auto; padding: 8px; }
.player-side__item {
  padding: 10px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background 0.12s ease;
  font-size: 13px;
  color: var(--xg-text-strong);
}
.player-side__item:hover { background: var(--xg-bg-alt); }
.player-side__item.is-active { background: var(--xg-primary-soft); color: var(--xg-text); font-weight: 500; }
.player-side__num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--xg-bg-alt);
  border: 1px solid var(--xg-border-strong);
  color: var(--xg-text-mute);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600; flex-shrink: 0;
}
.player-side__num svg { width: 12px; height: 12px; }
.player-side__item.is-active .player-side__num { background: var(--xg-text); color: #fff; border-color: var(--xg-text); }
.player-side__item.is-done .player-side__num { background: var(--xg-primary); color: #fff; border-color: var(--xg-primary); }
.player-side__title { flex: 1; line-height: 1.3; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-side__time { font-size: 11px; color: var(--xg-text-faint); }

/* ===== Docs ===== */
.docs-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
}
@media (max-width: 1100px) { .docs-layout { grid-template-columns: 1fr; } }
.docs-side {
  position: sticky; top: 96px; align-self: start;
  display: flex; flex-direction: column;
  font-size: 13px;
}
.docs-side h4 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--xg-text-mute); margin: 18px 12px 6px; font-weight: 600;
}
.docs-side__link {
  padding: 7px 12px;
  border-radius: 7px;
  color: var(--xg-text-mute);
  display: block;
  cursor: pointer;
  transition: all 0.12s ease;
  font-weight: 500;
}
.docs-side__link:hover { background: var(--xg-bg-alt); color: var(--xg-text); }
.docs-side__link.is-active { background: var(--xg-primary-soft); color: var(--xg-primary); font-weight: 600; }

.docs-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--xg-border);
  margin-bottom: 36px;
}
.docs-block:last-child { border-bottom: 0; }
.docs-block__copy h2 { margin-bottom: 12px; }
.docs-block__copy p { color: var(--xg-text-soft); line-height: 1.7; margin-bottom: 12px; font-size: 14px; }
.docs-block__copy ul { color: var(--xg-text-soft); line-height: 1.8; padding-left: 20px; font-size: 14px; }
.docs-block__copy ul li { margin-bottom: 4px; }
.docs-block__copy code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  padding: 1.5px 6px;
  background: var(--xg-bg-alt);
  border-radius: 5px;
  color: var(--xg-primary);
  border: 1px solid var(--xg-border);
}

.code-block {
  background: #0F1417;
  border: 1px solid #1F2630;
  border-radius: var(--xg-radius);
  overflow: hidden;
}
.code-block__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid #1F2630;
  background: #0B1013;
}
.code-block__lang {
  font-size: 11px;
  font-weight: 600;
  color: #94A3B8;
  letter-spacing: 0.06em;
}
.code-block__copy {
  font-size: 11.5px;
  color: #94A3B8;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #1F2630;
  background: #131A20;
  display: inline-flex; align-items: center; gap: 5px;
  transition: all 0.12s ease;
  font-family: 'Inter', sans-serif;
}
.code-block__copy:hover { color: #5DE0C5; border-color: #2A3A30; }
.code-block__copy svg { width: 12px; height: 12px; }
.code-block pre {
  padding: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.7;
  overflow-x: auto;
  color: #C4CDD3;
}
.code-block .tk-key { color: #7CD9FF; }
.code-block .tk-str { color: #5DE0C5; }
.code-block .tk-num { color: #FFB547; }
.code-block .tk-com { color: #6B7C85; font-style: italic; }
.code-block .tk-fn  { color: #82AAFF; }
.code-block .tk-pun { color: #94A3B8; }

.docs-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--xg-border);
  margin-bottom: 12px;
}
.docs-tab {
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--xg-text-mute);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}
.docs-tab.is-active { color: var(--xg-text); border-bottom-color: var(--xg-text); }

/* ===== Support ===== */
.support-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.support-grid--two { grid-template-columns: repeat(2, 1fr); }
.support-card {
  background: var(--xg-card);
  border: 1px solid var(--xg-border);
  border-radius: var(--xg-radius);
  padding: 22px;
  text-align: left;
  transition: all 0.15s ease;
}
.support-card:hover {
  border-color: var(--xg-border-strong);
  box-shadow: var(--xg-shadow-md);
  transform: translateY(-2px);
}
.support-card__icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--xg-bg-alt);
  border: 1px solid var(--xg-border);
  color: var(--xg-text);
  display: grid; place-items: center;
  margin-bottom: 16px;
}
.support-card__icon svg { width: 22px; height: 22px; }
.support-card h3 { margin-bottom: 6px; }
.support-card p { font-size: 13px; color: var(--xg-text-mute); margin-bottom: 16px; line-height: 1.55; }

.faq { display: flex; flex-direction: column; gap: 8px; }
.faq__item {
  background: var(--xg-card);
  border: 1px solid var(--xg-border);
  border-radius: var(--xg-radius);
  padding: 16px 20px;
  cursor: pointer;
  transition: border-color 0.12s ease;
}
.faq__item:hover { border-color: var(--xg-border-strong); }
.faq__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; font-size: 14px; color: var(--xg-text); }
.faq__head svg { transition: transform 0.2s ease; color: var(--xg-text-mute); width: 16px; height: 16px; }
.faq__item.is-open .faq__head svg { transform: rotate(180deg); color: var(--xg-text); }
.faq__body { color: var(--xg-text-soft); margin-top: 12px; line-height: 1.65; font-size: 13.5px; display: none; }
.faq__item.is-open .faq__body { display: block; }

/* Floating support button */
.support-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: var(--xg-text);
  color: #fff;
  font-weight: 600;
  font-size: 13.5px;
  border-radius: 100px;
  box-shadow: 0 8px 24px rgba(36, 36, 36, 0.2);
  transition: all 0.18s ease;
}
.support-fab:hover {
  background: var(--xg-primary);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(23, 191, 163, 0.25);
}
.support-fab svg { width: 18px; height: 18px; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--xg-text);
  color: #fff;
  padding: 11px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 8px 24px rgba(36, 36, 36, 0.2);
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast svg { width: 14px; height: 14px; color: #5DE0C5; }

/* Mobile sidebar toggle */
.menu-toggle {
  display: none;
  width: 38px; height: 38px;
  border-radius: 8px;
  background: var(--xg-bg);
  border: 1px solid var(--xg-border-strong);
  align-items: center; justify-content: center;
  color: var(--xg-text);
}
.menu-toggle svg { width: 18px; height: 18px; }

.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 19;
}
.sidebar-backdrop.is-open { display: block; }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .stats-grid, .action-grid { grid-template-columns: repeat(2, 1fr); }
  .support-grid { grid-template-columns: repeat(2, 1fr); }
  .auth { grid-template-columns: 1fr; }
  .auth__brand { display: none; }
  .auth__panel { padding: 32px 20px; }
}

@media (max-width: 768px) {
  :root { --xg-sidebar: 0px; }
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .sidebar.is-open { transform: translateX(0); }

  /* Topbar: muitos elementos competindo por largura. Esconde breadcrumbs
     (título já indica a página), aperta gap, simplifica back para ícone-only. */
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar__crumbs { display: none; }
  .topbar__back { padding: 7px 9px; gap: 0; }
  .topbar__back-label { display: none; }
  .topbar__user-name, .topbar__user-role { display: none; }
  .topbar__title { font-size: 14px; }
  .menu-toggle { display: inline-flex; }

  .content { padding: 20px 16px; }

  /* Welcome: filho da direita pode ter botões/inputs — garante wrap e
     que o input de busca (com min-width inline) ocupe a linha inteira. */
  .welcome > div { min-width: 0; }
  .welcome > div + div { flex-wrap: wrap; flex: 1 1 100%; }
  .welcome .input-group {
    min-width: 0 !important;
    width: 100%;
    flex: 1;
  }
  .welcome h1 { font-size: 24px; }

  /* Cards de aula: 1 coluna real (auto-fill com minmax 280 desperdiçava
     espaço e cortava em telas estreitas). */
  .category-grid { grid-template-columns: 1fr; gap: 12px; }

  .stats-grid, .action-grid { grid-template-columns: 1fr; gap: 12px; }
  .support-grid { grid-template-columns: 1fr; }
  .onboarding-hero { grid-template-columns: 1fr; }
  .ring-wrap { margin: 0 auto; }
  .trail__step { grid-template-columns: 44px 1fr; }
  .trail__actions { grid-column: 1 / -1; margin-top: 12px; }
  .docs-block { grid-template-columns: 1fr; }

  /* Player side panel: era sticky pra coluna direita no desktop. No mobile
     vira bloco de baixo do vídeo — sticky aqui só atrapalha (cola num
     viewport pequeno e cobre o conteúdo). */
  .player-side { position: static; max-height: none; }
  .player-meta h1 { font-size: 22px; }

  .auth__form h2 { font-size: 22px; }

  /* Floating support button compacto: ícone + label menor, sem competir
     com bottom-nav ou cobrir botão "Marcar como concluída". */
  .support-fab {
    bottom: 16px; right: 16px;
    padding: 10px 14px;
    font-size: 12px;
  }
}

/* Telas muito estreitas (iPhone SE 320px e similares): garante que
   botões em pares não estouram lateralmente. */
@media (max-width: 380px) {
  .player-meta__actions .btn { flex: 1 1 100%; justify-content: center; }
  .welcome > div + div .btn { flex: 1; }
}

/* Utils */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
@media (max-width: 768px) { .hide-mobile { display: none !important; } }
