:root {
  --security-font-stack: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

html,
body,
button,
input,
select,
textarea {
  font-family: var(--security-font-stack);
}

#main {
  padding-bottom: 0 !important;
}

#topbar {
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.topbar-main-row {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
}

#topbar-title-wrap {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

#topbar-title {
  flex: unset;
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

#topbar-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

#bottom-nav {
  position: static;
  inset: auto;
  height: auto;
  border-top: 0;
  border-bottom: 1px solid var(--border);
  background: var(--card-bg);
  z-index: auto;
}

#bottom-nav .bn-item {
  min-height: 58px;
}

#bottom-nav .bn-item .bn-icon {
  font-size: 20px;
}

#sidebar-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#sidebar-header .book-badge {
  order: 2;
  margin-bottom: 0;
}

#sidebar-header h1 {
  font-size: 17px;
  font-weight: 700;
}

#sidebar nav a,
#sidebar nav a.active,
.chapter-card .ch-title,
.ch-progress {
  font-weight: 500;
}

#sidebar nav a,
.chapter-card .ch-title {
  font-size: 14px;
}

.dashboard-hero h2,
.chapter-hero h2 {
  font-size: clamp(1.85rem, 2.4vw, 2.35rem);
}

.dashboard-hero p,
.chapter-hero p {
  max-width: 760px;
}

.chapter-hero {
  padding: 32px 36px;
}

.chapter-card .ch-topics {
  margin-top: 10px;
}

.chapter-card .ch-desc {
  margin-top: 8px;
}

.section-title {
  margin-top: 4px;
}

.nb-banner,
.lab-notebook-row {
  display: none !important;
}

@media (max-width: 900px) {
  .topbar-main-row {
    flex-wrap: wrap;
    padding: 12px 16px;
  }

  #topbar-title-wrap {
    width: 100%;
    order: 3;
  }

  #bottom-nav {
    width: 100%;
  }

  #bottom-nav .bn-item {
    min-height: 54px;
    font-size: 12px;
  }

  .chapter-hero,
  .dashboard-hero {
    padding: 24px 22px;
  }
}
