/* Mobile Responsive Styles - FIXED VERSION
   Path: docs/styles/mobile.css
   Fixed hamburger menu with proper nav drawer
   ============================================= */

/* =====================================================
   DESKTOP - Keep nav visible above 1100px
   ===================================================== */

@media screen and (min-width: 1100px) {
  .md-header-nav { display: flex !important; }
  /* Hide mobile-only elements on desktop */
  .md-header__button[for="__drawer"],
  .md-nav__toggle,
  .md-toggle--drawer,
  #__drawer,
  .md-overlay { display: none !important; }
  /* Keep tabs visible on desktop */
  .md-tabs {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  .md-tabs__list {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  .md-tabs__item {
    display: block !important;
    visibility: visible !important;
  }
  .md-tabs__link {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}

/* =====================================================
   MOBILE NAVIGATION - Under 1100px
   ===================================================== */

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

  /* Mobile header base styles */
  .md-header {
    height: 3.5rem;
    padding: 0 0.5rem;
    position: fixed;
    width: 100%;
    z-index: 4;
  }

  .md-header__inner {
    padding: 0 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  /* Style the hamburger button */
  .md-header__button[for="__drawer"] {
    display: flex !important;
    width: 2.25rem;
    height: 2.25rem;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #ffffff, #f0ede8);
    border-radius: 8px;
    box-shadow:
      3px 3px 8px rgba(26, 35, 50, 0.08),
      -3px -3px 8px rgba(255, 255, 255, 0.9);
    cursor: pointer;
    order: 1;
  }

  [data-md-color-scheme="slate"] .md-header__button[for="__drawer"] {
    background: linear-gradient(145deg, #2a3542, #222c3a);
    box-shadow:
      3px 3px 8px rgba(0, 0, 0, 0.3),
      -3px -3px 8px rgba(255, 255, 255, 0.03);
  }

  .md-header__button[for="__drawer"] svg {
    fill: #f59e0b;
  }

  /* Mobile header order: hamburger (1), search container (2), theme (3), github (4) */

  /* Search container - includes both icon and form */
  .md-header__inner .md-search {
    order: 2;
    display: flex !important;
    align-items: center;
    flex: 1;
    max-width: 280px; /* wider for better typing */
    min-width: 180px; /* ensure minimum width */
    margin-right: 0.5rem;
  }

  /* Search icon button - positioned within search container */
  .md-header__inner .md-search .md-search__icon,
  .md-header__inner label.md-header__button[for="__search"] {
    order: 1;
    margin-right: 0.25rem;
    flex-shrink: 0;
  }

  /* Search form - positioned after icon */
  .md-header__inner .md-search .md-search__form {
    order: 2;
    flex: 1;
  }

  /* Theme toggle - hide all first, then show only one */
  label.md-header__button[for^="__palette_"] {
    display: none !important;
    order: 3;
    margin-right: 0.5rem;
    flex-shrink: 0;
  }
  
  /* Show only the toggle for switching TO the other theme */
  [data-md-color-scheme="default"] label.md-header__button[for="__palette_1"] {
    display: flex !important;
  }
  [data-md-color-scheme="slate"] label.md-header__button[for="__palette_0"] {
    display: flex !important;
  }

  /* GitHub source */
  .md-source {
    display: inline-flex !important;
    order: 4;
    margin-right: 0.5rem;
    flex-shrink: 0;
  }

  /* Keep GitHub inline next to theme toggle (no fixed positioning) */
  .md-header__source,
  .md-header .md-source { position: static !important; margin-right: 0.25rem !important; }

  /* Fix GitHub icon color on mobile */
  .md-source__icon svg,
  .md-header .md-source__icon svg,
  .md-source svg {
    fill: #f59e0b !important;
  }

  [data-md-color-scheme="slate"] .md-source__icon svg,
  [data-md-color-scheme="slate"] .md-header .md-source__icon svg,
  [data-md-color-scheme="slate"] .md-source svg {
    fill: #fbbf24 !important;
  }

  /* Hide any GitHub/source block that theme may render inside drawer */
  .md-nav__source,
  .md-nav--primary .md-source,
  .md-sidebar--primary .md-source {
    display: none !important;
  }

  /* Keep hamburger fixed at the top-right above other controls */
  .md-header__button[for="__drawer"] { position: fixed; top: 8px; right: 8px; order: 5; }

  /* Medium view (tablet): add extra spacing between search and hamburger */
  @media screen and (min-width: 601px) and (max-width: 1099px) {
  .md-header .md-search { display: flex !important; margin-right: 1rem !important; }
    .md-header .md-source { margin-right: 0.75rem !important; }
  /* Keep search button visible on tablet */
  .md-header__inner label.md-header__button[for="__search"] { display: inline-flex !important; }
  }

  /* Force mobile drawer to be visible and styled */
  .md-sidebar--primary {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 242px !important;
    height: 100% !important;
    transform: translateX(-100%) !important;
    transition: transform .25s cubic-bezier(.4,0,.2,1) !important;
    z-index: 200 !important;
    background: #fff !important;
    overflow: hidden !important;
  }

  /* Show drawer when checkbox is checked - Material for MkDocs structure */
  .md-toggle--drawer:checked ~ .md-container .md-sidebar--primary,
  #__drawer:checked ~ .md-container .md-sidebar--primary,
  input[type="checkbox"]#__drawer:checked ~ .md-container .md-sidebar--primary {
    transform: translateX(0) !important;
  }

  /* Style the drawer content */
  .md-sidebar--primary .md-sidebar__scrollwrap {
    height: 100% !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .md-sidebar--primary .md-nav--primary {
    background: linear-gradient(180deg, #fdfdf9 0%, #f7f5f0 100%) !important;
    height: 100% !important;
  }

  [data-md-color-scheme="slate"] .md-sidebar--primary .md-nav--primary {
    background: linear-gradient(180deg, #1a2332 0%, #263244 100%) !important;
  }

  /* Overlay styling */
  .md-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    transition: opacity .25s !important;
    background-color: rgba(0,0,0,.54) !important;
    opacity: 0 !important;
    z-index: 199 !important;
    pointer-events: none !important;
    cursor: pointer !important;
  }

  .md-toggle--drawer:checked ~ .md-overlay,
  #__drawer:checked ~ .md-overlay,
  input[type="checkbox"]#__drawer:checked ~ .md-overlay {
    opacity: 1 !important;
    pointer-events: auto !important;
    display: block !important;
  }

  /* Mobile nav header with logo */
  .md-nav--primary .md-nav__title:first-child,
  .md-sidebar--primary .md-nav__title:first-child {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(26, 35, 50, 0.1);
    margin-bottom: 0;
    position: sticky;
    top: 0;
    z-index: 10;
    height: 60px;
    font-size: 0 !important; /* Hide text */
    color: transparent !important; /* Hide text */
    overflow: hidden;
  }

  /* Hide the text content but keep the container */
  .md-nav--primary .md-nav__title:first-child::after,
  .md-sidebar--primary .md-nav__title:first-child::after {
    display: none !important;
  }

  /* Hide any duplicate titles */
  .md-nav--primary .md-nav__title ~ .md-nav__title,
  .md-sidebar--primary .md-nav__title ~ .md-nav__title {
    display: none !important;
  }

  /* Hide any actual img logos that Material might inject */
  .md-nav--primary .md-nav__title img,
  .md-sidebar--primary .md-nav__title img,
  .md-nav--primary .md-logo img,
  .md-sidebar--primary .md-logo img,
  .md-nav--primary .md-nav__title .md-nav__button img,
  .md-sidebar--primary .md-nav__title .md-nav__button img {
    display: none !important;
  }

  /* Hide any text spans in the title */
  .md-nav--primary .md-nav__title span,
  .md-sidebar--primary .md-nav__title span,
  .md-nav--primary .md-nav__title .md-ellipsis,
  .md-sidebar--primary .md-nav__title .md-ellipsis {
    display: none !important;
  }

  /* Logo in drawer header - use pseudo element to show only icon */
  .md-nav--primary .md-nav__title:first-child::before,
  .md-sidebar--primary .md-nav__title:first-child::before {
    content: '';
    display: block;
    width: 50px;
    height: 50px;
    background: url('../logos/tenets_dark_icon_transparent_cropped.png') no-repeat center;
    background-size: contain;
    margin: 0 auto;
    position: relative;
    z-index: 1;
  }

  /* Light mode should use dark logo on amber background for contrast */
  [data-md-color-scheme="default"] .md-nav--primary .md-nav__title:first-child::before,
  [data-md-color-scheme="default"] .md-sidebar--primary .md-nav__title:first-child::before {
    background-image: url('../logos/tenets_dark_icon_transparent_cropped.png');
  }

  /* Dark mode uses dark logo too since background is amber */
  [data-md-color-scheme="slate"] .md-nav--primary .md-nav__title:first-child::before,
  [data-md-color-scheme="slate"] .md-sidebar--primary .md-nav__title:first-child::before {
    background-image: url('../logos/tenets_dark_icon_transparent_cropped.png');
  }

  /* Ensure we're hiding ALL possible logo/title elements */
  .md-nav--primary *[class*="logo"],
  .md-sidebar--primary *[class*="logo"],
  .md-nav--primary .md-nav__title > *,
  .md-sidebar--primary .md-nav__title > *,
  .md-nav--primary .md-nav__title a,
  .md-sidebar--primary .md-nav__title a,
  .md-nav--primary .md-nav__title .md-nav__button,
  .md-sidebar--primary .md-nav__title .md-nav__button {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
    font-size: 0 !important;
  }

  /* Navigation list container */
  .md-nav--primary .md-nav__list,
  .md-sidebar--primary .md-nav__list {
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
    display: block !important;
  }

  /* Hide any nested titles or back buttons */
  .md-nav--primary .md-nav__item .md-nav__title,
  .md-sidebar--primary .md-nav__item .md-nav__title,
  .md-nav--primary .md-nav__back,
  .md-sidebar--primary .md-nav__back {
    display: none !important;
  }

  /* Navigation items - Enhanced mobile styling */
  .md-nav--primary > .md-nav__list > .md-nav__item,
  .md-sidebar--primary > .md-nav__list > .md-nav__item {
    margin: 0.25rem 0.75rem !important;
    display: block !important;
  }

  .md-nav--primary .md-nav__link,
  .md-sidebar--primary .md-nav__link {
    padding: 1rem 1.25rem !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    color: #2a2723 !important;
    display: block !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none !important;
    position: relative !important;
    background: linear-gradient(135deg, #fdfdf9 0%, #f7f5f0 100%) !important;
    border-radius: 12px !important;
    box-shadow: 
      2px 2px 6px rgba(26, 35, 50, 0.05),
      -2px -2px 6px rgba(255, 255, 255, 0.8) !important;
    border: 1px solid rgba(245, 158, 11, 0.08) !important;
    overflow: hidden !important;
  }

  [data-md-color-scheme="slate"] .md-nav--primary .md-nav__link,
  [data-md-color-scheme="slate"] .md-sidebar--primary .md-nav__link {
    color: #f3f0e8 !important;
    background: linear-gradient(135deg, #2a3542 0%, #263244 100%) !important;
    box-shadow: 
      2px 2px 6px rgba(0, 0, 0, 0.2),
      -2px -2px 6px rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(251, 191, 36, 0.1) !important;
  }

  .md-nav--primary .md-nav__link:hover,
  .md-nav--primary .md-nav__link:active,
  .md-sidebar--primary .md-nav__link:hover,
  .md-sidebar--primary .md-nav__link:active {
    background: linear-gradient(135deg, #fff5e6 0%, #ffedcc 100%) !important;
    color: #f59e0b !important;
    transform: translateX(4px);
    box-shadow: 
      4px 4px 10px rgba(245, 158, 11, 0.12),
      -4px -4px 10px rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(245, 158, 11, 0.2) !important;
  }

  [data-md-color-scheme="slate"] .md-nav--primary .md-nav__link:hover,
  [data-md-color-scheme="slate"] .md-nav--primary .md-nav__link:active,
  [data-md-color-scheme="slate"] .md-sidebar--primary .md-nav__link:hover,
  [data-md-color-scheme="slate"] .md-sidebar--primary .md-nav__link:active {
    background: linear-gradient(135deg, #3a4554 0%, #334254 100%) !important;
    color: #fbbf24 !important;
    border-color: rgba(251, 191, 36, 0.25) !important;
  }

  .md-nav--primary .md-nav__link--active,
  .md-sidebar--primary .md-nav__link--active {
    background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 60%, #f59e0b 100%) !important;
    color: #1a2332 !important;
    font-weight: 600;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
    box-shadow: 
      0 3px 10px rgba(245, 158, 11, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
  }

  [data-md-color-scheme="slate"] .md-nav--primary .md-nav__link--active,
  [data-md-color-scheme="slate"] .md-sidebar--primary .md-nav__link--active {
    background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 60%, #f59e0b 100%) !important;
    color: #0f1419 !important;
    border: 1px solid rgba(251, 191, 36, 0.4) !important;
  }

  /* Glow effect on active */
  .md-nav--primary .md-nav__link--active::before,
  .md-sidebar--primary .md-nav__link--active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: #f59e0b;
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
  }

  /* Icon decoration */
  .md-nav--primary .md-nav__link::after,
  .md-sidebar--primary .md-nav__link::after {
    content: '→';
    position: absolute;
    right: 1.25rem;
    opacity: 0;
    color: #f59e0b;
    font-size: 1.2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .md-nav--primary .md-nav__link:hover::after,
  .md-sidebar--primary .md-nav__link:hover::after {
    opacity: 0.7;
    transform: translateX(3px);
  }

  .md-nav--primary .md-nav__link--active::after,
  .md-sidebar--primary .md-nav__link--active::after {
    content: '✓';
    opacity: 0.8;
    color: #1a2332;
  }

  [data-md-color-scheme="slate"] .md-nav--primary .md-nav__link--active::after,
  [data-md-color-scheme="slate"] .md-sidebar--primary .md-nav__link--active::after {
    color: #0f1419;
  }

  /* Blog/Contact special styling */
  .md-nav--primary .md-nav__link[href*="blog"],
  .md-nav--primary .md-nav__link[href*="contact"],
  .md-sidebar--primary .md-nav__link[href*="blog"],
  .md-sidebar--primary .md-nav__link[href*="contact"] {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%) !important;
    color: #1a2332 !important;
    font-weight: 700;
    margin: 0.5rem 1rem;
    padding: 0.875rem 1.25rem !important;
    border-radius: 12px;
    border: 1px solid rgba(245, 158, 11, 0.3);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
  }

  [data-md-color-scheme="slate"] .md-nav--primary .md-nav__link[href*="blog"],
  [data-md-color-scheme="slate"] .md-nav--primary .md-nav__link[href*="contact"],
  [data-md-color-scheme="slate"] .md-sidebar--primary .md-nav__link[href*="blog"],
  [data-md-color-scheme="slate"] .md-sidebar--primary .md-nav__link[href*="contact"] {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
    color: #0f1419 !important;
    border: 1px solid rgba(251, 191, 36, 0.4);
  }

  /* Let Material theme handle overlay, just style it */
  [data-md-color-scheme="slate"] .md-overlay {
    background: rgba(0, 0, 0, 0.7);
  }

  /* Let MkDocs Material handle search positioning and overlay */


  /* Phones only: hide the right-hand TOC */
  @media screen and (max-width: 720px) {
    .md-sidebar--secondary { display: none !important; }
  }

  /* Very small screens: keep search visible but more compact */
  @media screen and (max-width: 600px) {
    /* Keep search form visible but make it more compact */
    .md-header__inner .md-search {
      display: flex !important;
      min-width: 120px; /* smaller minimum for tiny screens */
      max-width: 200px;
    }
    .md-header__inner .md-search__form {
      display: flex !important; /* keep form visible */
      width: 100% !important;
      height: 26px !important; /* very compact on mobile */
    }
    /* Adjust input for small screens */
    .md-header__inner .md-search__input {
      font-size: 0.7rem !important;
      padding: 0 0.3rem 0 1.6rem !important;
      height: 26px !important;
      line-height: 26px !important;
    }

    /* Compact GitHub/source: icon only */
    .md-header__source,
    .md-header .md-source { display: inline-flex !important; order: 4; }
    .md-header .md-source__repository { display: none !important; }
    .md-header .md-source__icon { margin: 0 !important; }

    /* Slightly increase reserved space for buttons on tiny screens */
    .md-header__inner { padding-right: 148px !important; }
  }
}


/* =====================================================
   INSTALL COMMANDS WRAPPING ON SMALL SCREENS
   ===================================================== */
@media screen and (max-width: 768px) {
  /* Prefer wrapping for shell-like languages */
  .md-typeset .highlight[data-lang="bash"] pre,
  .md-typeset .highlight[data-lang="sh"] pre,
  .md-typeset .highlight[data-lang="shell"] pre,
  .md-typeset .highlight[data-lang="zsh"] pre,
  .md-typeset .highlight[data-lang="powershell"] pre,
  .md-typeset .highlight[data-lang="ps1"] pre,
  .md-typeset .highlight[data-lang="cmd"] pre {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  /* Fallback: if language attribute isn't present, allow wrapping inside pre > code */
  .md-typeset pre > code.language-bash,
  .md-typeset pre > code.language-sh,
  .md-typeset pre > code.language-shell,
  .md-typeset pre > code.language-zsh,
  .md-typeset pre > code.language-powershell,
  .md-typeset pre > code.language-cmd {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  /* Ensure code blocks fit viewport with smooth horizontal scroll when needed */
  .md-typeset .highlight,
  .md-typeset pre {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Slightly reduce code font size on mobile to increase fit */
  :root { --md-code-font-size: 0.85rem; }

  /* Let inline code wrap within paragraphs to avoid overflow */
  .md-typeset p code,
  .md-typeset li code,
  .md-typeset td code {
    white-space: break-spaces;
    word-break: break-word;
  }
}


/* =====================================================
   MOBILE CONTENT ADJUSTMENTS
   ===================================================== */

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

  /* Content spacing to account for fixed header */
  .md-container {
    padding-top: 3.5rem;
  }

  .md-content {
    padding: 1rem;
    max-width: 100%;
  }

  .md-content__inner {
    margin: 0;
    padding: 0 0 2rem;
  }

  /* Typography adjustments */
  .md-typeset h1 {
    font-size: 1.75rem;
    margin: 1.5rem 0 1rem;
  }

  .md-typeset h2 {
    font-size: 1.375rem;
    margin: 1.25rem 0 0.75rem;
  }

  .md-typeset h3 {
    font-size: 1.125rem;
    margin: 1rem 0 0.5rem;
  }

  /* Terminal showcase on mobile */
  .terminal-showcase {
    margin: 1.5rem -1rem;
  }

  .terminal {
    border-radius: 0;
  }

  .terminal-body {
    padding: 1rem;
    font-size: 0.75rem;
    min-height: 200px;
    max-height: 350px;
  }

  /* Hero adjustments */
  .victorian-hero,
  .hero-section {
    min-height: calc(100vh - 3.5rem);
    padding: 1.5rem 1rem;
    margin-top: 3.5rem;
  }

  .lantern-container {
    width: 80px;
    height: 80px;
  }

  .hero-title {
    font-size: 2.25rem;
  }

  .hero-tagline {
    font-size: 1.1rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
  }

  /* Features grid on mobile */
  .features-grid,
  .why-tenets-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  /* Installation section mobile overrides */
  .install-section {
    width: 100vw;
    max-width: 100%;
    overflow-x: hidden;
    margin-left: -1rem;
    margin-right: -1rem;
    padding: 2rem 1rem;
  }
  
  .install-section .section-container {
    max-width: 100%;
    padding: 0 0.5rem;
  }
  
  .install-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.5rem !important;
    margin: 1rem 0 !important;
    padding: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  .install-card {
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 0.5rem 0.4rem !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  
  .install-card h3 {
    font-size: 0.65rem !important;
    margin-bottom: 0.3rem !important;
    line-height: 1.1 !important;
    word-wrap: break-word !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  
  /* Shorter text for mobile */
  @media (max-width: 600px) {
    .install-card h3 span.full-text {
      display: none !important;
    }
    .install-card h3 span.short-text {
      display: inline !important;
    }
  }
  
  /* Default: show full text on larger screens */
  .install-card h3 span.short-text {
    display: none;
  }
  
  .install-card .code-block {
    position: relative !important;
    padding: 0.4rem !important;
    padding-right: 2.2rem !important;
    overflow: hidden !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  .install-card .code-block code {
    font-size: 0.5rem !important;
    white-space: nowrap !important;
    overflow-x: auto !important;
    display: block !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  .install-card .install-note {
    font-size: 0.6rem !important;
    line-height: 1.15 !important;
    word-wrap: break-word !important;
    padding: 0 0.2rem !important;
  }
  
  .install-card .copy-btn {
    position: absolute !important;
    top: 0.3rem !important;
    right: 0.3rem !important;
    padding: 0.15rem 0.25rem !important;
    font-size: 0.45rem !important;
    z-index: 10 !important;
  }
  
  /* Installation CTA buttons - mobile compact */
  .install-cta {
    flex-direction: row !important;
    gap: 0.5rem !important;
    margin-top: 1.5rem !important;
    padding: 0 0.5rem !important;
  }
  
  .install-cta .btn-primary.large,
  .install-cta .btn-secondary.large {
    min-width: auto !important;
    padding: 0.6rem 0.8rem !important;
    font-size: 0.75rem !important;
    flex: 1 !important;
    max-width: 150px !important;
  }
  
  .install-cta .btn-primary.large svg,
  .install-cta .btn-secondary.large svg {
    width: 14px !important;
    height: 14px !important;
  }
  
  /* Hide text on very small screens, show only icons */
  @media (max-width: 380px) {
    .install-cta .btn-secondary.large span {
      display: none !important;
    }
    .install-cta .btn-primary.large {
      font-size: 0.7rem !important;
    }
  }

  /* Workflow on mobile */
  .workflow-diagram {
    flex-direction: column;
  }

  .workflow-arrow {
    transform: rotate(90deg);
    margin: 0.5rem 0;
  }

  /* Prevent body scroll when drawer is open */
  body:has(.md-toggle--drawer:checked),
  body.drawer-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
  }
}

/* =====================================================
   SMALL PHONE - 480px and below
   ===================================================== */

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

  .md-header {
    height: 3rem;
  }

  .md-header__title {
    font-size: 1.1rem;
  }

  .md-header__button[for="__drawer"] {
    width: 2rem;
    height: 2rem;
  }
  
  /* Installation CTA buttons - ultra compact for small phones */
  .install-cta {
    gap: 0.4rem !important;
    margin-top: 1rem !important;
    padding: 0 0.25rem !important;
  }
  
  .install-cta .btn-primary.large,
  .install-cta .btn-secondary.large {
    padding: 0.45rem 0.6rem !important;
    font-size: 0.65rem !important;
    border-radius: 8px !important;
    max-width: 140px !important;
  }
  
  .install-cta .btn-primary.large svg,
  .install-cta .btn-secondary.large svg {
    width: 12px !important;
    height: 12px !important;
  }
  
  /* Shorten button text on small screens */
  .install-cta .btn-secondary.large span {
    font-size: 0.65rem !important;
  }

  .md-nav--primary,
  .md-sidebar--primary {
    width: 90% !important;
    max-width: 280px !important;
  }

  .hero-title {
    font-size: 1.875rem;
  }

  .lantern-container {
    width: 60px;
    height: 60px;
  }

  /* Adjust hero spacing for smaller header */
  .victorian-hero,
  .hero-section {
    margin-top: 3rem;
    min-height: calc(100vh - 3rem);
  }

  /* Content spacing adjustment */
  .md-container {
    padding-top: 3rem;
  }
}
