/* ============================================================
   NML Learning App — Frontend SPA Styles
   ============================================================ */

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

/* Reset just our app */
.nml-app-body,
.nml-app-body * { box-sizing: border-box; }
.nml-app-body {
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: #F8FAFC;
  color: #0F172A;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Fullscreen mode: aggressive reset of theme + admin bar margins
   so content starts at viewport y=0 with proper safe-area handling. */
.nml-app-body.nml-fullscreen,
html:has(body.nml-fullscreen),
body.nml-fullscreen {
  margin-top: 0 !important;
  padding-top: 0 !important;
}
.nml-app-body #wpadminbar,
.nml-app-body .admin-bar,
body.nml-fullscreen #wpadminbar { display: none !important; }
html.wp-toolbar,
html:has(body.nml-fullscreen) {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Respect iOS safe-area (notch + status bar) so content isn't hidden
   behind the browser chrome on mobile fullscreen. */
@supports (padding-top: env(safe-area-inset-top)) {
  body.nml-fullscreen .nml-main {
    padding-top: max(32px, env(safe-area-inset-top));
  }
  body.nml-fullscreen .nml-sidebar {
    padding-top: max(24px, env(safe-area-inset-top));
  }
}

/* ─── Design tokens ─── */
:root {
  --nml-blue:        #2F6BFF;
  --nml-blue-dark:   #1a56e8;
  --nml-blue-light:  #EEF3FF;
  --nml-blue-border: #C8DAFF;
  --nml-green:       #22C55E;
  --nml-green-light: #EDFBF3;
  --nml-red:         #DC2626;
  --nml-red-light:   #FEE2E2;
  --nml-amber:       #F59E0B;
  --nml-amber-light: #FEF3C7;

  --nml-brand: #3B0764;
  --nml-trade: #1E2D40;
  --nml-sales: #0F766E;
  --nml-ecom:  #A0522D;

  --nml-text:        #0F172A;
  --nml-text-mid:    #475569;
  --nml-text-muted:  #94A3B8;
  --nml-border:      #E2E8F0;
  --nml-bg-white:    #FFFFFF;
  --nml-bg-surface:  #F8FAFC;
  --nml-bg-soft:     #F1F5F9;

  --font-primary: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 16px;

  --shadow-sm: 0 1px 3px rgba(15,23,42,0.04), 0 2px 8px rgba(47,107,255,0.04);
  --shadow-md: 0 4px 16px rgba(47,107,255,0.08), 0 1px 3px rgba(0,0,0,0.04);

  --dur-fast: 150ms;
  --dur-base: 250ms;
  /* NML Motion Language — full token set */
  --dur-micro:     120ms;  /* Button press, ripple, micro-interactions */
  --dur-ui:        240ms;  /* Hover lift, card states, tab switches */
  --dur-page:      420ms;  /* Route transitions, modal open/close */
  --dur-cinematic: 700ms;  /* Progress bar fills, stat reveals */

  --ease-out:     cubic-bezier(0.0, 0.0, 0.2, 1);     /* Default: enter from rest */
  --ease-in-out:  cubic-bezier(0.4, 0.0, 0.2, 1);     /* A→B smooth slide */
  --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);  /* Bouncy CTA, hover lift */
  --ease-decel:   cubic-bezier(0.05, 0.7, 0.1, 1.0);  /* Long decel for progress */
}

/* ─── Boot loader (visible until React mounts) ─── */
.nml-app-boot {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background-image:
    radial-gradient(ellipse 60% 40% at 15% 10%, rgba(47,107,255,0.05) 0%, transparent 55%),
    radial-gradient(ellipse 50% 35% at 85% 90%, rgba(34,197,94,0.04) 0%, transparent 55%);
}

.nml-app-boot-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--nml-border);
  border-top-color: var(--nml-blue);
  border-radius: 50%;
  animation: nml-spin 0.8s linear infinite;
}

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

.nml-app-boot-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--nml-text-mid);
  letter-spacing: -0.01em;
}

/* ─── App shell ─── */
#nml-app-root {
  min-height: 100vh;
}

.nml-app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 18px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px;
  min-height: 600px;
}

/* Fullscreen mode keeps the original viewport-height layout (no card, no max-width). */
body.nml-fullscreen .nml-app-shell {
  grid-template-columns: 260px 1fr;
  gap: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 60% 40% at 15% 10%, rgba(47,107,255,0.05) 0%, transparent 55%),
    radial-gradient(ellipse 50% 35% at 85% 90%, rgba(34,197,94,0.04) 0%, transparent 55%);
  background-attachment: fixed;
}

/* Sidebar — floating card in embedded mode, full-height in fullscreen */
.nml-sidebar {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: 16px;
  padding: 22px 16px;
  position: sticky;
  top: 24px;
  height: fit-content;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  box-shadow: 0 2px 8px rgba(15,23,42,0.04);
  display: flex;
  flex-direction: column;
}

body.nml-fullscreen .nml-sidebar {
  border: none;
  border-right: 1px solid var(--nml-border);
  border-radius: 0;
  padding: 24px 20px;
  top: 0;
  height: 100vh;
  max-height: 100vh;
  box-shadow: none;
}

/* Main content area — floating card in embedded, padded full-width in fullscreen */
.nml-main {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: 16px;
  padding: 28px 32px;
  min-width: 0;
  box-shadow: 0 2px 8px rgba(15,23,42,0.04);
  min-height: 600px;
}

body.nml-fullscreen .nml-main {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 32px 40px 48px;
  box-shadow: none;
  min-height: 100vh;
}

.nml-main-narrow {
  max-width: 880px;
  margin: 0 auto;
}

.nml-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--nml-text);
  letter-spacing: -0.02em;
  margin-bottom: 32px;
  text-decoration: none;
}

.nml-sidebar-brand-logo {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--nml-blue) 0%, var(--nml-green) 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 14px;
}

.nml-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nml-sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-s);
  color: var(--nml-text-mid);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--dur-fast) var(--ease-out);
}
.nml-sidebar-link:hover {
  background: var(--nml-bg-soft);
  color: var(--nml-text);
}
.nml-sidebar-link.active {
  background: var(--nml-blue-light);
  color: var(--nml-blue);
  font-weight: 600;
}

.nml-sidebar-link-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nml-sidebar-divider {
  height: 1px;
  background: var(--nml-border);
  margin: 16px 0;
}

.nml-sidebar-section {
  font-size: 10px;
  font-weight: 700;
  color: var(--nml-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 14px;
  margin-bottom: 8px;
}

.nml-sidebar-user {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--nml-border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.nml-sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--nml-blue-light);
  color: var(--nml-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.nml-sidebar-user-info { flex: 1; min-width: 0; }
.nml-sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--nml-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nml-sidebar-user-plan {
  font-size: 11px;
  color: var(--nml-text-muted);
}

/* Skeleton loader */
.nml-skeleton {
  background: linear-gradient(90deg, var(--nml-bg-soft) 0%, #F1F5F9 50%, var(--nml-bg-soft) 100%);
  background-size: 200% 100%;
  animation: nml-skeleton 1.4s ease-in-out infinite;
  border-radius: 6px;
}
@keyframes nml-skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Mobile ─── */
@media (max-width: 880px) {
  .nml-app-shell {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 12px;
  }
  .nml-sidebar {
    position: relative;
    top: 0;
    height: auto;
    max-height: none;
    border-radius: 12px;
    padding: 16px;
  }
  body.nml-fullscreen .nml-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    width: 260px;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform var(--dur-base) var(--ease-out);
  }
  body.nml-fullscreen .nml-sidebar.open {
    transform: translateX(0);
  }
  .nml-main {
    padding: 20px;
    border-radius: 12px;
  }
  body.nml-fullscreen .nml-main {
    padding: 24px 20px 64px;
  }
}

/* ============================================================
   CYCLE 2 — Page styles
   ============================================================ */

/* Headings */
.nml-page { max-width: 1280px; }
.nml-h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--nml-text);
  letter-spacing: -0.025em;
  margin: 0 0 4px;
  line-height: 1.15;
}
.nml-h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--nml-text);
  letter-spacing: -0.01em;
  margin: 0;
}
.nml-sub {
  font-size: 15px;
  color: var(--nml-text-mid);
  margin: 0 0 28px;
}

.nml-section { margin-top: 32px; }
.nml-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.nml-section-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--nml-blue);
  text-decoration: none;
}
.nml-section-link:hover { text-decoration: underline; }

/* ─── Card primitive ─── */
.nml-card {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-l);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

/* ─── Button primitive ─── */
.nml-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-primary);
  font-weight: 600;
  border-radius: var(--radius-s);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  white-space: nowrap;
  text-decoration: none;
}
.nml-btn-sm { font-size: 13px; padding: 7px 14px; }
.nml-btn-md { font-size: 14px; padding: 10px 18px; }
.nml-btn-lg { font-size: 15px; padding: 12px 24px; }

.nml-btn-primary {
  background: var(--nml-blue);
  color: #fff;
}
.nml-btn-primary:hover { background: var(--nml-blue-dark); transform: translateY(-1px); }

.nml-btn-secondary {
  background: var(--nml-bg-white);
  color: var(--nml-text);
  border-color: var(--nml-border);
}
.nml-btn-secondary:hover { background: var(--nml-bg-soft); }

.nml-btn-ghost {
  background: transparent;
  color: var(--nml-text-mid);
}
.nml-btn-ghost:hover { background: var(--nml-bg-soft); color: var(--nml-text); }

.nml-btn-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ─── ITDE pill ─── */
.nml-itde-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
  padding: 3px 10px;
  border-radius: 12px;
}
.nml-itde-pill-letter {
  font-family: var(--font-mono);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(0,0,0,0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
}
.nml-itde-pill-acc {
  font-family: var(--font-mono);
  margin-left: 4px;
  opacity: 0.7;
}

/* ─── Dashboard hero ─── */
.nml-dash-hero {
  margin-bottom: 28px;
}

/* ─── Active session banner ─── */
.nml-active-banner {
  background: linear-gradient(135deg, #EEF3FF 0%, #fff 100%);
  border: 1px solid var(--nml-blue-border);
  border-radius: var(--radius-m);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.nml-active-banner-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(47,107,255,0.15);
  color: var(--nml-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nml-active-banner-body { flex: 1; min-width: 0; }
.nml-active-banner-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--nml-text);
  margin-bottom: 2px;
}
.nml-active-banner-sub {
  font-size: 13px;
  color: var(--nml-text-mid);
}

/* ─── Stats grid ─── */
.nml-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.nml-stat-card {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-m);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  transition: all var(--dur-fast) var(--ease-out);
}
.nml-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.nml-stat-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--nml-text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.nml-stat-value {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  color: var(--nml-text);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 6px;
}
.nml-stat-delta {
  font-size: 12px;
  font-weight: 600;
}
.nml-stat-blue  { color: var(--nml-blue); }
.nml-stat-green { color: var(--nml-green); }
.nml-stat-amber { color: var(--nml-amber); }
.nml-stat-gray  { color: var(--nml-text-muted); }

/* ─── Two-column layout ─── */
.nml-two-col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-top: 24px;
}
.nml-col-wide, .nml-col-narrow {
  min-width: 0;
}

/* ─── Function cards ─── */
.nml-fn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.nml-fn-card {
  display: block;
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-m);
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  transition: all var(--dur-fast) var(--ease-out);
  box-shadow: var(--shadow-sm);
}
.nml-fn-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--nml-blue-border);
}
.nml-fn-card-empty { opacity: 0.5; }
.nml-fn-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.nml-fn-pill {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  padding: 3px 10px;
  border-radius: 10px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.nml-fn-level {
  font-size: 11px;
  font-weight: 600;
  color: var(--nml-text-muted);
  text-transform: capitalize;
}
.nml-fn-soon {
  font-size: 11px;
  color: var(--nml-text-muted);
}
.nml-fn-stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 10px;
}
.nml-fn-stat-value {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--nml-text);
  line-height: 1;
}
.nml-fn-stat-label {
  font-size: 11px;
  color: var(--nml-text-muted);
}
.nml-fn-stat-foot {
  font-size: 11px;
  color: var(--nml-text-muted);
  margin-top: 6px;
}
.nml-fn-empty {
  text-align: center;
  color: var(--nml-text-muted);
  font-size: 13px;
  padding: 12px 0;
}

/* ─── Progress bar ─── */
.nml-progress-track {
  height: 6px;
  background: var(--nml-bg-soft);
  border-radius: 3px;
  overflow: hidden;
}
.nml-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width var(--dur-base) var(--ease-out);
}

/* ─── Challenge mini card ─── */
.nml-ch-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nml-ch-mini {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-s);
  padding: 14px 16px;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.nml-ch-mini:hover {
  border-color: var(--nml-blue);
  transform: translateX(2px);
}
.nml-ch-mini-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--nml-text);
  margin-bottom: 4px;
}
.nml-ch-mini-meta {
  font-size: 11px;
  color: var(--nml-text-muted);
  margin-bottom: 6px;
}
.nml-ch-mini-deadline {
  font-size: 11px;
  font-weight: 600;
  color: var(--nml-amber);
}

/* ─── Week calendar ─── */
.nml-week-cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.nml-day-cell {
  text-align: center;
  padding: 12px 6px;
  border-radius: var(--radius-s);
  border: 1px solid var(--nml-border);
  background: var(--nml-bg-white);
  transition: all var(--dur-fast) var(--ease-out);
}
.nml-day-active {
  background: var(--nml-green-light);
  border-color: var(--nml-green);
}
.nml-day-today {
  border-color: var(--nml-blue);
  border-width: 2px;
}
.nml-day-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--nml-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.nml-day-num {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--nml-text);
  margin: 4px 0;
  line-height: 1;
}
.nml-day-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--nml-border);
  margin: 0 auto;
}
.nml-day-active .nml-day-dot { background: var(--nml-green); }

/* ─── Sidebar function dots ─── */
.nml-sidebar-fn { padding-left: 14px; }
.nml-sidebar-fn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ─── Empty/placeholder states ─── */
.nml-empty-mini {
  background: var(--nml-bg-soft);
  border: 1px dashed var(--nml-border);
  border-radius: var(--radius-s);
  padding: 24px 16px;
  text-align: center;
  color: var(--nml-text-muted);
  font-size: 13px;
}
.nml-placeholder {
  text-align: center;
  padding: 56px 32px;
}
.nml-placeholder-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.nml-placeholder h2 { margin-bottom: 8px; }
.nml-placeholder p {
  color: var(--nml-text-mid);
  margin: 4px 0;
}
.nml-error-state {
  text-align: center;
  padding: 48px 32px;
}

/* ─── Toast ─── */
.nml-toast-root {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.nml-toast {
  background: var(--nml-bg-white);
  color: var(--nml-text);
  border-radius: var(--radius-s);
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(15,23,42,0.10);
  border-left: 4px solid var(--nml-blue);
  min-width: 240px;
  pointer-events: auto;
  animation: nml-toast-in 0.2s ease-out;
}
.nml-toast-success { border-left-color: var(--nml-green); }
.nml-toast-error   { border-left-color: var(--nml-red); }
.nml-toast-warning { border-left-color: var(--nml-amber); }
.nml-toast-info    { border-left-color: var(--nml-blue); }
@keyframes nml-toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .nml-two-col {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 880px) {
  .nml-h1 { font-size: 24px; }
  .nml-stat-value { font-size: 24px; }
  .nml-fn-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Shortcode container + login gate
   ============================================================ */

/* Embedded mode (theme header/footer visible) */
.nml-app-container {
  background: transparent;
  min-height: 600px;
}

/* Fullscreen mode (theme stripped) */
body.nml-fullscreen .nml-app-container {
  min-height: 100vh;
}

body.nml-fullscreen {
  margin: 0 !important;
  padding: 0 !important;
}

/* Login gate */
.nml-app-login-gate {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-l);
  padding: 48px 32px;
  text-align: center;
  max-width: 480px;
  margin: 80px auto;
  box-shadow: var(--shadow-sm);
}
.nml-app-login-gate h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--nml-text);
  margin: 0 0 12px;
}
.nml-app-login-gate p {
  color: var(--nml-text-mid);
  font-size: 14px;
  margin: 0 0 24px;
}

/* ============================================================
   CYCLE 3 — Practice flow + Cycle 4 — Challenge + Leaderboard
   ============================================================ */

/* ─── Resume card ─── */
.nml-resume-card { max-width: 600px; }
.nml-resume-meta { margin: 16px 0; }
.nml-resume-actions { display: flex; gap: 12px; margin-top: 16px; }

/* ─── Mode tabs ─── */
.nml-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.nml-mode-tab {
  background: var(--nml-bg-white);
  border: 2px solid var(--nml-border);
  border-radius: var(--radius-m);
  padding: 18px 20px;
  text-align: left;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nml-mode-tab:hover {
  border-color: var(--nml-blue);
  transform: translateY(-2px);
}
.nml-mode-tab.active {
  border-color: var(--nml-blue);
  background: var(--nml-blue-light);
}
.nml-mode-tab-locked {
  opacity: 0.5;
  cursor: not-allowed;
}
.nml-mode-tab-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--nml-text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.nml-mode-tab-sub {
  font-size: 12px;
  color: var(--nml-text-muted);
}

/* ─── Setup form ─── */
.nml-setup-card { max-width: 720px; }
.nml-setup-field { margin-bottom: 24px; }
.nml-setup-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--nml-text-mid);
  margin-bottom: 10px;
}
.nml-setup-action {
  margin-top: 32px;
  display: flex;
  justify-content: flex-end;
}

/* ─── Segmented control ─── */
.nml-segmented {
  display: inline-flex;
  background: var(--nml-bg-soft);
  border-radius: var(--radius-s);
  padding: 4px;
  gap: 2px;
  flex-wrap: wrap;
}
.nml-segmented-opt {
  background: transparent;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--nml-text-mid);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.nml-segmented-opt:hover { color: var(--nml-text); }
.nml-segmented-opt.active {
  background: var(--nml-bg-white);
  color: var(--nml-blue);
  box-shadow: 0 1px 3px rgba(15,23,42,0.06);
}

/* ─── Unlock info box ─── */
.nml-unlock-info {
  background: var(--nml-blue-light);
  border-radius: var(--radius-s);
  padding: 16px;
  margin-bottom: 20px;
}

/* ─── Session page ─── */
.nml-session-page { max-width: 800px; margin: 0 auto; }
.nml-session-header {
  margin-bottom: 24px;
}
.nml-session-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.nml-session-counter {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.nml-session-mode-pill {
  background: var(--nml-blue-light);
  color: var(--nml-blue);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.nml-session-q-num {
  font-size: 14px;
  color: var(--nml-text-mid);
}
.nml-session-q-num strong {
  color: var(--nml-text);
  font-family: var(--font-mono);
}
.nml-session-abandon {
  background: none;
  border: none;
  color: var(--nml-text-muted);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
}
.nml-session-abandon:hover { color: var(--nml-red); }

.nml-session-progress-track {
  height: 4px;
  background: var(--nml-bg-soft);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 12px;
}
.nml-session-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--nml-blue), var(--nml-green));
  transition: width var(--dur-base) var(--ease-out);
}

/* ─── ITDE progress mini ─── */
.nml-itde-progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.nml-itde-progress-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-s);
  padding: 8px 12px;
}
.nml-itde-progress-letter {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nml-itde-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--nml-bg-soft);
  border-radius: 2px;
  overflow: hidden;
}
.nml-itde-progress-bar-fill {
  height: 100%;
  transition: width var(--dur-base) var(--ease-out);
}
.nml-itde-progress-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--nml-text-mid);
  font-weight: 700;
  min-width: 28px;
  text-align: right;
}

/* ─── Question card ─── */
.nml-q-card {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-l);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.nml-q-text {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--nml-text);
  margin: 16px 0 24px;
}
.nml-q-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nml-q-option {
  background: var(--nml-bg-white);
  border: 2px solid var(--nml-border);
  border-radius: var(--radius-s);
  padding: 14px 18px;
  text-align: left;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  font-family: var(--font-primary);
  min-width: 0;
}
.nml-q-option:hover:not(:disabled) {
  border-color: var(--nml-blue);
  transform: translateX(2px);
}
.nml-q-option-letter {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--nml-bg-soft);
  color: var(--nml-text-mid);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all var(--dur-fast) var(--ease-out);
}
.nml-q-option-text {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: var(--nml-text);
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  text-align: left;
}
.nml-q-option-icon {
  font-size: 18px;
  font-weight: 700;
  margin-left: auto;
}
.nml-q-option-selected {
  border-color: var(--nml-blue);
  background: var(--nml-blue-light);
}
.nml-q-option-selected .nml-q-option-letter {
  background: var(--nml-blue);
  color: #fff;
}
.nml-q-option-correct {
  border-color: var(--nml-green);
  background: var(--nml-green-light);
}
.nml-q-option-correct .nml-q-option-letter {
  background: var(--nml-green);
  color: #fff;
}
.nml-q-option-correct .nml-q-option-icon { color: var(--nml-green); }
.nml-q-option-wrong {
  border-color: var(--nml-red);
  background: var(--nml-red-light);
}
.nml-q-option-wrong .nml-q-option-letter {
  background: var(--nml-red);
  color: #fff;
}
.nml-q-option-wrong .nml-q-option-icon { color: var(--nml-red); }
.nml-q-option:disabled {
  cursor: default;
  transform: none;
}

/* ─── Feedback ─── */
.nml-q-feedback {
  margin-top: 20px;
  padding: 16px;
  border-radius: var(--radius-s);
  border-left: 4px solid;
}
.nml-q-feedback-correct {
  background: var(--nml-green-light);
  border-color: var(--nml-green);
}
.nml-q-feedback-wrong {
  background: var(--nml-red-light);
  border-color: var(--nml-red);
}
.nml-q-feedback-head {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}
.nml-q-feedback-correct .nml-q-feedback-head { color: #166534; }
.nml-q-feedback-wrong .nml-q-feedback-head { color: #991B1B; }
.nml-q-feedback-head span {
  font-family: var(--font-mono);
  font-size: 13px;
  margin-left: 6px;
}
.nml-q-feedback-explanation {
  font-size: 13px;
  line-height: 1.5;
  color: var(--nml-text-mid);
}

/* ─── Session footer ─── */
.nml-session-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  align-items: center;
  margin-top: 8px;
}

/* ─── Result hero ─── */
.nml-result-hero {
  text-align: center;
  padding: 32px 0;
  margin-bottom: 24px;
}
.nml-result-emoji {
  font-size: 64px;
  margin-bottom: 16px;
  line-height: 1;
}

/* ─── Result ITDE breakdown ─── */
.nml-result-itde {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nml-result-itde-row {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-s);
  border-left-width: 4px;
}
.nml-result-itde-row.passed { border-left-color: var(--nml-green); }
.nml-result-itde-row.failed { border-left-color: var(--nml-red); }
.nml-result-itde-score {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nml-result-itde-num {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--nml-text);
}
.nml-result-itde-pass {
  font-size: 12px;
  font-weight: 600;
}
.passed .nml-result-itde-pass { color: var(--nml-green); }
.failed .nml-result-itde-pass { color: var(--nml-red); }
.nml-result-itde-points {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--nml-blue);
}

/* ─── Tabs ─── */
.nml-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 24px;
  border-bottom: 2px solid var(--nml-border);
  flex-wrap: wrap;
}
.nml-tab {
  background: none;
  border: none;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--nml-text-mid);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--dur-fast) var(--ease-out);
}
.nml-tab:hover { color: var(--nml-text); }
.nml-tab.active {
  color: var(--nml-blue);
  border-bottom-color: var(--nml-blue);
}

/* ─── Challenge cards ─── */
.nml-challenge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.nml-challenge-card {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-m);
  padding: 20px;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  box-shadow: var(--shadow-sm);
}
.nml-challenge-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--nml-blue-border);
}
.nml-challenge-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.nml-challenge-completed-pill {
  background: var(--nml-green-light);
  color: #166534;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 10px;
}
.nml-challenge-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--nml-text);
  margin: 0 0 8px;
  line-height: 1.3;
}
.nml-challenge-card-desc {
  font-size: 13px;
  color: var(--nml-text-mid);
  margin: 0 0 12px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nml-challenge-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--nml-text-muted);
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.nml-challenge-card-deadline {
  font-size: 12px;
  font-weight: 600;
  color: var(--nml-amber);
}
.nml-challenge-card-result {
  font-size: 13px;
  font-weight: 600;
  color: var(--nml-green);
  font-family: var(--font-mono);
}

/* ─── Challenge timer ─── */
.nml-challenge-timer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-m);
  padding: 14px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.nml-timer-display {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--nml-blue);
}
.nml-timer-urgent { color: var(--nml-red); animation: nml-pulse 1s ease-in-out infinite; }
@keyframes nml-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ─── Leaderboard ─── */
.nml-podium {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: end;
  gap: 12px;
  max-width: 600px;
  margin: 24px auto 0;
}
.nml-podium-spot {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-m);
  padding: 16px 12px;
  text-align: center;
  position: relative;
}
.nml-podium-1 { border-color: #FCD34D; background: linear-gradient(180deg, #FEF3C7 0%, #fff 100%); }
.nml-podium-2 { border-color: #CBD5E1; }
.nml-podium-3 { border-color: #D4A574; }
.nml-podium-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--nml-blue);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
}
.nml-podium-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--nml-text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nml-podium-value {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--nml-blue);
}
.nml-podium-rank {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--nml-text);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 10px;
}
.nml-podium-1 .nml-podium-rank { background: #F59E0B; }
.nml-podium-2 .nml-podium-rank { background: #64748B; }
.nml-podium-3 .nml-podium-rank { background: #A0522D; }

.nml-leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nml-leaderboard-row {
  display: grid;
  grid-template-columns: 50px 40px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-s);
}
.nml-leaderboard-row.is-me {
  border-color: var(--nml-blue);
  background: var(--nml-blue-light);
}
.nml-lb-rank {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--nml-text-mid);
}
.nml-lb-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--nml-bg-soft);
  color: var(--nml-text);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nml-lb-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--nml-text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.nml-lb-you {
  background: var(--nml-blue);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}
.nml-lb-value {
  text-align: right;
}
.nml-lb-num {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--nml-text);
}
.nml-lb-sub {
  font-size: 11px;
  color: var(--nml-text-muted);
}

.nml-sticky-my-rank {
  position: sticky;
  bottom: 12px;
  margin-top: 16px;
  background: var(--nml-blue);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius-s);
  display: grid;
  grid-template-columns: 50px 1fr auto;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 24px rgba(47,107,255,0.30);
}
.nml-sticky-my-rank .nml-lb-rank,
.nml-sticky-my-rank .nml-lb-name,
.nml-sticky-my-rank .nml-lb-num { color: #fff; }
.nml-sticky-my-rank .nml-lb-sub { color: rgba(255,255,255,0.7); }

/* ─── Mobile ─── */
@media (max-width: 880px) {
  .nml-mode-tabs { grid-template-columns: 1fr; }
  .nml-itde-progress { grid-template-columns: 1fr 1fr; }
  .nml-result-itde-row { grid-template-columns: 1fr; gap: 8px; }
  .nml-q-text { font-size: 16px; }
  .nml-leaderboard-row { grid-template-columns: 40px 32px 1fr auto; padding: 10px 12px; }
}

/* ============================================================
   PRACTICE FLOW — ported from practice-flow-mockup.html
   ============================================================ */

/* Screen container */
.nml-screen {
  max-width: 880px;
  margin: 0 auto;
}

.nml-screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.nml-screen-back {
  display: flex; align-items: center; gap: 8px;
  background: none;
  border: none;
  color: var(--nml-text-mid);
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius-s);
  margin-left: -12px;
  transition: all var(--dur-fast) var(--ease-out);
}
.nml-screen-back:hover { background: var(--nml-bg-white); color: var(--nml-text); }
.nml-screen-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--nml-text);
  letter-spacing: -0.02em;
}

/* ─── Resume banner ─── */
.nml-resume-card {
  background: linear-gradient(135deg, var(--nml-blue-light) 0%, #fff 100%);
  border: 1px solid var(--nml-blue-border);
  border-radius: var(--radius-l);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-md);
}
.nml-resume-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-m);
  background: var(--nml-blue);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nml-resume-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--nml-text);
  margin-bottom: 4px;
}
.nml-resume-sub {
  font-size: 13px;
  color: var(--nml-text-mid);
}
.nml-resume-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.nml-btn-secondary-soft {
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--nml-border);
  color: var(--nml-text-mid);
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--radius-s);
  cursor: pointer;
  transition: all var(--dur-fast);
}
.nml-btn-secondary-soft:hover { background: #fff; color: var(--nml-red); border-color: var(--nml-red); }
.nml-btn-resume {
  background: var(--nml-blue);
  color: #fff;
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: var(--radius-s);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(47,107,255,0.25);
}
.nml-btn-resume:hover { background: var(--nml-blue-dark); }

/* ─── Mode picker ─── */
.nml-mode-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 32px;
}
.nml-mode-card {
  background: var(--nml-bg-white);
  border: 2px solid var(--nml-border);
  border-radius: var(--radius-l);
  padding: 24px;
  cursor: pointer;
  position: relative;
  transition: all var(--dur-base) var(--ease-spring, cubic-bezier(0.34,1.56,0.64,1));
  box-shadow: var(--shadow-sm);
}
.nml-mode-card:hover:not(.locked) {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.nml-mode-card.selected {
  border-color: var(--nml-blue);
  box-shadow: 0 0 0 4px rgba(47,107,255,0.10), var(--shadow-md);
}
.nml-mode-card.locked { opacity: 0.7; }

.nml-mode-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}
.nml-mode-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-m);
  background: var(--nml-blue-light);
  color: var(--nml-blue);
  display: flex; align-items: center; justify-content: center;
}
.nml-mode-card.unlock .nml-mode-icon {
  background: rgba(34,197,94,0.10);
  color: var(--nml-green);
}
.nml-mode-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 4px;
}
.nml-mode-badge-free { background: var(--nml-green-light); color: #166534; }
.nml-mode-badge-premium { background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%); color: #92400E; }

.nml-mode-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--nml-text);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.nml-mode-desc {
  font-size: 13px;
  color: var(--nml-text-mid);
  line-height: 1.6;
  margin-bottom: 16px;
}

.nml-mode-feats { list-style: none; padding: 0; margin: 0; }
.nml-mode-feats li {
  font-size: 12px;
  color: var(--nml-text-mid);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
}
.nml-mode-feats li svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--nml-green);
}

.nml-mode-lock-banner {
  background: rgba(255,255,255,0.9);
  border-top: 1px solid var(--nml-border);
  margin: 16px -24px -24px;
  padding: 14px 24px;
  border-radius: 0 0 var(--radius-l) var(--radius-l);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--nml-text-mid);
}
.nml-mode-lock-banner svg { color: var(--nml-amber); flex-shrink: 0; }

/* ─── Config card ─── */
.nml-config-card {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-l);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.nml-config-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--nml-text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nml-step-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--nml-blue);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nml-config-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.nml-field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--nml-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  display: block;
}
.nml-field-hint {
  color: var(--nml-text-muted);
  text-transform: none;
  font-weight: 400;
}

/* Select wrap */
.nml-select-wrap {
  position: relative;
}
.nml-select-wrap select {
  width: 100%;
  padding: 10px 32px 10px 14px;
  background: var(--nml-bg-surface);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-s);
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 600;
  color: var(--nml-text);
  appearance: none;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.nml-select-wrap select:hover,
.nml-select-wrap select:focus { border-color: var(--nml-blue); outline: none; }
.nml-select-wrap::after {
  content: '';
  position: absolute;
  right: 14px; top: 50%;
  width: 8px; height: 8px;
  border-right: 2px solid var(--nml-text-muted);
  border-bottom: 2px solid var(--nml-text-muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

/* Level segmented control */
.nml-level-seg {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 4px;
  background: var(--nml-bg-surface);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-s);
}
.nml-level-opt {
  padding: 9px 10px;
  border-radius: 6px;
  font-family: var(--font-primary);
  font-size: 12px;
  font-weight: 600;
  color: var(--nml-text-mid);
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all var(--dur-fast) var(--ease-out);
}
.nml-level-opt:hover:not(.locked):not(.selected) {
  background: rgba(47,107,255,0.06);
  color: var(--nml-text);
}
.nml-level-opt.selected {
  background: var(--nml-blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(47,107,255,0.20);
}
.nml-level-opt.unlocked:not(.selected) {
  color: var(--nml-text);
}
.nml-level-opt.unlocked:not(.selected)::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--nml-green);
  margin-right: 2px;
}
.nml-level-opt.locked {
  color: var(--nml-text-muted);
  background: rgba(15,23,42,0.03);
  cursor: not-allowed;
  opacity: 0.7;
}

.nml-level-helper {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--nml-text-muted);
  line-height: 1.4;
}
.nml-level-helper b { color: var(--nml-text); font-weight: 600; }

.nml-locked-warning {
  background: var(--nml-amber-light);
  border: 1px solid #FCD34D;
  border-radius: var(--radius-s);
  padding: 12px 14px;
  margin-top: 10px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  color: #92400E;
  line-height: 1.55;
}
.nml-locked-warning svg { color: var(--nml-amber); flex-shrink: 0; margin-top: 1px; }
.nml-locked-warning b { color: #78350F; font-weight: 700; }

/* Chips */
.nml-chips-row { display: flex; flex-wrap: wrap; gap: 6px; }
.nml-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  background: var(--nml-bg-surface);
  border: 1px solid var(--nml-border);
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--nml-text-mid);
  cursor: pointer;
  font-family: var(--font-primary);
  transition: all var(--dur-fast) var(--ease-out);
}
.nml-chip:hover { border-color: var(--nml-blue); color: var(--nml-blue); }
.nml-chip.selected {
  background: var(--nml-blue);
  color: #fff;
  border-color: var(--nml-blue);
}

/* Slider */
.nml-slider-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.nml-slider-val {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--nml-blue);
  min-width: 50px;
  letter-spacing: -0.02em;
}
.nml-slider-row input[type="range"] {
  flex: 1;
  height: 6px;
  background: var(--nml-bg-soft);
  border-radius: 3px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.nml-slider-row input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 20px; height: 20px;
  background: var(--nml-blue);
  border: 3px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(47,107,255,0.30);
}
.nml-slider-row input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px;
  background: var(--nml-blue);
  border: 3px solid #fff;
  border-radius: 50%;
  cursor: pointer;
}

/* Unlock info */
.nml-unlock-info {
  background: linear-gradient(135deg, rgba(34,197,94,0.06) 0%, rgba(47,107,255,0.06) 100%);
  border: 1px solid rgba(34,197,94,0.20);
  border-radius: var(--radius-m);
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 14px;
}
.nml-unlock-info svg { flex-shrink: 0; color: var(--nml-green); }
.nml-unlock-info-text {
  font-size: 12px;
  color: var(--nml-text-mid);
  line-height: 1.6;
}
.nml-unlock-info-text b { color: var(--nml-text); font-weight: 700; }

/* Error banner */
.nml-error-banner {
  background: var(--nml-red-light);
  border: 1px solid rgba(220,38,38,0.30);
  border-left: 4px solid var(--nml-red);
  border-radius: var(--radius-m);
  padding: 14px 16px;
  margin-top: 12px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
  color: #991B1B;
}
.nml-error-banner svg { color: var(--nml-red); flex-shrink: 0; margin-top: 1px; }

/* Start button */
.nml-start-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}
.nml-btn-start {
  background: var(--nml-blue);
  color: #fff;
  font-family: var(--font-primary);
  font-size: 15px;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: var(--radius-s);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--dur-fast) var(--ease-out);
  box-shadow: 0 4px 12px rgba(47,107,255,0.25);
}
.nml-btn-start:hover:not(:disabled) {
  background: var(--nml-blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(47,107,255,0.35);
}
.nml-btn-start:disabled { opacity: 0.5; cursor: not-allowed; }

/* ─── Question screen ─── */
.nml-q-topbar {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-m);
  padding: 14px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}
.nml-q-back {
  background: var(--nml-bg-surface);
  border: 1px solid var(--nml-border);
  width: 34px; height: 34px;
  border-radius: var(--radius-s);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--nml-text-mid);
}
.nml-q-back:hover { background: var(--nml-bg-soft); color: var(--nml-text); }
.nml-q-mode-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 12px;
}
.nml-q-mode-daily { background: var(--nml-blue-light); color: var(--nml-blue); }
.nml-q-mode-unlock { background: rgba(34,197,94,0.12); color: #166534; }
.nml-q-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  font-size: 12px;
  color: var(--nml-text-mid);
  font-weight: 500;
}
.nml-q-meta-item { display: flex; align-items: center; gap: 5px; }
.nml-q-meta-emp { color: var(--nml-text); font-weight: 600; }

/* Progress card */
.nml-q-progress-card {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-m);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.nml-q-progress-simple {
  display: flex;
  align-items: center;
  gap: 16px;
}
.nml-q-progress-text {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--nml-text);
  letter-spacing: -0.02em;
}
.nml-q-progress-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--nml-bg-soft);
  border-radius: 4px;
  overflow: hidden;
}
.nml-q-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--nml-blue) 0%, var(--nml-green) 100%);
  border-radius: 4px;
  transition: width var(--dur-base) var(--ease-out);
}

/* ITDE quadrant progress */
.nml-itde-progress-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.nml-itde-prog {
  background: var(--nml-bg-surface);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-s);
  padding: 10px 12px;
}
.nml-itde-prog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.nml-itde-prog-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.nml-itde-prog-name-i, .nml-itde-prog-name-t { color: var(--nml-blue); }
.nml-itde-prog-name-d, .nml-itde-prog-name-e { color: var(--nml-green); }
.nml-itde-prog-count {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--nml-text);
}
.nml-itde-prog-bar {
  height: 4px;
  background: rgba(15,23,42,0.06);
  border-radius: 2px;
  overflow: hidden;
}
.nml-itde-prog-fill {
  height: 100%;
  border-radius: 2px;
  transition: width var(--dur-base);
}
.nml-itde-prog-blue { background: var(--nml-blue); }
.nml-itde-prog-green { background: var(--nml-green); }

/* Question card */
.nml-q-card {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-l);
  padding: 32px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
}
.nml-q-num-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.nml-q-num-pill {
  background: var(--nml-blue-light);
  color: var(--nml-blue);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  letter-spacing: -0.01em;
}
.nml-comp-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 12px;
}
.nml-comp-insight, .nml-comp-thinking { background: var(--nml-blue-light); color: var(--nml-blue); }
.nml-comp-development, .nml-comp-execution { background: var(--nml-green-light); color: #166534; }

.nml-q-text {
  font-size: 19px;
  font-weight: 600;
  color: var(--nml-text);
  line-height: 1.55;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}

/* Options */
.nml-q-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nml-q-option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background: var(--nml-bg-white);
  border: 2px solid var(--nml-border);
  border-radius: var(--radius-m);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  text-align: left;
  font-family: var(--font-primary);
  width: 100%;
}
.nml-q-option:hover:not(:disabled):not(.disabled) {
  border-color: var(--nml-blue-border);
  background: var(--nml-bg-surface);
}
.nml-q-option-letter {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--nml-bg-soft);
  color: var(--nml-text-mid);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nml-q-option-text {
  flex: 1;
  font-size: 14.5px;
  color: var(--nml-text);
  line-height: 1.55;
  padding-top: 3px;
}
.nml-q-option-check {
  width: 22px; height: 22px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--dur-fast);
  margin-top: 2px;
}
.nml-q-option.selected {
  border-color: var(--nml-blue);
  background: var(--nml-blue-light);
}
.nml-q-option.selected .nml-q-option-letter { background: var(--nml-blue); color: #fff; }
.nml-q-option.selected .nml-q-option-check { opacity: 1; color: var(--nml-blue); }
.nml-q-option.correct {
  border-color: var(--nml-green);
  background: var(--nml-green-light);
}
.nml-q-option.correct .nml-q-option-letter { background: var(--nml-green); color: #fff; }
.nml-q-option.correct .nml-q-option-check { opacity: 1; color: var(--nml-green); }
.nml-q-option.incorrect {
  border-color: var(--nml-red);
  background: var(--nml-red-light);
}
.nml-q-option.incorrect .nml-q-option-letter { background: var(--nml-red); color: #fff; }
.nml-q-option.incorrect .nml-q-option-check { opacity: 1; color: var(--nml-red); }
.nml-q-option.disabled { opacity: 0.55; cursor: default; }
.nml-q-option:disabled { cursor: default; }

/* Feedback */
.nml-feedback-block {
  background: var(--nml-green-light);
  border: 1px solid rgba(34,197,94,0.30);
  border-left: 4px solid var(--nml-green);
  border-radius: var(--radius-m);
  padding: 18px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.nml-feedback-block.incorrect {
  background: var(--nml-red-light);
  border-color: rgba(220,38,38,0.30);
  border-left-color: var(--nml-red);
}
.nml-feedback-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--nml-green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nml-feedback-block.incorrect .nml-feedback-icon { background: var(--nml-red); }
.nml-feedback-content { flex: 1; }
.nml-feedback-title {
  font-size: 15px;
  font-weight: 700;
  color: #166534;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nml-feedback-block.incorrect .nml-feedback-title { color: #991B1B; }
.nml-feedback-points {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(34,197,94,0.15);
  color: #166534;
}
.nml-feedback-text {
  font-size: 13.5px;
  color: var(--nml-text);
  line-height: 1.6;
}

/* Unlock info inline (during session) */
.nml-unlock-info-inline {
  background: rgba(34,197,94,0.06);
  border: 1px dashed rgba(34,197,94,0.30);
  border-radius: var(--radius-m);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--nml-text-mid);
}
.nml-unlock-info-inline svg { color: var(--nml-green); }
.nml-unlock-info-inline b { color: var(--nml-text); }

/* Action bar */
.nml-q-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.nml-btn-prev {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  color: var(--nml-text-mid);
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: var(--radius-s);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--dur-fast) var(--ease-out);
}
.nml-btn-prev:hover:not(:disabled) {
  border-color: var(--nml-text-mid);
  color: var(--nml-text);
}
.nml-btn-prev:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.nml-btn-next {
  background: var(--nml-blue);
  color: #fff;
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: var(--radius-s);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--dur-fast) var(--ease-out);
  box-shadow: 0 4px 12px rgba(47,107,255,0.20);
}
.nml-btn-next:hover:not(:disabled) {
  background: var(--nml-blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(47,107,255,0.30);
}
.nml-btn-next:disabled { opacity: 0.5; cursor: not-allowed; }
.nml-btn-next.submit {
  background: var(--nml-green);
  box-shadow: 0 4px 12px rgba(34,197,94,0.25);
}
.nml-btn-next.submit:hover { background: #16A34A; box-shadow: 0 6px 16px rgba(34,197,94,0.35); }

/* ─── Result screen ─── */
.nml-result-hero {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-l);
  padding: 32px;
  margin-bottom: 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.nml-result-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--nml-green) 0%, var(--nml-blue) 100%);
}
.nml-result-hero.fail::before {
  background: linear-gradient(90deg, var(--nml-amber) 0%, var(--nml-red) 100%);
}
.nml-result-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--nml-green-light);
  color: #166534;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 16px;
  margin-bottom: 14px;
}
.nml-result-badge.fail {
  background: var(--nml-amber-light);
  color: #92400E;
}
.nml-result-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--nml-text);
  letter-spacing: -0.025em;
  margin-bottom: 8px;
  line-height: 1.15;
}
.nml-result-sub {
  font-size: 15px;
  color: var(--nml-text-mid);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.55;
}
.nml-result-score-row {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--nml-border);
  flex-wrap: wrap;
}
.nml-score-item { text-align: center; }
.nml-score-val {
  font-family: var(--font-mono);
  font-size: 42px;
  font-weight: 700;
  color: var(--nml-text);
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}
.nml-score-val.success { color: var(--nml-green); }
.nml-score-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--nml-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ITDE breakdown */
.nml-itde-breakdown {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-l);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.nml-section-h {
  font-size: 17px;
  font-weight: 700;
  color: var(--nml-text);
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}
.nml-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.nml-breakdown-card {
  background: var(--nml-bg-surface);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-m);
  padding: 16px 18px;
}
.nml-breakdown-card.pass { border-color: var(--nml-green); background: var(--nml-green-light); }
.nml-breakdown-card.fail { border-color: var(--nml-amber); background: var(--nml-amber-light); }
.nml-breakdown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.nml-breakdown-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--nml-text);
  letter-spacing: -0.01em;
}
.nml-breakdown-status {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.nml-breakdown-card.pass .nml-breakdown-status { background: var(--nml-green); color: #fff; }
.nml-breakdown-card.fail .nml-breakdown-status { background: var(--nml-amber); color: #fff; }
.nml-breakdown-score {
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 700;
  color: var(--nml-text);
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}
.nml-denom {
  color: var(--nml-text-muted);
  font-size: 18px;
}
.nml-breakdown-pct {
  font-size: 11px;
  font-weight: 600;
  color: var(--nml-text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.nml-breakdown-bar {
  height: 5px;
  background: rgba(15,23,42,0.06);
  border-radius: 3px;
  overflow: hidden;
}
.nml-breakdown-bar-fill {
  height: 100%;
  border-radius: 3px;
}
.nml-breakdown-card.pass .nml-breakdown-bar-fill { background: var(--nml-green); }
.nml-breakdown-card.fail .nml-breakdown-bar-fill { background: var(--nml-amber); }
.nml-breakdown-points {
  font-size: 11px;
  font-weight: 700;
  color: var(--nml-green);
  margin-top: 8px;
  font-family: var(--font-mono);
}
.nml-breakdown-card.fail .nml-breakdown-points { color: var(--nml-amber); }

/* Result actions */
.nml-result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}
.nml-btn-review {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  color: var(--nml-text);
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 600;
  padding: 14px;
  border-radius: var(--radius-s);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.nml-btn-review:hover { border-color: var(--nml-text-mid); }
.nml-btn-continue {
  background: var(--nml-green);
  color: #fff;
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 700;
  padding: 14px;
  border-radius: var(--radius-s);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(34,197,94,0.25);
}
.nml-btn-continue:hover {
  background: #16A34A !important;
  color: #fff !important;
  transform: translateY(-1px);
}
.nml-btn-continue:hover svg { color: #fff !important; stroke: #fff !important; }

/* Responsive */
@media (max-width: 760px) {
  .nml-mode-picker { grid-template-columns: 1fr; }
  .nml-config-grid { grid-template-columns: 1fr; }
  .nml-config-grid > div[style*="span 2"] { grid-column: span 1 !important; }
  .nml-level-seg { grid-template-columns: 1fr 1fr; }
  .nml-itde-progress-grid { grid-template-columns: repeat(2,1fr); }
  .nml-breakdown-grid { grid-template-columns: repeat(2,1fr); }
  .nml-result-score-row { gap: 24px; }
  .nml-result-title { font-size: 24px; }
  .nml-q-card { padding: 22px; }
  .nml-q-text { font-size: 17px; }
}


/* ============================================================
   PRACTICE REVIEW PAGE
   ============================================================ */

/* 3-button result actions row */
.nml-result-actions-3 {
  grid-template-columns: 1fr 1fr 1fr;
}
@media (max-width: 600px) {
  .nml-result-actions-3 { grid-template-columns: 1fr; }
}

/* Summary banner */
.nml-review-summary {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-m);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.nml-review-summary-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nml-review-summary-mode {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--nml-blue);
}
.nml-review-summary-sub {
  font-size: 13px;
  color: var(--nml-text-mid);
}
.nml-review-summary-stats {
  display: flex;
  gap: 24px;
}
.nml-review-stat {
  text-align: right;
}
.nml-review-stat-val {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--nml-text);
  letter-spacing: -0.02em;
  line-height: 1;
}
.nml-review-stat-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--nml-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

/* Filter tabs */
.nml-review-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.nml-review-filter {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  color: var(--nml-text-mid);
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-s);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.nml-review-filter:hover { border-color: var(--nml-blue); color: var(--nml-blue); }
.nml-review-filter.active {
  background: var(--nml-blue);
  color: #fff;
  border-color: var(--nml-blue);
}
.nml-review-filter-correct.active {
  background: var(--nml-green);
  border-color: var(--nml-green);
}
.nml-review-filter-wrong.active {
  background: var(--nml-red);
  border-color: var(--nml-red);
}

/* Review item */
.nml-review-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.nml-review-item {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-left: 4px solid var(--nml-border);
  border-radius: var(--radius-m);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.nml-review-item.correct { border-left-color: var(--nml-green); }
.nml-review-item.wrong   { border-left-color: var(--nml-red); }

.nml-review-item-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.nml-review-item-num {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--nml-text-mid);
  background: var(--nml-bg-soft);
  padding: 3px 10px;
  border-radius: 12px;
}
.nml-review-item-status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 12px;
}
.nml-review-item-status.correct {
  background: var(--nml-green-light);
  color: #166534;
}
.nml-review-item-status.wrong {
  background: var(--nml-red-light);
  color: #991B1B;
}

.nml-review-item-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--nml-text);
  line-height: 1.5;
  margin-bottom: 14px;
}

/* Option rows */
.nml-review-item-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.nml-review-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: var(--nml-bg-surface);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-s);
  font-size: 13px;
  line-height: 1.5;
}
.nml-review-opt.correct {
  background: var(--nml-green-light);
  border-color: var(--nml-green);
}
.nml-review-opt.wrong {
  background: var(--nml-red-light);
  border-color: var(--nml-red);
}
.nml-review-opt-letter {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--nml-bg-soft);
  color: var(--nml-text-mid);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nml-review-opt.correct .nml-review-opt-letter {
  background: var(--nml-green); color: #fff;
}
.nml-review-opt.wrong .nml-review-opt-letter {
  background: var(--nml-red); color: #fff;
}
.nml-review-opt-text {
  flex: 1;
  color: var(--nml-text);
}
.nml-review-opt-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  margin-top: 2px;
}
.nml-review-opt.correct .nml-review-opt-label { color: #166534; }
.nml-review-opt.wrong   .nml-review-opt-label { color: #991B1B; }

/* Explanation block */
.nml-review-item-explanation {
  background: var(--nml-blue-light);
  border-left: 3px solid var(--nml-blue);
  border-radius: var(--radius-s);
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--nml-text);
  line-height: 1.6;
}
.nml-review-item-explanation-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--nml-blue);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

@media (max-width: 600px) {
  .nml-review-summary { flex-direction: column; align-items: stretch; }
  .nml-review-summary-stats { justify-content: space-between; }
  .nml-review-opt-label { display: none; }
}

/* ============================================================
   DASHBOARD — ported from nml-dashboard-mockup.html
   ============================================================ */

.nml-dash {
  max-width: 1280px;
  margin: 0 auto;
}

/* Topbar */
.nml-dash-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 24px;
  flex-wrap: wrap;
}
.nml-dash-greeting h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--nml-text);
  letter-spacing: -0.025em;
  margin: 0 0 4px;
  line-height: 1.15;
}
.nml-dash-greeting p {
  font-size: 13px;
  color: var(--nml-text-mid);
  margin: 0;
}
.nml-dash-wave {
  display: inline-block;
  animation: wave 2s ease-in-out infinite;
  transform-origin: 70% 70%;
}
@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(15deg); }
  75% { transform: rotate(-10deg); }
}
.nml-dash-topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.nml-dash-progress-pill {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: 30px;
  padding: 8px 18px 8px 14px;
  box-shadow: var(--shadow-sm);
}
.nml-dash-pill-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--nml-text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.nml-dash-pill-val {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--nml-text);
  letter-spacing: -0.02em;
}
.nml-dash-pill-bar-wrap {
  width: 80px;
  height: 5px;
  background: var(--nml-bg-soft);
  border-radius: 3px;
  overflow: hidden;
}
.nml-dash-pill-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--nml-blue) 0%, var(--nml-green) 100%);
  border-radius: 3px;
}

/* Resume banner above ITDE */
.nml-dash-resume-banner {
  background: linear-gradient(135deg, var(--nml-blue-light) 0%, #fff 100%);
  border: 1px solid var(--nml-blue-border);
  border-radius: var(--radius-m);
  padding: 14px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}
.nml-dash-resume-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--nml-blue);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nml-dash-resume-info { flex: 1; min-width: 0; }
.nml-dash-resume-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--nml-text);
  margin-bottom: 2px;
}
.nml-dash-resume-sub {
  font-size: 12px;
  color: var(--nml-text-mid);
}
.nml-dash-resume-btn {
  background: var(--nml-blue);
  color: #fff;
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: var(--radius-s);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(47,107,255,0.25);
}
.nml-dash-resume-btn:hover { background: var(--nml-blue-dark); transform: translateY(-1px); }

/* ─── ITDE Hero Card ─── */
.nml-itde-card {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-l);
  padding: 28px 32px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.nml-itde-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--nml-blue) 0%, var(--nml-green) 100%);
}
.nml-itde-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: start;
  gap: 0;
}
.nml-itde-node {
  text-align: center;
  padding: 0 8px;
}
.nml-itde-glass {
  width: 76px; height: 76px;
  margin: 0 auto 14px;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.85);
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,0.95),
    0 8px 20px rgba(47,107,255,0.10);
  overflow: hidden;
  transition: transform var(--dur-base) var(--ease-spring), box-shadow var(--dur-base) var(--ease-out);
}
.nml-itde-glass::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 45%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.45), transparent);
  border-radius: 18px 18px 0 0;
  pointer-events: none;
}
.nml-itde-glass:hover {
  transform: translateY(-4px);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,0.95), 0 12px 28px rgba(47,107,255,0.16);
}
.nml-glass-i, .nml-glass-t { background: rgba(47,107,255,0.10); border-color: rgba(47,107,255,0.22); }
.nml-glass-d, .nml-glass-e { background: rgba(34,197,94,0.10); border-color: rgba(34,197,94,0.22); }

.nml-itde-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--nml-text-muted);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.nml-itde-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--nml-text);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.nml-itde-desc {
  font-size: 11px;
  color: var(--nml-text-mid);
  line-height: 1.5;
  max-width: 130px;
  margin: 0 auto;
}
.nml-itde-conn {
  display: flex;
  align-items: center;
  padding-top: 38px;
  min-width: 32px;
}
.nml-itde-line {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--nml-blue) 0%, var(--nml-green) 100%);
  opacity: 0.4;
  border-radius: 1px;
  position: relative;
}
.nml-itde-line::after {
  content: '';
  position: absolute;
  right: -2px; top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 6px;
  background: var(--nml-text-muted);
  border-radius: 50%;
  opacity: 0.5;
}

/* ─── 3 KPI stat cards ─── */
.nml-dash-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.nml-dash-stat-card {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-m);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-base) var(--ease-spring), box-shadow var(--dur-base) var(--ease-out);
}
.nml-dash-stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.nml-dash-stat-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nml-dash-stat-icon-blue { background: var(--nml-blue-light); color: var(--nml-blue); }
.nml-dash-stat-icon-green { background: var(--nml-green-light); color: var(--nml-green); }
.nml-dash-stat-icon-amber { background: #FEF3C7; color: #B45309; }
.nml-dash-stat-body { flex: 1; min-width: 0; }
.nml-dash-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--nml-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.nml-dash-stat-val {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  color: var(--nml-text);
  letter-spacing: -0.03em;
  line-height: 1;
}
.nml-dash-stat-delta {
  font-size: 11px;
  color: var(--nml-green);
  font-weight: 600;
  margin-top: 4px;
}
.nml-dash-stat-delta.neg { color: var(--nml-red); }

/* ─── 2-Col: Continue + Challenge ─── */
.nml-dash-two-col {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

/* Continue Learning */
.nml-dash-continue-card {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-m);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.nml-dash-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--nml-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}
.nml-dash-module-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: var(--radius-s);
  background: var(--nml-bg-surface);
  transition: background var(--dur-fast) var(--ease-out);
}
.nml-dash-module-row + .nml-dash-module-row { margin-top: 10px; }
.nml-dash-module-row:hover { background: var(--nml-blue-light); }
.nml-dash-module-thumb {
  width: 48px; height: 48px;
  border-radius: var(--radius-s);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(15,23,42,0.10);
}
.nml-dash-module-info { flex: 1; min-width: 0; }
.nml-dash-module-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--nml-text);
  margin-bottom: 4px;
}
.nml-dash-module-meta {
  font-size: 11px;
  color: var(--nml-text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.nml-dash-module-dot {
  width: 3px; height: 3px;
  background: var(--nml-text-muted);
  border-radius: 50%;
}
.nml-dash-module-progress {
  margin-top: 8px;
  height: 5px;
  background: rgba(255,255,255,0.6);
  border-radius: 3px;
  overflow: hidden;
}
.nml-dash-module-progress-fill {
  height: 100%;
  border-radius: 3px;
}
.nml-dash-btn-resume {
  background: var(--nml-blue);
  color: #fff;
  font-family: var(--font-primary);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-s);
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--dur-fast) var(--ease-out);
}
.nml-dash-btn-resume:hover {
  background: var(--nml-blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(47,107,255,0.30);
}

/* Weekly Challenge banner */
.nml-dash-challenge-banner {
  background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 100%);
  border: 1px solid #FED7AA;
  border-radius: var(--radius-m);
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.nml-dash-challenge-title {
  font-size: 15px;
  font-weight: 700;
  color: #9A3412;
  margin-bottom: 4px;
}
.nml-dash-challenge-sub {
  font-size: 12px;
  color: #C2410C;
  margin-bottom: 14px;
}
.nml-dash-countdown {
  display: flex;
  gap: 8px;
}
.nml-dash-cd-block {
  flex: 1;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: var(--radius-s);
  padding: 8px 6px;
  text-align: center;
}
.nml-dash-cd-val {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: #9A3412;
  line-height: 1;
  letter-spacing: -0.02em;
}
.nml-dash-cd-label {
  font-size: 9px;
  color: #C2410C;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}
.nml-dash-btn-challenge {
  margin-top: 14px;
  width: 100%;
  background: var(--nml-text);
  color: #fff;
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--radius-s);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--dur-fast) var(--ease-out);
}
.nml-dash-btn-challenge:hover { background: #1E293B; transform: translateY(-1px); }

/* ─── Function progress grid ─── */
.nml-dash-fn-section { margin-bottom: 20px; }
.nml-dash-fn-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.nml-dash-fn-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--nml-text);
  letter-spacing: -0.01em;
  margin: 0;
}
.nml-dash-premium-hint {
  font-size: 11px;
  color: var(--nml-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.nml-dash-fn-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.nml-dash-fn-card {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-m);
  padding: 18px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--dur-base) var(--ease-spring), box-shadow var(--dur-base) var(--ease-out);
  position: relative;
  overflow: hidden;
}
.nml-dash-fn-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.nml-dash-fn-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.nml-dash-fn-ecom::before  { background: var(--nml-ecom); }
.nml-dash-fn-trade::before { background: var(--nml-trade); }
.nml-dash-fn-brand::before { background: var(--nml-brand); }
.nml-dash-fn-sales::before { background: var(--nml-sales); }
.nml-dash-fn-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.nml-dash-fn-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-s);
  display: flex; align-items: center; justify-content: center;
}
.nml-dash-fn-ecom  .nml-dash-fn-icon { background: rgba(160,82,45,0.10);  color: var(--nml-ecom); }
.nml-dash-fn-trade .nml-dash-fn-icon { background: rgba(30,45,64,0.10);   color: var(--nml-trade); }
.nml-dash-fn-brand .nml-dash-fn-icon { background: rgba(59,7,100,0.10);   color: var(--nml-brand); }
.nml-dash-fn-sales .nml-dash-fn-icon { background: rgba(15,118,110,0.10); color: var(--nml-sales); }
.nml-dash-fn-level-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.nml-dash-fn-ecom  .nml-dash-fn-level-badge { background: rgba(160,82,45,0.10);  color: var(--nml-ecom); }
.nml-dash-fn-trade .nml-dash-fn-level-badge { background: rgba(30,45,64,0.10);   color: var(--nml-trade); }
.nml-dash-fn-brand .nml-dash-fn-level-badge { background: rgba(59,7,100,0.10);   color: var(--nml-brand); }
.nml-dash-fn-sales .nml-dash-fn-level-badge { background: rgba(15,118,110,0.10); color: var(--nml-sales); }
.nml-dash-fn-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--nml-text);
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}
.nml-dash-fn-tag {
  font-size: 11px;
  color: var(--nml-text-muted);
  margin-bottom: 14px;
}
.nml-dash-fn-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nml-dash-fn-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--nml-bg-soft);
  border-radius: 3px;
  overflow: hidden;
}
.nml-dash-fn-progress-fill {
  height: 100%;
  border-radius: 3px;
}
.nml-dash-fn-ecom  .nml-dash-fn-progress-fill { background: var(--nml-ecom); }
.nml-dash-fn-trade .nml-dash-fn-progress-fill { background: var(--nml-trade); }
.nml-dash-fn-brand .nml-dash-fn-progress-fill { background: var(--nml-brand); }
.nml-dash-fn-sales .nml-dash-fn-progress-fill { background: var(--nml-sales); }
.nml-dash-fn-pct {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--nml-text);
  min-width: 32px;
  text-align: right;
}
.nml-dash-fn-card.locked { opacity: 0.6; }
.nml-dash-fn-card.locked .nml-dash-fn-pct { color: var(--nml-text-muted); }

/* ─── Screen action button (top-right of screen header) ─── */
.nml-screen-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  color: var(--nml-text-mid);
  font-family: var(--font-primary);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: var(--radius-s);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.nml-screen-action:hover {
  border-color: var(--nml-blue);
  color: var(--nml-blue);
  background: var(--nml-blue-light);
}

/* ─── Module chip × button ─── */
.nml-chip-x {
  font-size: 14px;
  line-height: 1;
  opacity: 0.7;
  margin-left: 4px;
}

/* ─── Practice History page ─── */
.nml-history-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.nml-history-stat {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-m);
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
}
.nml-history-stat.highlight {
  background: linear-gradient(135deg, var(--nml-blue-light) 0%, #fff 100%);
  border-color: var(--nml-blue-border);
}
.nml-history-stat-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--nml-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.nml-history-stat-val {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--nml-text);
  letter-spacing: -0.03em;
  line-height: 1;
}
.nml-history-stat.highlight .nml-history-stat-val { color: var(--nml-blue); }
.nml-history-stat-sub {
  font-size: 11px;
  color: var(--nml-text-muted);
  margin-top: 6px;
}

/* Filters */
.nml-history-filters {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-m);
}
.nml-history-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.nml-history-filter-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--nml-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 4px;
}
.nml-history-filter-pill {
  background: var(--nml-bg-surface);
  border: 1px solid var(--nml-border);
  color: var(--nml-text-mid);
  font-family: var(--font-primary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.nml-history-filter-pill:hover { border-color: var(--nml-blue); color: var(--nml-blue); }
.nml-history-filter-pill.active {
  background: var(--nml-blue);
  color: #fff;
  border-color: var(--nml-blue);
}

/* History list */
.nml-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nml-history-row {
  display: grid;
  grid-template-columns: 160px 1fr auto 40px;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-s);
  transition: all var(--dur-fast) var(--ease-out);
}
.nml-history-row:hover {
  border-color: var(--nml-blue-border);
  box-shadow: var(--shadow-sm);
}
.nml-history-row-type {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nml-history-mode-pill {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 8px;
  display: inline-block;
  width: fit-content;
}
.nml-history-mode-daily {
  background: var(--nml-blue-light);
  color: var(--nml-blue);
}
.nml-history-mode-unlock {
  background: rgba(34,197,94,0.12);
  color: #166534;
}
.nml-history-pass-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 8px;
  width: fit-content;
}
.nml-history-pass-badge.passed { background: var(--nml-green-light); color: #166534; }
.nml-history-pass-badge.failed { background: var(--nml-red-light);   color: #991B1B; }
.nml-history-row-main { min-width: 0; }
.nml-history-row-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--nml-text);
  margin-bottom: 2px;
}
.nml-history-row-meta {
  font-size: 11px;
  color: var(--nml-text-muted);
}
.nml-history-row-score {
  text-align: right;
}
.nml-history-row-score-val {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--nml-text);
  letter-spacing: -0.02em;
  line-height: 1;
}
.nml-history-row-score-sub {
  font-size: 11px;
  color: var(--nml-text-muted);
  margin-top: 4px;
}
.nml-history-row-action {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--nml-bg-surface);
  border: 1px solid var(--nml-border);
  color: var(--nml-text-mid);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-fast) var(--ease-out);
}
.nml-history-row-action:hover {
  background: var(--nml-blue);
  color: #fff;
  border-color: var(--nml-blue);
}

/* ─── Responsive ─── */
@media (max-width: 1100px) {
  .nml-dash-fn-grid { grid-template-columns: repeat(2, 1fr); }
  .nml-itde-card { padding: 24px; }
  .nml-history-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .nml-dash-two-col { grid-template-columns: 1fr; }
  .nml-dash-stats { grid-template-columns: 1fr; }
  .nml-itde-row { grid-template-columns: 1fr 1fr; row-gap: 24px; }
  .nml-itde-conn { display: none; }
  .nml-dash-topbar { flex-direction: column; align-items: flex-start; }
  .nml-dash-progress-pill { width: 100%; }
  .nml-history-row {
    grid-template-columns: 1fr auto;
    gap: 8px;
  }
  .nml-history-row-type { flex-direction: row; }
  .nml-history-row-action { grid-row: 1 / -1; grid-column: 2; }

  /* Mobile dashboard re-order: priority for action over education */
  .nml-dash {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .nml-dash > .nml-dash-topbar              { order: 1; margin-bottom: 0; }
  .nml-dash > .nml-mobile-progress-card-wrap { order: 2; }
  .nml-dash > .nml-dash-resume-banner       { order: 3; }
  .nml-dash > .nml-dash-fn-section          { order: 4; }
  .nml-dash > .nml-dash-two-col             { order: 5; }
  .nml-dash > .nml-dash-stats               { order: 6; }
  .nml-dash > .nml-itde-card                { order: 7; }
}


/* ============================================================
   SIDEBAR — refined per dashboard mockup
   ============================================================ */

.nml-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  margin-bottom: 18px;
  text-decoration: none;
  color: inherit;
}
.nml-sidebar-logo-mark {
  width: 36px; height: 36px;
  background: var(--nml-blue);
  border-radius: var(--radius-s);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: -0.02em;
  box-shadow: 0 4px 12px rgba(47,107,255,0.25);
}
.nml-sidebar-logo-img {
  width: 36px; height: 36px;
  border-radius: 9px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}
.nml-sidebar-logo-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--nml-text);
  line-height: 1.2;
}
.nml-sidebar-logo-tag {
  font-size: 10px;
  color: var(--nml-text-muted);
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.nml-sidebar-nav-section { margin-bottom: 14px; }
.nml-sidebar-nav-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--nml-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 12px;
  margin-bottom: 6px;
}
.nml-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nml-sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: var(--radius-s);
  font-size: 13px;
  font-weight: 500;
  color: var(--nml-text-mid);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.nml-sidebar-item:hover {
  background: var(--nml-bg-surface);
  color: var(--nml-text);
}
.nml-sidebar-item.active {
  background: var(--nml-blue);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(47,107,255,0.20);
}
.nml-sidebar-item.active .nml-sidebar-item-ico { color: #fff; }
.nml-sidebar-item.active:hover,
.nml-app-container a.nml-sidebar-item.active:hover {
  background: var(--nml-blue) !important;
  color: #fff !important;
}
.nml-sidebar-item.active:hover .nml-sidebar-item-ico,
.nml-sidebar-item.active:hover svg { color: #fff !important; stroke: #fff !important; }

.nml-sidebar-fn { padding-left: 14px; }
.nml-sidebar-fn-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.nml-sidebar-divider {
  height: 1px;
  background: var(--nml-border);
  margin: 12px 8px;
}

.nml-sidebar-streak {
  margin: 16px 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 100%);
  border: 1px solid #FED7AA;
  border-radius: var(--radius-m);
}
.nml-sidebar-streak-fire { font-size: 22px; line-height: 1; }
.nml-sidebar-streak-info { flex: 1; }
.nml-sidebar-streak-label {
  font-size: 10px;
  font-weight: 600;
  color: #9A3412;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.nml-sidebar-streak-val {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: #C2410C;
  line-height: 1;
  margin-top: 2px;
}

.nml-sidebar-user {
  margin-top: auto;
  padding: 12px 8px 4px;
  border-top: 1px solid var(--nml-border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border-left: none;
  border-right: none;
  border-bottom: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-family: var(--font-primary);
  transition: background var(--dur-fast) var(--ease-out);
}
.nml-sidebar-user:hover { background: var(--nml-bg-surface); }
.nml-sidebar-user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--nml-blue-light);
  color: var(--nml-blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.nml-sidebar-user-info { flex: 1; min-width: 0; }
.nml-sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--nml-text);
  line-height: 1.2;
}
.nml-sidebar-user-meta {
  font-size: 11px;
  color: var(--nml-text-muted);
  margin-top: 4px;
}

.nml-plan-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.nml-plan-chip.premium {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  color: #92400E;
}
.nml-plan-chip.free {
  background: var(--nml-bg-soft);
  color: var(--nml-text-mid);
}

/* ============================================================
   CHALLENGES — list, detail, play, result
   ============================================================ */

/* List page tabs */
.nml-cl-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--nml-border);
}
.nml-cl-tab {
  background: none;
  border: none;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--nml-text-mid);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--dur-fast) var(--ease-out);
  font-family: var(--font-primary);
}
.nml-cl-tab:hover { color: var(--nml-text); }
.nml-cl-tab.active {
  color: var(--nml-blue);
  border-bottom-color: var(--nml-blue);
}
.nml-cl-tab-count {
  background: var(--nml-bg-soft);
  color: var(--nml-text-mid);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
}
.nml-cl-tab.active .nml-cl-tab-count {
  background: var(--nml-blue-light);
  color: var(--nml-blue);
}

.nml-section-h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--nml-text);
  margin: 32px 0 14px;
  letter-spacing: -0.01em;
}

/* Featured challenge banner */
.nml-featured {
  background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 100%);
  border-radius: var(--radius-l);
  padding: 28px 32px;
  color: #fff;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.nml-featured::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(47,107,255,0.20) 0%, transparent 70%);
  border-radius: 50%;
}
.nml-featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(47,107,255,0.20);
  color: #93C5FD;
  font-size: 10px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}
.nml-featured-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}
.nml-featured-sub {
  font-size: 14px;
  color: rgba(255,255,255,0.75);
  margin-bottom: 20px;
  max-width: 600px;
  line-height: 1.5;
  position: relative;
  z-index: 1;
}
.nml-featured-cd {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}
.nml-fcd-block {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-s);
  padding: 8px 14px;
  text-align: center;
  min-width: 56px;
}
.nml-fcd-val {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
.nml-fcd-label {
  font-size: 9px;
  color: rgba(255,255,255,0.6);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}
.nml-featured-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}
.nml-featured-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255,255,255,0.8);
}
.nml-btn-featured {
  background: #fff;
  color: var(--nml-text);
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: var(--radius-s);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--dur-fast) var(--ease-out);
  position: relative;
  z-index: 1;
}
.nml-btn-featured:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.20);
}

/* Challenge grid cards */
.nml-ch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.nml-ch-card {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-m);
  padding: 20px;
  cursor: pointer;
  transition: all var(--dur-base) var(--ease-spring);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.nml-ch-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.nml-ch-ecommerce::before { background: var(--nml-ecom); }
.nml-ch-trade::before { background: var(--nml-trade); }
.nml-ch-brand::before { background: var(--nml-brand); }
.nml-ch-sales::before { background: var(--nml-sales); }
.nml-ch-general::before { background: var(--nml-blue); }
.nml-ch-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.nml-ch-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.nml-ch-chip {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 10px;
  background: var(--nml-bg-soft);
  color: var(--nml-text-mid);
}
.nml-ch-ecommerce .nml-ch-chip { background: rgba(160,82,45,0.10); color: var(--nml-ecom); }
.nml-ch-trade .nml-ch-chip { background: rgba(30,45,64,0.10); color: var(--nml-trade); }
.nml-ch-brand .nml-ch-chip { background: rgba(59,7,100,0.10); color: var(--nml-brand); }
.nml-ch-sales .nml-ch-chip { background: rgba(15,118,110,0.10); color: var(--nml-sales); }

.nml-ch-status {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 10px;
}
.nml-ch-status.live {
  background: rgba(34,197,94,0.12);
  color: #166534;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.nml-ch-status.live::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--nml-green);
  animation: nml-pulse 1.5s ease-in-out infinite;
}
.nml-ch-status.completed-passed {
  background: var(--nml-green-light);
  color: #166534;
}
.nml-ch-status.completed {
  background: var(--nml-amber-light);
  color: #92400E;
}

.nml-ch-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--nml-text);
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  line-height: 1.3;
}
.nml-ch-desc {
  font-size: 13px;
  color: var(--nml-text-mid);
  line-height: 1.5;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nml-ch-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 11px;
  color: var(--nml-text-muted);
}
.nml-ch-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.nml-ch-meta-item b { color: var(--nml-text); font-weight: 700; }
.nml-ch-score-badge {
  margin-left: auto;
  background: var(--nml-blue-light);
  color: var(--nml-blue);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
}

/* Challenge Detail */
.nml-cd-hero {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-l);
  padding: 28px 32px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
}
.nml-cd-status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.nml-cd-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--nml-text);
  letter-spacing: -0.025em;
  margin-bottom: 8px;
  line-height: 1.2;
}
.nml-cd-sub {
  font-size: 14px;
  color: var(--nml-text-mid);
  line-height: 1.55;
  margin-bottom: 24px;
  max-width: 720px;
}
.nml-cd-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--nml-border);
}
.nml-cd-stat { text-align: center; }
.nml-cd-stat-val {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  color: var(--nml-text);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 6px;
}
.nml-cd-stat-val.success { color: var(--nml-green); }
.nml-cd-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--nml-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.nml-cd-two-col {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.nml-cd-rules,
.nml-cd-rank {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-m);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.nml-cd-rules-h,
.nml-cd-rank-h {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--nml-text);
  margin-bottom: 14px;
}
.nml-cd-rank-h svg { color: #F59E0B; }
.nml-cd-rules-list { list-style: none; padding: 0; margin: 0; }
.nml-cd-rules-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
  color: var(--nml-text-mid);
  line-height: 1.5;
}
.nml-cd-rules-list li svg {
  flex-shrink: 0;
  margin-top: 4px;
  color: var(--nml-green);
}
.nml-cd-rules-list li b { color: var(--nml-text); font-weight: 700; }

.nml-cd-rank-row {
  display: grid;
  grid-template-columns: 30px 32px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--nml-bg-soft);
}
.nml-cd-rank-row:last-child { border-bottom: none; }
.nml-cd-rank-medal {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--nml-text-muted);
  text-align: center;
}
.nml-cd-rank-row.gold .nml-cd-rank-medal { color: #F59E0B; }
.nml-cd-rank-row.silver .nml-cd-rank-medal { color: #64748B; }
.nml-cd-rank-row.bronze .nml-cd-rank-medal { color: #A0522D; }
.nml-cd-rank-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--nml-blue-light);
  color: var(--nml-blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 700;
}
.nml-cd-rank-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--nml-text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nml-cd-rank-score {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--nml-text);
}

.nml-cd-cta-bar {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-m);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow-md);
}
.nml-cd-cta-info { flex: 1; min-width: 0; }
.nml-cd-cta-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--nml-text);
  margin-bottom: 4px;
}
.nml-cd-cta-sub {
  font-size: 12px;
  color: var(--nml-text-mid);
}
.nml-btn-enter {
  background: var(--nml-green);
  color: #fff;
  font-family: var(--font-primary);
  font-size: 15px;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: var(--radius-s);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all var(--dur-fast) var(--ease-out);
  box-shadow: 0 4px 12px rgba(34,197,94,0.25);
}
.nml-btn-enter:hover:not(:disabled) {
  background: #16A34A;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(34,197,94,0.35);
}
.nml-btn-enter:disabled { opacity: 0.5; cursor: not-allowed; }

/* Challenge Play (in-session) */
.nml-cp-topbar {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-m);
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}
.nml-cp-exit {
  background: var(--nml-bg-surface);
  border: 1px solid var(--nml-border);
  width: 34px; height: 34px;
  border-radius: var(--radius-s);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--nml-text-mid);
}
.nml-cp-exit:hover { background: var(--nml-bg-soft); color: var(--nml-text); }
.nml-cp-title-block { flex: 1; min-width: 0; }
.nml-cp-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--nml-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nml-cp-subtitle {
  font-size: 11px;
  color: var(--nml-text-muted);
  margin-top: 2px;
}
.nml-cp-progress-pill {
  background: var(--nml-blue-light);
  color: var(--nml-blue);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.nml-cp-timer {
  background: var(--nml-bg-surface);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-s);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--nml-text);
}
.nml-cp-timer.warning {
  background: var(--nml-amber-light);
  border-color: var(--nml-amber);
  color: var(--nml-amber);
  animation: nml-pulse 1s ease-in-out infinite;
}
.nml-cp-timer-val {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nml-cp-nav-strip {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-m);
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.nml-cp-nav-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--nml-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.nml-cp-nav-cells {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  flex: 1;
}
.nml-cp-nav-cell {
  width: 30px; height: 30px;
  background: var(--nml-bg-soft);
  border: 1px solid transparent;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--nml-text-muted);
  cursor: pointer;
  transition: all var(--dur-fast);
}
.nml-cp-nav-cell:hover { border-color: var(--nml-blue); color: var(--nml-text); }
.nml-cp-nav-cell.answered {
  background: var(--nml-green-light);
  color: #166534;
}
.nml-cp-nav-cell.flagged {
  background: var(--nml-amber-light);
  color: #92400E;
}
.nml-cp-nav-cell.current {
  background: var(--nml-blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(47,107,255,0.30);
}
.nml-cp-nav-legend {
  display: flex;
  gap: 14px;
  font-size: 11px;
  color: var(--nml-text-muted);
}
.nml-cp-nav-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.nml-cp-nav-legend-dot {
  width: 10px; height: 10px;
  border-radius: 3px;
  display: inline-block;
}
.nml-cp-nav-legend-dot.answered { background: var(--nml-green-light); border: 1px solid var(--nml-green); }
.nml-cp-nav-legend-dot.flagged { background: var(--nml-amber-light); border: 1px solid var(--nml-amber); }

.nml-cp-card {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-l);
  padding: 32px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
}
.nml-cp-q-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.nml-cp-q-pill {
  background: var(--nml-blue-light);
  color: var(--nml-blue);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
}
.nml-cp-flag-btn {
  background: var(--nml-bg-surface);
  border: 1px solid var(--nml-border);
  color: var(--nml-text-mid);
  font-family: var(--font-primary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-s);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--dur-fast);
}
.nml-cp-flag-btn:hover { color: var(--nml-amber); border-color: var(--nml-amber); }
.nml-cp-flag-btn.flagged {
  background: var(--nml-amber-light);
  border-color: var(--nml-amber);
  color: #92400E;
}
.nml-cp-q-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--nml-text);
  line-height: 1.55;
  margin-bottom: 24px;
}
.nml-cp-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nml-cp-option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  background: var(--nml-bg-white);
  border: 2px solid var(--nml-border);
  border-radius: var(--radius-m);
  cursor: pointer;
  text-align: left;
  font-family: var(--font-primary);
  width: 100%;
  transition: all var(--dur-fast) var(--ease-out);
}
.nml-cp-option:hover { border-color: var(--nml-blue-border); background: var(--nml-bg-surface); }
.nml-cp-option-letter {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--nml-bg-soft);
  color: var(--nml-text-mid);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nml-cp-option-text { flex: 1; font-size: 14px; color: var(--nml-text); line-height: 1.55; padding-top: 3px; }
.nml-cp-option-check { width: 22px; height: 22px; opacity: 0; transition: opacity var(--dur-fast); }
.nml-cp-option.selected { border-color: var(--nml-blue); background: var(--nml-blue-light); }
.nml-cp-option.selected .nml-cp-option-letter { background: var(--nml-blue); color: #fff; }
.nml-cp-option.selected .nml-cp-option-check { opacity: 1; color: var(--nml-blue); }

.nml-cp-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.nml-cp-actions-mid {
  font-size: 12px;
  color: var(--nml-text-mid);
}
.nml-cp-actions-mid b { color: var(--nml-text); font-family: var(--font-mono); }

.nml-btn-submit {
  background: var(--nml-green);
  color: #fff;
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: var(--radius-s);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--dur-fast) var(--ease-out);
  box-shadow: 0 4px 12px rgba(34,197,94,0.25);
}
.nml-btn-submit:hover:not(:disabled) {
  background: #16A34A;
  transform: translateY(-1px);
}
.nml-btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* Challenge Result */
.nml-cr-hero {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-l);
  padding: 32px;
  margin-bottom: 16px;
  text-align: center;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.nml-cr-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--nml-green) 0%, var(--nml-blue) 100%);
}
.nml-cr-rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #FEF3C7;
  color: #92400E;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 16px;
  margin-bottom: 14px;
}
.nml-cr-rank-badge svg { color: #F59E0B; }
.nml-cr-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--nml-text);
  letter-spacing: -0.025em;
  margin-bottom: 8px;
  line-height: 1.2;
}
.nml-cr-sub {
  font-size: 14px;
  color: var(--nml-text-mid);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.55;
}
.nml-cr-score-row {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--nml-border);
  flex-wrap: wrap;
}
.nml-cr-score-item { text-align: center; }
.nml-cr-score-val {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 700;
  color: var(--nml-text);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 6px;
}
.nml-cr-score-val.success { color: var(--nml-green); }
.nml-cr-score-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--nml-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ============================================================
   LEADERBOARD
   ============================================================ */

.nml-board-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.nml-board-btn {
  background: var(--nml-bg-white);
  border: 2px solid var(--nml-border);
  border-radius: var(--radius-l);
  padding: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  transition: all var(--dur-base) var(--ease-spring);
  font-family: var(--font-primary);
}
.nml-board-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.nml-board-btn.active {
  border-color: var(--nml-blue);
  background: var(--nml-blue-light);
  box-shadow: 0 0 0 4px rgba(47,107,255,0.10);
}
.nml-board-btn-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-m);
  background: var(--nml-blue-light);
  color: var(--nml-blue);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nml-board-btn.active .nml-board-btn-icon {
  background: var(--nml-blue);
  color: #fff;
}
.nml-board-btn-content { min-width: 0; }
.nml-board-btn-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--nml-text);
  margin-bottom: 2px;
}
.nml-board-btn-desc {
  font-size: 12px;
  color: var(--nml-text-mid);
}

.nml-filter-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.nml-filter-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--nml-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.nml-filter-spacer { flex: 1; }
.nml-filter-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--nml-text-mid);
}
.nml-filter-meta b { color: var(--nml-text); font-weight: 700; }

.nml-period-seg {
  display: inline-flex;
  background: var(--nml-bg-soft);
  border-radius: var(--radius-s);
  padding: 3px;
  gap: 2px;
}
.nml-period-seg button {
  background: transparent;
  border: none;
  padding: 7px 14px;
  border-radius: 6px;
  font-family: var(--font-primary);
  font-size: 12px;
  font-weight: 600;
  color: var(--nml-text-mid);
  cursor: pointer;
  transition: all var(--dur-fast);
}
.nml-period-seg button:hover { color: var(--nml-text); }
.nml-period-seg button.active {
  background: var(--nml-bg-white);
  color: var(--nml-blue);
  box-shadow: 0 1px 3px rgba(15,23,42,0.06);
}

/* Podium */
.nml-podium-wrap {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-l);
  padding: 32px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
}
.nml-podium-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  align-items: end;
  max-width: 600px;
  margin: 0 auto;
}
.nml-podium-spot {
  text-align: center;
  position: relative;
}
.nml-spot-1 { padding-top: 0; }
.nml-spot-2, .nml-spot-3 { padding-top: 24px; }
.nml-podium-medal { font-size: 22px; margin-bottom: 8px; }
.nml-podium-avatar-wrap { display: flex; justify-content: center; margin-bottom: 8px; }
.nml-podium-avatar {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--nml-blue-light);
  color: var(--nml-blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  font-weight: 700;
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(15,23,42,0.10);
}
.nml-spot-1 .nml-podium-avatar { width: 72px; height: 72px; border-color: #FEF3C7; }
.nml-podium-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--nml-text);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.nml-podium-meta {
  font-size: 11px;
  color: var(--nml-text-muted);
  margin-bottom: 12px;
}
.nml-podium-base {
  background: var(--nml-bg-surface);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-m);
  padding: 16px 8px 32px;
  position: relative;
}
.nml-spot-1 .nml-podium-base {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  border-color: #F59E0B;
}
.nml-spot-2 .nml-podium-base { border-color: #94A3B8; }
.nml-spot-3 .nml-podium-base { border-color: #A0522D; }
.nml-podium-score {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--nml-text);
  letter-spacing: -0.03em;
  line-height: 1;
}
.nml-spot-1 .nml-podium-score { font-size: 24px; color: #92400E; }
.nml-podium-score-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--nml-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}
.nml-spot-1 .nml-podium-score-label { color: #92400E; }
.nml-podium-pos {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: rgba(15,23,42,0.08);
}

/* Ranked list */
.nml-list-wrap {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-m);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.nml-list-head {
  display: grid;
  grid-template-columns: 60px 1fr 110px 90px;
  gap: 12px;
  padding: 12px 18px;
  background: var(--nml-bg-surface);
  border-bottom: 1px solid var(--nml-border);
  font-size: 10px;
  font-weight: 700;
  color: var(--nml-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.nml-list-row {
  display: grid;
  grid-template-columns: 60px 1fr 110px 90px;
  gap: 12px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--nml-bg-soft);
}
.nml-list-row:last-child { border-bottom: none; }
.nml-list-row.you {
  background: var(--nml-blue-light);
  border-left: 3px solid var(--nml-blue);
  padding-left: 15px;
}
.nml-row-pos {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--nml-text-mid);
}
.nml-row-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.nml-row-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--nml-bg-soft);
  color: var(--nml-text);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.nml-row-name-block { min-width: 0; }
.nml-row-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--nml-text);
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nml-you-tag {
  background: var(--nml-blue);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.nml-row-score { text-align: right; }
.nml-row-score-val {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--nml-text);
}
.nml-row-score-sub {
  font-size: 11px;
  color: var(--nml-text-muted);
  margin-top: 2px;
}
.nml-row-time {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--nml-text-mid);
  text-align: right;
}

/* ============================================================
   FUNCTION DASHBOARD
   ============================================================ */

.nml-fn-hero {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-l);
  padding: 24px 28px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.nml-fn-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.nml-fn-badge {
  width: 60px; height: 60px;
  border-radius: var(--radius-m);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(15,23,42,0.15);
}
.nml-fn-title-block { flex: 1; min-width: 0; }
.nml-fn-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--nml-text);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.nml-fn-chip {
  font-size: 11px;
  font-weight: 600;
  color: var(--nml-text-mid);
  background: var(--nml-bg-soft);
  padding: 4px 10px;
  border-radius: 10px;
}
.nml-premium-chip {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  color: #92400E;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 10px;
}
.nml-fn-subtitle {
  font-size: 13px;
  color: var(--nml-text-mid);
}

.nml-fn-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.nml-fn-stat-card {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-m);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.nml-fn-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--nml-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.nml-fn-stat-val {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  color: var(--nml-text);
  letter-spacing: -0.03em;
  line-height: 1;
}
.nml-fn-stat-delta {
  font-size: 11px;
  color: var(--nml-green);
  font-weight: 600;
  margin-top: 4px;
}

/* Level progression card */
.nml-level-card {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-l);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.nml-section-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--nml-text);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nml-levels-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 0;
  margin-bottom: 20px;
}
.nml-level-node { text-align: center; }
.nml-level-circle {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 10px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
}
.lc-done {
  background: var(--nml-green);
  color: #fff;
  box-shadow: 0 4px 12px rgba(34,197,94,0.30);
}
.lc-active {
  background: var(--nml-blue);
  color: #fff;
  box-shadow: 0 4px 12px rgba(47,107,255,0.30);
}
.lc-locked {
  background: var(--nml-bg-soft);
  color: var(--nml-text-muted);
}
.nml-level-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--nml-text);
  margin-bottom: 2px;
}
.nml-level-meta {
  font-size: 11px;
  color: var(--nml-text-muted);
}
.nml-level-meta.green { color: var(--nml-green); font-weight: 600; }
.nml-connector {
  height: 2px;
  min-width: 24px;
  margin-bottom: 38px;
}
.conn-done { background: var(--nml-green); opacity: 0.5; }
.conn-locked { background: var(--nml-border); }

.nml-unlock-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--nml-border);
}
.nml-us-item {
  text-align: center;
  padding: 10px;
  background: var(--nml-bg-surface);
  border-radius: var(--radius-s);
}
.nml-us-val {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.nml-us-val.pass { color: var(--nml-green); }
.nml-us-val.fail { color: var(--nml-amber); }
.nml-us-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--nml-text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Matrix card */
.nml-matrix-card {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-l);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.nml-matrix-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.nml-matrix-tab {
  background: var(--nml-bg-surface);
  border: 1px solid var(--nml-border);
  padding: 8px 14px;
  border-radius: var(--radius-s);
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 600;
  color: var(--nml-text-mid);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--dur-fast);
}
.nml-matrix-tab:hover:not(.locked) { border-color: var(--nml-blue); color: var(--nml-text); }
.nml-matrix-tab.active {
  background: var(--nml-blue);
  color: #fff;
  border-color: var(--nml-blue);
  box-shadow: 0 2px 8px rgba(47,107,255,0.20);
}
.nml-matrix-tab.locked {
  opacity: 0.55;
  cursor: not-allowed;
}
.nml-matrix-tab-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 6px;
}
.nml-matrix-tab:not(.active) .badge-pass { background: var(--nml-green-light); color: #166534; }
.nml-matrix-tab:not(.active) .badge-prog { background: var(--nml-blue-light); color: var(--nml-blue); }
.nml-matrix-tab:not(.active) .badge-lock { background: var(--nml-bg-soft); }
.nml-matrix-tab.active .nml-matrix-tab-badge {
  background: rgba(255,255,255,0.20);
  color: #fff;
}

.nml-itde-matrix-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.nml-itde-matrix-grid .nml-itde-card {
  background: var(--nml-bg-surface);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-m);
  padding: 18px;
  width: auto;
  height: auto;
  margin: 0;
  box-shadow: none;
  backdrop-filter: none;
  display: block;
  overflow: visible;
}
.nml-itde-matrix-grid .nml-itde-card::before { display: none; }
.nml-itde-matrix-grid .nml-itde-card:hover { transform: none; box-shadow: none; }
.nml-itde-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.nml-itde-card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--nml-text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.nml-ic-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}
.nml-itde-card-pct {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.nml-track {
  height: 6px;
  background: rgba(15,23,42,0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 14px;
}
.nml-track-fill { height: 100%; border-radius: 3px; transition: width var(--dur-base); }

.nml-mod-row {
  display: grid;
  grid-template-columns: 8px 1fr 60px 35px;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  font-size: 12px;
}
.nml-mod-dot { width: 8px; height: 8px; border-radius: 50%; }
.nml-mod-name {
  color: var(--nml-text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nml-mod-track { height: 4px; background: rgba(15,23,42,0.06); border-radius: 2px; overflow: hidden; }
.nml-mod-fill { height: 100%; border-radius: 2px; }
.nml-mod-pct {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--nml-text);
  text-align: right;
}

/* Free preview + paywall */
.nml-free-stats-preview {
  background: linear-gradient(135deg, var(--nml-blue-light) 0%, #fff 100%);
  border: 1px solid var(--nml-blue-border);
  border-radius: var(--radius-m);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.nml-free-preview-ico {
  width: 40px; height: 40px;
  border-radius: var(--radius-s);
  background: var(--nml-blue);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nml-free-preview-text { flex: 1; }
.nml-free-preview-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--nml-text);
  margin-bottom: 4px;
}
.nml-free-preview-sub {
  font-size: 12px;
  color: var(--nml-text-mid);
}

.nml-paywall {
  background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 100%);
  border-radius: var(--radius-l);
  padding: 32px;
  color: #fff;
  margin-bottom: 24px;
  box-shadow: 0 16px 48px rgba(15,23,42,0.20);
}
.nml-paywall-content {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 32px;
  align-items: center;
}
.nml-paywall-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245,158,11,0.20);
  color: #FCD34D;
  font-size: 10px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.nml-paywall-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 10px;
  line-height: 1.2;
}
.nml-paywall-sub {
  font-size: 14px;
  color: rgba(255,255,255,0.75);
  line-height: 1.55;
  margin-bottom: 18px;
}
.nml-paywall-feats {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}
.nml-paywall-feats li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  font-size: 13px;
  color: rgba(255,255,255,0.85);
}
.nml-paywall-feats li svg {
  width: 14px; height: 14px;
  color: var(--nml-green);
  flex-shrink: 0;
}
.nml-paywall-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.nml-btn-upgrade {
  background: linear-gradient(135deg, #F59E0B 0%, #FBBF24 100%);
  color: #422006;
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: var(--radius-s);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--dur-fast);
  box-shadow: 0 8px 20px rgba(245,158,11,0.30);
}
.nml-btn-upgrade:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(245,158,11,0.40);
}
.nml-paywall-price {
  text-align: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius-m);
  padding: 24px;
}
.nml-paywall-price-from {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.nml-paywall-price-amount {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 8px 0;
}
.nml-paywall-price-amount sup { font-size: 16px; vertical-align: super; opacity: 0.7; }
.nml-paywall-price-amount sub {
  font-size: 14px;
  vertical-align: baseline;
  color: rgba(255,255,255,0.7);
  font-weight: 500;
  margin-left: 4px;
}
.nml-paywall-price-note {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  margin-top: 8px;
}

/* ============================================================
   PROFILE
   ============================================================ */

.nml-profile-card {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-l);
  padding: 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow-md);
}
.nml-profile-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--nml-blue) 0%, #5B8FFF 100%);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(47,107,255,0.30);
}
.nml-profile-info { flex: 1; min-width: 0; }
.nml-profile-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--nml-text);
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.nml-profile-email {
  font-size: 13px;
  color: var(--nml-text-mid);
  margin-bottom: 10px;
}
.nml-profile-plan-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.nml-profile-plan-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.nml-profile-plan-chip.premium {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  color: #92400E;
}
.nml-profile-plan-chip.free {
  background: var(--nml-bg-soft);
  color: var(--nml-text-mid);
}

.nml-profile-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.nml-profile-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-m);
  text-decoration: none;
  color: var(--nml-text);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--dur-fast) var(--ease-out);
  cursor: pointer;
}
.nml-profile-action:hover {
  border-color: var(--nml-blue);
  background: var(--nml-blue-light);
  color: var(--nml-blue);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.nml-profile-action svg {
  color: var(--nml-text-mid);
  transition: color var(--dur-fast);
}
.nml-profile-action:hover svg { color: var(--nml-blue); }

/* ─── Responsive (mobile / tablet) ─── */
@media (max-width: 1100px) {
  .nml-cd-stats-row { grid-template-columns: repeat(2, 1fr); }
  .nml-cd-two-col { grid-template-columns: 1fr; }
  .nml-fn-stats-row { grid-template-columns: repeat(2, 1fr); }
  .nml-itde-matrix-grid { grid-template-columns: 1fr; }
  .nml-paywall-content { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 880px) {
  .nml-board-switch { grid-template-columns: 1fr; }
  .nml-podium-grid { grid-template-columns: 1fr; max-width: 320px; }
  .nml-list-head, .nml-list-row { grid-template-columns: 40px 1fr 80px; }
  .nml-list-head > div:last-child, .nml-list-row > div:last-child { display: none; }
  .nml-featured-title { font-size: 20px; }
  .nml-cd-title { font-size: 20px; }
  .nml-fn-hero { flex-direction: column; align-items: flex-start; }
  .nml-levels-row { grid-template-columns: 1fr 1fr; gap: 16px; }
  .nml-connector { display: none; }
  .nml-unlock-summary { grid-template-columns: 1fr 1fr; }
  .nml-cp-actions { flex-direction: column; }
  .nml-cp-actions-mid { order: 3; text-align: center; }
  .nml-paywall-title { font-size: 22px; }
  .nml-profile-card { flex-direction: column; text-align: center; }
}


/* ============================================================
   Review empty state — friendlier than red error banner
   ============================================================ */
.nml-empty-state-card {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: 16px;
  padding: 48px 32px;
  text-align: center;
  max-width: 560px;
  margin: 32px auto;
  box-shadow: 0 2px 8px rgba(15,23,42,0.04);
}
.nml-empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--nml-bg-soft);
  color: var(--nml-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.nml-empty-state-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--nml-text);
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.nml-empty-state-card p {
  font-size: 14px;
  color: var(--nml-text-mid);
  margin: 0 0 10px;
  line-height: 1.55;
}
.nml-empty-state-card code {
  background: var(--nml-bg-soft);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: var(--font-mono);
}
.nml-btn-primary {
  background: var(--nml-blue);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.nml-btn-primary:hover {
  background: #1F5AE0;
  transform: translateY(-1px);
}
.nml-btn-secondary {
  background: var(--nml-bg-white);
  color: var(--nml-text-mid);
  border: 1px solid var(--nml-border);
  padding: 10px 20px;
  border-radius: 8px;
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.nml-btn-secondary:hover {
  border-color: var(--nml-blue);
  color: var(--nml-blue);
}


/* ============================================================
   Hover/focus DNA enforcement — override any warm hover bleed
   from theme/WP defaults. All interactive elements inside .nml
   use blue hover + blue focus ring.
   ============================================================ */
.nml-app-container a:not(.active):not(.nml-sidebar-item.active):not(.nml-btn-continue):not(.nml-tab.active):hover,
.nml-app-container button:not([disabled]):not(.nml-btn-continue):not(.nml-btn-resume):not(.nml-dash-btn-resume):not(.nml-btn-primary):not(.nml-btn-start):not(.nml-btn-next):not(.nml-btn-submit):not(.nml-btn-enter):not(.nml-btn-upgrade):not(.nml-mp-done):not(.nml-mtab.active):not(.active):hover {
  color: var(--nml-blue);
}
.nml-app-container *:focus-visible {
  outline: 2px solid var(--nml-blue);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Specific overrides for hoverable cards & rows */
.nml-list-row {
  transition: background var(--dur-fast) var(--ease-out);
  cursor: pointer;
}
.nml-list-row:hover:not(.you) {
  background: var(--nml-blue-light);
}
.nml-list-row.you:hover {
  background: rgba(47,107,255,0.18);
}

/* Period segment hover — make affirmative blue feedback */
.nml-period-seg button:hover:not(.active) {
  color: var(--nml-blue);
  background: var(--nml-bg-white);
}

/* CdLabel above countdown blocks (new) */
.nml-dash-cd-label-top,
.nml-featured-cd-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--nml-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  margin-top: 4px;
}
.nml-featured-cd-label { color: rgba(255,255,255,0.6); }

/* When no end_date set */
.nml-dash-cd-fallback {
  background: rgba(47,107,255,0.08);
  color: var(--nml-blue);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  margin: 12px 0;
}
.nml-featured-open,
.nml-featured-ended {
  background: rgba(255,255,255,0.10);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  margin: 14px 0 20px;
  display: inline-block;
}
.nml-featured-ended { background: rgba(220,38,38,0.20); color: #FCA5A5; }

/* End-date label on grid cards */
.nml-ch-endlabel {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--nml-blue-light);
  color: var(--nml-blue);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  margin-bottom: 12px;
}

/* Scheduled status pill */
.nml-ch-status.scheduled {
  background: rgba(47,107,255,0.12);
  color: var(--nml-blue);
}


/* ============================================================
   Leaderboard v2 — premium hero podium + compact tabs
   ============================================================ */

/* Compact tab + period toolbar */
.nml-lb-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.nml-lb-tabs {
  display: inline-flex;
  background: var(--nml-bg-soft);
  border-radius: 10px;
  padding: 4px;
  gap: 2px;
}
.nml-lb-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 7px;
  background: transparent;
  border: none;
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 600;
  color: var(--nml-text-mid);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.nml-lb-tab:hover:not(.active) {
  color: var(--nml-blue);
}
.nml-lb-tab.active {
  background: var(--nml-bg-white);
  color: var(--nml-blue);
  box-shadow: 0 1px 4px rgba(15,23,42,0.10);
}
.nml-lb-tab svg { width: 15px; height: 15px; }

/* Stats strip */
.nml-lb-statbar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.nml-lb-stat {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: 10px;
  padding: 14px 18px;
  text-align: center;
}
.nml-lb-stat-val {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--nml-text);
  letter-spacing: -0.025em;
  line-height: 1;
  margin-bottom: 4px;
}
.nml-lb-stat-lbl {
  font-size: 10px;
  font-weight: 700;
  color: var(--nml-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Empty state */
.nml-lb-empty {
  background: var(--nml-bg-white);
  border: 1px solid var(--nml-border);
  border-radius: 16px;
  padding: 56px 32px;
  text-align: center;
  margin-top: 32px;
}
.nml-lb-empty-icon { font-size: 48px; margin-bottom: 16px; }
.nml-lb-empty-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--nml-text);
  margin-bottom: 6px;
}
.nml-lb-empty-sub {
  font-size: 13px;
  color: var(--nml-text-mid);
}

/* Row progress bar — relative to leader's score */
.nml-row-bar {
  height: 3px;
  background: var(--nml-bg-soft);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
  max-width: 200px;
}
.nml-row-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--nml-blue) 0%, #5B8FFF 100%);
  border-radius: 2px;
  transition: width var(--dur-base) var(--ease-out);
}
.nml-list-row.you .nml-row-bar-fill {
  background: linear-gradient(90deg, var(--nml-green) 0%, #4ADE80 100%);
}

/* Hide old big board switcher (deprecated v1 — kept selectors for back-compat) */
.nml-board-switch { display: none; }

/* Mobile responsive */
@media (max-width: 880px) {
  .nml-lb-toolbar { flex-direction: column; align-items: stretch; }
  .nml-lb-tabs, .nml-period-seg { width: 100%; justify-content: center; }
  .nml-lb-tab { flex: 1; justify-content: center; }
  .nml-lb-statbar { grid-template-columns: 1fr; gap: 8px; }
  .nml-row-bar { max-width: none; }
}


/* ============================================================
   AGGRESSIVE hover override — kill any theme pink/red bleed
   Theme uses high-specificity rules with !important on .button:hover,
   so we match + override with !important on our scoped buttons.
   ============================================================ */
.nml-app-container button,
.nml-app-container a {
  background-color: transparent;
}

/* Generic non-primary button hover */
.nml-app-container button:not([disabled]):not(.nml-btn-primary):not(.nml-btn-submit):not(.nml-btn-enter):not(.nml-btn-upgrade):not(.nml-btn-featured):not(.nml-btn-next):not(.nml-btn-prev):not(.nml-btn-continue):not(.nml-dash-btn-challenge):not(.nml-btn-review):not(.nml-cp-exit):not(.nml-cp-flag-btn):not(.nml-back-btn):hover {
  background-color: var(--nml-blue-light) !important;
  color: var(--nml-blue) !important;
}

/* Dark-themed buttons keep their own hover */
.nml-dash-btn-challenge:hover,
.nml-dash-btn-challenge:hover * {
  background: #1E293B !important;
  color: #fff !important;
}
.nml-btn-review:hover {
  background: var(--nml-blue) !important;
  color: #fff !important;
}

/* Leaderboard tab hover specifically */
.nml-lb-tab:hover:not(.active) {
  background: var(--nml-blue-light) !important;
  color: var(--nml-blue) !important;
}
.nml-lb-tab.active {
  background: var(--nml-bg-white) !important;
  color: var(--nml-blue) !important;
}

/* Period segmented control */
.nml-period-seg button:hover:not(.active) {
  background: var(--nml-blue-light) !important;
  color: var(--nml-blue) !important;
}
.nml-period-seg button.active {
  background: var(--nml-bg-white) !important;
  color: var(--nml-blue) !important;
}

/* Modes / cards / chips — keep these intentional */
.nml-mode-card,
.nml-chip,
.nml-ch-card,
.nml-board-btn {
  /* parent containers — exempt from generic button hover */
}
.nml-mode-card:hover,
.nml-chip:hover,
.nml-ch-card:hover {
  background-color: transparent !important;
}

/* Link buttons inside review filters */
.nml-review-filter:hover:not(.active) {
  background: var(--nml-blue-light) !important;
  color: var(--nml-blue) !important;
}


/* ============================================================
   NML MOTION LANGUAGE — Applied
   ============================================================
   Tokens:
     --dur-micro      120ms  micro-interactions, button press
     --dur-ui         240ms  hover, card states, tabs
     --dur-page       420ms  route entrance/exit
     --dur-cinematic  700ms  progress fills, KPI reveals
   ============================================================ */

/* ── Keyframes ────────────────────────────────────────────── */

@keyframes nml-fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes nml-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes nml-scale-in {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes nml-slide-down {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes nml-slide-up-toast {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes nml-pulse-soft {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

@keyframes nml-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes nml-progress-fill {
  from { width: 0; }
}

@keyframes nml-number-count {
  from { opacity: 0; transform: translateY(8px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Page entrance — applied to every screen ─────────────── */

.nml-screen,
.nml-dash {
  animation: nml-fade-up var(--dur-page) var(--ease-out) both;
}

/* ── Stagger reveal for grid children (CSS-only via delays) ─ */

.nml-dash-stats > *,
.nml-dash-fn-grid > *,
.nml-ch-grid > *,
.nml-stats-grid > *,
.nml-fn-stats-row > *,
.nml-lb-statbar > *,
.nml-history-stats > * {
  animation: nml-fade-up var(--dur-page) var(--ease-out) both;
}
.nml-dash-stats > *:nth-child(1),
.nml-dash-fn-grid > *:nth-child(1),
.nml-ch-grid > *:nth-child(1),
.nml-stats-grid > *:nth-child(1),
.nml-fn-stats-row > *:nth-child(1),
.nml-lb-statbar > *:nth-child(1),
.nml-history-stats > *:nth-child(1) { animation-delay:  60ms; }

.nml-dash-stats > *:nth-child(2),
.nml-dash-fn-grid > *:nth-child(2),
.nml-ch-grid > *:nth-child(2),
.nml-stats-grid > *:nth-child(2),
.nml-fn-stats-row > *:nth-child(2),
.nml-lb-statbar > *:nth-child(2),
.nml-history-stats > *:nth-child(2) { animation-delay: 120ms; }

.nml-dash-stats > *:nth-child(3),
.nml-dash-fn-grid > *:nth-child(3),
.nml-ch-grid > *:nth-child(3),
.nml-stats-grid > *:nth-child(3),
.nml-fn-stats-row > *:nth-child(3),
.nml-lb-statbar > *:nth-child(3),
.nml-history-stats > *:nth-child(3) { animation-delay: 180ms; }

.nml-dash-stats > *:nth-child(4),
.nml-dash-fn-grid > *:nth-child(4),
.nml-ch-grid > *:nth-child(4),
.nml-stats-grid > *:nth-child(4),
.nml-fn-stats-row > *:nth-child(4),
.nml-lb-statbar > *:nth-child(4),
.nml-history-stats > *:nth-child(4) { animation-delay: 240ms; }

.nml-dash-fn-grid > *:nth-child(5),
.nml-ch-grid > *:nth-child(5) { animation-delay: 300ms; }
.nml-dash-fn-grid > *:nth-child(6),
.nml-ch-grid > *:nth-child(6) { animation-delay: 360ms; }
.nml-ch-grid > *:nth-child(7) { animation-delay: 420ms; }
.nml-ch-grid > *:nth-child(8) { animation-delay: 480ms; }

/* ── Stagger reveal for list items ───────────────────────── */

.nml-list-row,
.nml-history-row,
.nml-review-item {
  animation: nml-fade-up 320ms var(--ease-out) both;
}
.nml-list-row:nth-child(1),
.nml-history-row:nth-child(1) { animation-delay:  40ms; }
.nml-list-row:nth-child(2),
.nml-history-row:nth-child(2) { animation-delay:  80ms; }
.nml-list-row:nth-child(3),
.nml-history-row:nth-child(3) { animation-delay: 120ms; }
.nml-list-row:nth-child(4),
.nml-history-row:nth-child(4) { animation-delay: 160ms; }
.nml-list-row:nth-child(5),
.nml-history-row:nth-child(5) { animation-delay: 200ms; }
.nml-list-row:nth-child(6),
.nml-history-row:nth-child(6) { animation-delay: 240ms; }
.nml-list-row:nth-child(7) { animation-delay: 280ms; }
.nml-list-row:nth-child(8) { animation-delay: 320ms; }
.nml-list-row:nth-child(9) { animation-delay: 360ms; }
.nml-list-row:nth-child(n+10) { animation-delay: 400ms; }

/* ── Podium spots — spring entrance ──────────────────────── */

.nml-podium-spot {
  animation: nml-scale-in 540ms var(--ease-spring) both;
}
.nml-podium-spot.nml-spot-2 { animation-delay:  60ms; }
.nml-podium-spot.nml-spot-1 { animation-delay: 180ms; }
.nml-podium-spot.nml-spot-3 { animation-delay: 300ms; }

/* ── KPI number reveal ───────────────────────────────────── */

.nml-dash-stat-val,
.nml-fn-stat-val,
.nml-lb-stat-val,
.nml-score-val,
.nml-cr-score-val,
.nml-cd-stat-val,
.nml-history-stat-val {
  animation: nml-number-count 540ms var(--ease-spring) both;
  animation-delay: 200ms;
}

/* ── Progress bar fill animations ────────────────────────── */

.nml-dash-pill-bar,
.nml-dash-fn-progress-fill,
.nml-dash-module-progress-fill,
.nml-breakdown-bar-fill,
.nml-q-progress-bar-fill,
.nml-itde-prog-fill,
.nml-track-fill,
.nml-mod-fill,
.nml-row-bar-fill {
  transition: width var(--dur-cinematic) var(--ease-decel);
}

/* ── Button press feedback (micro) ───────────────────────── */

.nml-app-container button:not([disabled]):active,
.nml-screen button:not([disabled]):active,
.nml-dash button:not([disabled]):active {
  transform: scale(0.97);
  transition: transform var(--dur-micro) var(--ease-spring);
}

/* ── Card hover lift — applied to interactive cards ──────── */

.nml-mode-card,
.nml-ch-card,
.nml-dash-fn-card,
.nml-history-row,
.nml-list-row {
  transition:
    transform var(--dur-ui) var(--ease-spring),
    box-shadow var(--dur-ui) var(--ease-out),
    border-color var(--dur-ui) var(--ease-out),
    background var(--dur-ui) var(--ease-out);
}

.nml-mode-card:not(.locked):hover,
.nml-ch-card:hover,
.nml-dash-fn-card:not(.locked):hover {
  transform: translateY(-3px);
}

.nml-history-row:hover {
  transform: translateY(-1px);
}

/* ── Sidebar nav items — slide-in on active ──────────────── */

.nml-sidebar-item {
  transition:
    background var(--dur-ui) var(--ease-out),
    color var(--dur-ui) var(--ease-out),
    padding-left var(--dur-ui) var(--ease-spring);
}

.nml-sidebar-item:hover {
  padding-left: 18px;
}

.nml-sidebar-item.active {
  animation: nml-slide-down var(--dur-ui) var(--ease-out) both;
}

/* ── Toast slide-in ──────────────────────────────────────── */

.nml-toast {
  animation: nml-slide-up-toast var(--dur-ui) var(--ease-spring) both;
}

/* ── Modal / overlay fade ────────────────────────────────── */

.nml-resume-card,
.nml-error-banner,
.nml-dash-resume-banner {
  animation: nml-fade-up var(--dur-ui) var(--ease-out) both;
}

/* ── Question card — slide-in on next ────────────────────── */

.nml-q-card,
.nml-cp-card {
  animation: nml-fade-up var(--dur-ui) var(--ease-out) both;
}

/* ── Feedback block (correct/wrong reveal) ───────────────── */

.nml-feedback-block {
  animation: nml-scale-in 360ms var(--ease-spring) both;
}

/* ── Result hero — cinematic entrance ────────────────────── */

.nml-result-hero,
.nml-cr-hero,
.nml-cd-hero,
.nml-featured {
  animation: nml-fade-up 540ms var(--ease-decel) both;
}

.nml-result-badge,
.nml-cr-rank-badge {
  animation: nml-scale-in 480ms var(--ease-spring) both;
  animation-delay: 200ms;
}

/* ── ITDE Hero nodes — staggered ─────────────────────────── */

.nml-itde-node {
  animation: nml-fade-up 480ms var(--ease-spring) both;
}
.nml-itde-row .nml-itde-node:nth-child(1) { animation-delay: 100ms; }
.nml-itde-row .nml-itde-node:nth-child(3) { animation-delay: 200ms; }
.nml-itde-row .nml-itde-node:nth-child(5) { animation-delay: 300ms; }
.nml-itde-row .nml-itde-node:nth-child(7) { animation-delay: 400ms; }
.nml-itde-row .nml-itde-conn {
  animation: nml-fade-in var(--dur-page) var(--ease-out) both;
}
.nml-itde-row .nml-itde-conn:nth-child(2) { animation-delay: 150ms; }
.nml-itde-row .nml-itde-conn:nth-child(4) { animation-delay: 250ms; }
.nml-itde-row .nml-itde-conn:nth-child(6) { animation-delay: 350ms; }

/* ── Countdown blocks — pulse when < 1 min ───────────────── */

.nml-cp-timer.warning .nml-cp-timer-val {
  animation: nml-pulse-soft 1s ease-in-out infinite;
}

/* ── Skeleton shimmer ────────────────────────────────────── */

.nml-skeleton {
  background: linear-gradient(
    90deg,
    var(--nml-bg-soft, #F1F5F9) 0%,
    rgba(255,255,255,0.7) 50%,
    var(--nml-bg-soft, #F1F5F9) 100%
  );
  background-size: 200% 100%;
  animation: nml-shimmer 1.4s linear infinite;
}

/* ── Filter pill / segmented control — snappy ────────────── */

.nml-lb-tab,
.nml-period-seg button,
.nml-review-filter,
.nml-history-filter-pill,
.nml-cl-tab,
.nml-chip {
  transition:
    background var(--dur-micro) var(--ease-out),
    color var(--dur-micro) var(--ease-out),
    border-color var(--dur-micro) var(--ease-out),
    box-shadow var(--dur-micro) var(--ease-out);
}

/* ── Reduced motion — accessibility ──────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ============================================================
   Avatar img variants — sync from WordPress avatar_url
   ============================================================ */
.nml-sidebar-user-avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--nml-border);
}
.nml-profile-avatar-img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid var(--nml-border);
  box-shadow: 0 4px 12px rgba(15,23,42,0.08);
}


/* ============================================================
   INSTRUCTION PAGE
   ============================================================ */

.nml-instr-screen { max-width: 980px; margin: 0 auto; }

/* Header + lang toggle */
.nml-instr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.nml-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--nml-border);
  padding: 8px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--nml-text-mid);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.nml-back-btn:hover {
  color: var(--nml-blue);
  border-color: var(--nml-blue-border, #BFD3FF);
  background: var(--nml-blue-light, #EEF3FF);
}

.nml-lang-toggle {
  display: inline-flex;
  background: #fff;
  border: 1px solid var(--nml-border);
  border-radius: 100px;
  padding: 3px;
  gap: 2px;
}
.nml-lang-btn {
  background: transparent;
  border: none;
  padding: 7px 14px;
  border-radius: 100px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--nml-text-muted);
  cursor: pointer;
  transition: all var(--dur-ui) var(--ease-out);
  letter-spacing: 0.04em;
}
.nml-lang-btn:hover:not(.active) { color: var(--nml-blue); }
.nml-lang-btn.active {
  background: var(--nml-blue) !important;
  color: #fff !important;
  box-shadow: 0 2px 6px rgba(47,107,255,0.25);
}

/* Hero */
.nml-instr-hero {
  background: linear-gradient(135deg, #1A2540 0%, #0F172A 100%);
  color: #fff;
  border-radius: var(--radius-l, 16px);
  padding: 48px 40px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(15,23,42,0.10);
}
.nml-instr-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(47,107,255,0.25), transparent 50%),
              radial-gradient(circle at 20% 80%, rgba(34,197,94,0.18), transparent 50%);
  pointer-events: none;
}
.nml-instr-hero-content { position: relative; z-index: 1; max-width: 640px; }
.nml-instr-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 6px 12px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 18px;
  color: rgba(255,255,255,0.9);
}
.nml-instr-hero-title {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 14px;
}
.nml-instr-hero-title span { color: #5B8FFF; }
.nml-instr-hero-p {
  font-size: 16px;
  color: rgba(255,255,255,0.78);
  line-height: 1.6;
}

/* TOC */
.nml-instr-toc {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 40px;
}
.nml-instr-toc-item {
  background: #fff;
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-m, 12px);
  padding: 16px;
  text-align: left;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all var(--dur-ui) var(--ease-out);
  cursor: pointer;
}
.nml-instr-toc-item:hover {
  border-color: var(--nml-blue) !important;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.nml-instr-toc-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--nml-blue);
  letter-spacing: 0.08em;
}
.nml-instr-toc-name { font-size: 14px; font-weight: 700; color: var(--nml-text); }
.nml-instr-toc-desc { font-size: 12px; color: var(--nml-text-muted); }

/* Section */
.nml-instr-section { margin-bottom: 56px; scroll-margin-top: 32px; }
.nml-instr-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--nml-blue);
  margin-bottom: 10px;
}
.nml-instr-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--nml-text);
  margin-bottom: 12px;
}
.nml-instr-lead {
  font-size: 15px;
  color: var(--nml-text-mid);
  margin-bottom: 24px;
  max-width: 700px;
  line-height: 1.6;
}
.nml-instr-sub-h {
  font-size: 16px;
  font-weight: 700;
  margin: 32px 0 14px;
  color: var(--nml-text);
}
.nml-instr-sub-p { font-size: 13px; color: var(--nml-text-mid); margin-bottom: 16px; }

/* ITDE flow */
.nml-instr-itde-flow {
  background: #fff;
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-l, 16px);
  padding: 32px;
  margin-bottom: 16px;
}
.nml-instr-itde-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.nml-instr-itde-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 18px 14px;
  background: var(--nml-bg-soft, #F8FAFC);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-m, 12px);
  transition: all var(--dur-ui) var(--ease-out);
}
.nml-instr-itde-node:hover {
  border-color: var(--nml-blue-border, #BFD3FF);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.nml-instr-itde-glass {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 6px 16px rgba(47,107,255,0.15), inset 0 1px 0 rgba(255,255,255,0.6);
}
.nml-instr-glass-i, .nml-instr-glass-t { background: linear-gradient(135deg, #DBEAFE 0%, #BFDBFE 100%); }
.nml-instr-glass-d, .nml-instr-glass-e { background: linear-gradient(135deg, #DCFCE7 0%, #BBF7D0 100%); }
.nml-instr-itde-letter {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
}
.nml-instr-glass-i .nml-instr-itde-letter, .nml-instr-glass-t .nml-instr-itde-letter { color: var(--nml-blue); }
.nml-instr-glass-d .nml-instr-itde-letter, .nml-instr-glass-e .nml-instr-itde-letter { color: var(--nml-green); }
.nml-instr-itde-num {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--nml-text-muted);
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}
.nml-instr-itde-name { font-size: 14px; font-weight: 700; color: var(--nml-text); margin-bottom: 6px; }
.nml-instr-itde-desc { font-size: 11px; color: var(--nml-text-muted); line-height: 1.4; }

.nml-instr-itde-explain {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
.nml-instr-itde-detail {
  background: var(--nml-bg-soft, #F8FAFC);
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-m, 12px);
  padding: 18px 20px;
}
.nml-instr-itde-detail-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.nml-instr-itde-detail-letter {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
}
.nml-instr-letter-i, .nml-instr-letter-t { background: #DBEAFE; color: #1E40AF; }
.nml-instr-letter-d, .nml-instr-letter-e { background: #DCFCE7; color: #166534; }
.nml-instr-itde-detail-name { font-size: 14px; font-weight: 700; color: var(--nml-text); }
.nml-instr-itde-detail-text { font-size: 13px; color: var(--nml-text-mid); line-height: 1.55; }

/* Brand row */
.nml-instr-brand-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.nml-instr-brand-card {
  border-radius: var(--radius-m, 12px);
  padding: 16px 18px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all var(--dur-ui) var(--ease-out);
}
.nml-instr-brand-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.nml-sb-ecom  { background: var(--nml-ecom); }
.nml-sb-trade { background: var(--nml-trade); }
.nml-sb-brand { background: var(--nml-brand); }
.nml-sb-sales { background: var(--nml-sales); }
.nml-instr-brand-name { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.nml-instr-brand-desc { font-size: 11px; opacity: 0.8; }

/* Features */
.nml-instr-feat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.nml-instr-feat {
  background: #fff;
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-m, 12px);
  padding: 24px;
  transition: all var(--dur-ui) var(--ease-out);
}
.nml-instr-feat:hover { border-color: var(--nml-blue-border, #BFD3FF); box-shadow: var(--shadow-md); }
.nml-instr-feat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.nml-instr-feat-icon {
  width: 44px; height: 44px;
  background: var(--nml-blue-light, #EEF3FF);
  color: var(--nml-blue);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.nml-instr-feat-badge {
  background: var(--nml-blue-light, #EEF3FF);
  color: var(--nml-blue);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 100px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.nml-instr-feat-badge.premium {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  color: #92400E;
}
.nml-instr-feat-title { font-size: 17px; font-weight: 700; color: var(--nml-text); margin-bottom: 6px; }
.nml-instr-feat-desc { font-size: 13px; color: var(--nml-text-mid); margin-bottom: 14px; line-height: 1.55; }
.nml-instr-feat-points { list-style: none; display: flex; flex-direction: column; gap: 8px; padding: 0; }
.nml-instr-feat-points li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--nml-text-mid);
}
.nml-instr-feat-points li svg { color: var(--nml-green); flex-shrink: 0; margin-top: 2px; }

/* Ladder */
.nml-instr-ladder {
  background: #fff;
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-l, 16px);
  padding: 32px;
}
.nml-instr-ladder-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: center;
  margin-bottom: 24px;
}
.nml-instr-ladder-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.nml-instr-ladder-circle {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}
.nml-instr-lc-done {
  background: var(--nml-green);
  color: #fff;
  box-shadow: 0 4px 12px rgba(34,197,94,0.30);
}
.nml-instr-lc-current {
  background: var(--nml-blue);
  color: #fff;
  box-shadow: 0 4px 12px rgba(47,107,255,0.30);
  animation: nml-instr-pulse 2s ease-in-out infinite;
}
@keyframes nml-instr-pulse {
  0%, 100% { box-shadow: 0 4px 12px rgba(47,107,255,0.30); }
  50%      { box-shadow: 0 4px 20px rgba(47,107,255,0.50); }
}
.nml-instr-lc-locked {
  background: var(--nml-bg-soft, #F8FAFC);
  color: var(--nml-text-muted);
  border: 2px dashed var(--nml-border);
}
.nml-instr-ladder-name { font-size: 13px; font-weight: 700; color: var(--nml-text); margin-bottom: 4px; }
.nml-instr-ladder-meta { font-size: 11px; color: var(--nml-text-muted); }
.nml-instr-ladder-meta.green { color: var(--nml-green); }
.nml-instr-ladder-meta.blue  { color: var(--nml-blue); }

.nml-instr-ladder-conn {
  position: relative;
  height: 4px;
  margin-top: -52px;
  margin-bottom: 64px;
}
.nml-instr-ladder-conn-line { position: absolute; inset: 0; background: var(--nml-border); border-radius: 2px; }
.nml-instr-ladder-conn-fill { position: absolute; inset: 0; background: var(--nml-green); border-radius: 2px; }

.nml-instr-unlock-rules {
  background: var(--nml-blue-light, #EEF3FF);
  border-left: 4px solid var(--nml-blue);
  border-radius: 0 var(--radius-m, 12px) var(--radius-m, 12px) 0;
  padding: 18px 22px;
  margin-top: 16px;
}
.nml-instr-unlock-rules-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--nml-text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nml-instr-unlock-rules-list {
  font-size: 13px;
  color: var(--nml-text-mid);
  list-style: none;
  padding: 0;
}
.nml-instr-unlock-rules-list li {
  padding-left: 16px;
  position: relative;
  margin-bottom: 4px;
  line-height: 1.55;
}
.nml-instr-unlock-rules-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--nml-blue);
  font-weight: 700;
}
.nml-instr-unlock-rules-list b { color: var(--nml-text); }

/* Points table */
.nml-instr-points-table {
  background: #fff;
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-l, 16px);
  overflow: hidden;
}
.nml-instr-points-table table { width: 100%; border-collapse: collapse; }
.nml-instr-points-table th {
  background: var(--nml-bg-soft, #F8FAFC);
  font-size: 11px;
  font-weight: 700;
  color: var(--nml-text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid var(--nml-border);
}
.nml-instr-points-table th:last-child { text-align: right; }
.nml-instr-points-table td {
  padding: 16px 20px;
  font-size: 14px;
  color: var(--nml-text);
  border-bottom: 1px solid var(--nml-border);
}
.nml-instr-points-table tr:last-child td { border-bottom: none; }
.nml-instr-points-table td:last-child {
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--nml-green);
}
.nml-instr-pts-source {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nml-instr-pts-icon {
  width: 32px; height: 32px;
  background: var(--nml-blue-light, #EEF3FF);
  color: var(--nml-blue);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.nml-instr-pts-icon.gold {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  color: #92400E;
}
.nml-instr-pts-meta { font-size: 11px; color: var(--nml-text-muted); margin-top: 2px; }

/* Dashboard tour */
.nml-instr-dash-tour {
  background: #fff;
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-l, 16px);
  overflow: hidden;
}
.nml-instr-dash-item {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 20px;
  padding: 24px 28px;
  border-bottom: 1px solid var(--nml-border);
  align-items: flex-start;
}
.nml-instr-dash-item:last-child { border-bottom: none; }
.nml-instr-dash-num {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--nml-blue);
  width: 44px;
  height: 44px;
  background: var(--nml-blue-light, #EEF3FF);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.nml-instr-dash-name { font-size: 16px; font-weight: 700; color: var(--nml-text); margin-bottom: 6px; }
.nml-instr-dash-desc { font-size: 13px; color: var(--nml-text-mid); line-height: 1.6; }
.nml-instr-dash-desc b { color: var(--nml-text); }
.nml-instr-dash-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--nml-blue-light, #EEF3FF);
  color: var(--nml-blue);
  margin-left: 8px;
  vertical-align: middle;
}
.nml-instr-dash-tag.premium {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  color: #92400E;
}

/* FAQ */
.nml-instr-faq-list { display: flex; flex-direction: column; gap: 8px; }
.nml-instr-faq {
  background: #fff;
  border: 1px solid var(--nml-border);
  border-radius: var(--radius-m, 12px);
  overflow: hidden;
  transition: all 200ms var(--ease-out);
}
.nml-instr-faq[open] {
  border-color: var(--nml-blue-border, #BFD3FF);
  box-shadow: 0 1px 3px rgba(15,23,42,0.06);
}
.nml-instr-faq summary {
  padding: 16px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--nml-text);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nml-instr-faq summary::-webkit-details-marker { display: none; }
.nml-instr-faq summary::after {
  content: '+';
  font-size: 20px;
  color: var(--nml-blue);
  transition: transform 200ms var(--ease-out);
}
.nml-instr-faq[open] summary::after { content: '−'; }
.nml-instr-faq-body {
  padding: 0 20px 18px;
  font-size: 13px;
  color: var(--nml-text-mid);
  line-height: 1.65;
}
.nml-instr-faq-body b { color: var(--nml-text); }

/* CTA */
.nml-instr-cta {
  background: linear-gradient(135deg, var(--nml-blue) 0%, #1E4ED8 100%);
  color: #fff;
  border-radius: var(--radius-l, 16px);
  padding: 36px;
  text-align: center;
  margin-top: 24px;
  box-shadow: 0 8px 24px rgba(47,107,255,0.20);
}
.nml-instr-cta-title { font-size: 22px; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.02em; }
.nml-instr-cta-sub { font-size: 14px; opacity: 0.85; margin-bottom: 20px; }
.nml-instr-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff !important;
  color: var(--nml-blue) !important;
  padding: 12px 24px;
  border-radius: 100px;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--dur-ui) var(--ease-spring);
  box-shadow: 0 4px 12px rgba(0,0,0,0.10);
}
.nml-instr-cta-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.18); }

/* Mobile — match app breakpoint 900px */
@media (max-width: 900px) {
  /* Prevent horizontal overflow on the whole page */
  .nml-instr-screen { max-width: 100%; overflow-x: hidden; }
  .nml-instr-screen * { max-width: 100%; }

  /* Header: stack vertically */
  .nml-instr-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 16px;
  }
  .nml-lang-toggle { align-self: flex-start; }

  /* Hero: smaller padding, smaller title, prevent overflow */
  .nml-instr-hero {
    padding: 28px 20px;
    border-radius: 14px;
    margin-bottom: 24px;
  }
  .nml-instr-hero-title {
    font-size: 22px;
    line-height: 1.2;
    letter-spacing: -0.02em;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  .nml-instr-hero-p {
    font-size: 14px;
    line-height: 1.55;
  }
  .nml-instr-hero-eyebrow { margin-bottom: 14px; }

  /* TOC: 2 cols on mobile */
  .nml-instr-toc {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 32px;
  }
  .nml-instr-toc-item { padding: 14px; }
  .nml-instr-toc-name { font-size: 13px; }
  .nml-instr-toc-desc { font-size: 11px; }

  /* Sections: smaller titles, mb */
  .nml-instr-section { margin-bottom: 36px; }
  .nml-instr-title {
    font-size: 22px;
    line-height: 1.25;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  .nml-instr-lead { font-size: 14px; line-height: 1.55; }

  /* ITDE flow */
  .nml-instr-itde-flow { padding: 20px 16px; }
  .nml-instr-itde-row {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .nml-instr-itde-node { padding: 14px 10px; }
  .nml-instr-itde-glass { width: 44px; height: 44px; margin-bottom: 10px; }
  .nml-instr-itde-letter { font-size: 18px; }

  .nml-instr-itde-explain {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .nml-instr-itde-detail { padding: 14px 16px; }

  /* Sub-brand row: 2 cols */
  .nml-instr-brand-row {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  /* Features: 1 col */
  .nml-instr-feat-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .nml-instr-feat { padding: 18px; }
  .nml-instr-feat-title { font-size: 16px; }

  /* Ladder: 2 cols + remove connectors */
  .nml-instr-ladder { padding: 20px 16px; }
  .nml-instr-ladder-row {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    row-gap: 24px;
  }
  .nml-instr-ladder-conn { display: none; }
  .nml-instr-ladder-circle { width: 52px; height: 52px; font-size: 15px; }
  .nml-instr-unlock-rules { padding: 14px 16px; }

  /* Points table: scroll horizontal if needed */
  .nml-instr-points-table { overflow-x: auto; }
  .nml-instr-points-table table { min-width: 360px; }
  .nml-instr-points-table th,
  .nml-instr-points-table td { padding: 12px 14px; font-size: 13px; }
  .nml-instr-pts-icon { width: 28px; height: 28px; }
  .nml-instr-pts-meta { font-size: 10px; }

  /* Dashboard tour: tighter */
  .nml-instr-dash-item {
    grid-template-columns: 44px 1fr;
    gap: 14px;
    padding: 18px 16px;
  }
  .nml-instr-dash-num {
    width: 36px; height: 36px;
    font-size: 18px;
  }
  .nml-instr-dash-name { font-size: 15px; }
  .nml-instr-dash-desc { font-size: 13px; }

  /* FAQ: smaller */
  .nml-instr-faq summary { padding: 14px 16px; font-size: 13px; }
  .nml-instr-faq-body { padding: 0 16px 14px; font-size: 13px; }

  /* CTA */
  .nml-instr-cta { padding: 28px 20px; }
  .nml-instr-cta-title { font-size: 18px; }
  .nml-instr-cta-sub { font-size: 13px; }
}


/* ============================================================
   MOBILE OPTIMIZATION — bottom tab bar + module picker
   ============================================================ */

/* Bottom tab bar — hidden on desktop, shown on mobile */
.nml-mobile-tabbar {
  display: none;
}

@media (max-width: 900px) {
  /* Hide sidebar, switch to single column */
  .nml-sidebar { display: none !important; }

  .nml-app-shell {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  /* Add bottom padding so content above tabbar isn't hidden */
  .nml-main {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  /* Show bottom tab bar */
  .nml-mobile-tabbar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--nml-border);
    padding: 6px 4px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 16px rgba(15,23,42,0.06);
    z-index: 9999;
    width: 100%;
    box-sizing: border-box;
  }

  .nml-mtab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: transparent;
    border: none;
    padding: 6px 4px;
    border-radius: 8px;
    font-family: inherit;
    color: var(--nml-text-muted);
    cursor: pointer;
    transition: all 150ms var(--ease-out);
    min-height: 50px;
  }

  .nml-mtab:active { transform: scale(0.93); }

  .nml-mtab-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1;
  }

  .nml-mtab.active {
    color: var(--nml-blue);
    background: var(--nml-blue-light, #EEF3FF);
  }
  .nml-mtab.active svg { stroke: var(--nml-blue); }
}

/* ============================================================
   MODULE PICKER — searchable, collapsible, mobile-friendly
   ============================================================ */

.nml-mp {
  background: #fff;
  border: 1px solid var(--nml-border);
  border-radius: 10px;
  overflow: hidden;
}

.nml-mp-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 14px;
  background: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 150ms var(--ease-out);
}
.nml-mp-trigger:hover { background: var(--nml-bg-soft, #F8FAFC); }
.nml-mp-trigger.open {
  background: var(--nml-blue-light, #EEF3FF);
  border-bottom: 1px solid var(--nml-border);
  border-radius: 10px 10px 0 0;
}

.nml-mp-trigger svg { color: var(--nml-text-muted); flex-shrink: 0; }
.nml-mp-trigger.open svg { color: var(--nml-blue); }

.nml-mp-trigger-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.nml-mp-trigger-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--nml-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nml-mp-trigger-meta {
  font-size: 11px;
  color: var(--nml-text-muted);
  font-weight: 500;
}

.nml-mp-selected-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px 12px;
  border-top: 1px dashed var(--nml-border);
}
.nml-mp-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 4px 4px 10px;
  background: var(--nml-blue);
  color: #fff;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}
.nml-mp-pill-x {
  background: rgba(255,255,255,0.20);
  border: none;
  color: #fff;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.nml-mp-pill-x:hover { background: rgba(255,255,255,0.35); }

.nml-mp-panel {
  background: #fff;
  animation: nml-mp-expand 220ms var(--ease-out) both;
}
@keyframes nml-mp-expand {
  from { opacity: 0; max-height: 0; }
  to   { opacity: 1; max-height: 500px; }
}

.nml-mp-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--nml-border);
  color: var(--nml-text-muted);
}
.nml-mp-search {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  color: var(--nml-text);
}
.nml-mp-search::placeholder { color: var(--nml-text-muted); }

.nml-mp-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--nml-bg-soft, #F8FAFC);
  border-bottom: 1px solid var(--nml-border);
  gap: 8px;
  flex-wrap: wrap;
}
.nml-mp-count {
  font-size: 12px;
  color: var(--nml-text-mid);
  font-weight: 600;
}
.nml-mp-action-btns {
  display: flex;
  gap: 6px;
}
.nml-mp-mini-btn {
  background: transparent;
  border: 1px solid var(--nml-border);
  padding: 4px 10px;
  border-radius: 100px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--nml-blue);
  cursor: pointer;
  transition: all 150ms var(--ease-out);
}
.nml-mp-mini-btn:hover {
  background: var(--nml-blue-light, #EEF3FF);
  border-color: var(--nml-blue-border, #BFD3FF);
}

.nml-mp-list {
  max-height: 280px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.nml-mp-empty {
  padding: 24px 14px;
  text-align: center;
  font-size: 13px;
  color: var(--nml-text-muted);
}
.nml-mp-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--nml-border);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 120ms var(--ease-out);
}
.nml-mp-item:hover { background: var(--nml-bg-soft, #F8FAFC); }
.nml-mp-item:last-child { border-bottom: none; }
.nml-mp-item.selected { background: var(--nml-blue-light, #EEF3FF); }

.nml-mp-item-check {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--nml-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #fff;
  color: #fff;
  transition: all 120ms var(--ease-out);
}
.nml-mp-item.selected .nml-mp-item-check {
  background: var(--nml-blue);
  border-color: var(--nml-blue);
}

.nml-mp-item-main { min-width: 0; flex: 1; }
.nml-mp-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--nml-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nml-mp-item-meta {
  font-size: 11px;
  color: var(--nml-text-muted);
  margin-top: 1px;
}

.nml-mp-done {
  width: 100%;
  background: var(--nml-blue);
  border: none;
  color: #fff;
  padding: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms var(--ease-out);
}
.nml-mp-done:hover { background: #1E4ED8; }

/* Mobile-specific tweaks for picker */
@media (max-width: 900px) {
  .nml-mp-list { max-height: 220px; }
  .nml-mp-actions { flex-direction: column; align-items: stretch; }
  .nml-mp-action-btns { justify-content: flex-end; }
}


/* ============================================================
   MOBILE TOP BAR — minimal app title (transparent, no card)
   ============================================================ */

.nml-mobile-topbar { display: none; }

@media (max-width: 900px) {
  /* ─── Top bar: brand only (avatar removed) ─── */
  .nml-mobile-topbar {
    display: flex;
    align-items: center;
    background: transparent;
    border-bottom: 1px solid var(--nml-border);
    padding: 14px 0;
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
    margin: 0 14px 4px;
    position: relative;
    z-index: 40;
  }

  .nml-mtop-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    flex: 1;
    min-width: 0;
  }
  .nml-mtop-logo {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    object-fit: contain;
    flex-shrink: 0;
  }
  .nml-mtop-brand-text { display: flex; flex-direction: column; min-width: 0; }
  .nml-mtop-brand-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--nml-text);
    letter-spacing: 0.04em;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Avatar mini button (right side) */
  .nml-mtop-avatar-mini {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--nml-blue) 0%, #1E4ED8 100%);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    overflow: visible;
    font-family: inherit;
    box-shadow: 0 2px 6px rgba(47,107,255,0.20);
    transition: transform 150ms var(--ease-out);
  }
  .nml-mtop-avatar-mini:active { transform: scale(0.92); }

  .nml-mtop-avatar-mini-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
  }

  /* Premium dot indicator */
  .nml-mtop-avatar-mini.premium::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: #FBBF24;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.10);
  }

  /* Dashboard greeting — Variant C bold style */
  .nml-dash > .nml-dash-topbar {
    margin-top: 8px;
    margin-bottom: 16px;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0;
  }
  .nml-dash-greeting h1 {
    font-size: 22px;
    line-height: 1.2;
    margin: 0 0 8px 0;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--nml-text);
  }
  .nml-dash-greeting-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 11px;
    color: var(--nml-text-mid);
  }
  .nml-dash-greeting-dot {
    width: 3px;
    height: 3px;
    background: var(--nml-text-muted);
    border-radius: 50%;
    flex-shrink: 0;
  }
  .nml-dash-greeting-streak {
    font-size: 11px;
    color: var(--nml-text-mid);
    font-weight: 500;
  }
  /* Hide old avatar refs (now in top bar) */
  .nml-dash-greeting-avatar-img,
  .nml-dash-greeting-avatar { display: none; }

  /* Bỏ background trắng container, để nền theme/web lộ qua */
  .nml-main {
    padding-left: 0 !important;
    padding-right: 0 !important;
    background: transparent !important;
  }
  .nml-screen, .nml-dash {
    padding-left: 14px !important;
    padding-right: 14px !important;
    padding-top: 8px !important;
    background: transparent !important;
  }

  /* App shell trên mobile = transparent */
  .nml-app-shell {
    background: transparent !important;
    overflow-x: hidden;
  }
  .nml-app-container {
    background: transparent !important;
    overflow-x: hidden;
  }
  /* Universal mobile overflow guard */
  body, html { overflow-x: hidden; }

  /* Function section: stack title above premium hint */
  .nml-dash-fn-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 16px;
  }
  .nml-dash-fn-header h2 { font-size: 18px; }
  .nml-dash-premium-hint { font-size: 11px; }

  /* Function grid: 2 cols on mobile */
  .nml-dash-fn-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  /* All content cards: force opaque white bg + stronger shadow so they read well above transparent page */
  .nml-dash-fn-card,
  .nml-dash-stat-card,
  .nml-dash-continue-card,
  .nml-dash-challenge-banner,
  .nml-itde-card,
  .nml-dash-resume-banner,
  .nml-card {
    background: #FFFFFF !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04) !important;
  }
}

/* Desktop fallback: greeting row falls back to original layout (no avatar shown) */
@media (min-width: 901px) {
  .nml-dash-greeting-avatar,
  .nml-dash-greeting-avatar-img,
  .nml-dash-greeting-meta { display: none; }
  .nml-dash-greeting-row { display: contents; }
}



/* ============================================================
   PRACTICE — Mode tabs (replaces old big mode-picker cards)
   ============================================================ */

.nml-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--nml-bg-soft, #F8FAFC);
  border: 1px solid var(--nml-border);
  border-radius: 12px;
  padding: 6px;
  margin-bottom: 12px;
}

.nml-mode-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: transparent;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  color: var(--nml-text-mid);
  transition: all 200ms var(--ease-out);
}

.nml-mode-tab:hover:not(.active) {
  background: rgba(47,107,255,0.05);
  color: var(--nml-blue);
}

.nml-mode-tab.active {
  background: #fff;
  color: var(--nml-text);
  box-shadow: 0 2px 8px rgba(47,107,255,0.12), 0 1px 3px rgba(15,23,42,0.06);
}

.nml-mode-tab.active svg { color: var(--nml-blue); }

.nml-mode-tab.locked { opacity: 0.62; }
.nml-mode-tab.locked svg { color: var(--nml-text-muted); }

.nml-mode-tab-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.nml-mode-tab-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nml-mode-tab-meta {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--nml-text-muted);
  text-transform: uppercase;
}

.nml-mode-tab.active .nml-mode-tab-meta { color: var(--nml-blue); }

/* Summary block under tabs */
.nml-mode-summary {
  background: #fff;
  border: 1px solid var(--nml-border);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 18px;
}

.nml-mode-summary-desc {
  font-size: 13px;
  color: var(--nml-text-mid);
  line-height: 1.55;
  margin-bottom: 10px;
}

.nml-mode-summary-feats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 12px;
  color: var(--nml-text-mid);
  font-weight: 600;
}
.nml-mode-summary-feats span { white-space: nowrap; }

.nml-mode-lock-banner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 12px;
  background: #FEF3C7;
  border: 1px solid #FCD34D;
  color: #92400E;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}

/* Mobile-specific tweaks */
@media (max-width: 900px) {
  .nml-mode-tab { padding: 10px 12px; }
  .nml-mode-tab-name { font-size: 12px; }
  .nml-mode-tab-meta { font-size: 9px; }
  .nml-mode-summary { padding: 14px; }
  .nml-mode-summary-feats { gap: 4px 10px; font-size: 11px; }
}


/* ============================================================
   MOBILE DASHBOARD — Variant C full styling
   ============================================================ */

/* Visibility helpers */
.nml-mobile-only { display: none; }
.nml-desktop-only { display: block; }

@media (max-width: 900px) {
  .nml-mobile-only { display: block; }
  .nml-desktop-only { display: none !important; }

  /* ─── Overall Progress Card (mobile-only) ─── */
  .nml-mobile-progress-card-wrap {
    margin-bottom: 16px;
  }
  .nml-mobile-progress-card {
    background: #fff;
    border: 1px solid var(--nml-border);
    border-radius: 16px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(15,23,42,0.04);
  }
  .nml-mp-info { flex: 1; min-width: 0; }
  .nml-mp-label {
    font-size: 12px;
    color: var(--nml-text-mid);
    font-weight: 600;
    margin-bottom: 4px;
  }
  .nml-mp-value {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--nml-text);
    line-height: 1;
    margin-bottom: 10px;
    font-family: 'Plus Jakarta Sans', sans-serif;
  }
  .nml-mp-bar {
    height: 7px;
    background: var(--nml-border);
    border-radius: 100px;
    overflow: hidden;
  }
  .nml-mp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--nml-blue) 0%, #5B8FFF 100%);
    border-radius: 100px;
    animation: nml-fillBar 1.2s var(--ease-decel) both;
    transform-origin: left;
  }
  @keyframes nml-fillBar {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
  }
  .nml-mp-chart {
    width: 78px;
    height: 78px;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 8px rgba(47, 107, 255, 0.20));
  }

  /* ─── ITDE Hero Card: convert to 2x2 grid + compact header ─── */
  .nml-itde-card {
    padding: 16px !important;
    border-radius: 14px !important;
  }
  .nml-itde-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    row-gap: 10px !important;
  }
  /* Hide connector lines between nodes on mobile */
  .nml-itde-conn { display: none !important; }

  .nml-itde-node {
    background: var(--nml-bg-soft);
    border: 1px solid var(--nml-border);
    border-radius: 12px;
    padding: 12px 10px;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
  }
  .nml-itde-glass {
    width: 40px !important;
    height: 40px !important;
    border-radius: 11px !important;
    margin-bottom: 0 !important;
  }
  .nml-itde-glass svg { width: 22px !important; height: 22px !important; }
  .nml-itde-num { font-size: 9px !important; margin-bottom: 0 !important; }
  .nml-itde-name { font-size: 12px !important; margin-bottom: 0 !important; }
  .nml-itde-desc { display: none; } /* Hide description on mobile - too cluttered */

  /* ─── 3 KPI stats: keep 3-col, compact ─── */
  .nml-dash-stats {
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 8px !important;
    margin-bottom: 16px;
  }
  .nml-dash-stat-card {
    padding: 12px 10px !important;
    flex-direction: column !important;
    gap: 0 !important;
    align-items: flex-start !important;
    text-align: left;
  }
  /* Hide stat icon on mobile - save space */
  .nml-dash-stat-icon { display: none !important; }
  .nml-dash-stat-body { width: 100%; }
  .nml-dash-stat-label {
    font-size: 10px !important;
    margin-bottom: 6px !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    color: var(--nml-text-muted) !important;
    font-weight: 700 !important;
  }
  .nml-dash-stat-val {
    font-size: 22px !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em !important;
    line-height: 1 !important;
    margin-bottom: 4px !important;
  }
  .nml-dash-stat-delta {
    font-size: 10px !important;
    font-weight: 700 !important;
  }

  /* ─── 2-col → 1 col stacked on mobile ─── */
  .nml-dash-two-col {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    margin-bottom: 16px;
  }

  /* Continue Learning: redesign to thumbnail + info + button row */
  .nml-dash-continue-card {
    padding: 16px !important;
    border-radius: 16px;
  }
  .nml-dash-section-label {
    font-size: 13px !important;
    margin-bottom: 12px !important;
  }

  /* Weekly Challenge: with trophy header */
  .nml-dash-challenge-banner {
    background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%) !important;
    border: 1px solid #FDE68A !important;
    padding: 18px !important;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(251,191,36,0.18) !important;
  }
  .nml-dash-challenge-header-mobile {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
  }
  .nml-dash-challenge-text-mobile {
    flex: 1;
    min-width: 0;
  }
  .nml-dash-challenge-title {
    font-size: 16px !important;
    font-weight: 800 !important;
    color: #92400E !important;
    margin-bottom: 4px !important;
  }
  .nml-dash-challenge-sub {
    font-size: 12px !important;
    color: #B45309 !important;
    margin-bottom: 0 !important;
  }
  .nml-trophy-svg {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    filter: drop-shadow(0 6px 12px rgba(251,191,36,0.40));
    animation: nml-trophyBob 3s ease-in-out infinite;
  }
  @keyframes nml-trophyBob {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50% { transform: translateY(-4px) rotate(3deg); }
  }

  /* Countdown blocks — yellow theme */
  .nml-dash-cd-label-top {
    font-size: 10px !important;
    color: #92400E !important;
    margin-bottom: 8px !important;
    margin-top: 0 !important;
  }
  .nml-dash-countdown {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 6px !important;
    margin-bottom: 14px;
  }
  .nml-dash-cd-block {
    background: #FEF3C7 !important;
    border: 1px solid #FCD34D !important;
    border-radius: 10px !important;
    padding: 10px 4px !important;
    text-align: center;
  }
  .nml-dash-cd-val {
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 20px !important;
    font-weight: 800 !important;
    color: #78350F !important;
    line-height: 1 !important;
    margin-bottom: 3px !important;
  }
  .nml-dash-cd-label {
    font-size: 9px !important;
    color: #92400E !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em;
  }

  .nml-dash-btn-challenge {
    width: 100%;
    background: #fff !important;
    color: #92400E !important;
    border: 1px solid #FCD34D !important;
    border-radius: 100px !important;
    padding: 10px 16px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 6px rgba(251,191,36,0.20) !important;
  }

  /* ─── Function Progress section ─── */
  .nml-dash-fn-section { margin-bottom: 16px; }
  .nml-dash-fn-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
  .nml-dash-fn-card {
    padding: 14px !important;
    border-radius: 14px !important;
    position: relative;
    overflow: hidden;
  }
  /* Ensure top accent strip visible on mobile (3px line in sub-brand color) */
  .nml-dash-fn-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: 14px 14px 0 0;
  }
  .nml-dash-fn-card.nml-dash-fn-ecom::before  { background: var(--nml-ecom, #A0522D); }
  .nml-dash-fn-card.nml-dash-fn-trade::before { background: var(--nml-trade, #1E2D40); }
  .nml-dash-fn-card.nml-dash-fn-brand::before { background: var(--nml-brand, #3B0764); }
  .nml-dash-fn-card.nml-dash-fn-sales::before { background: var(--nml-sales, #0F766E); }

  .nml-dash-fn-card .nml-dash-fn-top { margin-bottom: 12px !important; }
  .nml-dash-fn-icon {
    width: 32px !important;
    height: 32px !important;
    border-radius: 9px !important;
  }
  .nml-dash-fn-level-badge {
    font-size: 9px !important;
    padding: 3px 7px !important;
  }
  .nml-dash-fn-name {
    font-size: 14px !important;
    margin-bottom: 3px !important;
  }
  .nml-dash-fn-tag {
    font-size: 10px !important;
    margin-bottom: 10px !important;
  }
  .nml-dash-fn-pct {
    font-size: 11px !important;
    font-weight: 800 !important;
  }

  /* ─── Continue Learning module thumb polish ─── */
  .nml-dash-module-thumb {
    width: 56px !important;
    height: 56px !important;
    border-radius: 12px !important;
    position: relative;
    overflow: hidden;
  }
  .nml-dash-module-thumb::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.20) 0%, transparent 50%);
    pointer-events: none;
  }
  .nml-dash-module-thumb svg {
    position: relative;
    z-index: 1;
  }
  .nml-dash-btn-resume {
    flex-shrink: 0;
    padding: 9px 16px !important;
    border-radius: 100px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 10px rgba(47,107,255,0.25) !important;
  }
}


/* ============================================================
   UNIFIED BUTTON HOVER — Primary blue → White outlined (NML system)
   Default: blue bg + white text
   Hover:   white bg + blue border + blue text
   Active:  scale(0.97)
   ============================================================ */

.nml-btn-primary,
.nml-dash-btn-challenge,
.nml-btn-start,
.nml-btn-next,
.nml-btn-submit,
.nml-mp-done,
button.nml-btn-cta {
  background: var(--nml-blue) !important;
  color: #fff !important;
  border: 1px solid var(--nml-blue) !important;
  transition: all 200ms var(--ease-out) !important;
}

.nml-btn-primary svg,
.nml-dash-btn-challenge svg,
.nml-btn-start svg,
.nml-btn-next svg,
.nml-btn-submit svg,
.nml-mp-done svg,
button.nml-btn-cta svg {
  color: #fff;
  stroke: #fff;
  transition: all 200ms var(--ease-out);
}

.nml-btn-primary:hover:not(:disabled):not(.nml-btn-disabled),
.nml-dash-btn-challenge:hover:not(:disabled),
.nml-btn-start:hover:not(:disabled),
.nml-btn-next:hover:not(:disabled),
.nml-btn-submit:hover:not(:disabled),
.nml-mp-done:hover:not(:disabled),
button.nml-btn-cta:hover:not(:disabled) {
  background: #fff !important;
  color: var(--nml-blue) !important;
  border-color: var(--nml-blue) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(47,107,255,0.18) !important;
}

.nml-btn-primary:hover:not(:disabled) svg,
.nml-dash-btn-challenge:hover:not(:disabled) svg,
.nml-btn-start:hover:not(:disabled) svg,
.nml-btn-next:hover:not(:disabled) svg,
.nml-btn-submit:hover:not(:disabled) svg,
.nml-mp-done:hover:not(:disabled) svg,
button.nml-btn-cta:hover:not(:disabled) svg {
  color: var(--nml-blue);
  stroke: var(--nml-blue);
}

.nml-btn-primary:active,
.nml-dash-btn-challenge:active,
.nml-btn-start:active,
.nml-btn-next:active,
.nml-btn-submit:active,
.nml-mp-done:active,
button.nml-btn-cta:active {
  transform: scale(0.97);
}

/* Touch devices: skip hover state visual swap (no real hover) */
@media (hover: none) {
  .nml-btn-primary:hover:not(:disabled),
  .nml-dash-btn-challenge:hover:not(:disabled),
  .nml-btn-start:hover:not(:disabled),
  .nml-btn-next:hover:not(:disabled),
  .nml-btn-submit:hover:not(:disabled),
  .nml-mp-done:hover:not(:disabled),
  button.nml-btn-cta:hover:not(:disabled) {
    background: var(--nml-blue) !important;
    color: #fff !important;
    transform: none;
  }
  @media (max-width: 900px) {
    .nml-btn-primary:hover:not(:disabled) svg,
    .nml-dash-btn-challenge:hover:not(:disabled) svg,
    .nml-btn-start:hover:not(:disabled) svg,
    .nml-btn-next:hover:not(:disabled) svg,
    .nml-btn-submit:hover:not(:disabled) svg,
    .nml-mp-done:hover:not(:disabled) svg,
    button.nml-btn-cta:hover:not(:disabled) svg {
      color: #fff;
      stroke: #fff;
    }
  }
}

/* Challenge card mobile button: keep yellow theme, NOT primary blue */
@media (max-width: 900px) {
  .nml-dash-challenge-banner .nml-dash-btn-challenge {
    background: #fff !important;
    color: #92400E !important;
    border: 1px solid #FCD34D !important;
  }
  .nml-dash-challenge-banner .nml-dash-btn-challenge:hover {
    background: #FEF3C7 !important;
    color: #78350F !important;
  }
}

