*, *::before, *::after { box-sizing: border-box; }
html, body { max-width: 100%; }
html { overflow-x: clip; }
body { overflow-x: clip; }
img, svg { max-width: 100%; }

@media (max-width: 1100px) {
  .topbar {
    height: auto;
    min-height: 64px;
    padding: 10px 14px;
    gap: 10px 14px;
    flex-wrap: wrap;
  }
  .topbar-left { flex: 1 1 440px; min-width: 0; }
  .topbar-search-box { width: min(320px, 48vw); min-width: 180px; }
  .topbar-center-nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    gap: 20px;
    overflow-x: auto;
    scrollbar-width: thin;
  }
  .topbar-nav-link { padding: 8px 2px 10px; white-space: nowrap; }
  .topbar-right-actions { margin-left: auto; }

  .dr-layout { display: block; min-height: 0; }
  .dr-sidebar-left {
    position: relative;
    top: auto;
    width: 100%;
    min-width: 0;
    height: auto;
    padding: 8px 14px;
    overflow: visible;
    gap: 0;
    border-right: 0;
    border-bottom: 1px solid #1E293B;
  }
  .dr-nav-header,
  .dr-nav-section-label,
  .dr-sidebar-divider,
  .dr-brand-card,
  .dr-quick-link-btn { display: none !important; }
  .dr-sidebar-left > div { width: 100%; }
  .dr-nav-items {
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }
  .dr-nav-btn { width: auto; min-height: 40px; flex: 0 0 auto; white-space: nowrap; }
  .dr-content-area { width: 100%; padding: 24px; }
  .dr-doc-unified-layout { display: block; }
  .dr-inpage-left-menu {
    position: sticky;
    top: calc(var(--dr-topbar-height, 64px) + 8px);
    z-index: 60;
    width: 100%;
    min-width: 0;
    max-height: none;
    flex-direction: row;
    overflow-x: auto;
    margin-bottom: 16px;
    padding: 8px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    scrollbar-width: thin;
  }
  .dr-inpage-menu-title { display: none; }
  .dr-inpage-nav-link { width: auto; flex: 0 0 auto; overflow: visible; text-overflow: clip; }
  .dr-unified-doc-stream { padding: 28px; }
  .dr-stream-section { scroll-margin-top: calc(var(--dr-topbar-height, 64px) + 76px); }
  .dr-stream-content-body table { display: block; width: 100%; max-width: 100%; overflow-x: auto; }
}

@media (max-width: 700px) {
  .topbar-left { flex: 1 1 100%; gap: 10px; }
  .topbar-brand-logo {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .topbar-brand-logo img { height: 26px; }
  .topbar-search-box { width: auto; min-height: 44px; flex: 1 1 auto; min-width: 0; }
  .topbar-search-input { min-height: 44px; }
  .topbar-search-kbd { display: none; }
  .topbar-right-actions { width: 100%; margin-left: 0; justify-content: space-between; }
  .topbar-env-badge,
  .glemo-lang-select { min-height: 44px; }
  .topbar-center-nav { order: 4; gap: 16px; }
  .topbar-nav-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .dr-nav-items {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    padding-bottom: 0;
  }
  .dr-nav-btn {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.25;
    white-space: normal;
    justify-content: center;
    text-align: center;
  }
  .dr-nav-btn svg { width: 14px; height: 14px; }
  .dr-content-area { padding: 18px 14px; }
  .dr-overview-header { display: block; }
  .dr-side-quote-box { display: none; }
  .dr-pillars-4grid,
  .dr-featured-grid,
  .dr-persona-groups-grid { grid-template-columns: 1fr !important; }
  .dr-hero-banner,
  .dr-marketplace-hero-block { flex-direction: column; align-items: flex-start; padding: 22px; }
  .dr-hero-banner-badges { margin-top: 16px; text-align: left; flex-direction: row; flex-wrap: wrap; }
  .dr-title-main { font-size: 22px; letter-spacing: 0; }
  .dr-unified-doc-stream { padding: 20px 16px; gap: 28px; }
  .dr-stream-section { padding-bottom: 28px; }
  .dr-featured-card { min-width: 0; }
  .dr-stream-content-body :is(h1, h2, h3, p, li, td, th) { overflow-wrap: anywhere; }
  .bc-link {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
  }
}

@media (max-width: 430px) {
  .topbar { padding: 9px 10px; }
  .topbar-brand-logo img { height: 23px; }
  .topbar-search-input { font-size: 12px; padding-right: 10px; }
  .topbar-env-badge > div { display: none; }
  .topbar-env-badge { padding: 8px 10px; }
  .topbar-nav-link { font-size: 12px; }
  .dr-nav-btn svg { display: none; }
  .dr-content-area { padding: 16px 10px; }
  .dr-unified-doc-stream { padding: 18px 12px; }
  .dr-hero-banner { padding: 18px; }
  .dr-hero-banner h2 { font-size: 18px; }
}

html[dir="rtl"] .topbar-left,
html[dir="rtl"] .topbar-right-actions,
html[dir="rtl"] .dr-nav-items,
html[dir="rtl"] .dr-inpage-left-menu { direction: rtl; }
