/* ========================================
   RESPONSIVE DESIGN FIXES
   ======================================== */

/* Logo Styling */
.jugaad-logo{
    width:80% !important;
    height:100% !important;
    max-width: 100%;
    margin: 0 !important;
    padding: 0 !important;
}

/* Reduce gap below logo/header */
header#site-header,
header {
    margin: 0 !important;
    padding: 5px 10px !important;
    min-height: auto !important;
    height: auto !important;
}

/* Logo container spacing */
header a.group\/headerlogo,
header a[href*="logo"],
header > div,
header > a,
header div,
header nav {
    margin: 0 !important;
    padding: 0 !important;
}

/* Remove spacing from all header child elements */
header * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.no-margin-y {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.lesser-margin-y {
    margin-top: 0.20rem !important;
    margin-bottom: 0.20rem !important;
}

.no-margin-bottom {
    margin-bottom: 0 !important;
}

/* ========================================
   GLOBAL PAGE SCROLLING
   ======================================== */

/* Ensure page can scroll properly - important for sticky to work */
html {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    width: 100%;
    height: 100%;
}

body {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    width: 100%;
    min-height: 100vh !important;
    height: auto !important;
    max-height: none !important;
}

/* Remove height constraints from all containers to allow scrolling */
body > div:not(aside),
#__next:not(aside),
[class*="PageContent"],
[class*="container"],
main,
article {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
}

/* Ensure wrapper containers don't restrict height */
div[class*="flex"][class*="justify-center"],
div[class*="flex"][class*="lg:flex-row"] {
    max-height: none !important;
    /*min-height: 100vh !important;*/
}

/* ========================================
   HAMBURGER MENU & MOBILE NAVIGATION
   ======================================== */

/* Header fixes for mobile */
@media screen and (max-width: 1023px) {
    /* Fix header height and layout */
    header#site-header {
        height: auto !important;
        min-height: 50px !important;
        padding: 5px 10px !important;
        margin: 0 !important;
    }

    /* Ensure header content doesn't overflow */
    header#site-header > div {
        width: 100% !important;
        overflow: hidden !important;
    }

    /* Header logo container - 45px height on mobile */
    header a.group\/headerlogo {
        display: flex !important;
        align-items: center !important;
        height: 45px !important;
        width: auto !important;
    }

    header img {
        height: 45px !important;
        max-height: 45px !important;
        width: auto !important;
    }

    /* Ensure hamburger button is always visible on mobile */
    button[aria-label="Open table of contents"] {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 100 !important;
        flex-shrink: 0 !important;
        padding: 12px !important;
        min-width: 48px !important;
        min-height: 48px !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Make hamburger icon larger */
    button[aria-label="Open table of contents"] svg,
    button[aria-label="Open table of contents"] .gb-icon {
        width: 24px !important;
        height: 24px !important;
        min-width: 24px !important;
        min-height: 24px !important;
    }

    /* Make sure the sidebar is hidden by default on mobile */
    aside#table-of-contents {
        display: none !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 80% !important;
        max-width: 320px !important;
        height: 100vh !important;
        background: white !important;
        z-index: 9999 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3) !important;
        transition: transform 0.3s ease-in-out !important;
    }

    /* Ensure mobile sidebar scroll container works */
    aside#table-of-contents [data-testid="toc-scroll-container"] {
        flex: 1 1 auto !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        min-height: 0 !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* Remove bullets from mobile sidebar menu */
    aside#table-of-contents ul,
    aside#table-of-contents ol {
        list-style: none !important;
        padding-left: 0 !important;
        margin-left: 0 !important;
    }

    aside#table-of-contents li {
        list-style-type: none !important;
        padding-left: 0 !important;
    }

    /* When navigation is open */
    html.navigation-open aside#table-of-contents {
        display: flex !important;
        transform: translateX(0) !important;
    }

    /* Overlay/backdrop when menu is open */
    html.navigation-open::before {
        content: "" !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background: rgba(0, 0, 0, 0.5) !important;
        z-index: 9998 !important;
        animation: fadeIn 0.3s ease-in-out !important;
    }

    /* Prevent body scroll when menu is open */
    html.navigation-open body {
        overflow: hidden !important;
    }
}

/* Animation for overlay */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Close button styling inside the sidebar - MOBILE ONLY */
.nav-close-button {
    position: sticky !important;
    top: 0 !important;
    right: 0 !important;
    padding: 15px !important;
    background: white !important;
    border: none !important;
    font-size: 24px !important;
    cursor: pointer !important;
    z-index: 10000 !important;
    width: 100% !important;
    text-align: right !important;
    border-bottom: 1px solid #e5e7eb !important;
}

/* Hide close button on desktop - only show on mobile */
@media screen and (min-width: 1024px) {
    .nav-close-button {
        display: none !important;
    }
}

/* ========================================
   BASE RESPONSIVE STYLES
   ======================================== */

/* Ensure all images are responsive (except header logos) */
img:not(header img, .no-max-width) {
    max-width: 100% !important;
    height: auto !important;
}

/* Header logo container - flexible width */
a.group\/headerlogo,
a[class*="group"][class*="headerlogo"] {
    display: flex !important;
    align-items: center !important;
    height: 50px !important;
}

/* Header logo specific styling - fixed height, auto width */
header img {
    width: auto !important;
    height: 50px !important;
    max-height: 50px !important;
    object-fit: contain !important;
}

/* On mobile, slightly smaller logo */
@media screen and (max-width: 768px) {
    a.group\/headerlogo,
    a[class*="group"][class*="headerlogo"] {
        height: 75px !important;
    }

    header img {
        height: 120px !important;
        max-height: 120px !important;
        width: 100% !important;
    }
}

/* Responsive video embeds */
iframe,
video,
embed {
    max-width: 100% !important;
    height: auto !important;
}

/* Ensure containers don't exceed viewport */
* {
    max-width: 100%;
    box-sizing: border-box;
}

/* Ensure all elements within body respect the container width */
@media screen and (min-width: 1024px) {
    /* Specifically constrain wide elements with aggressive rules */
    body img:not(header img, .no-max-width):not(aside img),
    body figure:not(aside figure),
    body video:not(aside video),
    body iframe:not(aside iframe),
    body pre:not(aside pre),
    body table:not(aside table) {
        max-width: 100% !important;
        width: auto !important;
        height: auto !important;
        overflow-x: auto !important;
    }

    /* Ensure divs with background images also respect width */
    body div[style*="background-image"]:not(aside):not(aside *) {
        max-width: 100% !important;
        background-size: contain !important;
    }
}

/* Clean, minimal list styling for content - Override GitBook defaults */
article ul,
main ul,
section ul {
    list-style-type: disc !important;
    list-style-position: outside !important;
    padding-left: 1.5rem !important;
    margin-bottom: 1rem !important;
    margin-left: 0 !important;
}

article ol,
main ol,
section ol {
    list-style-type: decimal !important;
    list-style-position: outside !important;
    padding-left: 1.5rem !important;
    margin-bottom: 1rem !important;
    margin-left: 0 !important;
}

article li,
main li,
section li {
    margin-bottom: 0.5rem !important;
    line-height: 1.6 !important;
    padding-left: 0 !important;
    display: list-item !important;
    flex-direction: initial !important;
    align-items: initial !important;
}

/* Override flex classes on content list items */
article li.flex,
main li.flex,
section li.flex,
article li[class*="flex"],
main li[class*="flex"],
section li[class*="flex"] {
    display: list-item !important;
}

/* Hide GitBook's custom bullet divs - they create duplicate bullets */
article li > div:first-child,
main li:not(.show-li-img) > div:first-child,
section li > div:first-child {
    display: none !important;
}

/* Ensure list item content (p, span, text) is visible */
article li > p,
article li > span:not(:first-child),
article li > div:not(:first-child),
main li > p,
main li > span:not(:first-child),
main li > div:not(:first-child),
section li > p,
section li > span:not(:first-child),
section li > div:not(:first-child) {
    display: block !important;
}

/* Ensure no pseudo-elements add extra bullets to content */
article li::before,
article li::after,
main li::before,
main li::after,
section li::before,
section li::after {
    content: none !important;
    display: none !important;
}

/* Remove bullets from navigation/sidebar lists */
nav ul,
nav ol,
aside ul,
aside ol,
#table-of-contents ul,
#table-of-contents ol,
[role="navigation"] ul,
[role="navigation"] ol {
    list-style: none !important;
    padding-left: 0 !important;
}

nav li,
aside li,
#table-of-contents li,
[role="navigation"] li {
    list-style-type: none !important;
    list-style: none !important;
    padding-left: 0 !important;
    margin-bottom: 0 !important;
}

/* Ensure navigation items don't get pseudo-element bullets */
nav li::before,
nav li::after,
aside li::before,
aside li::after,
#table-of-contents li::before,
#table-of-contents li::after {
    content: none !important;
    display: none !important;
}

/* ========================================
   DESKTOP SIDEBAR - FULL HEIGHT & FIXED SCROLLING
   ======================================== */

/* Make sidebar FIXED on the left side - always visible */
@media screen and (min-width: 1024px) {
    /* Prevent horizontal scrolling */
    html,
    body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    /* Sidebar fixed on left side */
    aside#table-of-contents,
    aside[id="table-of-contents"],
    #table-of-contents {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        max-height: 100vh !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        z-index: 100 !important;
        width: 280px !important;
        min-width: 280px !important;
        max-width: 280px !important;
        padding: 20px !important;
        box-sizing: border-box !important;
        scrollbar-width: thin !important;
        scrollbar-color: #03a7cc #f1f1f1 !important;
    }

    /* Sidebar logo container - ensure it's visible on desktop */
    aside#table-of-contents > div.hidden.lg\:flex {
        display: flex !important;
        visibility: visible !important;
        padding: 15px 20px !important;
        flex-shrink: 0 !important;
    }

    /* Sidebar logo sizing - full width */
    aside#table-of-contents a.group\/headerlogo,
    aside#table-of-contents a[class*="group"][class*="headerlogo"] {
        display: flex !important;
        width: 100% !important;
        max-width: 240px !important;
        height: auto !important;
    }

    /* Sidebar logo - only show light mode version, hide dark mode version */
    aside#table-of-contents img.block {
        width: 100% !important;
        height: 50px !important;
        max-width: 100% !important;
        display: block !important;
    }

    aside#table-of-contents img.hidden {
        display: none !important;
    }

    /* Ensure inner scroll container fills available height */
    aside#table-of-contents [data-testid="toc-scroll-container"],
    aside#table-of-contents .hide-scrollbar.overflow-y-auto {
        flex: 1 1 auto !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        min-height: 0 !important;
    }

    /* Custom scrollbar for sidebar */
    aside#table-of-contents::-webkit-scrollbar {
        width: 8px !important;
    }

    aside#table-of-contents::-webkit-scrollbar-track {
        background: #f1f1f1 !important;
    }

    aside#table-of-contents::-webkit-scrollbar-thumb {
        background: #03a7cc !important;
        border-radius: 4px !important;
    }

    aside#table-of-contents::-webkit-scrollbar-thumb:hover {
        background: #028ba8 !important;
    }

    /* Header stays at top */
    header#site-header,
    header {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 15px !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    /* Shift content to account for BOTH left and right sidebars */
    body {
        margin-left: 280px !important;
        margin-right: 0 !important;
        padding: 0 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        height: auto !important;
        min-height: 100vh !important;
        max-height: none !important;
        box-sizing: border-box !important;
        width: auto !important;
    }


    /* CRITICAL: Force ALL body children (except sidebars) to stay within bounds */
    body > *:not(aside):not(#table-of-contents),
    body > div:not(aside):not(#table-of-contents),
    body > main:not(aside):not(#table-of-contents) {
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    body div:not(aside):not(#table-of-contents):not(aside *) {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Reset body containers */
    body > div:first-child,
    #__next,
    html > body > div {
        margin-left: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        max-height: none !important;
        overflow-x: hidden !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Content area styling */
    main,
    article,
    [role="main"] {
        padding-left: 20px !important;
        padding-right: 20px !important;
        padding-bottom: 20px !important;
        max-height: none !important;
        height: auto !important;
        overflow-x: hidden !important;
        overflow-y: visible !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    /* Allow content to flow naturally */
    main h1, main h2, main h3, main h4, main h5, main h6,
    article h1, article h2, article h3, article h4, article h5, article h6,
    [role="main"] h1, [role="main"] h2, [role="main"] h3, [role="main"] h4, [role="main"] h5, [role="main"] h6 {
        width: auto !important;
        max-width: 100% !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    /* Remove constraints on all containers */
    div[class*="flex"],
    div[class*="container"] {
        overflow: visible !important;
        max-height: none !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Prevent any element from using full viewport width */
    body [style*="width: 100vw"],
    body [class*="w-screen"],
    body [class*="full-width"] {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Override any inline height styles */
    [style*="height: 100vh"]:not(aside#table-of-contents),
    [style*="max-height: 100vh"]:not(aside#table-of-contents) {
        height: auto !important;
        max-height: none !important;
    }

    /* Make original right sidebar sticky */
    aside.order-last,
    aside[class*="order-last"] {
        position: sticky !important;
        top: 0 !important;
        max-height: 100vh !important;
        overflow-y: auto !important;
        align-self: flex-start !important;
    }

    /* Prevent any absolute/fixed positioned content from overlapping left sidebar */
    body [style*="position: absolute"]:not(aside):not(aside *),
    body [style*="position: fixed"]:not(aside):not(aside *) {
        max-width: calc(100vw - 280px) !important;
        left: 280px !important;
    }

    /* Ensure header and all its children fit within available space */
    header,
    header * {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
}

/* ========================================
   MOBILE DEVICES (max-width: 768px)
   ======================================== */

@media screen and (max-width: 768px) {

    /* Layout fixes - reset desktop sidebar margins */
    body {
        font-size: 16px !important;
        line-height: 1.6 !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        padding-left: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        min-height: 100vh !important;
        height: auto !important;
        max-height: none !important;
    }

    /* Reset desktop layout on mobile */
    body > div:first-child,
    #__next,
    html > body > div {
        display: block !important;
        margin-left: 0 !important;
        padding-left: 0 !important;
        max-height: none !important;
        height: auto !important;
        overflow: visible !important;
    }

    /* Reset content area on mobile */
    main,
    article,
    [role="main"] {
        width: 100% !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    /* Main content area */
    main,
    article,
    section {
        padding: 15px !important;
        margin: 0 auto !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Key Functionalities - 2 boxes per row on mobile */
    #key-functionalities ~ div.inline-grid,
    div.inline-grid[class*="grid-cols"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        margin-bottom: 1rem !important;
    }

    /* Make sure the boxes fit properly in 2 columns - CUSTOM SPACING */
    div.inline-grid > div,
    div.inline-grid > a {
        min-width: 0 !important;
        width: 100% !important;
        padding: 8px !important;
        min-height: auto !important;
        height: auto !important;
    }

    /* Reduce excessive padding/margins in boxes */
    div.inline-grid > div > *,
    div.inline-grid > a > * {
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Adjust image size in the boxes for mobile 2-column layout - 200px */
    div.inline-grid img {
        max-width: 200px !important;
        width: 100% !important;
        height: auto !important;
        margin: 0 auto 1px auto !important;
        display: block !important;
    }

    /* Increase text size in boxes for better readability - CUSTOM SPACING */
    div.inline-grid h3,
    div.inline-grid h4 {
        font-size: 1rem !important;
        line-height: 1.1 !important;
        font-weight: 600 !important;
        margin-top: 1px !important;
        margin-bottom: 0 !important;
        text-align: center !important;
    }

    div.inline-grid p {
        font-size: 0.875rem !important;
        line-height: 1.2 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        text-align: center !important;
    }

    /* Reduce vertical spacing inside card content */
    div.inline-grid [class*="flex-col"],
    div.inline-grid [class*="space-y"] {
        gap: 4px !important;
    }

    /* Tighten up the entire section */
    #key-functionalities {
        margin-bottom: 0.5rem !important;
    }

    #key-functionalities + p {
        margin-bottom: 0.75rem !important;
    }

    /* Ensure main content doesn't overflow */
    main > * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Fix any full-width containers */
    div[class*="max-w-screen"],
    div[class*="container"] {
        padding-left: 15px !important;
        padding-right: 15px !important;
        box-sizing: border-box !important;
    }

    /* Headings - proper sizing for mobile */
    h1 {
        font-size: 1.75rem !important;
        line-height: 1.3 !important;
        margin-bottom: 1rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.875rem !important;
    }

    h3 {
        font-size: 1.25rem !important;
        line-height: 1.4 !important;
        margin-bottom: 0.75rem !important;
    }

    h4 {
        font-size: 1.125rem !important;
        line-height: 1.4 !important;
        margin-bottom: 0.625rem !important;
    }

    h5,
    h6 {
        font-size: 1rem !important;
        line-height: 1.5 !important;
        margin-bottom: 0.5rem !important;
    }

    /* Paragraph text */
    p {
        font-size: 1rem !important;
        line-height: 1.6 !important;
        margin-bottom: 1rem !important;
    }

    /* Simple mobile list styling */
    article ul,
    main ul,
    section ul,
    article ol,
    main ol,
    section ol {
        padding-left: 1.25rem !important;
        margin-bottom: 0.75rem !important;
    }

    article li,
    main li,
    section li {
        font-size: 1rem !important;
        line-height: 1.5 !important;
        margin-bottom: 0.5rem !important;
    }

    /* Hide GitBook's custom bullet divs on mobile too */
    article li > div:first-child,
    main li > div:first-child,
    section li > div:first-child {
        display: none !important;
    }

    /* Tables - make them scrollable on mobile */
    table {
        display: block !important;
        overflow-x: auto !important;
        width: 100% !important;
        border-collapse: collapse !important;
        margin-bottom: 1rem !important;
    }

    /* Code blocks */
    pre,
    code {
        font-size: 0.875rem !important;
        overflow-x: auto !important;
        white-space: pre-wrap !important;
        word-wrap: break-word !important;
    }

    /* Buttons */
    button,
    .button,
    a[role="button"] {
        padding: 12px 20px !important;
        font-size: 1rem !important;
        min-height: 44px !important;
        width: auto !important;
        display: inline-block !important;
    }

    /* Navigation fixes */
    nav {
        width: 100% !important;
        padding: 10px !important;
    }

    /* Sidebar - typically in GitBook */
    aside,
    [role="navigation"],
    .sidebar {
        width: 100% !important;
        position: relative !important;
        margin-bottom: 1rem !important;
    }

    /* Forms */
    input,
    textarea,
    select {
        font-size: 16px !important;
        padding: 12px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Fix flexbox layouts */
    .flex,
    [class*="flex"] {
        /* flex-direction: column !important; */
        gap: 1rem !important;
    }

    /* Grid layouts - convert to single column (except breadcrumbs) */
    .grid:not(nav[aria-label="Breadcrumb"] *),
    [class*="grid"]:not(nav[aria-label="Breadcrumb"] *) {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    /* GitBook specific fixes */
    [class*="PageContent"],
    [class*="page-content"] {
        padding: 15px !important;
        width: 100% !important;
    }

    [class*="SidebarLayout"] {
        flex-direction: column !important;
    }

    /* Cards and content blocks */
    .card,
    [class*="card"],
    .content-block {
        width: 100% !important;
        margin: 10px 0 !important;
        padding: 15px !important;
    }

    /* Images in content */
    img {
        margin: 10px 0 !important;
    }
}

/* ========================================
   TABLET DEVICES (769px - 1024px)
   ======================================== */

/* ========================================
   TABLET DEVICES (769px - 1023px)
   ======================================== */

@media screen and (min-width: 769px) and (max-width: 1023px) {

    body {
        font-size: 17px !important;
        padding-left: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    main,
    article,
    section {
        padding: 20px !important;
    }

    h1 {
        font-size: 2rem !important;
    }

    h2 {
        font-size: 1.75rem !important;
    }

    h3 {
        font-size: 1.5rem !important;
    }

    /* Reset desktop layout on tablet */
    body > div:first-child,
    #__next,
    html > body > div {
        display: block !important;
        margin-left: 0 !important;
        padding-left: 0 !important;
    }

    /* Sidebar for tablet - not fixed */
    aside#table-of-contents,
    aside,
    [role="navigation"],
    .sidebar {
        position: relative !important;
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
    }
}

/* ========================================
   SMALL MOBILE DEVICES (max-width: 480px)
   ======================================== */

@media screen and (max-width: 480px) {

    body {
        font-size: 14px !important;
    }

    main,
    article,
    section {
        padding: 10px !important;
    }

    h1 {
        font-size: 1.5rem !important;
    }

    h2 {
        font-size: 1.25rem !important;
    }

    h3 {
        font-size: 1.125rem !important;
    }

    .jugaad-logo {
        width: 90% !important;
    }

    /* Even more compact spacing for small screens */
    button,
    .button {
        padding: 10px 15px !important;
        font-size: 0.875rem !important;
    }
}

/* ========================================
   LANDSCAPE MOBILE (max-height: 500px)
   ======================================== */

@media screen and (max-height: 500px) and (orientation: landscape) {

    /* Reduce vertical spacing in landscape mode */
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        margin-top: 0.5rem !important;
        margin-bottom: 0.5rem !important;
    }

    p,
    ul,
    ol {
        margin-bottom: 0.75rem !important;
    }
}

/* ========================================
   UTILITY CLASSES FOR HIDING/SHOWING
   ======================================== */

/* Hide on mobile */
@media screen and (max-width: 768px) {
    .hide-mobile,
    .desktop-only {
        display: none !important;
    }
}

/* Hide on desktop */
@media screen and (min-width: 769px) {
    .hide-desktop,
    .mobile-only {
        display: none !important;
    }
}

/* ========================================
   TOUCH-FRIENDLY INTERACTIONS
   ======================================== */

@media (hover: none) and (pointer: coarse) {
    /* Touch devices - make interactive elements larger */
    a,
    button,
    input,
    select,
    textarea {
        min-height: 44px !important;
        min-width: 44px !important;
    }

    /* Remove hover effects on touch devices */
    *:hover {
        -webkit-tap-highlight-color: transparent;
    }
}

/* ========================================
   SIDEBAR DROPDOWN TOGGLE STYLES
   ======================================== */

/* Smooth transitions for collapsible sub-menu items ONLY */
aside#table-of-contents li > div.flex.overflow-hidden {
    transition: height 0.25s ease-out, opacity 0.25s ease-out !important;
}

/* Chevron rotation animation */
aside#table-of-contents a.toclink span.group svg.gb-icon {
    transition: transform 0.2s ease-out !important;
}

/* Make chevron spans more clickable */
aside#table-of-contents a.toclink span.group {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 24px !important;
    min-height: 24px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
}

/* Hover effect on chevron */
aside#table-of-contents a.toclink span.group:hover {
    background-color: rgba(0, 0, 0, 0.05) !important;
}

/* ========================================
   BREADCRUMB FIXES - PREVENT LINE WRAPPING
   ======================================== */

/* Breadcrumb nav wrapper - allow full width */
nav[aria-label="Breadcrumb"] {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

/* Breadcrumb container - force single line with high specificity */
nav[aria-label="Breadcrumb"] ol,
nav[aria-label="Breadcrumb"] ol.flex,
nav[aria-label="Breadcrumb"] ol.flex.flex-wrap,
nav[aria-label="Breadcrumb"] ol[class*="flex"] {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    gap: 0.5rem !important;
    width: max-content !important;
    max-width: 100% !important;
}

/* Breadcrumb items - force inline on same line */
nav[aria-label="Breadcrumb"] li,
nav[aria-label="Breadcrumb"] li.flex,
nav[aria-label="Breadcrumb"] ol li,
nav[aria-label="Breadcrumb"] ol.flex li {
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    gap: 0.5rem !important;
}

/* Allow the last breadcrumb item to shrink/truncate if needed */
nav[aria-label="Breadcrumb"] li:last-child,
nav[aria-label="Breadcrumb"] ol li:last-child {
    flex-shrink: 1 !important;
    min-width: 0 !important;
    overflow: hidden !important;
}

/* Breadcrumb links - keep inline, truncate if too long */
nav[aria-label="Breadcrumb"] a,
nav[aria-label="Breadcrumb"] li a {
    display: inline-flex !important;
    align-items: center !important;
    white-space: nowrap !important;
    gap: 0.375rem !important;
}

nav[aria-label="Breadcrumb"] li:last-child a {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
}

/* Chevron separator - keep visible inline */
nav[aria-label="Breadcrumb"] li svg[aria-hidden="true"],
nav[aria-label="Breadcrumb"] svg.gb-icon {
    flex-shrink: 0 !important;
    display: inline-block !important;
}

/* Mobile breadcrumb adjustments */
@media screen and (max-width: 768px) {
    nav[aria-label="Breadcrumb"] ol,
    nav[aria-label="Breadcrumb"] ol.flex {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
    }

    nav[aria-label="Breadcrumb"] ol::-webkit-scrollbar {
        display: none !important;
    }

    nav[aria-label="Breadcrumb"] li:last-child a {
        max-width: 250px !important;
    }
}