.futuredev-app {
  --fd-bg: #070a0f;
  --fd-bg-soft: #0b1018;
  --fd-panel: #10151f;
  --fd-panel-2: #151b27;
  --fd-line: rgba(255,255,255,.09);
  --fd-line-strong: rgba(255,255,255,.16);
  --fd-text: #f7f8fb;
  --fd-muted: #9aa4b2;
  --fd-accent: #ff5722;
  --fd-green: #4ade80;
  --fd-red: #ff7373;
  color: var(--fd-text);
  background: var(--fd-bg);
  border-radius: 26px;
  overflow: hidden;
  min-height: 760px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.futuredev-app * { box-sizing: border-box; }
.futuredev-app button { font: inherit; }
.fd-focus-shell { position: relative; display: grid; grid-template-columns: 320px 1fr; min-height: 760px; background: radial-gradient(circle at 65% -20%, rgba(255,87,34,.12), transparent 26%), linear-gradient(180deg, #090d14, #070a0f); }
.fd-dashboard-mode { grid-template-columns: 280px 1fr; }
.fd-sidebar { border-right: 1px solid var(--fd-line); padding: 28px 22px; background: rgba(0,0,0,.24); }
.fd-brand { display: flex; align-items: center; gap: 10px; font-size: 26px; font-weight: 850; letter-spacing: -.045em; }
.fd-brand span { color: var(--fd-accent); }
.fd-sidebar-note { color: var(--fd-muted); font-size: 13px; margin: 8px 0 28px; }
.fd-menu-button, .fd-ghost { background: rgba(255,255,255,.03); color: #dbe1ea; border: 1px solid var(--fd-line); border-radius: 12px; padding: 11px 14px; cursor: pointer; }
.fd-menu-button { width: 100%; text-align: left; margin: 16px 0 22px; }
.fd-menu-button-first { margin-top: 0; }
.fd-menu-button:hover, .fd-ghost:hover { border-color: var(--fd-line-strong); background: rgba(255,255,255,.06); }
.fd-primary { border: 0; background: var(--fd-accent); color: #fff; border-radius: 12px; padding: 12px 18px; font-weight: 780; cursor: pointer; box-shadow: 0 14px 34px rgba(255,87,34,.22); }
.fd-primary:hover { filter: brightness(1.05); }
.fd-course-card { border: 1px solid var(--fd-line); border-radius: 16px; padding: 18px; background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.015)); margin-bottom: 24px; }
.fd-course-card > div:first-child { display: flex; justify-content: space-between; gap: 16px; }
.fd-course-card small { color: var(--fd-muted); }
.fd-progress { height: 7px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 16px; }
.fd-progress span, .fd-mini-progress i:before { display: block; height: 100%; width: var(--fd-progress-width, 0%); background: var(--fd-accent); border-radius: inherit; transition: width .45s ease; }
.fd-lesson-list { display: grid; gap: 8px; }
.fd-lesson-list button { display: flex; gap: 12px; align-items: center; text-align: left; color: #d4dae4; background: transparent; border: 1px solid transparent; border-radius: 12px; padding: 12px; cursor: pointer; }
.fd-lesson-list button span { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--fd-line); border-radius: 999px; color: var(--fd-muted); font-size: 12px; }
.fd-lesson-list button.is-active, .fd-lesson-list button:hover { background: var(--fd-panel-2); border-color: var(--fd-line); }
.fd-lesson-list button.is-active { box-shadow: inset 3px 0 0 var(--fd-accent); }
.fd-card-progress,
.fd-segment-progress { margin: 18px 0 20px; }
.fd-lesson-list button.is-completed { color: #eefcf3; }
.fd-lesson-list button.is-completed span {
  border-color: rgba(74,222,128,.45);
  background: rgba(74,222,128,.12);
  color: var(--fd-green);
}
.fd-lesson-list button.is-completed.is-active span {
  background: var(--fd-green);
  color: #06110a;
}

.fd-learning-main { min-width: 0; padding: 0 28px 28px; }
.fd-topbar { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--fd-line); }
.fd-crumbs { color: var(--fd-muted); display: flex; gap: 12px; align-items: center; font-size: 14px; }
.fd-crumbs strong { color: #fff; }
.fd-top-actions { display: flex; align-items: center; gap: 14px; }
.fd-mini-progress { width: 250px; display: grid; grid-template-columns: 1fr auto; gap: 10px; color: var(--fd-muted); font-size: 13px; }
.fd-mini-progress strong { color: #fff; }
.fd-mini-progress i { grid-column: 1 / -1; display: block; height: 6px; border-radius: 999px; background: rgba(255,255,255,.09); overflow: hidden; }
.fd-mini-progress i:before { content: ''; width: var(--fd-progress-width, 0%); }
.fd-card-large { max-width: 1180px; margin: 28px auto 0; border: 1px solid var(--fd-line); border-radius: 18px; background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.014)); overflow: hidden; }
.fd-tabs { display: flex; gap: 28px; padding: 0 32px; border-bottom: 1px solid var(--fd-line); }
.fd-tabs button { position: relative; background: transparent; border: 0; color: #d8dde7; padding: 24px 10px; cursor: pointer; }
.fd-tabs button.is-active { color: #fff; font-weight: 760; }
.fd-tabs button.is-active:after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 999px; background: var(--fd-accent); }
.fd-tab-panel { min-height: 520px; padding: 44px 32px; }
.fd-reading { max-width: 760px; margin: 0 auto; }
.fd-reading h1 { margin: 0 0 30px; font-size: 42px; line-height: 1.05; letter-spacing: -.055em; }
.fd-reading h2 { font-size: 30px; margin: 0 0 16px; letter-spacing: -.04em; }
.fd-reading p, .fd-content, .fd-lead-small { color: var(--fd-muted); font-size: 17px; line-height: 1.72; }
.fd-content h2, .fd-content h3 { color: #fff; letter-spacing: -.03em; }
.fd-content code, .fd-reading code { background: rgba(255,255,255,.08); color: #fff; padding: 3px 7px; border-radius: 7px; }
.fd-code-block { background: #0a0e15; border: 1px solid var(--fd-line); border-radius: 14px; padding: 18px; color: #e9edf5; overflow: auto; }
.fd-soft-box { background: rgba(255,255,255,.04); border: 1px solid var(--fd-line); border-radius: 14px; padding: 18px; color: var(--fd-muted); margin-top: 24px; }
.fd-code-workspace { max-width: 960px; margin: 0 auto; border: 1px solid var(--fd-line); border-radius: 16px; background: #080c13; overflow: hidden; }
.fd-file-tabs { display: flex; border-bottom: 1px solid var(--fd-line); background: rgba(255,255,255,.025); }
.fd-file-tabs button { background: transparent; border: 0; color: #d8dde7; padding: 16px 22px; cursor: pointer; }
.fd-file-tabs button.is-active { color: #fff; box-shadow: inset 0 -3px 0 var(--fd-accent); }
.fd-code-editor { display: block; width: 100%; min-height: 390px; resize: vertical; border: 0; outline: 0; background: #080c13; color: #f0f3f8; padding: 24px; font: 15px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.fd-code-actions { display: flex; gap: 12px; justify-content: flex-end; align-items: center; padding: 16px; border-top: 1px solid var(--fd-line); }
.fd-footer-actions { display: flex; align-items: center; gap: 16px; padding: 22px 32px; border-top: 1px solid var(--fd-line); }
.fd-help-button { margin-left: auto; }
.fd-result { border: 1px solid var(--fd-line); border-radius: 14px; padding: 18px; margin-bottom: 22px; color: var(--fd-muted); }
.fd-result.is-passed { border-color: rgba(74,222,128,.4); color: var(--fd-green); background: rgba(74,222,128,.06); }
.fd-result.is-failed { border-color: rgba(255,115,115,.4); color: var(--fd-red); background: rgba(255,115,115,.06); }
.fd-modal-backdrop { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 42px; background: rgba(0,0,0,.62); backdrop-filter: blur(10px); }
.fd-preview-modal { width: min(920px, 100%); height: min(650px, 100%); border: 1px solid rgba(255,255,255,.22); border-radius: 20px; overflow: hidden; box-shadow: 0 40px 90px rgba(0,0,0,.55); background: var(--fd-panel); }
.fd-preview-modal header { height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid var(--fd-line); }
.fd-preview-modal header button { background: transparent; border: 0; color: #fff; font-size: 26px; cursor: pointer; }
.fd-preview { width: 100%; height: calc(100% - 58px); border: 0; background: #fff; }
.fd-help-drawer { position: absolute; top: 24px; right: 24px; bottom: 24px; z-index: 30; width: min(380px, calc(100% - 48px)); border: 1px solid var(--fd-line-strong); border-radius: 18px; background: rgba(16,21,31,.96); box-shadow: 0 30px 80px rgba(0,0,0,.45); padding: 22px; backdrop-filter: blur(12px); }
.fd-help-drawer header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.fd-help-drawer header button { background: transparent; border: 0; color: #fff; font-size: 24px; cursor: pointer; }
.fd-help-drawer p { color: var(--fd-muted); line-height: 1.6; }
.fd-ai-output { border: 1px solid var(--fd-line); border-radius: 14px; padding: 14px; color: #fff; margin: 18px 0; }
.fd-dashboard { padding: 72px; }
.fd-eyebrow { color: var(--fd-accent); font-weight: 850; text-transform: uppercase; letter-spacing: .12em; font-size: 12px; }
.fd-dashboard h1 { margin: 0; font-size: clamp(48px, 7vw, 88px); letter-spacing: -.07em; line-height: .92; }
.fd-lead { color: var(--fd-muted); font-size: 20px; max-width: 680px; line-height: 1.6; }
.fd-path-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; margin-top: 38px; }
.fd-path-card { min-height: 260px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.014)); border: 1px solid var(--fd-line); border-radius: 20px; padding: 24px; }
.fd-path-card span { color: var(--fd-accent); font-size: 12px; font-weight: 800; }
.fd-path-card h2 { margin: 0; letter-spacing: -.04em; }
.fd-path-card p { color: var(--fd-muted); line-height: 1.6; }
.fd-path-card .fd-primary { margin-top: auto; }
.fd-path-card.is-muted { opacity: .52; }
.fd-error { padding: 32px; color: var(--fd-red); }
@media (max-width: 1050px) {
  .fd-focus-shell, .fd-dashboard-mode { grid-template-columns: 1fr; }
  .fd-sidebar { border-right: 0; border-bottom: 1px solid var(--fd-line); }
  .fd-topbar, .fd-top-actions, .fd-footer-actions { flex-wrap: wrap; }
  .fd-path-grid { grid-template-columns: 1fr; }
  .fd-dashboard { padding: 36px; }
}

/* v0.3.8: block wrapper no longer controls width or layout; Gutenberg alignment handles it. */
.futuredev-app {
  width: 100%;
  max-width: none;
}
.fd-card-large {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}
.fd-reading {
  max-width: 860px;
}
.fd-content p {
  margin: 0 0 20px;
}
.fd-content h2 {
  margin: 34px 0 12px;
  font-size: 24px;
}
.fd-instructions {
  color: var(--fd-muted);
  font-size: 17px;
  line-height: 1.8;
  white-space: normal;
}
.fd-dashboard-sidebar .fd-sidebar-note {
  margin-top: 0;
}

/* v0.3.4: clean dashboard, path-level sidebar, and language/segment selection */
.fd-dashboard-mode {
  display: block;
  min-height: 760px;
}
.fd-dashboard-clean {
  max-width: 1440px;
  margin: 0 auto;
}
.fd-path-mode {
  grid-template-columns: 320px 1fr;
}
.fd-path-dashboard h1 {
  max-width: 900px;
}
.fd-sidebar-label {
  color: var(--fd-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
  margin: 24px 0 12px;
  font-weight: 800;
}
.fd-track-list {
  display: grid;
  gap: 8px;
}
.fd-track-list button {
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
  color: #d4dae4;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
}
.fd-track-list button span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--fd-line);
  border-radius: 999px;
  color: var(--fd-muted);
  font-size: 12px;
}
.fd-track-list button.is-active,
.fd-track-list button:hover {
  background: var(--fd-panel-2);
  border-color: var(--fd-line);
}
.fd-track-list button.is-active {
  box-shadow: inset 3px 0 0 var(--fd-accent);
}
.fd-segment-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 38px;
}
.fd-segment-card {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.014));
  border: 1px solid var(--fd-line);
  border-radius: 20px;
  padding: 24px;
}
.fd-segment-card span {
  color: var(--fd-accent);
  font-size: 12px;
  font-weight: 800;
}
.fd-segment-card h2 {
  margin: 0;
  letter-spacing: -.04em;
}
.fd-segment-card p {
  color: var(--fd-muted);
  line-height: 1.6;
}
.fd-segment-card .fd-primary,
.fd-segment-card .fd-ghost {
  margin-top: auto;
}
.fd-module-title {
  margin: 18px 0 8px;
  color: var(--fd-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 800;
}
@media (max-width: 1200px) {
  .fd-segment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .fd-segment-grid { grid-template-columns: 1fr; }
}


/* v0.3.5: make lesson content use the full learning container width */
.fd-tab-panel {
  width: 100%;
}
.fd-reading,
.fd-content,
.fd-code-workspace {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}
.fd-reading {
  padding-right: min(6vw, 72px);
}
.fd-reading .fd-content {
  max-width: none;
}
.fd-code-workspace {
  min-height: 520px;
}
.fd-code-editor {
  min-height: 470px;
}


/* v0.3.14: stronger IDE-like syntax highlighting for lesson code snippets */
.fd-code-block,
.fd-content pre {
  position: relative;
  background: linear-gradient(180deg, #121821 0%, #0B1018 100%);
  color: #EAF0FF;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  padding: 22px 24px;
  overflow: auto;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 18px 54px rgba(0,0,0,.34);
}
.fd-code-block code,
.fd-content pre code {
  display: block;
  padding: 0;
  background: transparent !important;
  color: #EAF0FF !important;
  border-radius: 0;
  font: 14px/1.8 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  tab-size: 2;
  white-space: pre;
}
.fd-code-block .fd-token,
.fd-content pre .fd-token {
  text-shadow: 0 0 18px rgba(255,255,255,.04);
}
.fd-token-comment { color: #7A8599 !important; font-style: italic; }
.fd-token-keyword { color: #C792EA !important; font-weight: 700; }
.fd-token-string { color: #A6E22E !important; }
.fd-token-number { color: #FFB86C !important; }
.fd-token-tag { color: #FF5C8A !important; font-weight: 800; }
.fd-token-attr { color: #FFD166 !important; }
.fd-token-selector { color: #82AAFF !important; font-weight: 750; }
.fd-token-property { color: #80D8FF !important; }
.fd-token-value { color: #C3E88D !important; }
.fd-token-builtin { color: #64FFDA !important; }
.fd-token-punc,
.fd-token-op { color: #FF6A2A !important; font-weight: 700; }


/* v0.3.11: frontend stylesheet is also printed inline with dynamic block/shortcode root */
.futuredev-app,
.futuredev-app * {
  -webkit-tap-highlight-color: transparent;
}

.futuredev-app button,
.fd-path-card,
.fd-segment-card,
.fd-course-card,
.fd-card-large,
.fd-code-workspace,
.fd-lesson-list button,
.fd-track-list button,
.fd-tabs button {
  transition:
    background-color .36s ease,
    border-color .36s ease,
    color .36s ease,
    box-shadow .36s ease,
    opacity .36s ease,
    transform .36s ease,
    filter .36s ease;
}

.fd-focus-shell {
  animation: fdPageIn .52s cubic-bezier(.2,.8,.2,1) both;
}

.fd-dashboard,
.fd-learning-main {
  animation: fdContentIn .62s cubic-bezier(.2,.8,.2,1) both;
}

.fd-sidebar {
  animation: fdSidebarIn .54s cubic-bezier(.2,.8,.2,1) both;
}

.fd-card-large,
.fd-code-workspace,
.fd-reading {
  animation: fdPanelIn .52s cubic-bezier(.2,.8,.2,1) both;
}

.fd-tab-panel {
  animation: none;
}

.fd-tab-panel.is-fading {
  animation: fdTabFade .26s ease both;
}

.fd-path-card,
.fd-segment-card {
  animation: fdCardIn .62s cubic-bezier(.2,.8,.2,1) both;
}

.fd-path-card:nth-child(2),
.fd-segment-card:nth-child(2) { animation-delay: .07s; }
.fd-path-card:nth-child(3),
.fd-segment-card:nth-child(3) { animation-delay: .14s; }
.fd-path-card:nth-child(4),
.fd-segment-card:nth-child(4) { animation-delay: .21s; }
.fd-segment-card:nth-child(5) { animation-delay: .28s; }
.fd-segment-card:nth-child(6) { animation-delay: .35s; }

.fd-primary:hover,
.fd-ghost:hover,
.fd-menu-button:hover {
  transform: translateY(-1px);
}

.fd-path-card:hover,
.fd-segment-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255,255,255,.18);
  box-shadow: 0 24px 60px rgba(0,0,0,.28);
}

.fd-lesson-list button:hover,
.fd-track-list button:hover {
  transform: translateX(2px);
}

.fd-tabs button:after,
.fd-file-tabs button {
  transition: transform .36s ease, opacity .36s ease, box-shadow .36s ease, color .36s ease;
}

.fd-tabs button.is-active:after {
  animation: fdUnderlineIn .36s cubic-bezier(.2,.8,.2,1) both;
}

.fd-modal-backdrop {
  animation: fdBackdropIn .36s ease both;
}

.fd-preview-modal {
  animation: fdModalIn .46s cubic-bezier(.2,.8,.2,1) both;
}

.fd-help-drawer {
  animation: fdDrawerIn .48s cubic-bezier(.2,.8,.2,1) both;
}

.fd-result,
.fd-ai-output,
.fd-soft-box {
  animation: fdSoftIn .44s cubic-bezier(.2,.8,.2,1) both;
}

@keyframes fdPageIn {
  from { opacity: 0; transform: translateY(10px) scale(.992); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fdContentIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fdSidebarIn {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fdPanelIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes fdCardIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fdUnderlineIn {
  from { transform: scaleX(.35); opacity: .35; }
  to { transform: scaleX(1); opacity: 1; }
}

@keyframes fdBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fdModalIn {
  from { opacity: 0; transform: translateY(18px) scale(.975); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fdDrawerIn {
  from { opacity: 0; transform: translateX(22px); }
  to { opacity: 1; transform: translateX(0); }
}

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

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

@keyframes fdTabFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* v0.3.15: One Dark Darker inspired code theme */
.futuredev-app {
  --fd-code-bg: #1b1f27;
  --fd-code-bg-deep: #181a1f;
  --fd-code-line: rgba(171, 178, 191, .16);
  --fd-code-text: #abb2bf;
  --fd-code-comment: #5c6370;
  --fd-code-red: #e06c75;
  --fd-code-orange: #d19a66;
  --fd-code-yellow: #e5c07b;
  --fd-code-green: #98c379;
  --fd-code-cyan: #56b6c2;
  --fd-code-blue: #61afef;
  --fd-code-purple: #c678dd;
}
.fd-code-block,
.fd-content pre {
  background: linear-gradient(180deg, var(--fd-code-bg) 0%, var(--fd-code-bg-deep) 100%) !important;
  border-color: var(--fd-code-line) !important;
  color: var(--fd-code-text) !important;
}
.fd-code-block code,
.fd-content pre code {
  color: var(--fd-code-text) !important;
}
.fd-code-editor-shell {
  position: relative;
  min-height: 470px;
  background: var(--fd-code-bg-deep);
  overflow: hidden;
}
.fd-code-editor-highlight,
.fd-code-editor {
  min-height: 470px;
  margin: 0;
  padding: 24px;
  border: 0;
  outline: 0;
  font: 15px/1.7 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  tab-size: 2;
  white-space: pre;
}
.fd-code-editor-highlight {
  position: absolute;
  inset: 0;
  overflow: hidden;
  color: var(--fd-code-text);
  pointer-events: none;
  background: transparent;
}
.fd-code-editor-highlight code {
  display: block;
  background: transparent !important;
  color: var(--fd-code-text) !important;
  padding: 0 !important;
}
.fd-code-editor {
  position: relative;
  z-index: 2;
  width: 100%;
  display: block;
  resize: vertical;
  overflow: auto;
  background: transparent !important;
  color: transparent !important;
  -webkit-text-fill-color: transparent;
  caret-color: #ffffff;
  min-height: 470px;
}
.fd-code-editor::selection {
  background: rgba(97, 175, 239, .26);
  color: transparent;
}
.fd-token-comment { color: var(--fd-code-comment) !important; font-style: italic; }
.fd-token-keyword { color: var(--fd-code-purple) !important; font-weight: 700; }
.fd-token-string { color: var(--fd-code-green) !important; }
.fd-token-number { color: var(--fd-code-orange) !important; }
.fd-token-tag { color: var(--fd-code-red) !important; font-weight: 750; }
.fd-token-attr { color: var(--fd-code-orange) !important; }
.fd-token-selector { color: var(--fd-code-yellow) !important; font-weight: 700; }
.fd-token-property { color: var(--fd-code-red) !important; }
.fd-token-value { color: var(--fd-code-green) !important; }
.fd-token-builtin { color: var(--fd-code-cyan) !important; }
.fd-token-punc,
.fd-token-op { color: var(--fd-code-blue) !important; font-weight: 650; }
.fd-file-tabs {
  background: #1d2129 !important;
  border-bottom-color: var(--fd-code-line) !important;
}
.fd-code-actions {
  background: #181a1f;
  border-top-color: var(--fd-code-line) !important;
}

/* v0.3.17: fuller One Dark Darker token coverage */
.futuredev-app {
  --fd-code-unit: #d19a66;
  --fd-code-type: #e5c07b;
}
.fd-token-unit { color: var(--fd-code-unit) !important; }
.fd-token-type { color: var(--fd-code-type) !important; }
.fd-code-editor-highlight .fd-token-tag,
.fd-code-block .fd-token-tag,
.fd-content pre .fd-token-tag { color: #e06c75 !important; }
.fd-code-editor-highlight .fd-token-attr,
.fd-code-block .fd-token-attr,
.fd-content pre .fd-token-attr { color: #d19a66 !important; }
.fd-code-editor-highlight .fd-token-string,
.fd-code-block .fd-token-string,
.fd-content pre .fd-token-string { color: #98c379 !important; }
.fd-code-editor-highlight .fd-token-punc,
.fd-code-editor-highlight .fd-token-op,
.fd-code-block .fd-token-punc,
.fd-code-block .fd-token-op,
.fd-content pre .fd-token-punc,
.fd-content pre .fd-token-op { color: #61afef !important; }

/* FutureDev language controls */
.fd-language-toggle,
.futuredev-language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--fd-line, rgba(255,255,255,.09));
  border-radius: 999px;
  background: rgba(255,255,255,.04);
}
.fd-language-toggle button,
.futuredev-language-switcher button {
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  background: transparent;
  color: var(--fd-muted, #9AA4B2);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.fd-language-toggle button.is-active,
.futuredev-language-switcher button.is-active {
  background: var(--fd-accent, #FF5722);
  color: #111;
}
.fd-code-note {
  margin: 22px 0;
}
.fd-code-note > p {
  color: var(--fd-muted, #9AA4B2);
  font-size: 14px;
  line-height: 1.75;
  margin-bottom: 10px;
}


/* v0.5.6: keep the lesson index usable on long curriculums. */
.fd-focus-shell > .fd-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.fd-focus-shell > .fd-sidebar .fd-course-card {
  flex: 0 0 auto;
}
.fd-focus-shell > .fd-sidebar .fd-lesson-list {
  flex: 1 1 auto;
  max-height: calc(100vh - 300px);
  min-height: 240px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  margin-right: -6px;
  overscroll-behavior: contain;
}
.fd-focus-shell > .fd-sidebar .fd-lesson-list::-webkit-scrollbar {
  width: 8px;
}
.fd-focus-shell > .fd-sidebar .fd-lesson-list::-webkit-scrollbar-track {
  background: rgba(255,255,255,.04);
  border-radius: 999px;
}
.fd-focus-shell > .fd-sidebar .fd-lesson-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.18);
  border-radius: 999px;
}
.fd-focus-shell > .fd-sidebar .fd-lesson-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255,87,34,.55);
}
@media (max-width: 1050px) {
  .fd-focus-shell > .fd-sidebar .fd-lesson-list {
    max-height: 320px;
  }
}


/* v0.7.1: Polish example tab label changed to plural. */
.fd-lesson-human-content p,
.fd-examples-content p {
  max-width: 980px;
}
.fd-examples-content .fd-code-block,
.fd-lesson-human-content .fd-code-block {
  margin: 22px 0 24px;
}
.fd-exercise-list {
  display: grid;
  gap: 14px;
  margin: 28px 0 24px;
}
.fd-exercise-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 6px 14px;
  width: 100%;
  text-align: left;
  padding: 18px 18px;
  border-radius: 16px;
  border: 1px solid var(--fd-line);
  background: rgba(255,255,255,.035);
  color: var(--fd-text);
  cursor: pointer;
  transition: border-color .22s ease, background .22s ease, transform .22s ease;
}
.fd-exercise-card:hover,
.fd-exercise-card.is-active {
  border-color: rgba(255,87,34,.58);
  background: rgba(255,87,34,.08);
  transform: translateY(-1px);
}
.fd-exercise-card span {
  grid-row: span 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,87,34,.15);
  color: var(--fd-accent);
  font-weight: 800;
}
.fd-exercise-card strong {
  font-size: 16px;
}
.fd-exercise-card small {
  color: var(--fd-muted);
  line-height: 1.6;
  font-size: 14px;
}


/* v0.7.3: collapsible sidebar for front-end learning views. */
.fd-focus-shell.fd-sidebar-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}
.fd-focus-shell.fd-sidebar-collapsed > .fd-sidebar {
  width: 0;
  min-width: 0;
  padding-left: 0;
  padding-right: 0;
  border-right: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}
.fd-sidebar {
  transition: width .34s ease, padding .34s ease, opacity .25s ease, border-color .25s ease;
}
.fd-topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.fd-topbar-left .fd-crumbs {
  min-width: 0;
  flex-wrap: wrap;
}
.fd-sidebar-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  border: 1px solid var(--fd-line);
  background: rgba(255,255,255,.035);
  color: #dbe1ea;
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 760;
}
.fd-sidebar-toggle:before {
  content: '☰';
  color: var(--fd-accent);
  font-size: 13px;
  line-height: 1;
}
.fd-sidebar-toggle:hover {
  border-color: var(--fd-line-strong);
  background: rgba(255,255,255,.065);
  transform: translateY(-1px);
}
.fd-sidebar-toggle-path {
  margin: 0 0 24px;
}
@media (max-width: 1050px) {
  .fd-focus-shell:not(.fd-dashboard-mode) {
    grid-template-columns: 1fr;
  }
  .fd-focus-shell.fd-sidebar-collapsed > .fd-sidebar {
    display: none;
  }
  .fd-focus-shell:not(.fd-sidebar-collapsed) > .fd-sidebar {
    border-bottom: 1px solid var(--fd-line);
  }
  .fd-topbar-left {
    width: 100%;
  }
  .fd-topbar-left .fd-crumbs {
    font-size: 13px;
  }
}
@media (max-width: 680px) {
  .fd-sidebar-toggle {
    width: 100%;
    justify-content: center;
  }
  .fd-topbar-left {
    align-items: stretch;
    flex-direction: column;
  }
}


/* v0.7.4: compact, responsive learning header for small screens. */
.fd-toggle-short {
  display: none;
}
.fd-top-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}
.fd-crumbs {
  min-width: 0;
  max-width: 100%;
}
.fd-crumb-current {
  min-width: 0;
}

@media (max-width: 900px) {
  .fd-learning-main {
    padding-left: 18px;
    padding-right: 18px;
  }
  .fd-topbar {
    min-height: auto;
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 14px 0;
  }
  .fd-topbar-left {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    width: 100%;
    gap: 10px;
    align-items: center;
  }
  .fd-topbar-left .fd-crumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
  }
  .fd-crumb-path,
  .fd-crumb-track,
  .fd-crumb-sep {
    display: none;
  }
  .fd-crumb-current {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
  }
  .fd-top-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: 100%;
  }
  .fd-mini-progress {
    width: auto;
    min-width: 0;
  }
  .fd-top-buttons {
    gap: 8px;
  }
  .fd-top-buttons .fd-ghost,
  .fd-top-buttons .fd-primary {
    padding: 10px 13px;
    white-space: nowrap;
  }
}

@media (max-width: 560px) {
  .fd-learning-main {
    padding-left: 14px;
    padding-right: 14px;
  }
  .fd-sidebar-toggle {
    width: auto;
    min-width: 42px;
    justify-content: center;
    padding: 10px 12px;
  }
  .fd-sidebar-toggle:before {
    margin-right: 0;
  }
  .fd-toggle-long {
    display: none;
  }
  .fd-toggle-short {
    display: inline;
    font-size: 12px;
  }
  .fd-top-actions {
    grid-template-columns: 1fr;
  }
  .fd-top-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .fd-top-buttons .fd-ghost,
  .fd-top-buttons .fd-primary {
    justify-content: center;
    text-align: center;
    width: 100%;
  }
  .fd-mini-progress {
    grid-template-columns: auto auto;
  }
  .fd-tabs {
    overflow-x: auto;
    gap: 18px;
    padding-left: 18px;
    padding-right: 18px;
  }
  .fd-tab-panel {
    padding-left: 18px;
    padding-right: 18px;
  }
}

@media (max-width: 380px) {
  .fd-top-buttons {
    grid-template-columns: 1fr;
  }
}

/* v0.8.1: keep the learning header stable on tablets and smaller screens.
   The breadcrumb gets room to wrap instead of forcing the whole header wider. */
.fd-topbar {
  flex-wrap: wrap;
  align-items: center;
}
.fd-topbar-left {
  flex: 1 1 420px;
  min-width: 0;
  flex-wrap: wrap;
}
.fd-topbar-left .fd-crumbs {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow: visible;
  flex-wrap: wrap;
  row-gap: 6px;
  line-height: 1.45;
}
.fd-crumb-current {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

@media (max-width: 1100px) {
  .fd-topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px 0;
  }
  .fd-topbar-left {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
  }
  .fd-topbar-left .fd-crumbs {
    order: 2;
    flex: 0 0 100%;
    width: 100%;
    padding-top: 2px;
  }
  .fd-topbar-left .fd-sidebar-toggle {
    order: 1;
  }
  .fd-top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
  }
  .fd-mini-progress {
    width: auto;
    min-width: 0;
  }
}

@media (max-width: 900px) {
  .fd-topbar-left {
    display: flex;
    flex-direction: row;
    align-items: center;
  }
  .fd-topbar-left .fd-crumbs {
    display: flex;
    white-space: normal;
    overflow: visible;
  }
  .fd-crumb-current {
    display: inline;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }
}

@media (max-width: 560px) {
  .fd-topbar-left {
    align-items: stretch;
  }
  .fd-topbar-left .fd-sidebar-toggle {
    width: 100%;
  }
  .fd-topbar-left .fd-crumbs {
    font-size: 13px;
  }
}


/* v0.8.18: AI Mentor chat as an absolute floating widget with internal scroll */
.futuredev-app,
.futuredev-shell,
.fd-learning-shell,
.fd-lesson-shell,
.fd-lesson-layout,
.fd-learning-view,
.fd-panel,
.fd-lesson-card {
  position: relative;
}

.fd-ai-drawer,
.fd-ai-panel,
.fd-mentor-drawer,
.fd-mentor-panel,
.futuredev-ai-drawer,
.futuredev-ai-panel,
.futuredev-mentor-drawer,
.futuredev-mentor-panel,
[data-fd-ai-drawer],
[data-fd-mentor-panel] {
  position: absolute !important;
  right: 24px !important;
  bottom: 24px !important;
  top: auto !important;
  left: auto !important;
  width: min(420px, calc(100vw - 48px)) !important;
  max-width: calc(100vw - 48px) !important;
  max-height: min(680px, calc(100vh - 160px)) !important;
  height: auto !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  z-index: 80 !important;
  border: 1px solid var(--fd-line-strong, rgba(255,255,255,.16)) !important;
  border-radius: 22px !important;
  background:
    radial-gradient(circle at 20% 0%, rgba(255,87,34,.16), transparent 34%),
    linear-gradient(180deg, #111824 0%, #090f17 100%) !important;
  box-shadow: 0 28px 90px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.03) inset !important;
}

.fd-ai-drawer-header,
.fd-ai-panel-header,
.fd-mentor-drawer-header,
.fd-mentor-panel-header,
.futuredev-ai-header,
.futuredev-mentor-header,
[data-fd-ai-header] {
  flex: 0 0 auto !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px !important;
  border-bottom: 1px solid var(--fd-line, rgba(255,255,255,.09)) !important;
  background: rgba(255,255,255,.035) !important;
}

.fd-ai-drawer-body,
.fd-ai-panel-body,
.fd-mentor-drawer-body,
.fd-mentor-panel-body,
.futuredev-ai-body,
.futuredev-mentor-body,
.fd-ai-messages,
.fd-mentor-messages,
.futuredev-ai-messages,
.futuredev-mentor-messages,
[data-fd-ai-messages],
[data-fd-mentor-messages] {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: min(470px, calc(100vh - 290px)) !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  padding: 18px !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,87,34,.75) rgba(255,255,255,.08);
}

.fd-ai-drawer-body::-webkit-scrollbar,
.fd-ai-panel-body::-webkit-scrollbar,
.fd-mentor-drawer-body::-webkit-scrollbar,
.fd-mentor-panel-body::-webkit-scrollbar,
.futuredev-ai-body::-webkit-scrollbar,
.futuredev-mentor-body::-webkit-scrollbar,
.fd-ai-messages::-webkit-scrollbar,
.fd-mentor-messages::-webkit-scrollbar,
.futuredev-ai-messages::-webkit-scrollbar,
.futuredev-mentor-messages::-webkit-scrollbar {
  width: 10px;
}

.fd-ai-drawer-body::-webkit-scrollbar-track,
.fd-ai-panel-body::-webkit-scrollbar-track,
.fd-mentor-drawer-body::-webkit-scrollbar-track,
.fd-mentor-panel-body::-webkit-scrollbar-track,
.futuredev-ai-body::-webkit-scrollbar-track,
.futuredev-mentor-body::-webkit-scrollbar-track,
.fd-ai-messages::-webkit-scrollbar-track,
.fd-mentor-messages::-webkit-scrollbar-track,
.futuredev-ai-messages::-webkit-scrollbar-track,
.futuredev-mentor-messages::-webkit-scrollbar-track {
  background: rgba(255,255,255,.06);
  border-radius: 999px;
}

.fd-ai-drawer-body::-webkit-scrollbar-thumb,
.fd-ai-panel-body::-webkit-scrollbar-thumb,
.fd-mentor-drawer-body::-webkit-scrollbar-thumb,
.fd-mentor-panel-body::-webkit-scrollbar-thumb,
.futuredev-ai-body::-webkit-scrollbar-thumb,
.futuredev-mentor-body::-webkit-scrollbar-thumb,
.fd-ai-messages::-webkit-scrollbar-thumb,
.fd-mentor-messages::-webkit-scrollbar-thumb,
.futuredev-ai-messages::-webkit-scrollbar-thumb,
.futuredev-mentor-messages::-webkit-scrollbar-thumb {
  background: rgba(255,87,34,.72);
  border-radius: 999px;
}

.fd-ai-drawer-footer,
.fd-ai-panel-footer,
.fd-mentor-drawer-footer,
.fd-mentor-panel-footer,
.futuredev-ai-footer,
.futuredev-mentor-footer,
[data-fd-ai-footer] {
  flex: 0 0 auto !important;
  padding: 14px !important;
  border-top: 1px solid var(--fd-line, rgba(255,255,255,.09)) !important;
  background: rgba(0,0,0,.18) !important;
}

.fd-ai-drawer textarea,
.fd-ai-panel textarea,
.fd-mentor-drawer textarea,
.fd-mentor-panel textarea,
.futuredev-ai-panel textarea,
.futuredev-mentor-panel textarea,
.fd-ai-drawer input,
.fd-ai-panel input,
.fd-mentor-drawer input,
.fd-mentor-panel input {
  max-height: 130px !important;
  overflow-y: auto !important;
}

.fd-ai-message,
.fd-mentor-message,
.futuredev-ai-message,
.futuredev-mentor-message,
[data-fd-ai-message] {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.fd-ai-trigger,
.fd-mentor-trigger,
.futuredev-ai-trigger,
.futuredev-mentor-trigger,
[data-fd-ai-trigger] {
  position: relative;
  z-index: 90;
}

@media (max-width: 720px) {
  .fd-ai-drawer,
  .fd-ai-panel,
  .fd-mentor-drawer,
  .fd-mentor-panel,
  .futuredev-ai-drawer,
  .futuredev-ai-panel,
  .futuredev-mentor-drawer,
  .futuredev-mentor-panel,
  [data-fd-ai-drawer],
  [data-fd-mentor-panel] {
    position: fixed !important;
    right: 12px !important;
    bottom: 12px !important;
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    max-height: calc(100vh - 88px) !important;
    z-index: 99999 !important;
  }

  .fd-ai-drawer-body,
  .fd-ai-panel-body,
  .fd-mentor-drawer-body,
  .fd-mentor-panel-body,
  .futuredev-ai-body,
  .futuredev-mentor-body,
  .fd-ai-messages,
  .fd-mentor-messages,
  .futuredev-ai-messages,
  .futuredev-mentor-messages,
  [data-fd-ai-messages],
  [data-fd-mentor-messages] {
    max-height: calc(100vh - 230px) !important;
  }
}


/* v0.8.19: fixed help trigger outside the learning container; chat opens above it */
.fd-help-fixed-trigger {
  position: fixed !important;
  right: 28px !important;
  bottom: 28px !important;
  z-index: 99990 !important;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 18px 0 10px;
  border: 1px solid rgba(255,87,34,.44);
  border-radius: 999px;
  background:
    radial-gradient(circle at 20% 0%, rgba(255,255,255,.18), transparent 32%),
    linear-gradient(180deg, #ff6a33, #ff5722);
  color: #fff;
  font-weight: 850;
  letter-spacing: -.01em;
  box-shadow: 0 18px 50px rgba(255,87,34,.32), 0 10px 36px rgba(0,0,0,.45);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.fd-help-fixed-trigger:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
  box-shadow: 0 22px 60px rgba(255,87,34,.38), 0 14px 42px rgba(0,0,0,.5);
}

.fd-help-fixed-trigger[aria-expanded="true"] {
  background: linear-gradient(180deg, #1b2432, #111824);
  border-color: rgba(255,255,255,.18);
}

.fd-help-fixed-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(0,0,0,.18);
  color: #fff;
  font-weight: 950;
}

.fd-help-drawer.fd-help-chat-widget,
.fd-help-drawer {
  position: fixed !important;
  right: 28px !important;
  bottom: 92px !important;
  top: auto !important;
  left: auto !important;
  width: min(420px, calc(100vw - 56px)) !important;
  max-width: calc(100vw - 56px) !important;
  max-height: min(640px, calc(100vh - 132px)) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  z-index: 99989 !important;
  border: 1px solid var(--fd-line-strong, rgba(255,255,255,.16)) !important;
  border-radius: 22px !important;
  background:
    radial-gradient(circle at 20% 0%, rgba(255,87,34,.16), transparent 34%),
    linear-gradient(180deg, #111824 0%, #090f17 100%) !important;
  box-shadow: 0 28px 90px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.03) inset !important;
}

.fd-help-chat-header,
.fd-help-drawer > header {
  flex: 0 0 auto !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px !important;
  border-bottom: 1px solid var(--fd-line, rgba(255,255,255,.09)) !important;
  background: rgba(255,255,255,.035) !important;
}

.fd-help-chat-scroll {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: min(450px, calc(100vh - 280px)) !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  padding: 18px !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,87,34,.75) rgba(255,255,255,.08);
}

.fd-help-chat-scroll::-webkit-scrollbar {
  width: 10px;
}

.fd-help-chat-scroll::-webkit-scrollbar-track {
  background: rgba(255,255,255,.06);
  border-radius: 999px;
}

.fd-help-chat-scroll::-webkit-scrollbar-thumb {
  background: rgba(255,87,34,.72);
  border-radius: 999px;
}

.fd-help-chat-footer {
  flex: 0 0 auto !important;
  padding: 14px !important;
  border-top: 1px solid var(--fd-line, rgba(255,255,255,.09)) !important;
  background: rgba(0,0,0,.18) !important;
}

.fd-help-chat-footer .fd-primary {
  width: 100%;
}

.fd-help-button {
  display: none !important;
}

@media (max-width: 720px) {
  .fd-help-fixed-trigger {
    right: 14px !important;
    bottom: 14px !important;
    min-height: 50px;
    padding-right: 15px;
  }

  .fd-help-fixed-trigger span:last-child {
    display: none;
  }

  .fd-help-drawer.fd-help-chat-widget,
  .fd-help-drawer {
    right: 12px !important;
    bottom: 76px !important;
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    max-height: calc(100vh - 100px) !important;
  }

  .fd-help-chat-scroll {
    max-height: calc(100vh - 245px) !important;
  }
}


/* v0.8.20: AI Mentor rendered through a body-level portal, independent from Gutenberg/theme containers */
.futuredev-ai-portal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999999 !important;
  pointer-events: none !important;
  width: 100vw !important;
  height: 100vh !important;
}

.futuredev-ai-portal .fd-help-fixed-trigger,
.futuredev-ai-portal .fd-help-drawer {
  pointer-events: auto !important;
}

.futuredev-ai-portal .fd-help-fixed-trigger {
  position: absolute !important;
}

.futuredev-ai-portal .fd-help-drawer.fd-help-chat-widget,
.futuredev-ai-portal .fd-help-drawer {
  position: absolute !important;
}


/* v0.8.21: frontend lesson JSON importer */
.fd-import-link {
  width: 42px;
  min-width: 42px;
  padding-inline: 0 !important;
  font-size: 20px;
  text-decoration: none;
}

.futuredev-import-page {
  min-height: calc(100vh - 80px);
  padding: clamp(24px, 5vw, 72px);
  background:
    radial-gradient(circle at 16% -8%, rgba(255,87,34,.18), transparent 30%),
    radial-gradient(circle at 100% 0%, rgba(99,102,241,.08), transparent 28%),
    linear-gradient(180deg, #070a0f 0%, #05080d 100%);
  color: var(--fd-text, #f7f8fb);
  border-radius: 24px;
}

.fd-import-public-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.fd-import-public-header {
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--fd-line, rgba(255,255,255,.09));
}

.fd-import-public-header h1 {
  max-width: 880px;
  margin: 0;
  color: #fff;
  font-size: clamp(38px, 5vw, 72px);
  line-height: .95;
  letter-spacing: -.07em;
}

.fd-import-public-header p:not(.fd-eyebrow) {
  max-width: 760px;
  margin: 16px 0 0;
  color: var(--fd-muted, #9aa4b2);
  font-size: 16px;
  line-height: 1.7;
}

.fd-import-public-form {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.fd-import-public-card {
  padding: 22px;
  border: 1px solid var(--fd-line, rgba(255,255,255,.09));
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.018));
  box-shadow: 0 28px 90px rgba(0,0,0,.35);
}

.fd-import-public-card h1,
.fd-import-public-card h2 {
  margin-top: 0;
  color: #fff;
  letter-spacing: -.035em;
}

.fd-import-public-card p {
  color: var(--fd-muted, #9aa4b2);
  line-height: 1.7;
}

.fd-import-public-card label {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  color: #f7f8fb;
  font-weight: 750;
}

.fd-import-public-card label.is-disabled {
  opacity: .54;
}

.fd-import-public-card select,
.fd-import-public-card textarea {
  width: 100%;
  border: 1px solid var(--fd-line-strong, rgba(255,255,255,.16));
  border-radius: 14px;
  background: #080d14;
  color: #e5e7eb;
  box-shadow: none;
}

.fd-import-public-card select {
  min-height: 46px;
  padding: 0 13px;
}

.fd-import-public-card textarea {
  min-height: 640px;
  padding: 16px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.65;
}

.fd-import-public-card select:focus,
.fd-import-public-card textarea:focus {
  outline: none;
  border-color: rgba(255,87,34,.65);
  box-shadow: 0 0 0 4px rgba(255,87,34,.12);
}

.fd-import-public-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.fd-import-public-result {
  display: none;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--fd-line, rgba(255,255,255,.09));
  color: #fff;
}

.fd-import-public-result.is-success,
.fd-import-public-result.is-error {
  display: block;
}

.fd-import-public-result.is-success {
  border-color: rgba(74,222,128,.35);
  background: rgba(74,222,128,.1);
}

.fd-import-public-result.is-error {
  border-color: rgba(255,115,115,.4);
  background: rgba(255,115,115,.1);
}

@media (max-width: 940px) {
  .fd-import-public-form {
    grid-template-columns: 1fr;
  }

  .fd-import-public-card textarea {
    min-height: 460px;
  }
}


/* v0.9.2: instant dashboard skeleton */
.fd-path-card-skeleton {
  position: relative;
  overflow: hidden;
}

.fd-path-card-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.055), transparent);
  animation: fdSkeletonSweep 1.4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes fdSkeletonSweep {
  0% { transform: translateX(-100%); }
  60%, 100% { transform: translateX(100%); }
}


/* v0.9.3: no-flicker dashboard boot */
.fd-dashboard-is-booting .fd-path-grid,
.fd-dashboard-is-ready .fd-path-grid {
  min-height: 280px;
}

.fd-dashboard-is-booting .fd-path-card,
.fd-dashboard-is-ready .fd-path-card {
  animation: fdDashboardCardIn .28s ease both;
}

.fd-path-card-skeleton-soft {
  opacity: .62;
}

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


/* v0.9.4: background-prefetched segments and blurred placeholder loader */
.fd-path-loading-mode .fd-path-dashboard {
  position: relative;
}

.fd-path-loading-back {
  margin-bottom: 20px;
}

.fd-segment-grid-loading {
  min-height: 440px;
}

.fd-segment-skeleton {
  position: relative;
  overflow: hidden;
  filter: saturate(.82);
  animation: fdSegmentSkeletonIn .42s ease both;
  animation-delay: var(--fd-skeleton-delay, 0ms);
}

.fd-segment-skeleton h2,
.fd-segment-skeleton p,
.fd-segment-skeleton span {
  filter: blur(.18px);
}

.fd-segment-skeleton::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(255,87,34,.12), transparent 34%),
    linear-gradient(90deg, transparent, rgba(255,255,255,.055), transparent);
  transform: translateX(-100%);
  animation: fdSegmentSkeletonSweep 1.55s ease-in-out infinite;
  pointer-events: none;
}

.fd-segment-skeleton::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,.018), rgba(255,255,255,.006));
  pointer-events: none;
}

.fd-segment-skeleton > * {
  position: relative;
  z-index: 1;
}

.fd-segment-skeleton button[disabled] {
  opacity: .72;
  cursor: wait;
}

@keyframes fdSegmentSkeletonSweep {
  0% { transform: translateX(-100%); }
  60%, 100% { transform: translateX(100%); }
}

@keyframes fdSegmentSkeletonIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}


/* v0.9.5: server-side preload with blur; real content removes blur after data loads */
.futuredev-app.fd-app-preloading {
  min-height: 560px;
}

.fd-preload-shell {
  opacity: 1;
  filter: blur(5px);
  transform: translateY(0);
  transition:
    opacity .24s ease,
    filter .24s ease,
    transform .24s ease;
}

.futuredev-app.fd-app-swapping .fd-preload-shell {
  opacity: 0;
  filter: blur(10px);
  transform: translateY(8px) scale(.992);
}

.futuredev-app.fd-app-ready > .fd-focus-shell,
.futuredev-app.fd-app-ready > .fd-preload-shell + .fd-focus-shell {
  animation: fdPreloadedContentIn .28s cubic-bezier(.22, 1, .36, 1) both;
}

.fd-preload-dashboard {
  min-height: 540px;
}

.fd-preload-card {
  position: relative;
  overflow: hidden;
  pointer-events: none;
}

.fd-preload-card h2,
.fd-preload-card p,
.fd-preload-card span,
.fd-preload-card button {
  filter: blur(.18px);
}

.fd-preload-card::before {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.065), transparent);
  animation: fdPreloadSweep 1.45s ease-in-out infinite;
  pointer-events: none;
}

.fd-preload-card-soft {
  opacity: .64;
}

@keyframes fdPreloadSweep {
  0% { transform: translateX(-100%); }
  60%, 100% { transform: translateX(100%); }
}

@keyframes fdPreloadedContentIn {
  from {
    opacity: 0;
    filter: blur(7px);
    transform: translateY(8px) scale(.992);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}


/* v0.9.6: stronger real preload blur and single reveal */
.futuredev-app.fd-app-preloading .fd-preload-shell {
  filter: blur(5px) !important;
}

.futuredev-app.fd-app-swapping .fd-preload-shell {
  filter: blur(10px) !important;
}

.futuredev-app.fd-app-ready > .fd-focus-shell {
  animation: fdPreloadedContentIn .34s cubic-bezier(.22, 1, .36, 1) both;
  backface-visibility: hidden;
}

.futuredev-app.fd-app-ready .fd-path-card {
  animation-delay: 0ms !important;
}


/* v0.9.7: static blur preload, no shimmer or card motion */
.futuredev-app.fd-app-preloading .fd-preload-card::before,
.futuredev-app.fd-app-preloading .fd-preload-card::after,
.fd-preload-card::before,
.fd-preload-card::after,
.fd-path-card-skeleton::after,
.fd-segment-skeleton::before,
.fd-segment-skeleton::after {
  content: none !important;
  display: none !important;
  animation: none !important;
}

.futuredev-app.fd-app-preloading .fd-preload-shell {
  opacity: 1 !important;
  filter: blur(5px) !important;
  transform: none !important;
  transition: opacity .22s ease, filter .22s ease !important;
}

.futuredev-app.fd-app-swapping .fd-preload-shell {
  opacity: 0 !important;
  filter: blur(8px) !important;
  transform: none !important;
}

.futuredev-app.fd-app-ready > .fd-focus-shell,
.futuredev-app.fd-app-ready > .fd-preload-shell + .fd-focus-shell,
.fd-dashboard-is-booting .fd-path-card,
.fd-dashboard-is-ready .fd-path-card,
.fd-segment-skeleton {
  animation: none !important;
}

.futuredev-app.fd-app-ready > .fd-focus-shell {
  opacity: 1 !important;
  filter: blur(0) !important;
  transform: none !important;
  transition: opacity .22s ease, filter .22s ease !important;
}


/* v0.9.8: segment view uses the same static blur preload pattern */
.fd-path-blur-preload .fd-sidebar-preload,
.fd-path-blur-preload .fd-path-dashboard {
  filter: blur(4px);
  opacity: .92;
  transform: none;
}

.fd-path-blur-preload .fd-segment-skeleton,
.fd-path-blur-preload .fd-track-list-preload button,
.fd-path-blur-preload .fd-course-card-preload {
  position: relative;
  overflow: hidden;
  pointer-events: none;
}

.fd-path-blur-preload .fd-segment-skeleton {
  filter: none;
  opacity: .96;
  animation: none !important;
}

.fd-path-blur-preload .fd-segment-skeleton h2,
.fd-path-blur-preload .fd-segment-skeleton p,
.fd-path-blur-preload .fd-segment-skeleton span,
.fd-path-blur-preload .fd-segment-skeleton button {
  filter: none !important;
}

.fd-path-blur-preload .fd-segment-skeleton::before,
.fd-path-blur-preload .fd-segment-skeleton::after,
.fd-path-blur-preload .fd-track-list-preload button::before,
.fd-path-blur-preload .fd-track-list-preload button::after {
  content: none !important;
  display: none !important;
  animation: none !important;
}

.fd-path-blur-preload .fd-segment-grid-loading {
  min-height: 520px;
}

.fd-path-blur-preload .fd-sidebar-toggle[disabled],
.fd-path-blur-preload .fd-segment-skeleton button[disabled],
.fd-path-blur-preload .fd-track-list-preload button[disabled] {
  cursor: wait;
}

.fd-path-mode:not(.fd-path-blur-preload) .fd-segment-card {
  animation: none !important;
}


/* v0.9.11: path error belongs to main container, never to sidebar */
.fd-path-error-mode {
  display: block !important;
  width: min(1180px, calc(100vw - 48px));
  margin: 0 auto;
}

.fd-path-error-main {
  max-width: 820px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.fd-path-error-main h1 {
  max-width: 760px;
  word-break: normal;
  overflow-wrap: normal;
}

.fd-path-error-main .fd-lead {
  max-width: 720px;
  overflow-wrap: break-word;
}


/* v0.9.12: consistent front-end h1 spacing */
.futuredev-app h1,
.futuredev-import-page h1 {
  margin-bottom: 25px !important;
}


/* v0.10.14: code background cleanup.
   Keep the highlighted pre/code container, but remove the extra inner background from inline code inside code blocks. */
.futuredev-app pre code,
.futuredev-app .fd-code-block code,
.futuredev-app .fd-builder-preview-content pre code {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}


/* v0.10.25: frontend importer supports course/segment/module + JSON file upload */
.fd-import-file-label {
  display: grid;
  gap: 10px;
}

.fd-import-file-label input[type="file"] {
  width: 100%;
  padding: 16px;
  border: 1px dashed rgba(255,255,255,.20);
  border-radius: 16px;
  background: rgba(255,255,255,.045);
  color: #f8fafc;
}

.fd-import-or {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0;
  color: #8e99aa;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.fd-import-or::before,
.fd-import-or::after {
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(255,255,255,.10);
}

.fd-import-public-card code {
  color: #fed7aa;
}


/* v0.10.26: frontend importer uses file upload only */
.fd-import-file-help {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  color: #9faabc;
  font-size: 13px;
  line-height: 1.55;
}

.fd-import-public-card textarea[data-fd-import-json],
.fd-import-or,
button[data-fd-format-json] {
  display: none !important;
}


/* v0.10.27: readable inline JSON field labels in the public importer */
.futuredev-import-page .fd-import-public-card p code,
.futuredev-import-page .fd-import-public-card li code,
.futuredev-import-page .fd-import-public-card .fd-import-file-help code {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 2px 7px;
  border: 1px solid rgba(255, 87, 34, .22);
  border-radius: 7px;
  background: rgba(255, 87, 34, .10);
  color: #ffb199;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: .88em;
  font-weight: 800;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
  box-shadow: none;
}

.futuredev-import-page .fd-import-public-card p code *,
.futuredev-import-page .fd-import-public-card li code * {
  color: inherit !important;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
}

.futuredev-import-page .fd-import-public-card p {
  line-height: 1.75;
}


/* v0.10.29: lesson intro, key summary, quiz, and answer feedback */
.fd-lesson-intro-card {
  margin: 0 0 24px;
  padding: 24px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 22px;
  background:
    radial-gradient(circle at 16% 0%, rgba(255,87,34,.12), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.02));
}

.fd-lesson-intro-card h2 {
  margin: 0 0 14px;
  color: #fff;
  font-size: clamp(24px, 3vw, 36px);
  letter-spacing: -.045em;
}

.fd-lesson-intro-card ul {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 9px;
  color: #d8dee9;
}

.fd-lesson-key-summary {
  margin: 0 0 28px;
  padding: 22px 24px;
  border-left: 4px solid #ff5722;
  border-radius: 18px;
  background: rgba(255, 87, 34, .08);
  color: #e9edf5;
}

.fd-lesson-key-summary p {
  margin: 0 0 12px;
  line-height: 1.75;
}

.fd-lesson-key-summary p:last-child {
  margin-bottom: 0;
}

.fd-muted {
  color: #9faabc;
  line-height: 1.7;
}

.fd-quiz-list {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.fd-quiz-question {
  padding: 20px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 20px;
  background: rgba(2,6,12,.42);
}

.fd-quiz-question.is-correct {
  border-color: rgba(34,197,94,.38);
  background: rgba(34,197,94,.07);
}

.fd-quiz-question.is-wrong {
  border-color: rgba(248,113,113,.38);
  background: rgba(248,113,113,.07);
}

.fd-quiz-question h3 {
  margin: 0 0 14px;
  color: #fff;
  font-size: 18px;
  line-height: 1.35;
}

.fd-quiz-options {
  display: grid;
  gap: 8px;
}

.fd-quiz-options button {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  background: rgba(255,255,255,.035);
  color: #dbe4ef;
  text-align: left;
  cursor: pointer;
}

.fd-quiz-options button:hover,
.fd-quiz-options button.is-selected {
  border-color: rgba(255,87,34,.42);
  background: rgba(255,87,34,.10);
  color: #fff;
}

.fd-quiz-explanation {
  margin: 14px 0 0;
  color: #aab4c3;
  line-height: 1.65;
}

.fd-quiz-score,
.fd-ai-like-feedback {
  margin-top: 20px;
  padding: 18px 20px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.02));
  color: #d8dee9;
}

.fd-quiz-score strong {
  color: #fff;
}

.fd-ai-like-feedback {
  border-color: rgba(255,87,34,.22);
  background: rgba(255,87,34,.08);
}

.fd-ai-like-feedback p:last-child {
  margin-bottom: 0;
}


/* v0.10.30: cleaner lesson flow — intro once, summary once, then theory */
.fd-lesson-intro-card {
  margin-bottom: 18px !important;
}

.fd-lesson-intro-card .fd-eyebrow,
.fd-lesson-key-summary .fd-eyebrow {
  margin-bottom: 10px;
}

.fd-lesson-key-summary {
  margin-bottom: 34px !important;
}

.fd-reading > .fd-content {
  margin-top: 0;
}

.fd-code-actions {
  align-items: center;
}

.fd-code-actions .fd-primary[data-check] {
  margin-left: auto;
}


/* v0.10.31: quiz is checked explicitly and supports localized object fields */
.fd-quiz-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
}

.fd-quiz-actions .fd-muted {
  margin: 0;
}

.fd-quiz-question:not(.is-correct):not(.is-wrong) .fd-quiz-explanation {
  display: none;
}

/* v0.10.33: better exercise flow after checking answer */
.fd-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.fd-exercise-card.is-completed {
  opacity: .82;
  border-color: rgba(34,197,94,.38);
  background: rgba(34,197,94,.07);
}

.fd-exercise-card.is-completed strong {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(34,197,94,.75);
}

.fd-exercise-card.is-completed span {
  background: rgba(34,197,94,.18);
  color: #86efac;
}

/* v0.10.34: code tab includes task context and inline answer result; no separate answer tab */
.fd-current-task-box {
  margin: 0 0 18px;
  padding: 20px 22px;
  border: 1px solid rgba(255, 87, 34, .24);
  border-radius: 20px;
  background:
    radial-gradient(circle at 14% 0%, rgba(255,87,34,.10), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.02));
}

.fd-current-task-box h2 {
  margin: 0 0 10px;
  color: #fff;
  font-size: clamp(22px, 2.6vw, 32px);
  letter-spacing: -.035em;
}

.fd-current-task-box p {
  margin: 0;
  color: #d8dee9;
  line-height: 1.7;
}

.fd-current-task-box small {
  display: block;
  margin-top: 10px;
  color: #9faabc;
}

.fd-inline-answer-result {
  margin-top: 22px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 20px;
  background: rgba(2,6,12,.42);
}

.fd-inline-answer-result h2 {
  margin: 0 0 14px;
  color: #fff;
}

/* v0.10.35: hints belong to the exercise tab, not the code header */
.fd-current-task-box small {
  display: none !important;
}

.fd-exercise-hints-box {
  margin-top: 16px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 18px;
  background: rgba(2,6,12,.36);
  overflow: hidden;
}

.fd-exercise-hints-box summary {
  cursor: pointer;
  padding: 15px 18px;
  color: #fff;
  font-weight: 850;
}

.fd-exercise-hints-box > div {
  padding: 0 18px 18px;
  color: #aeb8c7;
  line-height: 1.65;
}

.fd-exercise-hints-box ol {
  margin: 12px 0 0;
  padding-left: 22px;
  display: grid;
  gap: 8px;
}

.fd-exercise-hints-box li {
  color: #d8dee9;
}


/* v0.10.36: reliable code editor caret and starter-code rendering */
.fd-code-editor-highlight,
.fd-code-editor {
  box-sizing: border-box !important;
  font-variant-ligatures: none !important;
  letter-spacing: 0 !important;
  word-spacing: 0 !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}

.fd-code-editor {
  color: #e9edf5 !important;
  -webkit-text-fill-color: #e9edf5 !important;
  caret-color: #ffffff !important;
  line-height: 1.72 !important;
}

.fd-code-editor-highlight {
  opacity: .38;
}

.fd-code-editor:focus + .fd-code-editor-highlight,
.fd-code-editor-shell:focus-within .fd-code-editor-highlight {
  opacity: .18;
}

.fd-code-editor::selection {
  color: #ffffff !important;
  background: rgba(97, 175, 239, .38) !important;
}


/* v0.10.40: restore syntax highlight without double ghost text */
.fd-code-editor-shell {
  position: relative;
}

.fd-code-editor-highlight {
  opacity: 1 !important;
  color: #e9edf5 !important;
  text-shadow: none !important;
  pointer-events: none !important;
  z-index: 1 !important;
}

.fd-code-editor,
.fd-code-editor:focus {
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  text-shadow: none !important;
  caret-color: #ffffff !important;
  background: transparent !important;
  position: relative;
  z-index: 2 !important;
}

/* Keep typed text readable while selecting, without showing a permanent second text layer. */
.fd-code-editor::selection {
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  background: rgba(97, 175, 239, .32) !important;
}

.fd-code-editor-shell:focus-within .fd-code-editor-highlight {
  opacity: 1 !important;
}

/* Prevent browser/iOS visual artifacts caused by transparent textarea text. */
.fd-code-editor {
  font-synthesis: none !important;
  -webkit-font-smoothing: antialiased !important;
  transform: translateZ(0);
}

.fd-code-editor-highlight,
.fd-code-editor-highlight * {
  text-shadow: none !important;
}


/* v0.10.41: iPad/Safari first-render layout stabilization */
.futuredev-app,
.futuredev-app * {
  min-width: 0;
}

.futuredev-app {
  contain: layout paint;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.fd-dashboard-clean {
  width: 100%;
}

.fd-path-grid {
  width: 100%;
  align-items: stretch;
}

.fd-path-card {
  min-width: 0;
  width: 100%;
  overflow: hidden;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.fd-path-card h2,
.fd-path-card p,
.fd-path-card span {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
}

@supports (-webkit-touch-callout: none) {
  .fd-path-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 18px !important;
  }

  .fd-path-grid > .fd-path-card {
    flex: 1 1 calc(33.333% - 12px);
    max-width: calc(33.333% - 12px);
  }

  @media (max-width: 1180px) {
    .fd-path-grid > .fd-path-card {
      flex-basis: calc(50% - 9px);
      max-width: calc(50% - 9px);
    }
  }

  @media (max-width: 760px) {
    .fd-path-grid > .fd-path-card {
      flex-basis: 100%;
      max-width: 100%;
    }
  }
}

@media (min-width: 761px) and (max-width: 1180px) {
  .fd-dashboard {
    padding: 48px 40px;
  }

  .fd-dashboard h1 {
    font-size: clamp(46px, 8vw, 74px);
  }

  .fd-path-card h2 {
    font-size: clamp(30px, 5.2vw, 46px);
    line-height: .98;
    letter-spacing: -.055em;
  }
}

/* v0.10.42: previous card-level visibility hiding removed; dashboard now fades as one layer. */


/* v0.10.42: smooth iPad/Safari dashboard fade instead of flicker */
.futuredev-app .fd-dashboard-mode {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity .72s cubic-bezier(.22, 1, .36, 1),
    transform .72s cubic-bezier(.22, 1, .36, 1);
  will-change: opacity, transform;
}

.futuredev-app.fd-app-ready .fd-dashboard-mode,
.futuredev-app.fd-app-soft-ready .fd-dashboard-mode {
  opacity: 1;
  transform: translateY(0);
}

.futuredev-app.fd-app-swapping .fd-dashboard-mode {
  opacity: 0;
  transform: translateY(8px);
}

.futuredev-app .fd-path-grid,
.futuredev-app .fd-path-card {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Keep learning screens instant; fade is only for dashboard/path shell stabilization. */
.futuredev-app .fd-learning-shell,
.futuredev-app .fd-learning-window {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .futuredev-app .fd-dashboard-mode {
    transition: none;
    transform: none;
  }
}


/* v0.10.43: real container-based path card layout for iPad/Safari */
.fd-dashboard .fd-path-grid,
.futuredev-app .fd-dashboard .fd-path-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)) !important;
  gap: 18px !important;
  width: 100% !important;
  max-width: 100% !important;
  align-items: stretch !important;
}

.fd-dashboard .fd-path-grid > .fd-path-card,
.futuredev-app .fd-dashboard .fd-path-grid > .fd-path-card {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  flex: none !important;
}

@supports (-webkit-touch-callout: none) {
  .fd-dashboard .fd-path-grid,
  .futuredev-app .fd-dashboard .fd-path-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)) !important;
  }

  .fd-dashboard .fd-path-grid > .fd-path-card,
  .futuredev-app .fd-dashboard .fd-path-grid > .fd-path-card {
    flex: none !important;
    max-width: none !important;
    min-width: 0 !important;
  }
}

.fd-dashboard .fd-path-card h2,
.futuredev-app .fd-dashboard .fd-path-card h2 {
  hyphens: none !important;
  -webkit-hyphens: none !important;
  overflow-wrap: normal !important;
  word-break: keep-all !important;
  line-height: 1.02 !important;
}

.fd-dashboard .fd-path-card p,
.futuredev-app .fd-dashboard .fd-path-card p {
  overflow-wrap: break-word !important;
  word-break: normal !important;
}

@media (max-width: 760px) {
  .fd-dashboard .fd-path-grid,
  .futuredev-app .fd-dashboard .fd-path-grid {
    grid-template-columns: 1fr !important;
  }
}

/* If the dashboard card itself is narrow, do not try to show several path cards. */
@container (max-width: 720px) {
  .fd-path-grid {
    grid-template-columns: 1fr !important;
  }
}

.fd-dashboard,
.fd-dashboard-clean {
  container-type: inline-size;
}


/* v0.10.46: lesson view top controls use previous/next lesson, not importer/hint */
.fd-top-buttons {
  gap: 10px;
}

.fd-top-buttons button[disabled] {
  opacity: .42;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

.fd-top-buttons .fd-ghost,
.fd-top-buttons .fd-primary {
  white-space: nowrap;
}

@media (max-width: 760px) {
  .fd-top-buttons {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .fd-top-buttons .fd-ghost,
  .fd-top-buttons .fd-primary {
    width: 100%;
  }
}


/* v0.10.47: polished lesson header for iPad/tablet landscape */
.fd-learning-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  padding: 0 0 22px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.fd-learning-header .fd-crumbs {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: rgba(226,232,240,.68);
}

.fd-learning-header .fd-crumb-current {
  color: #fff;
  font-weight: 850;
}

.fd-learning-header .fd-top-actions {
  display: grid;
  grid-template-columns: minmax(220px, 360px) auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.fd-learning-header .fd-mini-progress {
  width: 100%;
  max-width: 360px;
  min-width: 220px;
  padding: 0;
}

.fd-learning-header .fd-mini-progress span,
.fd-learning-header .fd-mini-progress strong {
  font-size: 15px;
}

.fd-learning-header .fd-top-buttons {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

.fd-learning-header .fd-top-buttons .fd-ghost,
.fd-learning-header .fd-top-buttons .fd-primary {
  min-height: 52px;
  padding: 0 22px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 800;
}

.fd-learning-header .fd-top-buttons .fd-ghost {
  background: rgba(255,255,255,.035);
  border-color: rgba(255,255,255,.11);
}

.fd-learning-header .fd-top-buttons .fd-primary {
  box-shadow: 0 18px 40px rgba(255,87,34,.24);
}

/* iPad Pro 11 landscape and similar widths */
@media (min-width: 900px) and (max-width: 1220px) {
  .fd-learning-shell {
    padding-top: 42px;
  }

  .fd-learning-header {
    gap: 16px;
  }

  .fd-learning-header .fd-top-actions {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .fd-learning-header .fd-mini-progress {
    max-width: 100%;
  }

  .fd-learning-header .fd-top-buttons {
    justify-content: flex-start;
    display: grid;
    grid-template-columns: minmax(220px, max-content) minmax(220px, max-content);
    gap: 12px;
  }

  .fd-learning-header .fd-top-buttons .fd-ghost,
  .fd-learning-header .fd-top-buttons .fd-primary {
    justify-content: center;
    text-align: center;
  }

  .fd-learning-header .fd-crumbs {
    padding-right: 0;
  }
}

@media (max-width: 760px) {
  .fd-learning-header .fd-top-actions {
    grid-template-columns: 1fr;
  }

  .fd-learning-header .fd-top-buttons {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .fd-learning-header .fd-top-buttons .fd-ghost,
  .fd-learning-header .fd-top-buttons .fd-primary {
    width: 100%;
  }
}

/* Keep the tab card visually separated from the lesson header */
.fd-card-large {
  margin-top: 20px;
}


/* v0.10.48: keep lesson navigation buttons aligned right on iPad/tablet landscape */
@media (min-width: 900px) and (max-width: 1220px) {
  .fd-learning-header .fd-top-actions {
    grid-template-columns: minmax(220px, 360px) auto !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  .fd-learning-header .fd-top-buttons {
    justify-content: flex-end !important;
    display: flex !important;
    margin-left: auto !important;
  }
}

@media (min-width: 761px) {
  .fd-learning-header .fd-top-buttons {
    justify-content: flex-end !important;
    margin-left: auto;
  }
}


/* v0.10.49: separate lesson nav buttons from progress bar */
.fd-topbar {
  gap: 28px !important;
}

.fd-top-actions {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: minmax(220px, 360px) minmax(360px, max-content) !important;
  align-items: center !important;
  justify-content: space-between !important;
  column-gap: clamp(48px, 8vw, 120px) !important;
}

.fd-top-actions .fd-mini-progress {
  justify-self: start !important;
  width: 100% !important;
  max-width: 360px !important;
}

.fd-top-actions .fd-top-buttons {
  justify-self: end !important;
  margin-left: 0 !important;
  display: flex !important;
  justify-content: flex-end !important;
  gap: 14px !important;
}

/* iPad Pro landscape: keep controls in one clean row, but with real breathing room. */
@media (min-width: 900px) and (max-width: 1220px) {
  .fd-top-actions {
    grid-template-columns: minmax(220px, 330px) minmax(380px, max-content) !important;
    column-gap: clamp(56px, 7vw, 96px) !important;
  }

  .fd-top-actions .fd-mini-progress {
    max-width: 330px !important;
  }

  .fd-top-actions .fd-top-buttons {
    justify-self: end !important;
  }
}

/* If there is genuinely not enough horizontal space, stack cleanly instead of sticking controls together. */
@media (max-width: 899px) {
  .fd-top-actions {
    grid-template-columns: 1fr !important;
    row-gap: 16px !important;
  }

  .fd-top-actions .fd-mini-progress,
  .fd-top-actions .fd-top-buttons {
    justify-self: stretch !important;
    width: 100% !important;
  }

  .fd-top-actions .fd-top-buttons {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 560px) {
  .fd-top-actions .fd-top-buttons {
    grid-template-columns: 1fr !important;
  }
}


/* v0.10.50: importer follows frontend curriculum structure */
.fd-import-public select {
  min-height: 52px;
}

.fd-import-public-result.is-success {
  border-color: rgba(34,197,94,.25);
  background: rgba(34,197,94,.08);
  color: #bbf7d0;
}

/* v0.10.52: import preview report */
.fd-import-preview-report {
  margin: 22px 0;
  padding: 24px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 24px;
  background:
    radial-gradient(circle at 16% 0%, rgba(255,87,34,.12), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.022));
}

.fd-import-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.fd-import-preview-head h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(26px, 3vw, 42px);
  letter-spacing: -.045em;
}

.fd-import-preview-head > span {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(2,6,12,.34);
  color: #ffb199;
  font-weight: 800;
  white-space: nowrap;
}

.fd-import-preview-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 22px;
}

.fd-import-preview-grid > div {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(2,6,12,.32);
}

.fd-import-preview-grid span {
  display: block;
  color: #aeb8c7;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.fd-import-preview-grid strong {
  display: block;
  margin-top: 8px;
  color: #fff;
  font-size: 34px;
  letter-spacing: -.05em;
}

.fd-import-preview-grid.is-saved > div {
  border-color: rgba(34,197,94,.18);
  background: rgba(34,197,94,.06);
}

.fd-import-preview-report h3 {
  margin: 22px 0 10px;
  color: #fff;
  font-size: 18px;
}

.fd-import-preview-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  list-style: none;
}

.fd-import-preview-list li {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.035);
  color: #d8dee9;
}

.fd-import-preview-list.is-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fd-import-preview-warnings {
  margin-top: 18px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(245,158,11,.24);
  background: rgba(245,158,11,.08);
  color: #fde68a;
}

.fd-import-preview-warnings ul {
  margin: 10px 0 0;
  padding-left: 20px;
}

@media (max-width: 1000px) {
  .fd-import-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fd-import-preview-list.is-compact {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .fd-import-preview-grid {
    grid-template-columns: 1fr;
  }

  .fd-import-preview-head {
    display: grid;
  }
}



/* v0.10.54: admin flow is Segment -> Module -> Lesson */
.fd-builder-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 18px;
}

.fd-builder-module-card {
  text-align: left;
  min-height: 280px;
}

.fd-builder-add-card {
  text-decoration: none;
  border-style: dashed !important;
  background:
    radial-gradient(circle at 12% 0%, rgba(255,255,255,.08), transparent 36%),
    rgba(255,255,255,.025) !important;
}

.fd-builder-add-card:hover {
  border-color: rgba(255,87,34,.42) !important;
}

.fd-builder-add-lesson-btn {
  margin-top: 14px;
  width: 100%;
  justify-content: center;
}

.fd-builder-modules-screen .fd-builder-screen-head {
  margin-bottom: 22px;
}

.fd-builder-editor-screen {
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
}

.fd-builder-json-area {
  width: 100%;
  min-height: 560px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.12);
  background: #05070d;
  color: #e5e7eb;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  line-height: 1.65;
}

@media (max-width: 980px) {
  .fd-builder-editor-screen {
    grid-template-columns: 1fr;
  }
}

/* v0.10.55: inline dashboard flow mirrors frontend: segment -> modules -> lessons */
.fd-admin-inline-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 18px;
}

.fd-admin-inline-module-card {
  text-align: left;
  min-height: 270px;
}

.fd-admin-inline-module-lessons .fd-admin-index-list-lessons {
  margin-top: 22px;
}

.fd-admin-inline-lesson-edit {
  max-width: 1180px;
  margin-inline: auto;
}

.fd-admin-inline-lesson-edit .fd-builder-editor-hero,
.fd-admin-inline-lesson-edit .fd-builder-tab-panels,
.fd-admin-inline-lesson-edit .fd-builder-editor-tabs {
  width: 100%;
}

.fd-admin-inline-lesson-edit .fd-builder-preview-window {
  margin-top: 0;
}

.fd-admin-inline-segment-detail .fd-admin-inline-segment-summary {
  margin-bottom: 24px;
}

.fd-admin-inline-segments .fd-builder-segment-card,
.fd-admin-inline-segment-detail .fd-builder-module-card,
.fd-admin-inline-module-lessons .fd-admin-index-card {
  cursor: pointer;
}

/* v0.10.56: polished inline admin module/lesson flow */
.fd-admin-inline-polished-view {
  padding: 0;
}

.fd-admin-inline-polished-view .fd-builder-topbar {
  position: relative;
  overflow: hidden;
  margin: 0 0 32px;
  padding: clamp(26px, 3vw, 42px);
  border-radius: 30px;
  border: 1px solid rgba(255,255,255,.105);
  background:
    radial-gradient(circle at 16% 0%, rgba(255,87,34,.16), transparent 36%),
    radial-gradient(circle at 82% 12%, rgba(59,130,246,.08), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.025));
  box-shadow: 0 28px 70px rgba(0,0,0,.25);
}

.fd-admin-inline-polished-view .fd-builder-topbar::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,87,34,.45), transparent);
  opacity: .65;
}

.fd-admin-inline-polished-view .fd-builder-topbar h2 {
  margin: 4px 0 12px;
  max-width: 780px;
  color: #fff;
  font-size: clamp(38px, 5vw, 72px);
  line-height: .92;
  letter-spacing: -.07em;
}

.fd-admin-inline-polished-view .fd-builder-topbar p:not(.fd-admin-eyebrow) {
  max-width: 720px;
  color: #aeb8c7;
  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.65;
}

.fd-admin-inline-polished-view .fd-builder-topbar-actions {
  align-self: start;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.fd-admin-inline-polished-view .fd-builder-topbar-actions .fd-admin-button {
  min-height: 52px;
  padding-inline: 22px;
  border-radius: 16px;
  font-size: 15px;
}

.fd-admin-inline-segment-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 28px;
}

.fd-admin-inline-segment-summary span,
.fd-builder-card-badges span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(2,6,12,.32);
  color: #dbe2ee;
  font-weight: 850;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}

.fd-admin-inline-segment-summary strong,
.fd-builder-card-badges strong {
  color: #fff;
}

.fd-admin-inline-module-grid,
.fd-builder-module-grid.fd-admin-inline-module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 1.8vw, 24px);
  align-items: stretch;
}

.fd-admin-inline-module-card,
.fd-admin-inline-segment-detail .fd-builder-module-card {
  position: relative;
  min-height: 320px;
  padding: 26px;
  border-radius: 22px;
  border: 1px solid rgba(148,163,184,.17);
  background:
    radial-gradient(circle at 20% 0%, rgba(255,87,34,.12), transparent 38%),
    linear-gradient(180deg, rgba(18,27,42,.78), rgba(10,15,24,.88));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.045),
    0 18px 48px rgba(0,0,0,.22);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.fd-admin-inline-module-card:hover,
.fd-admin-inline-segment-detail .fd-builder-module-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,87,34,.42);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.055),
    0 24px 60px rgba(0,0,0,.28),
    0 0 0 1px rgba(255,87,34,.08);
}

.fd-admin-inline-module-card .fd-builder-segment-kicker,
.fd-admin-inline-module-card > span:first-child {
  width: max-content;
  margin-bottom: 22px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,87,34,.28);
  background: rgba(255,87,34,.10);
  color: #ff8a65;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.fd-admin-inline-module-card h3 {
  max-width: 92%;
  margin: 0 0 18px;
  color: #fff;
  font-size: clamp(30px, 2.7vw, 46px);
  line-height: .98;
  letter-spacing: -.06em;
}

.fd-admin-inline-module-card p {
  max-width: 92%;
  margin: 0;
  color: #aeb8c7;
  font-size: 15px;
  line-height: 1.62;
}

.fd-admin-inline-module-card .fd-builder-card-badges {
  position: absolute;
  left: 26px;
  right: 26px;
  bottom: 86px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.fd-admin-inline-module-card .fd-builder-card-cta {
  position: absolute;
  left: 26px;
  bottom: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  background: #ff5722;
  color: #fff;
  font-weight: 950;
  box-shadow: 0 20px 46px rgba(255,87,34,.28);
}

.fd-admin-inline-module-lessons .fd-admin-index-list-lessons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 1.6vw, 20px);
  margin-top: 26px;
}

.fd-admin-inline-module-lessons .fd-admin-index-card {
  min-height: 170px;
  padding: 22px;
  border-radius: 20px;
  border: 1px solid rgba(148,163,184,.18);
  background:
    radial-gradient(circle at 16% 0%, rgba(255,87,34,.10), transparent 34%),
    linear-gradient(180deg, rgba(18,27,42,.82), rgba(10,15,24,.92));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045);
  text-align: left;
}

.fd-admin-inline-module-lessons .fd-admin-index-card span {
  display: block;
  margin-bottom: 18px;
  color: #ff8a65;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.fd-admin-inline-module-lessons .fd-admin-index-card h3 {
  margin: 0 0 12px;
  color: #fff;
  font-size: clamp(22px, 2.2vw, 34px);
  line-height: 1.05;
  letter-spacing: -.045em;
}

.fd-admin-inline-module-lessons .fd-admin-index-card p {
  margin: 0;
  color: #aeb8c7;
  font-size: 15px;
}

.fd-admin-inline-lesson-edit .fd-builder-editor-hero {
  margin-bottom: 22px;
  padding: clamp(24px, 3vw, 42px);
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,.10);
  background:
    radial-gradient(circle at 16% 0%, rgba(255,87,34,.15), transparent 36%),
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.02));
}

.fd-admin-inline-lesson-edit .fd-builder-editor-hero h1 {
  color: #fff;
  font-size: clamp(38px, 5vw, 72px);
  line-height: .92;
  letter-spacing: -.07em;
}

.fd-admin-inline-lesson-edit .fd-builder-editor-tabs {
  margin-bottom: 22px;
  padding: 12px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.035);
}

.fd-admin-inline-lesson-edit .fd-builder-tab-panels,
.fd-admin-inline-lesson-edit .fd-builder-preview-window {
  border-radius: 26px;
}

@media (max-width: 1280px) {
  .fd-admin-inline-module-grid,
  .fd-builder-module-grid.fd-admin-inline-module-grid,
  .fd-admin-inline-module-lessons .fd-admin-index-list-lessons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .fd-admin-inline-polished-view .fd-builder-topbar {
    padding: 22px;
  }

  .fd-admin-inline-polished-view .fd-builder-topbar-actions {
    justify-content: stretch;
  }

  .fd-admin-inline-polished-view .fd-builder-topbar-actions .fd-admin-button {
    width: 100%;
  }

  .fd-admin-inline-module-grid,
  .fd-builder-module-grid.fd-admin-inline-module-grid,
  .fd-admin-inline-module-lessons .fd-admin-index-list-lessons {
    grid-template-columns: 1fr;
  }

  .fd-admin-inline-module-card,
  .fd-admin-inline-segment-detail .fd-builder-module-card {
    min-height: 300px;
  }
}

/* v0.10.57: force module cards into the same grid language as segment cards */
.fd-admin-inline-segment-detail .fd-admin-segment-module-list,
.fd-admin-inline-segment-detail .fd-admin-module-grid-force,
.fd-admin-inline-segment-detail .fd-builder-module-grid,
.fd-admin-inline-segment-detail .fd-admin-inline-module-grid {
  width: 100% !important;
  max-width: none !important;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: clamp(18px, 1.8vw, 24px) !important;
  align-items: stretch !important;
  margin-top: 26px !important;
}

.fd-admin-inline-segment-detail .fd-admin-segment-module-list > *,
.fd-admin-inline-segment-detail .fd-admin-module-grid-force > *,
.fd-admin-inline-segment-detail .fd-builder-module-grid > *,
.fd-admin-inline-segment-detail .fd-admin-inline-module-grid > * {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
}

/* Old module details/cards, if still rendered by the PHP, should look like segment cards too. */
.fd-admin-inline-segment-detail .fd-admin-segment-module-card,
.fd-admin-inline-segment-detail .fd-builder-module-card,
.fd-admin-inline-segment-detail .fd-admin-inline-module-card {
  position: relative !important;
  min-height: 320px !important;
  height: 100% !important;
  padding: 26px !important;
  border-radius: 22px !important;
  border: 1px solid rgba(148,163,184,.17) !important;
  background:
    radial-gradient(circle at 18% 0%, rgba(255,87,34,.13), transparent 38%),
    linear-gradient(180deg, rgba(18,27,42,.78), rgba(10,15,24,.90)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.045),
    0 18px 48px rgba(0,0,0,.22) !important;
  overflow: hidden !important;
}

.fd-admin-inline-segment-detail .fd-admin-segment-module-card:hover,
.fd-admin-inline-segment-detail .fd-builder-module-card:hover,
.fd-admin-inline-segment-detail .fd-admin-inline-module-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,87,34,.42) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.055),
    0 24px 60px rgba(0,0,0,.28),
    0 0 0 1px rgba(255,87,34,.08) !important;
}

/* If module is rendered as details/summary, hide the accordion look and card it. */
.fd-admin-inline-segment-detail details.fd-admin-segment-module-card {
  display: block !important;
}

.fd-admin-inline-segment-detail details.fd-admin-segment-module-card > summary {
  list-style: none !important;
  display: block !important;
  padding: 0 !important;
  cursor: pointer !important;
}

.fd-admin-inline-segment-detail details.fd-admin-segment-module-card > summary::-webkit-details-marker {
  display: none !important;
}

.fd-admin-inline-segment-detail .fd-admin-segment-module-card summary span,
.fd-admin-inline-segment-detail .fd-builder-module-card .fd-builder-segment-kicker,
.fd-admin-inline-segment-detail .fd-admin-inline-module-card .fd-builder-segment-kicker {
  display: inline-flex !important;
  width: max-content !important;
  margin: 0 0 22px !important;
  padding: 8px 12px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,87,34,.28) !important;
  background: rgba(255,87,34,.10) !important;
  color: #ff8a65 !important;
  font-size: 12px !important;
  font-weight: 950 !important;
  letter-spacing: .08em !important;
  text-transform: uppercase !important;
}

.fd-admin-inline-segment-detail .fd-admin-segment-module-card h3,
.fd-admin-inline-segment-detail .fd-admin-segment-module-card summary strong,
.fd-admin-inline-segment-detail .fd-builder-module-card h3,
.fd-admin-inline-segment-detail .fd-admin-inline-module-card h3 {
  display: block !important;
  max-width: 92% !important;
  margin: 0 0 18px !important;
  color: #fff !important;
  font-size: clamp(30px, 2.7vw, 46px) !important;
  line-height: .98 !important;
  letter-spacing: -.06em !important;
}

.fd-admin-inline-segment-detail .fd-admin-segment-module-card summary small,
.fd-admin-inline-segment-detail .fd-builder-module-card p,
.fd-admin-inline-segment-detail .fd-admin-inline-module-card p {
  display: block !important;
  max-width: 92% !important;
  margin: 0 !important;
  color: #aeb8c7 !important;
  font-size: 15px !important;
  line-height: 1.62 !important;
}

/* Hide old lesson accordion content on the module grid screen; user should click module first. */
.fd-admin-inline-segment-detail .fd-admin-segment-module-card > div:not(.fd-builder-card-badges),
.fd-admin-inline-segment-detail .fd-admin-segment-module-card .fd-builder-lesson-nav {
  display: none !important;
}

/* Badge + CTA placement in module cards */
.fd-admin-inline-segment-detail .fd-admin-segment-module-card .fd-builder-card-badges,
.fd-admin-inline-segment-detail .fd-builder-module-card .fd-builder-card-badges,
.fd-admin-inline-segment-detail .fd-admin-inline-module-card .fd-builder-card-badges {
  position: absolute !important;
  left: 26px !important;
  right: 26px !important;
  bottom: 86px !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
}

.fd-admin-inline-segment-detail .fd-admin-segment-module-card .fd-builder-card-cta,
.fd-admin-inline-segment-detail .fd-builder-module-card .fd-builder-card-cta,
.fd-admin-inline-segment-detail .fd-admin-inline-module-card .fd-builder-card-cta,
.fd-admin-inline-segment-detail .fd-admin-segment-module-card::after {
  position: absolute !important;
  left: 26px !important;
  bottom: 26px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 46px !important;
  padding: 0 18px !important;
  border-radius: 14px !important;
  background: #ff5722 !important;
  color: #fff !important;
  font-weight: 950 !important;
  box-shadow: 0 20px 46px rgba(255,87,34,.28) !important;
}

/* Add CTA for old details cards if they have no explicit CTA element. */
.fd-admin-inline-segment-detail details.fd-admin-segment-module-card::after {
  content: "Otwórz lekcje →";
}

/* Make the segment-detail header feel like the cockpit without taking over the whole screen. */
.fd-admin-inline-segment-detail .fd-builder-topbar {
  margin-bottom: 28px !important;
}

.fd-admin-inline-segment-detail .fd-admin-inline-segment-summary {
  margin: 0 0 26px !important;
}

/* Lesson cards grid should also mirror the card system. */
.fd-admin-inline-module-lessons .fd-admin-index-list,
.fd-admin-inline-module-lessons .fd-admin-index-list-lessons {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: clamp(16px, 1.6vw, 22px) !important;
}

.fd-admin-inline-module-lessons .fd-admin-index-card {
  width: 100% !important;
  min-height: 190px !important;
}

@media (max-width: 1280px) {
  .fd-admin-inline-segment-detail .fd-admin-segment-module-list,
  .fd-admin-inline-segment-detail .fd-admin-module-grid-force,
  .fd-admin-inline-segment-detail .fd-builder-module-grid,
  .fd-admin-inline-segment-detail .fd-admin-inline-module-grid,
  .fd-admin-inline-module-lessons .fd-admin-index-list,
  .fd-admin-inline-module-lessons .fd-admin-index-list-lessons {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 760px) {
  .fd-admin-inline-segment-detail .fd-admin-segment-module-list,
  .fd-admin-inline-segment-detail .fd-admin-module-grid-force,
  .fd-admin-inline-segment-detail .fd-builder-module-grid,
  .fd-admin-inline-segment-detail .fd-admin-inline-module-grid,
  .fd-admin-inline-module-lessons .fd-admin-index-list,
  .fd-admin-inline-module-lessons .fd-admin-index-list-lessons {
    grid-template-columns: 1fr !important;
  }
}


/* v0.10.65: optional last lesson resume, no auto redirect */
.fd-dashboard-resume {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 22px 0 28px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.10);
  background:
    radial-gradient(circle at 10% 0%, rgba(255,87,34,.12), transparent 36%),
    rgba(255,255,255,.035);
}

.fd-dashboard-resume .fd-primary {
  min-height: 48px;
}

.fd-dashboard-resume span {
  color: #aeb8c7;
  font-size: 14px;
  line-height: 1.45;
}

@media (max-width: 640px) {
  .fd-dashboard-resume {
    display: grid;
  }

  .fd-dashboard-resume .fd-primary {
    width: 100%;
  }
}


/* v0.10.66: clean resume button without explanatory copy */
.fd-dashboard-resume {
  width: max-content;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
}

.fd-dashboard-resume span {
  display: none !important;
}


/* v0.10.68: mobile lesson UI and full-width lesson list drawer */
.fd-sidebar-mobile-close {
  display: none;
}

@media (max-width: 760px) {
  .futuredev-app {
    --fd-mobile-pad: 18px;
  }

  .fd-focus-shell:not(.fd-dashboard-mode) {
    display: block !important;
    min-height: 100svh;
  }

  .fd-focus-shell:not(.fd-dashboard-mode) > .fd-sidebar {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9998 !important;
    width: 100vw !important;
    max-width: none !important;
    min-width: 0 !important;
    height: 100svh !important;
    padding: calc(env(safe-area-inset-top, 0px) + 20px) 18px calc(env(safe-area-inset-bottom, 0px) + 24px) !important;
    border: 0 !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
    opacity: 1 !important;
    overflow: auto !important;
    pointer-events: auto !important;
    background:
      radial-gradient(circle at 18% 0%, rgba(255,87,34,.16), transparent 38%),
      linear-gradient(180deg, #080c12 0%, #05070b 100%) !important;
    box-shadow: 0 0 0 1px rgba(255,255,255,.06) inset, 0 28px 90px rgba(0,0,0,.62);
    transform: translateX(0);
    transition: transform .28s ease, opacity .2s ease !important;
  }

  .fd-focus-shell.fd-sidebar-collapsed:not(.fd-dashboard-mode) > .fd-sidebar {
    display: block !important;
    transform: translateX(-105%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  .fd-sidebar-mobile-close {
    display: inline-grid;
    place-items: center;
    position: sticky;
    top: 0;
    z-index: 3;
    width: 44px;
    height: 44px;
    margin-left: auto;
    margin-bottom: 14px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 14px;
    background: rgba(255,255,255,.05);
    color: #fff;
    font-size: 28px;
    line-height: 1;
  }

  .fd-sidebar .fd-menu-button-first {
    min-height: 52px;
    margin: 0 0 16px;
    border-radius: 16px;
  }

  .fd-sidebar .fd-course-card {
    margin-bottom: 18px;
    border-radius: 20px;
  }

  .fd-lesson-list {
    display: grid;
    gap: 8px;
    padding-bottom: 30px;
  }

  .fd-module-title {
    margin-top: 18px;
    padding: 0 4px;
    font-size: 12px;
    letter-spacing: .08em;
  }

  .fd-lesson-list button {
    min-height: 52px;
    padding: 12px 14px;
    border-radius: 16px;
    text-align: left;
    line-height: 1.35;
  }

  .fd-learning-main {
    padding: 0 var(--fd-mobile-pad) calc(env(safe-area-inset-bottom, 0px) + 84px) !important;
    min-width: 0;
  }

  .fd-topbar {
    min-height: auto;
    display: grid;
    gap: 16px;
    padding: 20px 0 18px;
  }

  .fd-topbar-left {
    display: grid !important;
    gap: 14px !important;
  }

  .fd-sidebar-toggle {
    width: auto !important;
    min-height: 48px;
    justify-content: center;
    padding: 0 18px !important;
    border-radius: 16px !important;
    font-size: 15px !important;
  }

  .fd-sidebar-toggle .fd-toggle-long {
    display: inline !important;
  }

  .fd-sidebar-toggle .fd-toggle-short {
    display: none !important;
  }

  .fd-crumbs {
    display: none !important;
  }

  .fd-top-actions {
    display: grid !important;
    gap: 14px;
    width: 100%;
  }

  .fd-mini-progress {
    width: 100% !important;
    padding: 4px 0;
  }

  .fd-top-buttons {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
  }

  .fd-top-buttons .fd-ghost,
  .fd-top-buttons .fd-primary {
    width: 100%;
    min-height: 54px;
    border-radius: 16px;
    font-size: 16px;
  }

  .fd-card-large {
    margin-top: 22px !important;
    border-radius: 22px !important;
    overflow: hidden !important;
  }

  .fd-tabs {
    display: flex !important;
    gap: 8px !important;
    padding: 10px 10px 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }

  .fd-tabs button {
    flex: 0 0 auto !important;
    min-width: max-content !important;
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    padding: 16px 18px 18px !important;
    border-radius: 14px 14px 0 0;
    scroll-snap-align: start;
    font-size: 15px;
    line-height: 1.2;
  }

  .fd-tabs button.is-active:after {
    left: 12px;
    right: 12px;
    bottom: 0;
  }

  .fd-tab-panel {
    min-height: 0 !important;
    padding: 28px 18px !important;
  }

  .fd-reading {
    max-width: none !important;
    margin: 0 !important;
  }

  .fd-reading h1 {
    font-size: clamp(36px, 12vw, 54px) !important;
    line-height: .94 !important;
    margin-bottom: 24px !important;
    letter-spacing: -.07em !important;
  }

  .fd-reading h2,
  .fd-content h2 {
    font-size: clamp(26px, 8vw, 38px) !important;
    line-height: 1.04 !important;
  }

  .fd-reading p,
  .fd-content,
  .fd-lead-small,
  .fd-instructions {
    font-size: 18px !important;
    line-height: 1.65 !important;
  }

  .fd-lesson-intro-card,
  .fd-summary-card,
  .fd-soft-box,
  .fd-example-card,
  .fd-quiz-card,
  .fd-exercise-card {
    border-radius: 22px !important;
    padding: 24px !important;
  }

  .fd-lesson-intro-card ul {
    padding-left: 20px;
  }

  .fd-lesson-intro-card li {
    margin-bottom: 14px;
    line-height: 1.55;
  }

  .fd-reading pre,
  .fd-content pre,
  .fd-code-block {
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    border-radius: 18px !important;
    padding: 18px !important;
    font-size: 13px !important;
    line-height: 1.65 !important;
  }

  .fd-reading pre code,
  .fd-content pre code,
  .fd-code-block code {
    white-space: pre !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
  }

  .fd-code-workspace {
    border-radius: 20px !important;
  }

  .fd-file-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .fd-file-tabs button {
    flex: 0 0 auto;
    min-width: max-content;
    white-space: nowrap;
  }

  .fd-code-editor {
    min-height: 300px !important;
    padding: 18px !important;
    font-size: 14px !important;
    line-height: 1.7 !important;
  }

  .fd-footer-actions {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px !important;
  }

  .fd-footer-actions button {
    width: 100%;
    min-height: 52px;
    border-radius: 16px;
  }

  .fd-help-button,
  [data-help] {
    right: 18px !important;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 18px) !important;
    z-index: 60 !important;
  }

  .fd-ai-drawer,
  .fd-ai-panel,
  .fd-mentor-drawer,
  .fd-mentor-panel,
  .futuredev-ai-drawer,
  .futuredev-ai-panel,
  .futuredev-mentor-drawer,
  .futuredev-mentor-panel,
  [data-fd-ai-drawer],
  [data-fd-mentor-panel] {
    position: fixed !important;
    inset: auto 12px calc(env(safe-area-inset-bottom, 0px) + 12px) 12px !important;
    width: auto !important;
    max-width: none !important;
    max-height: min(680px, calc(100svh - 88px)) !important;
    z-index: 9999 !important;
  }
}


/* v0.10.69: mobile sidebar close + wrapped code + wider content */
@media (max-width: 760px) {
  .futuredev-app {
    --fd-mobile-pad: 10px;
  }

  .futuredev-app,
  .futuredev-shell,
  .fd-focus-shell,
  .fd-learning-main,
  .fd-card-large,
  .fd-tab-panel,
  .fd-reading,
  .fd-content {
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .fd-focus-shell:not(.fd-dashboard-mode) > .fd-sidebar {
    left: 0 !important;
    right: 0 !important;
    width: 100dvw !important;
    max-width: 100dvw !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    overflow-x: hidden !important;
  }

  .fd-sidebar-mobile-close {
    position: fixed !important;
    top: calc(env(safe-area-inset-top, 0px) + 14px) !important;
    right: 16px !important;
    z-index: 10001 !important;
    display: grid !important;
    place-items: center !important;
    width: 48px !important;
    height: 48px !important;
    margin: 0 !important;
    border-radius: 16px !important;
    border: 1px solid rgba(255,255,255,.18) !important;
    background: rgba(12,17,26,.94) !important;
    color: #fff !important;
    box-shadow: 0 18px 48px rgba(0,0,0,.38) !important;
  }

  .fd-sidebar .fd-menu-button-first {
    margin-top: 58px !important;
  }

  .fd-sidebar .fd-course-card {
    overflow: hidden !important;
  }

  .fd-sidebar .fd-course-card > div:first-child {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 10px !important;
    align-items: baseline !important;
  }

  .fd-sidebar .fd-course-card strong,
  .fd-sidebar .fd-course-card small {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .fd-learning-main {
    padding-left: var(--fd-mobile-pad) !important;
    padding-right: var(--fd-mobile-pad) !important;
  }

  .fd-card-large {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    border-left-color: rgba(255,255,255,.08) !important;
    border-right-color: rgba(255,255,255,.08) !important;
  }

  .fd-tab-panel {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .fd-reading {
    width: 100% !important;
  }

  .fd-reading p,
  .fd-content p,
  .fd-content li,
  .fd-lead-small,
  .fd-instructions {
    max-width: none !important;
  }

  .fd-reading pre,
  .fd-content pre,
  .fd-code-block {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    white-space: pre-wrap !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
  }

  .fd-reading pre code,
  .fd-content pre code,
  .fd-code-block code,
  .fd-code-block .token {
    white-space: pre-wrap !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
  }

  .fd-reading pre,
  .fd-content pre {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .fd-content pre[class*="language-"],
  .fd-reading pre[class*="language-"] {
    white-space: pre-wrap !important;
  }

  .fd-content code[class*="language-"],
  .fd-reading code[class*="language-"] {
    white-space: pre-wrap !important;
  }

  .fd-lesson-intro-card,
  .fd-summary-card,
  .fd-soft-box,
  .fd-example-card,
  .fd-quiz-card,
  .fd-exercise-card {
    padding-left: 22px !important;
    padding-right: 22px !important;
  }
}


/* v0.10.70: tighter mobile content and proper mentor chat */
@media (max-width: 760px) {
  html,
  body {
    overflow-x: hidden !important;
  }

  .futuredev-shell,
  .futuredev-app,
  .futuredev-app *,
  .futuredev-app *::before,
  .futuredev-app *::after {
    box-sizing: border-box !important;
  }

  .futuredev-app,
  .futuredev-shell,
  .fd-focus-shell:not(.fd-dashboard-mode),
  .fd-learning-main,
  .fd-card-large,
  .fd-tab-panel,
  .fd-reading,
  .fd-content {
    width: 100% !important;
    max-width: 100% !important;
  }

  .futuredev-app {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .fd-focus-shell:not(.fd-dashboard-mode) {
    margin-left: 0 !important;
    margin-right: 0 !important;
    overflow-x: hidden !important;
  }

  .fd-learning-main {
    padding-left: 4px !important;
    padding-right: 4px !important;
    overflow-x: hidden !important;
  }

  .fd-card-large {
    border-radius: 20px !important;
  }

  .fd-tab-panel {
    padding-left: 8px !important;
    padding-right: 8px !important;
    overflow-x: hidden !important;
  }

  .fd-reading {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .fd-lesson-intro-card,
  .fd-summary-card,
  .fd-lesson-key-summary,
  .fd-soft-box,
  .fd-example-card,
  .fd-quiz-card,
  .fd-exercise-card {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 18px !important;
    padding-right: 18px !important;
  }

  .fd-reading p,
  .fd-content p,
  .fd-content li {
    word-break: normal !important;
    overflow-wrap: anywhere !important;
  }

  .fd-help-fixed-trigger,
  .fd-help-button,
  [data-help] {
    right: 12px !important;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 76px) !important;
    max-width: calc(100vw - 24px) !important;
    z-index: 9997 !important;
  }

  .fd-help-fixed-trigger span:not(.fd-help-fixed-icon) {
    display: none !important;
  }

  .fd-help-drawer.fd-help-chat-widget,
  .fd-help-drawer,
  .fd-ai-drawer,
  .fd-ai-panel,
  .fd-mentor-drawer,
  .fd-mentor-panel,
  .futuredev-ai-drawer,
  .futuredev-ai-panel,
  .futuredev-mentor-drawer,
  .futuredev-mentor-panel,
  [data-fd-ai-drawer],
  [data-fd-mentor-panel] {
    position: fixed !important;
    inset: auto 10px calc(env(safe-area-inset-bottom, 0px) + 10px) 10px !important;
    width: auto !important;
    max-width: none !important;
    height: min(72svh, 620px) !important;
    max-height: min(72svh, 620px) !important;
    z-index: 10000 !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    overflow: hidden !important;
    border-radius: 22px !important;
  }

  .fd-help-chat-header {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    padding: 16px !important;
    border-bottom: 1px solid rgba(255,255,255,.10) !important;
  }

  .fd-help-chat-header div {
    display: grid;
    gap: 2px;
  }

  .fd-help-chat-header strong {
    color: #fff;
    font-size: 17px;
  }

  .fd-help-chat-header span {
    color: var(--fd-muted);
    font-size: 12px;
  }

  .fd-help-chat-header button {
    width: 42px !important;
    height: 42px !important;
    border-radius: 14px !important;
    border: 1px solid rgba(255,255,255,.14) !important;
    background: rgba(255,255,255,.06) !important;
    color: #fff !important;
  }

  .fd-help-chat-scroll {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    padding: 16px !important;
    display: grid !important;
    align-content: start !important;
    gap: 12px !important;
  }

  .fd-chat-bubble {
    width: fit-content;
    max-width: 92%;
    padding: 13px 14px;
    border-radius: 18px;
    line-height: 1.55;
    font-size: 14px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }

  .fd-chat-bubble-mentor {
    justify-self: start;
    color: #dbe2ee;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.055);
  }

  .fd-chat-bubble-user {
    justify-self: end;
    color: #fff;
    background: rgba(255,87,34,.18);
    border: 1px solid rgba(255,87,34,.28);
  }

  .fd-help-chat-footer {
    flex: 0 0 auto !important;
    display: grid !important;
    gap: 10px !important;
    padding: 12px !important;
    border-top: 1px solid rgba(255,255,255,.10) !important;
    background: rgba(2,6,12,.55) !important;
  }

  .fd-help-chat-footer textarea {
    width: 100% !important;
    min-height: 82px !important;
    max-height: 150px !important;
    resize: vertical !important;
    border-radius: 16px !important;
    border: 1px solid rgba(255,255,255,.12) !important;
    background: rgba(255,255,255,.045) !important;
    color: #fff !important;
    padding: 13px 14px !important;
    font: inherit !important;
    line-height: 1.45 !important;
    outline: none !important;
  }

  .fd-help-chat-footer textarea::placeholder {
    color: rgba(216,221,231,.56) !important;
  }

  .fd-help-chat-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  .fd-help-chat-actions button {
    min-height: 46px !important;
    border-radius: 14px !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    font-size: 13px !important;
  }
}


/* v0.10.71: mentor persona and mobile-safe chat trigger */
.fd-help-fixed-trigger {
  max-width: calc(100vw - 32px) !important;
  overflow: hidden !important;
}

@media (max-width: 760px) {
  .fd-help-fixed-trigger,
  .fd-help-button,
  [data-help] {
    position: fixed !important;
    right: max(12px, env(safe-area-inset-right, 0px)) !important;
    left: auto !important;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 88px) !important;
    width: 58px !important;
    height: 58px !important;
    min-width: 58px !important;
    max-width: 58px !important;
    min-height: 58px !important;
    padding: 0 !important;
    border-radius: 999px !important;
    display: grid !important;
    place-items: center !important;
    transform: translateX(0) !important;
    overflow: visible !important;
    z-index: 9997 !important;
  }

  .fd-help-fixed-icon {
    width: 58px !important;
    height: 58px !important;
    display: grid !important;
    place-items: center !important;
    border-radius: 999px !important;
    font-size: 24px !important;
    line-height: 1 !important;
  }

  .fd-help-fixed-trigger > span:not(.fd-help-fixed-icon),
  .fd-help-button > span:not(.fd-help-fixed-icon),
  [data-help] > span:not(.fd-help-fixed-icon) {
    display: none !important;
  }

  .fd-help-drawer.fd-help-chat-widget {
    right: max(10px, env(safe-area-inset-right, 0px)) !important;
    left: max(10px, env(safe-area-inset-left, 0px)) !important;
  }
}


/* v0.10.72: Future Dev persona and distinct mentor chat background */
.fd-help-drawer.fd-help-chat-widget,
.fd-help-drawer {
  background:
    radial-gradient(circle at 18% 0%, rgba(255,87,34,.22), transparent 34%),
    radial-gradient(circle at 88% 18%, rgba(255,176,122,.10), transparent 30%),
    linear-gradient(180deg, rgba(35,20,18,.98), rgba(9,12,18,.98)) !important;
  border-color: rgba(255,122,76,.22) !important;
  box-shadow:
    0 28px 90px rgba(0,0,0,.52),
    0 0 0 1px rgba(255,122,76,.08) inset !important;
}

.fd-help-chat-header {
  background:
    linear-gradient(90deg, rgba(255,87,34,.16), rgba(255,255,255,.025)) !important;
  border-bottom-color: rgba(255,122,76,.18) !important;
}

.fd-help-chat-header strong {
  color: #fff !important;
}

.fd-help-chat-header span {
  color: #ffb199 !important;
}

.fd-chat-bubble-mentor {
  background:
    linear-gradient(180deg, rgba(255,122,76,.13), rgba(255,255,255,.055)) !important;
  border-color: rgba(255,122,76,.20) !important;
  color: #f4e7df !important;
}

.fd-chat-bubble-user {
  background:
    linear-gradient(180deg, rgba(255,87,34,.92), rgba(220,68,28,.92)) !important;
  border-color: rgba(255,151,112,.35) !important;
  color: #fff !important;
  box-shadow: 0 14px 36px rgba(255,87,34,.18) !important;
}

.fd-help-chat-footer {
  background:
    linear-gradient(180deg, rgba(10,12,18,.82), rgba(5,7,11,.92)) !important;
  border-top-color: rgba(255,122,76,.16) !important;
}

.fd-help-chat-footer textarea {
  background: rgba(5,7,11,.72) !important;
  border-color: rgba(255,122,76,.18) !important;
}

.fd-help-chat-footer textarea:focus {
  border-color: rgba(255,122,76,.44) !important;
  box-shadow: 0 0 0 3px rgba(255,87,34,.10) !important;
}

@media (max-width: 760px) {
  .fd-help-drawer.fd-help-chat-widget,
  .fd-help-drawer {
    background:
      radial-gradient(circle at 14% 0%, rgba(255,87,34,.24), transparent 34%),
      linear-gradient(180deg, rgba(36,19,17,.99), rgba(7,9,14,.99)) !important;
  }
}


/* v0.10.73: red Future Dev mentor chat background */
.fd-help-drawer.fd-help-chat-widget,
.fd-help-drawer {
  background:
    radial-gradient(circle at 16% 0%, rgba(255,87,34,.28), transparent 34%),
    radial-gradient(circle at 82% 12%, rgba(255,44,44,.18), transparent 32%),
    linear-gradient(180deg, #32100f 0%, #1b0809 48%, #08070b 100%) !important;
  border-color: rgba(255,87,34,.30) !important;
  box-shadow:
    0 30px 95px rgba(0,0,0,.58),
    0 0 0 1px rgba(255,105,72,.12) inset,
    0 0 46px rgba(255,48,32,.10) !important;
}

.fd-help-chat-header {
  background:
    linear-gradient(90deg, rgba(255,87,34,.25), rgba(130,18,18,.34)) !important;
  border-bottom-color: rgba(255,132,92,.24) !important;
}

.fd-help-chat-scroll {
  background:
    radial-gradient(circle at 50% 0%, rgba(255,87,34,.08), transparent 38%) !important;
}

.fd-chat-bubble-mentor {
  background:
    linear-gradient(180deg, rgba(72,18,18,.82), rgba(35,12,13,.86)) !important;
  border-color: rgba(255,132,92,.26) !important;
  color: #ffe9e2 !important;
}

.fd-chat-bubble-user {
  background:
    linear-gradient(180deg, #ff5722, #d93622) !important;
  border-color: rgba(255,190,164,.42) !important;
  color: #fff !important;
  box-shadow: 0 16px 38px rgba(255,55,32,.24) !important;
}

.fd-help-chat-footer {
  background:
    linear-gradient(180deg, rgba(36,10,11,.92), rgba(12,6,8,.96)) !important;
  border-top-color: rgba(255,132,92,.22) !important;
}

.fd-help-chat-footer textarea {
  background: rgba(22,7,8,.88) !important;
  border-color: rgba(255,132,92,.26) !important;
}

.fd-help-chat-footer textarea:focus {
  border-color: rgba(255,151,112,.58) !important;
  box-shadow: 0 0 0 3px rgba(255,87,34,.14) !important;
}

@media (max-width: 760px) {
  .fd-help-drawer.fd-help-chat-widget,
  .fd-help-drawer {
    background:
      radial-gradient(circle at 12% 0%, rgba(255,87,34,.30), transparent 34%),
      radial-gradient(circle at 82% 10%, rgba(255,44,44,.20), transparent 32%),
      linear-gradient(180deg, #35100f 0%, #1c0809 52%, #07070b 100%) !important;
  }
}


/* v0.10.74: polished Future Dev chat buttons + message icon */
.fd-help-fixed-trigger {
  display: inline-flex !important;
  align-items: center !important;
  gap: 11px !important;
  min-height: 58px !important;
  padding: 8px 18px 8px 9px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,151,112,.32) !important;
  background:
    radial-gradient(circle at 28% 18%, rgba(255,196,171,.32), transparent 34%),
    linear-gradient(135deg, #ff5722 0%, #d73522 54%, #8f171b 100%) !important;
  color: #fff !important;
  box-shadow:
    0 22px 58px rgba(255,57,34,.26),
    0 8px 22px rgba(0,0,0,.28),
    inset 0 1px 0 rgba(255,255,255,.20) !important;
  font-weight: 900 !important;
  letter-spacing: -.01em !important;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease !important;
}

.fd-help-fixed-trigger:hover {
  transform: translateY(-2px) !important;
  filter: brightness(1.05) !important;
  box-shadow:
    0 28px 68px rgba(255,57,34,.32),
    0 10px 26px rgba(0,0,0,.32),
    inset 0 1px 0 rgba(255,255,255,.23) !important;
}

.fd-help-fixed-trigger:active {
  transform: translateY(0) scale(.98) !important;
}

.fd-help-fixed-icon {
  display: grid !important;
  place-items: center !important;
  width: 42px !important;
  height: 42px !important;
  border-radius: 999px !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.24), rgba(255,255,255,.08)) !important;
  border: 1px solid rgba(255,255,255,.24) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18) !important;
  color: #fff !important;
}

.fd-help-fixed-icon svg {
  width: 23px !important;
  height: 23px !important;
  display: block !important;
}

.fd-help-chat-actions .fd-primary,
.fd-help-chat-actions .fd-ghost,
.fd-help-chat-footer button {
  position: relative !important;
  overflow: hidden !important;
  min-height: 48px !important;
  border-radius: 15px !important;
  font-weight: 900 !important;
  letter-spacing: -.01em !important;
}

.fd-help-chat-actions .fd-primary {
  border: 1px solid rgba(255,180,150,.35) !important;
  background:
    radial-gradient(circle at 25% 0%, rgba(255,255,255,.20), transparent 35%),
    linear-gradient(135deg, #ff5722, #d73522) !important;
  box-shadow:
    0 16px 34px rgba(255,57,34,.24),
    inset 0 1px 0 rgba(255,255,255,.18) !important;
}

.fd-help-chat-actions .fd-ghost {
  border: 1px solid rgba(255,151,112,.24) !important;
  background:
    linear-gradient(180deg, rgba(255,122,76,.13), rgba(255,255,255,.045)) !important;
  color: #ffe9e2 !important;
}

.fd-help-chat-actions .fd-primary:hover,
.fd-help-chat-actions .fd-ghost:hover,
.fd-help-chat-footer button:hover {
  transform: translateY(-1px) !important;
  filter: brightness(1.05) !important;
}

@media (max-width: 760px) {
  .fd-help-fixed-trigger,
  .fd-help-button,
  [data-help] {
    right: max(12px, env(safe-area-inset-right, 0px)) !important;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 88px) !important;
    width: 60px !important;
    height: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
    min-height: 60px !important;
    padding: 0 !important;
    border-radius: 999px !important;
  }

  .fd-help-fixed-icon {
    width: 48px !important;
    height: 48px !important;
    border-radius: 999px !important;
  }

  .fd-help-fixed-icon svg {
    width: 25px !important;
    height: 25px !important;
  }

  .fd-help-chat-actions {
    grid-template-columns: 1fr !important;
  }

  .fd-help-chat-actions .fd-primary,
  .fd-help-chat-actions .fd-ghost,
  .fd-help-chat-footer button {
    min-height: 50px !important;
    font-size: 14px !important;
  }
}


/* v0.10.75: roomier Future Dev chat composer */
.fd-help-drawer.fd-help-chat-widget,
.fd-help-drawer {
  width: min(420px, calc(100vw - 32px)) !important;
}

.fd-help-chat-header {
  padding: 18px 20px !important;
}

.fd-help-chat-header div {
  min-width: 0 !important;
}

.fd-help-chat-header strong {
  display: block !important;
  font-size: 18px !important;
  line-height: 1.15 !important;
  letter-spacing: -.02em !important;
}

.fd-help-chat-header span {
  display: none !important;
}

.fd-help-chat-scroll {
  padding: 18px 20px !important;
  gap: 14px !important;
}

.fd-chat-bubble {
  max-width: 94% !important;
  padding: 14px 15px !important;
  font-size: 14px !important;
  line-height: 1.55 !important;
}

.fd-help-chat-footer {
  padding: 14px !important;
  gap: 10px !important;
}

.fd-help-chat-footer textarea {
  min-height: 112px !important;
  max-height: 220px !important;
  padding: 14px 15px !important;
  border-radius: 16px !important;
  line-height: 1.5 !important;
}

.fd-help-chat-actions {
  display: grid !important;
  grid-template-columns: auto 1fr !important;
  gap: 10px !important;
  align-items: stretch !important;
}

.fd-help-chat-actions .fd-ghost,
.fd-help-chat-actions .fd-primary {
  min-height: 42px !important;
  padding: 0 14px !important;
  border-radius: 14px !important;
  font-size: 13px !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
}

.fd-help-chat-actions .fd-primary {
  padding-inline: 18px !important;
}

.fd-help-chat-actions .fd-ghost {
  max-width: 160px !important;
}

@media (max-width: 760px) {
  .fd-help-drawer.fd-help-chat-widget,
  .fd-help-drawer {
    width: auto !important;
  }

  .fd-help-chat-header {
    padding: 16px !important;
  }

  .fd-help-chat-scroll {
    padding: 16px !important;
  }

  .fd-help-chat-footer {
    padding: 12px !important;
  }

  .fd-help-chat-footer textarea {
    min-height: 118px !important;
    max-height: 240px !important;
  }

  .fd-help-chat-actions {
    grid-template-columns: 1fr 1fr !important;
  }

  .fd-help-chat-actions .fd-ghost,
  .fd-help-chat-actions .fd-primary {
    max-width: none !important;
    min-height: 44px !important;
    padding-inline: 10px !important;
    font-size: 12.5px !important;
  }
}

@media (max-width: 420px) {
  .fd-help-chat-actions {
    grid-template-columns: 1fr !important;
  }

  .fd-help-chat-actions .fd-ghost,
  .fd-help-chat-actions .fd-primary {
    width: 100% !important;
  }
}
