/* SYNAPTIC UI overrides */
html,
body {
  overflow-x: hidden;
  max-width: 100vw;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

img,
video,
iframe,
embed,
object,
svg,
canvas {
  max-width: 100%;
  height: auto;
}

/* Homepage approval mode: keep homepage academic and remove legacy mission/self-discovery blocks. */
#synaptic-home-root > .home-mission-summary,
#synaptic-home-root > .premium-tests-cta-block,
#synaptic-home-root > .synaptic-flow-section,
#synaptic-home-root > .neural-flow-section,
#synaptic-home-root > .neural-divider-section {
  display: none !important;
}

/* Premium academic command bar refinement */
.lbfl-masthead {
  border-bottom-color: rgba(0, 212, 178, 0.18) !important;
}

.lbfl-brand__title {
  display: inline-flex !important;
  flex-direction: column;
  gap: 0.1rem;
}

.lbfl-brand__short {
  display: none;
}

.lbfl-brand__full {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lbfl-search-toggle,
.lbfl-mobile-toggle {
  box-shadow: 0 10px 24px rgba(0, 212, 178, 0.18) !important;
}

@media (max-width: 859px) {
  .lbfl-masthead__inner {
    min-height: 68px !important;
    padding-inline: 0.75rem !important;
  }

  .lbfl-nav {
    min-height: 68px !important;
    gap: 0.45rem !important;
  }

  .lbfl-brand {
    flex: 0 1 auto !important;
    max-width: 94px;
    gap: 0.4rem !important;
  }

  .lbfl-brand__logo {
    width: 38px !important;
    height: 38px !important;
    max-width: 38px !important;
    max-height: 38px !important;
  }

  .lbfl-brand__full {
    display: none !important;
  }

  .lbfl-brand__short {
    display: block !important;
    color: #f8fafc;
    font-weight: 950;
    font-size: 0.98rem;
    letter-spacing: 0.02em;
  }

  .lbfl-nav-actions {
    margin-left: auto;
    gap: 0.38rem !important;
  }

  .lbfl-search-toggle,
  .lbfl-mobile-toggle {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    border-radius: 14px !important;
  }

  .lbfl-language-switcher {
    transform: scale(0.94);
    transform-origin: center;
  }

  .lbfl-translate-shell {
    display: none !important;
  }
}

@media (max-width: 420px) {
  .lbfl-brand {
    max-width: 86px;
  }

  .lbfl-brand__logo {
    width: 34px !important;
    height: 34px !important;
  }

  .lbfl-brand__short {
    font-size: 0.9rem;
  }

  .lbfl-search-toggle,
  .lbfl-mobile-toggle {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
  }
}

/* Educational boundary: compact by default, stronger only for health/behaviour content. */
.educational-boundary {
  margin: 0.9rem 0 1.35rem;
  padding: 0.75rem 0.95rem;
  border-left: 4px solid #00d4b2;
  border-radius: 12px;
  background: rgba(0, 212, 178, 0.055);
  color: #dbeafe;
  font-size: 0.9rem;
  line-height: 1.55;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.20);
}

.educational-boundary--compact {
  display: block;
  font-size: 0.82rem;
  line-height: 1.48;
  padding: 0.62rem 0.78rem;
  margin: 0.7rem 0 1.1rem;
  border-left-width: 3px;
}

.educational-boundary--detailed {
  background: rgba(0, 212, 178, 0.07);
}

.educational-boundary strong {
  color: #f8fafc;
}

.educational-boundary span[lang="bn"] {
  color: #cbd5e1;
  font-size: 0.92em;
}

/* Reusable premium hub design system. */
.lbfl-hub-intro,
.lbfl-hub-panel,
.lbfl-study-step,
.lbfl-principle-card,
.lbfl-route-card,
.lbfl-log-card,
.lbfl-outcome-card {
  border: 1px solid rgba(0, 212, 178, 0.16);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.84), rgba(2, 6, 23, 0.72));
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.lbfl-hub-intro {
  padding: clamp(1.2rem, 4vw, 2rem);
  margin: 0 0 1.5rem;
}

.lbfl-hub-kicker,
.lbfl-card-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid rgba(0, 212, 178, 0.24);
  border-radius: 999px;
  background: rgba(0, 212, 178, 0.07);
  color: #7fffe7;
  padding: 0.25rem 0.62rem;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lbfl-hub-title {
  margin: 0.8rem 0 0.75rem;
  color: #f8fafc;
  font-size: clamp(1.55rem, 5vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.lbfl-hub-lead {
  margin: 0;
  color: #dbeafe;
  font-size: clamp(1rem, 2.2vw, 1.16rem);
  line-height: 1.7;
}

.lbfl-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 1rem;
  margin: 1.1rem 0 1.8rem;
}

.lbfl-study-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 0.85rem;
  margin: 1rem 0 1.8rem;
  counter-reset: study-step;
}

.lbfl-study-step {
  position: relative;
  padding: 1rem;
  overflow: hidden;
}

.lbfl-study-step::before {
  counter-increment: study-step;
  content: counter(study-step);
  position: absolute;
  top: 0.75rem;
  right: 0.9rem;
  color: rgba(103, 232, 249, 0.34);
  font-size: 2rem;
  font-weight: 950;
  line-height: 1;
}

.lbfl-study-step h3,
.lbfl-principle-card h3,
.lbfl-route-card h3,
.lbfl-log-card h3,
.lbfl-outcome-card h3 {
  margin: 0 0 0.55rem;
  color: #f8fafc;
  font-size: 1.04rem;
  line-height: 1.3;
}

.lbfl-study-step p,
.lbfl-principle-card p,
.lbfl-route-card p,
.lbfl-log-card p,
.lbfl-outcome-card p {
  margin: 0;
  color: #cbd5e1;
  font-size: 0.94rem;
  line-height: 1.65;
}

.lbfl-principle-card,
.lbfl-route-card,
.lbfl-log-card,
.lbfl-outcome-card {
  padding: 1.05rem;
}

.lbfl-route-card a,
.lbfl-log-card a,
.lbfl-text-link {
  color: #5eead4 !important;
  font-weight: 850;
  text-decoration: none !important;
}

.lbfl-route-card a:hover,
.lbfl-log-card a:hover,
.lbfl-text-link:hover {
  color: #99f6e4 !important;
  text-decoration: underline !important;
  text-underline-offset: 4px;
}

.lbfl-section-title {
  margin: 2rem 0 0.7rem;
  color: #f8fafc;
  font-size: clamp(1.35rem, 4.8vw, 2rem);
  line-height: 1.13;
  letter-spacing: -0.02em;
  border-bottom: 1px solid rgba(148, 163, 184, 0.20);
  padding-bottom: 0.55rem;
}

.lbfl-note-list {
  display: grid;
  gap: 0.7rem;
  margin: 1rem 0 1.5rem;
  padding: 0;
  list-style: none;
}

.lbfl-note-list li {
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.52);
}

/* Page typography refinement. */
.page,
.page__inner-wrap,
.page__content,
.archive,
.initial-content,
.highlighter-rouge,
.highlight,
.highlight pre,
.highlight code,
pre,
code {
  min-width: 0 !important;
  max-width: 100% !important;
}

.page__content {
  overflow-wrap: anywhere;
  word-break: normal;
}

.page__content p,
.page__content li,
.page__content td,
.page__content th {
  overflow-wrap: anywhere;
}

.page__content pre,
.page__content .highlight,
.page__content .highlight pre,
.page__content div.highlighter-rouge,
.page__content div.highlighter-rouge pre {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  overflow-x: hidden !important;
  white-space: pre-wrap !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  border-radius: 14px;
}

.page__content pre code,
.page__content .highlight code,
.page__content code.language-text,
.page__content .language-text,
.page__content .highlight .language-text {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  white-space: pre-wrap !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

.page__content table,
.page__content .table-wrapper {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

[style*="width:100vw"],
[style*="width: 100vw"] {
  width: 100% !important;
  max-width: 100% !important;
}

body:has(.fab, .floating-microphone, .neural-fab) .page__footer,
body:has(.fab, .floating-microphone, .neural-fab) .site-footer,
body:has(#synaptic-floating-ai-root) .page__footer,
body:has(#synaptic-floating-ai-root) .site-footer {
  padding-bottom: 100px;
}

#synaptic-floating-ai-root.synaptic-floating-ai-shell {
  bottom: 1.2rem !important;
  right: 1.1rem !important;
}

#synaptic-floating-ai-root .synaptic-core-bubble-btn {
  width: 54px !important;
  height: 54px !important;
}

#synaptic-floating-ai-root .synaptic-bubble-icon {
  width: 23px !important;
  height: 23px !important;
}

@media (max-width: 768px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
  }

  #main,
  .page,
  .page__inner-wrap,
  .page__content,
  .archive,
  .initial-content {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  .page__content {
    padding-bottom: 8.5rem;
  }

  .educational-boundary {
    font-size: 0.82rem;
    line-height: 1.48;
  }

  .educational-boundary--compact {
    font-size: 0.76rem;
    line-height: 1.42;
    padding: 0.56rem 0.68rem;
  }

  .lbfl-card-grid,
  .lbfl-study-grid {
    gap: 0.8rem;
  }

  .lbfl-hub-intro,
  .lbfl-study-step,
  .lbfl-principle-card,
  .lbfl-route-card,
  .lbfl-log-card,
  .lbfl-outcome-card {
    border-radius: 16px;
  }

  #synaptic-floating-ai-root.synaptic-floating-ai-shell {
    bottom: calc(5.25rem + env(safe-area-inset-bottom)) !important;
    right: 1rem !important;
  }

  #synaptic-floating-ai-root .synaptic-core-bubble-btn {
    width: 48px !important;
    height: 48px !important;
  }

  #synaptic-floating-ai-root .synaptic-bubble-icon {
    width: 21px !important;
    height: 21px !important;
  }

  .page__content pre,
  .page__content .highlight pre,
  .page__content div.highlighter-rouge pre {
    padding: 1rem !important;
    font-size: clamp(0.68rem, 3.1vw, 0.82rem) !important;
    line-height: 1.62 !important;
    letter-spacing: -0.015em;
    white-space: pre-wrap !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  .page__content pre code,
  .page__content .highlight code,
  .page__content code.language-text {
    font-size: inherit !important;
    line-height: inherit !important;
    white-space: pre-wrap !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  .page__content h1 {
    font-size: clamp(1.8rem, 8vw, 2.45rem);
    line-height: 1.12;
  }

  .page__content h2 {
    font-size: clamp(1.45rem, 6.5vw, 2.05rem);
    line-height: 1.18;
  }

  .page__content h3 {
    font-size: clamp(1.15rem, 5vw, 1.5rem);
    line-height: 1.22;
  }
}

@media (max-width: 420px) {
  .page__content pre,
  .page__content .highlight pre,
  .page__content div.highlighter-rouge pre {
    padding: 0.85rem !important;
    font-size: clamp(0.62rem, 3.4vw, 0.76rem) !important;
  }
}
