/* Knowledgebase (help center) UI — Tailwind/tw- compatible helpers
   Loaded ONLY on knowledgebase pages via templates/croster/includes/head.tpl */

/* KB pages: full width (override cp-tailwind .tw-content max-width) */
.tw-content {
  max-width: none;
}

/* De Croster layout wrapped content in a Bootstrap `.container`.
   Make KB pages truly full-width by removing the container max-width only there. */
body.tpl-knowledgebase #main-body > .container,
body.tpl-knowledgebasecat #main-body > .container,
body.tpl-knowledgebasearticle #main-body > .container,
body.tpl-knowledgebasesearch #main-body > .container {
  max-width: none !important;
  width: 100%;
}

/* Croster adds generous padding on #main-body; reduce it on KB pages */
body.tpl-knowledgebase section#main-body,
body.tpl-knowledgebasecat section#main-body,
body.tpl-knowledgebasearticle section#main-body,
body.tpl-knowledgebasesearch section#main-body {
  padding-top: 10px !important;
}

/* Reduce top whitespace on KB pages (Croster containers + tw-content padding) */
body.tpl-knowledgebase .primary-content,
body.tpl-knowledgebasecat .primary-content,
body.tpl-knowledgebasearticle .primary-content,
body.tpl-knowledgebasesearch .primary-content {
  padding-top: 0 !important;
}

body.tpl-knowledgebase .tw-content,
body.tpl-knowledgebasecat .tw-content,
body.tpl-knowledgebasearticle .tw-content,
body.tpl-knowledgebasesearch .tw-content {
  padding-top: 0.25rem;
}

.tw-kb-hero {
  padding: 0 0 0.75rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.tw-kb-start-here {
  margin: 0.75rem 0 1rem;
}

.tw-kb-start-here-card {
  padding: 1rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  border-left: 4px solid rgba(2, 115, 212, 0.55);
}

.tw-kb-start-here-left {
  min-width: 0;
}

.tw-kb-start-here-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: #0f172a;
}

.tw-kb-start-here-desc {
  margin-top: 0.25rem;
  color: #475569;
  font-size: 0.9rem;
}

.tw-kb-start-here-actions {
  flex: 0 0 auto;
}

.tw-kb-hero-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tw-kb-hero-title,
.tw-kb-hero h1 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 600;
  color: #003366;
}

.tw-kb-hero p {
  margin: 0.25rem 0 0;
  color: #475569;
}

.tw-kb-searchbar {
  margin-top: 0.75rem;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
}

.tw-kb-searchbar .tw-input {
  min-width: 0;
  border-radius: 9999px;
  padding: 0.85rem 1.05rem;
  font-size: 1rem;
}

.tw-kb-searchbar .tw-btn {
  border-radius: 9999px;
  padding: 0.85rem 1.25rem;
  font-size: 0.95rem;
}

.tw-kb-searchbar.tw-kb-searchbar-quick {
  grid-template-columns: auto;
  justify-content: end;
}

.tw-kb-search-cta {
  min-width: 220px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1rem;
  padding: 0.9rem 1.25rem;
}

.tw-kb-search-cta--trail {
  min-width: clamp(250px, 24vw, 340px);
  padding: 0.68rem 1.15rem;
  font-size: 0.95rem;
  white-space: nowrap;
  flex: 0 0 auto;
}

/* Quick-search modal */
body.tw-kb-qs-open {
  overflow: hidden;
}

.tw-kb-qs-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.46);
  padding: 1rem;
}

.tw-kb-qs-overlay[hidden] {
  display: none !important;
}

.tw-kb-qs-dialog {
  width: 100%;
  max-width: 760px;
  border-radius: 1rem;
  border: 1px solid #dbe7f3;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.34);
  padding: 1rem;
}

.tw-kb-qs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.tw-kb-qs-title {
  font-size: 1.15rem;
  line-height: 1.5rem;
  font-weight: 700;
  color: #003366;
}

.tw-kb-qs-close {
  border: 0;
  background: transparent;
  color: #64748b;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tw-kb-qs-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.tw-kb-qs-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.65rem;
  align-items: center;
}

.tw-kb-qs-form .tw-input {
  height: 3rem;
  border-radius: 0.75rem;
  font-size: 1.02rem;
}

.tw-kb-qs-form .tw-btn {
  height: 3rem;
  border-radius: 0.75rem;
  padding: 0 1.1rem;
}

.tw-kb-qs-hint {
  margin-top: 0.75rem;
  color: #64748b;
  font-size: 0.875rem;
}

.tw-kb-searchbar--home {
  margin-top: 1rem;
}

@media (max-width: 640px) {
  .tw-kb-qs-overlay {
    padding: 0.6rem;
  }

  .tw-kb-qs-dialog {
    border-radius: 0.85rem;
    padding: 0.8rem;
  }

  .tw-kb-searchbar {
    grid-template-columns: 1fr;
  }

  .tw-kb-searchbar .tw-btn {
    width: 100%;
  }

  .tw-kb-searchbar.tw-kb-searchbar-quick {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .tw-kb-search-cta {
    min-width: 0;
    justify-content: center;
  }

  .tw-kb-qs-form {
    grid-template-columns: 1fr;
  }

  .tw-kb-qs-form .tw-input,
  .tw-kb-qs-form .tw-btn {
    height: 2.85rem;
  }

  .tw-kb-qs-form .tw-btn {
    width: 100%;
  }
}

@media (min-width: 1024px) {
  .tw-kb-hero-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }
}

.tw-kb-section-title {
  margin: 1.25rem 0 0.75rem;
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 600;
  color: #0f172a;
}

.tw-kb-cardlink {
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.tw-kb-cardlink__main {
  display: block;
  text-decoration: none;
  color: inherit;
}

.tw-kb-cardlink:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.10);
}

.tw-kb-cardmeta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.tw-kb-count {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 9999px;
  background: rgba(2, 115, 212, 0.10);
  color: #0273d4;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.tw-kb-desc {
  margin: 0.5rem 0 0;
  color: #475569;
  font-size: 0.875rem;
}

.tw-kb-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tw-kb-list > li + li {
  border-top: 1px solid #e2e8f0;
}

.tw-kb-list > li > a {
  display: block;
  padding: 0.9rem 1rem;
  text-decoration: none;
  color: inherit;
}

.tw-kb-list > li > a:hover {
  background: #f8fafc;
}

.tw-kb-sidebar-body {
  border-top: 1px solid #e2e8f0;
  padding-top: 0.5rem;
  margin-top: 0.5rem;
}

.tw-kb-sidebar .tw-kb-list > li + li {
  border-top: 0;
}

.tw-kb-sidebar .tw-kb-list > li > a {
  border-radius: 0.6rem;
  margin: 0.15rem 0;
}

/* Category tree: hide deeper levels by default (JS expands) */
.tw-kb-sidebar-cats > li[data-depth]:not([data-depth="0"]) {
  display: none;
}

.tw-kb-sidebar-cats > li.is-visible,
.tw-kb-sidebar-cats > li[data-inpath="1"] {
  display: block;
}

.tw-kb-sidebar-cats > li .tw-kb-cat-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  border-left: 2px solid transparent;
  border-radius: 0.6rem;
  margin: 0.15rem 0;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  padding-right: 0.6rem;
  padding-left: calc(0.55rem + (var(--as-depth, 0) * 0.85rem));
}

.tw-kb-cat-link {
  flex: 1 1 auto;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  display: block;
}

.tw-kb-cat-toggle,
.tw-kb-cat-toggle-spacer {
  width: 1.85rem;
  height: 1.85rem;
  flex: 0 0 auto;
}

.tw-kb-cat-toggle {
  border: 0;
  background: transparent;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}

.tw-kb-cat-toggle:hover {
  background: #f1f5f9;
  color: #334155;
}

.tw-kb-cat-toggle-icon {
  transition: transform 150ms ease;
}

.tw-kb-cat.is-open > .tw-kb-cat-row .tw-kb-cat-toggle-icon {
  transform: rotate(90deg);
}

/* Category-level article list (used for "Start hier" accordion) */
.tw-kb-cat-articles {
  display: none;
  list-style: none;
  margin: 0.15rem 0 0.5rem;
  padding: 0 0 0 calc(2.65rem + (var(--as-depth, 0) * 0.85rem));
}

.tw-kb-sidebar-cats > li.is-open > .tw-kb-cat-articles {
  display: block;
}

.tw-kb-sidebar-cats > li[data-articles-static="1"] > .tw-kb-cat-articles {
  display: block;
}

.tw-kb-cat-articles > li > a {
  display: block;
  padding: 0.45rem 0.75rem;
  border-left: 2px solid transparent;
  border-radius: 0.6rem;
  text-decoration: none;
  color: inherit;
}

.tw-kb-cat-articles > li > a:hover {
  background: #f8fafc;
}

.tw-kb-cat-articles > li.is-current > a {
  background: rgba(2, 115, 212, 0.08);
  border-left-color: #0273d4;
}

.tw-kb-cat-articles > li.is-current > a .tw-kb-list-title {
  color: #0273d4;
  font-weight: 600;
}

/* Current article: inline section links (from ToC) */
.tw-kb-article-sections {
  list-style: none;
  margin: 0.25rem 0 0.55rem;
  padding: 0 0 0 0.85rem;
  border-left: 1px solid #dbeafe;
}

.tw-kb-article-sections > li + li {
  margin-top: 0.2rem;
}

.tw-kb-menu-section-link {
  display: block;
  padding: 0.28rem 0.45rem;
  border-radius: 0.5rem;
  text-decoration: none;
  color: #334155;
  font-size: 0.78rem;
  line-height: 1.15rem;
}

.tw-kb-menu-section-link.toc-h3 {
  padding-left: 0.95rem;
  font-size: 0.75rem;
  color: #475569;
}

.tw-kb-menu-section-link:hover {
  background: #f8fafc;
  color: #0f172a;
}

.tw-kb-menu-section-link.is-active {
  color: #0273d4;
  background: rgba(2, 115, 212, 0.08);
  font-weight: 600;
}

/* MediaCP nested left nav (Control Panel -> subcategories -> articles) */
.tw-kb-cat-sections {
  display: none;
  list-style: none;
  margin: 0.15rem 0 0.6rem;
  padding: 0 0 0 calc(2.65rem + (var(--as-depth, 0) * 0.85rem));
}

.tw-kb-sidebar-cats > li.is-open > .tw-kb-cat-sections {
  display: block;
}

.tw-kb-cat-section + .tw-kb-cat-section {
  margin-top: 0.35rem;
}

.tw-kb-cat-section-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0.75rem;
  border-radius: 0.6rem;
  text-decoration: none;
  color: inherit;
}

.tw-kb-cat-section-link:hover {
  background: #f8fafc;
}

.tw-kb-cat-section.is-inpath > .tw-kb-cat-section-link .tw-kb-cat-section-name {
  color: #0f172a;
  font-weight: 600;
}

.tw-kb-cat-section-articles {
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0 0 0 0.75rem;
  border-left: 1px solid #e2e8f0;
}

.tw-kb-cat-section-articles > li > a {
  display: block;
  padding: 0.35rem 0.65rem;
  border-left: 2px solid transparent;
  border-radius: 0.6rem;
  text-decoration: none;
  color: inherit;
}

.tw-kb-cat-section-articles > li > a:hover {
  background: #f8fafc;
}

.tw-kb-cat-section-articles > li.is-current > a {
  background: rgba(2, 115, 212, 0.08);
  border-left-color: #0273d4;
}

.tw-kb-cat-section-articles > li.is-current > a .tw-kb-list-title {
  color: #0273d4;
  font-weight: 600;
}

.tw-kb-sidebar-cats > li.is-current > .tw-kb-cat-row {
  background: rgba(2, 115, 212, 0.08);
  border-left-color: #0273d4;
}

.tw-kb-sidebar-cats > li.is-current > .tw-kb-cat-row .tw-kb-list-title {
  color: #0273d4;
  font-weight: 600;
}

.tw-kb-sidebar-cats > li.is-inpath > .tw-kb-cat-row .tw-kb-list-title {
  color: #0f172a;
  font-weight: 600;
}

.tw-kb-sidebar-articles > li > a {
  border-left: 2px solid transparent;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.tw-kb-sidebar-articles > li.is-current > a {
  background: rgba(2, 115, 212, 0.08);
  border-left-color: #0273d4;
}

.tw-kb-sidebar-articles > li.is-current > a .tw-kb-list-title {
  color: #0273d4;
  font-weight: 600;
}

.tw-kb-sidebar .tw-kb-list-title {
  font-weight: 400;
  font-size: 0.9rem;
  line-height: 1.25rem;
  color: #334155;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tw-kb-sidebar .tw-kb-count {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  flex: 0 0 auto;
  display: none;
}

.tw-kb-sidebar-icon {
  color: #94a3b8;
}

.tw-kb-list-title {
  font-weight: 600;
  color: #0f172a;
}

.tw-kb-list-snippet {
  margin-top: 0.25rem;
  color: #64748b;
  font-size: 0.875rem;
}

.tw-kb-layout-2 {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.tw-kb-layout-3 {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 240px;
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 1280px) {
  .tw-kb-layout-2 {
    grid-template-columns: 360px minmax(0, 1fr);
  }

  .tw-kb-layout-3 {
    grid-template-columns: 360px minmax(0, 1fr) 280px;
  }
}

.tw-kb-sidebar-actions {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}

.tw-kb-sidebar-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.tw-kb-sidebar-toggle-icon {
  transition: transform 150ms ease;
}

.tw-kb-sidebar.is-collapsed .tw-kb-sidebar-toggle-icon {
  transform: rotate(-90deg);
}

.tw-kb-sidebar-body.is-collapsed {
  display: none;
}

/* Sticky category sidebar (desktop) */
@media (min-width: 1024px) {
  .tw-kb-sidebar {
    position: sticky;
    top: 110px;
  }

  .tw-kb-sidebar-toggle {
    display: none;
  }

  .tw-kb-sidebar-body {
    display: block !important;
  }
}

@media (max-width: 1023px) {
  .tw-kb-layout-2,
  .tw-kb-layout-3 {
    grid-template-columns: 1fr;
  }

  /* Mobile article pages: show article content first, categories below.
     Prevents the impression that clicks did not navigate. */
  body.tpl-knowledgebasearticle .tw-kb-layout-3 > main {
    order: 1;
  }

  body.tpl-knowledgebasearticle .tw-kb-layout-3 > aside:first-child {
    order: 2;
  }

  body.tpl-knowledgebasearticle .tw-kb-layout-3 > .tw-kb-toc-col {
    order: 3;
  }

  .tw-kb-toc-col {
    display: none;
  }

  .tw-kb-sidebar > .tw-kb-cardmeta .tw-card-title {
    display: none;
  }

  .tw-kb-sidebar .tw-kb-sidebar-actions {
    display: flex;
    width: 100%;
    gap: 0.5rem;
  }

  .tw-kb-sidebar .tw-kb-sidebar-actions .tw-kb-sidebar-toggle.tw-btn.tw-btn-ghost.tw-btn-sm {
    flex: 1 1 auto;
    width: 100%;
    min-height: 48px !important;
    padding: 0.75rem 1rem !important;
    border: 1px solid #6ee7b7 !important;
    background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%) !important;
    color: #065f46 !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    justify-content: center !important;
    border-radius: 0.75rem !important;
  }

  .tw-kb-sidebar .tw-kb-sidebar-actions .tw-kb-sidebar-toggle.tw-btn.tw-btn-ghost.tw-btn-sm:hover,
  .tw-kb-sidebar .tw-kb-sidebar-actions .tw-kb-sidebar-toggle.tw-btn.tw-btn-ghost.tw-btn-sm:focus {
    border-color: #34d399 !important;
    background: #a7f3d0 !important;
    color: #064e3b !important;
  }

  .tw-kb-sidebar .tw-kb-sidebar-actions > a.tw-btn {
    min-height: 48px !important;
    min-width: 48px !important;
    padding: 0.75rem 0.85rem !important;
    border-radius: 0.75rem !important;
  }

  /* Mobile: avoid clipped category/article titles in the sidebar */
  .tw-kb-cat-articles,
  .tw-kb-cat-sections {
    padding-left: 0.5rem !important;
  }

  .tw-kb-cat-section-articles {
    padding-left: 0.35rem !important;
  }

  .tw-kb-cat-articles > li > a,
  .tw-kb-cat-section-articles > li > a {
    overflow: visible;
    min-width: 0;
    padding: 0.4rem 0.45rem !important;
  }

  .tw-kb-article-sections {
    padding-left: 0.5rem;
  }

  .tw-kb-menu-section-link {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .tw-kb-sidebar .tw-kb-list-title {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.25rem;
    max-width: 100%;
  }

  .tw-kb-cat-articles > li > a .tw-kb-list-title,
  .tw-kb-cat-section-articles > li > a .tw-kb-list-title {
    display: block;
    font-size: 0.84rem !important;
    line-height: 1.15rem !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    max-width: 100% !important;
  }
}

.tw-kb-breadcrumbs {
  font-size: 0.875rem;
  color: #64748b;
  margin-bottom: 0.75rem;
}

/* Top trail bar (yellow) shown on all KB pages */
.tw-kb-trailbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin: 0 0 0.85rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid #fcd34d;
  border-radius: 0.75rem;
  background: linear-gradient(180deg, #fffbe8 0%, #fef3c7 100%);
  color: #854d0e;
  font-size: 0.875rem;
  line-height: 1.3;
}

.tw-kb-trail-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1 1 auto;
}

.tw-kb-trail-home,
.tw-kb-trail-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  color: #854d0e;
  text-decoration: none;
}

.tw-kb-trail-home {
  font-weight: 700;
}

.tw-kb-trail-link {
  font-weight: 600;
}

.tw-kb-trail-home:hover,
.tw-kb-trail-link:hover {
  color: #713f12;
  text-decoration: underline;
}

.tw-kb-trail-sep {
  color: #b45309;
  font-weight: 700;
}

.tw-kb-trail-current {
  color: #7c2d12;
  font-weight: 700;
  min-width: 0;
}

@media (max-width: 640px) {
  body.tpl-knowledgebase .footer-widgets .contacts_box,
  body.tpl-knowledgebasecat .footer-widgets .contacts_box,
  body.tpl-knowledgebasearticle .footer-widgets .contacts_box,
  body.tpl-knowledgebasesearch .footer-widgets .contacts_box {
    display: none !important;
  }

  body.tpl-knowledgebasearticle .tw-kb-tags-wrap {
    display: none !important;
  }

  .tw-kb-trailbar {
    flex-wrap: wrap;
    justify-content: flex-start;
    padding: 0.5rem 0.65rem;
    gap: 0.6rem;
    align-items: stretch;
  }

  .tw-kb-trail-left {
    order: 1;
    flex: 1 1 100%;
    font-size: 0.8125rem;
    line-height: 1.25rem;
    width: 100%;
  }

  .tw-kb-trail-link,
  .tw-kb-trail-current {
    overflow-wrap: anywhere;
  }

  .tw-kb-search-cta--trail {
    order: 2;
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    justify-content: center;
    padding: 0.72rem 0.95rem;
    font-size: 0.95rem;
  }
}

.tw-kb-breadcrumbs a {
  color: #0273d4;
  text-decoration: none;
}

.tw-kb-breadcrumbs a:hover {
  text-decoration: underline;
}

.tw-kb-article-title {
  margin: 0;
  font-size: 1.75rem;
  line-height: 2.25rem;
  font-weight: 500;
  color: #003366;
}

.tw-kb-meta {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: #64748b;
  font-size: 0.875rem;
}

.tw-kb-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.tw-kb-back-wrap {
  margin-top: 0.75rem;
}

.tw-kb-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

/* Prev/Next article navigation (bottom of article) */
.tw-kb-prevnext-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0 !important; /* override .tw-card padding */
  overflow: hidden; /* keep rounded corners on the card */
}

.tw-kb-prevnext-btn {
  background: #ecfdf5;
  color: #047857;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  font-weight: 600;
  white-space: nowrap;
}

.tw-kb-prevnext-btn.is-left {
  justify-content: flex-start;
}

.tw-kb-prevnext-btn.is-right {
  justify-content: flex-end;
  border-left: 1px solid #a7f3d0;
}

.tw-kb-prevnext-btn:hover {
  background: #d1fae5;
  color: #065f46;
}

.tw-kb-prevnext-btn:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.22);
}

.tw-kb-prevnext-btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.tw-kb-prevnext-btn.is-disabled:hover {
  background: #ecfdf5;
  color: #047857;
}

/* Article content ("prose" equivalent) */
.tw-kb-prose {
  margin-top: 1.25rem;
  font-size: 1rem;
  line-height: 1.75;
  color: #0f172a;
}

.tw-kb-prose strong {
  font-weight: 600;
  color: #0f172a;
}

.tw-kb-prose h2,
.tw-kb-prose h3 {
  scroll-margin-top: 110px;
}

.tw-kb-prose h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 600;
  color: #0f172a;
}

.tw-kb-prose h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.125rem;
  line-height: 1.5rem;
  font-weight: 600;
  color: #0f172a;
}

.tw-kb-prose p {
  margin: 0.9rem 0 0;
}

/* Keep long URLs/text inside the viewport on mobile/article pages */
.tw-kb-prose,
.tw-kb-prose p,
.tw-kb-prose li {
  overflow-wrap: break-word;
  word-break: normal;
}

.tw-kb-prose a {
  overflow-wrap: anywhere;
  word-break: normal;
}

@media (max-width: 640px) {
  body.tpl-knowledgebasearticle .tw-kb-prose,
  body.tpl-knowledgebasearticle .tw-kb-prose p,
  body.tpl-knowledgebasearticle .tw-kb-prose li {
    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
    max-width: 100% !important;
  }

  body.tpl-knowledgebasearticle .tw-kb-prose a {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    max-width: 100% !important;
  }

  body.tpl-knowledgebasearticle .tw-kb-prose {
    overflow-x: hidden;
  }
}

.tw-kb-lead {
  margin-top: 0.75rem;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #475569;
}

.tw-kb-prose li p {
  margin-top: 0.45rem;
}

.tw-kb-prose li p:first-child {
  margin-top: 0;
}

.tw-kb-prose ul,
.tw-kb-prose ol {
  margin: 0.9rem 0 0;
  padding-left: 1.25rem;
}

.tw-kb-prose li {
  margin: 0.45rem 0 0;
}

.tw-kb-prose a {
  color: #0273d4;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tw-kb-prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: #f1f5f9;
  border-radius: 0.375rem;
  padding: 0.12rem 0.35rem;
  font-size: 0.95em;
}

.tw-kb-prose pre {
  margin-top: 1rem;
  background: #0b1220;
  color: #e2e8f0;
  border-radius: 0.75rem;
  padding: 1rem;
  overflow: auto;
}

.tw-kb-prose pre code {
  background: transparent;
  padding: 0;
}

.tw-kb-prose img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
}

.tw-kb-prose iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  border-radius: 0.75rem;
  background: #0b1220;
}

.tw-kb-prose table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.tw-kb-prose th,
.tw-kb-prose td {
  border: 1px solid #e2e8f0;
  padding: 0.75rem;
  text-align: left;
}

.tw-kb-prose blockquote {
  margin-top: 1rem;
  border-left: 4px solid rgba(2, 115, 212, 0.35);
  padding-left: 1rem;
  color: #334155;
}

/* Callouts (added via kb-toc.js) */
.tw-kb-callout {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid #e2e8f0;
  border-left-width: 4px;
  border-radius: 0.75rem;
  background: #f8fafc;
}

.tw-kb-callout.is-important {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

.tw-kb-callout.is-warning {
  border-left-color: #ef4444;
  background: #fef2f2;
}

.tw-kb-callout.is-tip {
  border-left-color: #10b981;
  background: #ecfdf5;
}

.tw-kb-callout.is-note {
  border-left-color: rgba(2, 115, 212, 0.55);
}

/* ToC */
.tw-kb-toc {
  position: sticky;
  top: 110px;
}

.tw-kb-toc-title {
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.75rem;
}

.tw-kb-toc-nav a {
  display: block;
  padding: 0.25rem 0;
  color: #334155;
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.tw-kb-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tw-kb-toc-nav a:hover {
  color: #0f172a;
}

.tw-kb-toc-nav a.is-active {
  color: #0273d4;
  font-weight: 600;
}

.tw-kb-toc-nav .toc-h3 {
  padding-left: 1rem;
  font-size: 0.8125rem;
  color: #475569;
}

.tw-kb-toc-mobile {
  margin-top: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  background: #fff;
}

@media (min-width: 1024px) {
  .tw-kb-toc-mobile {
    display: none;
  }
}

.tw-kb-toc-mobile summary {
  cursor: pointer;
  font-weight: 600;
  color: #0f172a;
}

/* Tags (chips) */
.tw-kb-tags {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.tw-kb-tag {
  display: inline-flex;
}

.tw-kb-tag.is-hidden {
  display: none;
}

.tw-kb-tag a,
.tw-kb-taglink {
  display: inline-flex;
  align-items: center;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 9999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
}

.tw-kb-tag a:hover,
.tw-kb-taglink:hover {
  background: #f8fafc;
  color: #0f172a;
}

.tw-kb-tags-toggle {
  border: 0;
  background: transparent;
  color: #0273d4;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.25rem 0.25rem;
}

/* Contact blocks */
.tw-kb-contact {
  margin-top: 1.25rem;
}

.tw-kb-contact-header {
  margin-bottom: 0.75rem;
}

.tw-kb-contact-subtitle {
  margin-top: -0.35rem;
  color: #475569;
  font-size: 0.875rem;
}

.tw-kb-contact-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tw-kb-contact-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.15rem;
}

.tw-kb-contact-desc {
  color: #475569;
  font-size: 0.875rem;
  flex: 1 1 auto;
}

.tw-kb-contact-muted {
  color: #94a3b8;
  font-size: 0.875rem;
  display: inline-block;
  margin-top: 0.25rem;
}

.tw-kb-emergency {
  border-left: 4px solid #ef4444;
  background: #fff;
}

.tw-kb-emergency-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: #b91c1c;
  margin-bottom: 0.35rem;
}

.tw-kb-emergency-desc {
  color: #475569;
  font-size: 0.875rem;
}

.tw-kb-emergency-actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.tw-kb-emergency-phone {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px dashed #fecaca;
  background: #fff;
  color: #475569;
  border-radius: 9999px;
  padding: 0.45rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
