/* Responsive Breakpoints and Variables */

:root {
  /* Breakpoint values */
  --mobile-max: 767px;
  --tablet-min: 768px;
  --tablet-max: 1023px;
  --desktop-min: 1024px;
  --desktop-large-min: 1200px;
  
  /* Navigation responsive variables */
  --nav-height-desktop: auto;
  --nav-height-mobile: 60px;
  --nav-padding-desktop: 0.6rem 1rem;
  --nav-padding-mobile: 0.4rem 1rem;
  
  /* Sidebar responsive variables */
  --sidebar-width-desktop: 380px;
  --sidebar-width-tablet: 320px;
  --sidebar-width-mobile: 100%;
  
  /* Font sizes responsive */
  --brand-font-size-desktop: 2.8rem;
  --brand-font-size-mobile: 2rem;
  --brand-first-letter-desktop: 4.2rem;
  --brand-first-letter-mobile: 3rem;
}

/* Mobile Portrait */
@media (max-width: 767px) {
  /* Reset mobile viewport issues */
  html, body {
    overflow: visible !important;
    position: static !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    min-height: 100vh !important;
  }
  
  body {
    display: block !important;
  }
  
  /* Ensure mobile scrolling works properly */
  * {
    -webkit-overflow-scrolling: touch !important;
  }
  
  .main-navigation {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: var(--nav-padding-mobile);
    min-height: var(--nav-height-mobile);
    position: relative;
  }
  
  .nav-brand h1 {
    font-size: var(--brand-font-size-mobile);
  }
  
  .nav-brand h1::first-letter {
    font-size: var(--brand-first-letter-mobile);
  }
  
  .mobile-nav-toggle {
    display: flex !important;
  }
  
  /* Mobile Navigation Layout */
  .nav-left {
    justify-content: center;
    position: relative;
    width: 100%;
  }
  
  .mobile-nav-toggle {
    position: absolute !important;
    left: 1px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
  }
  
  .mobile-nav-toggle .hamburger-line {
    background: white !important;
  }
  
  .mobile-nav-toggle:hover {
    background: transparent !important;
  }
  
  .mobile-nav-toggle:focus {
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
  }
  
  .mobile-nav-toggle:focus:not(.menu-open) {
    box-shadow: none !important;
  }
  
  .mobile-nav-toggle:active {
    outline: none !important;
    background: transparent !important;
    box-shadow: 0 0 40px rgba(255, 255, 255, 1) !important;
  }
  
  .mobile-nav-toggle.menu-open {
    box-shadow: 0 0 40px rgba(255, 255, 255, 1) !important;
  }
  
  .nav-links {
    display: none; /* Hidden by default on mobile */
  }
  
  .nav-links.mobile-open .nav-link {
    padding: 0.8rem 1rem;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  
  .nav-links.mobile-open .nav-link:last-child {
    border-bottom: none;
  }
  
  .nav-user {
    display: none; /* Hidden by default on mobile, shown when menu opens */
  }
  
  /* Mobile Sidebar Toggle Button (in toolbar) */
  .mobile-sidebar-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    border: none !important;
    background: transparent !important;
    padding: 8px !important;
    width: auto !important;
    height: auto !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
  }
  
  .mobile-sidebar-toggle:hover {
    background: transparent !important;
    box-shadow: 0 0 40px rgba(255, 255, 255, 1) !important;
  }
  
  .mobile-sidebar-toggle:focus {
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
  }
  
  .mobile-sidebar-toggle:active {
    outline: none !important;
    background: transparent !important;
    box-shadow: 0 0 40px rgba(255, 255, 255, 1) !important;
    border: none !important;
  }
  
  .mobile-sidebar-toggle.open {
    box-shadow: 0 0 40px rgba(255, 255, 255, 1) !important;
    background: transparent !important;
  }
  
  /* Ensure no background when sidebar is closed */
  .mobile-sidebar-toggle:not(.open) {
    background: transparent !important;
  }
  
  .mobile-sidebar-toggle:not(.open):not(:hover):not(:active) {
    box-shadow: none !important;
    background: transparent !important;
  }
  
  .mobile-sidebar-toggle .icon-placeholder svg,
  .mobile-sidebar-toggle svg {
    color: #343a40;
    width: 28px;
    height: 28px;
  }

  .mobile-sidebar-toggle.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
  }

  .mobile-sidebar-toggle.disabled:hover {
    background: inherit;
    color: inherit;
    box-shadow: none;
    transform: none;
  }
  
  /* Mobile Toolbar */
  .notation-toolbar {
    flex-shrink: 0 !important;
    padding: 15px !important;
  }
  
  /* Mobile Toolbar Buttons - Icon Only */
  .generate-btn,
  .random-btn,
  .download-btn,
  .play-btn,
  .stop-btn {
    border: none !important;
    background: transparent !important;
    padding: 8px !important;
    width: auto !important;
    height: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
  }
  
  .generate-btn:hover,
  .random-btn:hover,
  .download-btn:hover,
  .play-btn:hover,
  .stop-btn:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    box-shadow: none !important;
    transform: none !important;
  }
  
  .generate-btn .icon-placeholder,
  .random-btn .icon-placeholder,
  .download-btn .icon-placeholder,
  .play-btn .icon-placeholder,
  .stop-btn .icon-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .generate-btn svg,
  .random-btn svg,
  .download-btn svg,
  .play-btn svg,
  .stop-btn svg {
    color: #343a40;
    width: 28px;
    height: 28px;
  }
  
  
  /* Mobile Sidebar */
  .sidebar {
    position: fixed !important;
    top: var(--nav-height-mobile) !important;
    left: -100% !important;
    width: 100% !important;
    bottom: 0 !important;
    height: auto !important;
    transform: translateX(0) !important;
    transition: left 0.3s ease !important;
    z-index: 999 !important;
    box-shadow: none !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  /* Add extra space at bottom of sidebar content */
  .sidebar .controls {
    padding-bottom: 100px !important;
  }
  
  /* Mobile Clef Button Spacing Fix */
  .clef-btn {
    padding: 15px 25px !important;
  }
  
  .clef-symbol {
    min-width: 35px !important;
    padding: 2px 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.2rem !important;
  }
  
  .sidebar.open {
    left: 0 !important;
  }
  
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    min-height: calc(100vh - var(--nav-height-mobile)) !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
  }
  
  /* Mobile Quote Display */
  .quote-display {
    padding: 60px 15px 20px 15px !important;
    min-height: 200px !important;
    height: auto !important;
    justify-content: center !important;
    overflow-y: auto !important;
    max-height: calc(100vh - 140px) !important;
  }
  
  .quote-text {
    font-size: 1.5rem !important;
    line-height: 1.4 !important;
    margin-bottom: 15px !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
  }
  
  .quote-author {
    font-size: 1rem !important;
    margin-top: 10px !important;
  }
  
  /* Mobile Preview Placeholder */
  .preview-placeholder {
    padding: 40px 20px !important;
    min-height: 300px !important;
  }
  
  .preview-placeholder h2 {
    font-size: 1.8em !important;
    margin-bottom: 15px !important;
    line-height: 1.3 !important;
  }
  
  .preview-placeholder p {
    font-size: 1.1em !important;
    line-height: 1.4 !important;
    max-width: 100% !important;
  }
  
  /* Mobile Sheet Music Display */
  .notation-container {
    flex: 1 !important;
    overflow: visible !important;
    min-height: 400px !important;
  }
  
  #notation-display {
    overflow-x: auto !important;
    overflow-y: visible !important;
    padding: 15px 15px 100px 15px !important;
    -webkit-overflow-scrolling: touch !important;
    min-height: 400px !important;
  }
  
  #notation-display svg {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    margin: 15px auto 50px auto !important;
    display: block !important;
  }
}

/* Tablet Portrait & Small Screens */
@media (min-width: 768px) and (max-width: 1023px) {
  .main-navigation {
    padding: var(--nav-padding-desktop);
  }
  
  .nav-brand h1 {
    font-size: 2.4rem;
  }
  
  .nav-brand h1::first-letter {
    font-size: 3.6rem;
  }
  
  .nav-links {
    gap: 0.8rem;
  }
  
  .nav-link {
    padding: 0.4rem 0.8rem;
    font-size: 1rem;
  }
  
  /* Tablet Sidebar Toggle Button */
  .mobile-sidebar-toggle {
    display: flex !important;
  }
  
  /* Tablet Sidebar */
  .sidebar {
    width: var(--sidebar-width-tablet) !important;
    position: fixed !important;
    left: -var(--sidebar-width-tablet) !important;
    top: 0 !important;
    transition: left 0.3s ease !important;
    z-index: 999 !important;
  }
  
  .sidebar.open {
    left: 0 !important;
  }
  
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
  }
  
  /* Tablet Preview Placeholder */
  .preview-placeholder {
    padding: 50px 30px !important;
    min-height: 350px !important;
  }
  
  .preview-placeholder h2 {
    font-size: 2.0em !important;
    margin-bottom: 18px !important;
  }
  
  .preview-placeholder p {
    font-size: 1.2em !important;
    max-width: 500px !important;
  }
}

/* Mobile Landscape - Apply same mobile styles but with height constraints */
@media (max-width: 1023px) and (orientation: landscape) {
  /* Reset mobile viewport issues for landscape */
  html, body {
    overflow: visible !important;
    position: static !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    min-height: 100vh !important;
  }
  
  body {
    display: block !important;
  }
  
  /* Ensure mobile scrolling works properly in landscape */
  * {
    -webkit-overflow-scrolling: touch !important;
  }
  
  /* Mobile Navigation Layout for Landscape */
  .mobile-nav-toggle {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
    box-shadow: none !important;
  }
  
  .mobile-nav-toggle .hamburger-line {
    background: white !important;
  }
  
  .mobile-nav-toggle:hover {
    background: transparent !important;
  }
  
  .mobile-nav-toggle:focus {
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
  }
  
  .mobile-nav-toggle:active {
    outline: none !important;
    background: transparent !important;
    box-shadow: 0 0 40px rgba(255, 255, 255, 1) !important;
  }
  
  .mobile-nav-toggle.menu-open {
    box-shadow: 0 0 40px rgba(255, 255, 255, 1) !important;
  }
  
  /* Mobile Sidebar Toggle Button (in toolbar) for Landscape */
  .mobile-sidebar-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    border: none !important;
    background: transparent !important;
    padding: 8px !important;
    width: auto !important;
    height: auto !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
  }
  
  .mobile-sidebar-toggle:hover {
    background: transparent !important;
    box-shadow: 0 0 40px rgba(255, 255, 255, 1) !important;
  }
  
  .mobile-sidebar-toggle:focus {
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
  }
  
  .mobile-sidebar-toggle:active {
    outline: none !important;
    background: transparent !important;
    box-shadow: 0 0 40px rgba(255, 255, 255, 1) !important;
    border: none !important;
  }
  
  .mobile-sidebar-toggle.open {
    box-shadow: 0 0 40px rgba(255, 255, 255, 1) !important;
    background: transparent !important;
  }
  
  /* Ensure no background when sidebar is closed */
  .mobile-sidebar-toggle:not(.open) {
    background: transparent !important;
  }
  
  .mobile-sidebar-toggle:not(.open):not(:hover):not(:active) {
    box-shadow: none !important;
    background: transparent !important;
  }
  
  .mobile-sidebar-toggle .icon-placeholder svg,
  .mobile-sidebar-toggle svg {
    color: #343a40 !important;
    width: 28px;
    height: 28px;
  }
  
  /* Mobile Toolbar Buttons - Icon Only for Landscape */
  .generate-btn,
  .random-btn,
  .download-btn,
  .play-btn,
  .stop-btn {
    border: none !important;
    background: transparent !important;
    padding: 8px !important;
    width: auto !important;
    height: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
  }
  
  .generate-btn:hover,
  .random-btn:hover,
  .download-btn:hover,
  .play-btn:hover,
  .stop-btn:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    box-shadow: none !important;
    transform: none !important;
  }
  
  .generate-btn svg,
  .random-btn svg,
  .download-btn svg,
  .play-btn svg,
  .stop-btn svg {
    color: #343a40 !important;
    width: 28px;
    height: 28px;
  }
  
  /* Mobile Sheet Music Display for Landscape */
  .notation-container {
    flex: 1 !important;
    overflow: visible !important;
    min-height: 300px !important;
  }
  
  #notation-display {
    overflow-x: auto !important;
    overflow-y: visible !important;
    padding: 15px 15px 80px 15px !important;
    -webkit-overflow-scrolling: touch !important;
    min-height: 300px !important;
  }
  
  #notation-display svg {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    margin: 15px auto 40px auto !important;
    display: block !important;
  }
  
  /* Mobile Sidebar for Landscape */
  .sidebar {
    position: fixed !important;
    top: var(--nav-height-mobile) !important;
    left: -100% !important;
    width: 100% !important;
    bottom: 0 !important;
    height: auto !important;
    transform: translateX(0) !important;
    transition: left 0.3s ease !important;
    z-index: 999 !important;
    box-shadow: none !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  /* Add extra space at bottom of sidebar content in landscape */
  .sidebar .controls {
    padding-bottom: 80px !important;
  }
  
  /* Mobile Clef Button Spacing Fix for Landscape */
  .clef-btn {
    padding: 12px 20px !important;
  }
  
  .clef-symbol {
    min-width: 30px !important;
    padding: 2px 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.1rem !important;
  }
  
  .sidebar.open {
    left: 0 !important;
  }
  
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    min-height: calc(100vh - var(--nav-height-mobile)) !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
  }
  
  /* Mobile Toolbar for Landscape */
  .notation-toolbar {
    flex-shrink: 0 !important;
    padding: 12px !important;
  }
  
  /* Utility Sidebar Scrolling Fix for Mobile Landscape */
  .utilities-sidebar {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-height: calc(100vh - var(--nav-height-mobile)) !important;
    overscroll-behavior: contain !important;
  }
  
  .utilities-sidebar .controls {
    padding-bottom: 200px !important;
  }
  
  /* Mobile Landscape Preview Placeholder */
  .preview-placeholder {
    padding: 30px 20px !important;
    min-height: 250px !important;
  }
  
  .preview-placeholder h2 {
    font-size: 1.6em !important;
    margin-bottom: 12px !important;
    line-height: 1.2 !important;
  }
  
  .preview-placeholder p {
    font-size: 1.0em !important;
    line-height: 1.3 !important;
    max-width: 100% !important;
  }
  
  /* Specific fix for 882x344 screen size */
  @media (width: 882px) and (height: 344px) {
    .utilities-sidebar {
      max-height: 100vh !important;
    }
    
    .preview-placeholder {
      padding: 20px 15px !important;
      min-height: 200px !important;
    }
    
    .preview-placeholder h2 {
      font-size: 1.4em !important;
      margin-bottom: 8px !important;
    }
    
    .preview-placeholder p {
      font-size: 0.9em !important;
      line-height: 1.2 !important;
    }
  }
  
  /* Specific fix for 667x375 screen size */
  @media (width: 667px) and (height: 375px) {
    .utilities-sidebar {
      max-height: 100vh !important;
    }
    
    .preview-placeholder {
      padding: 25px 15px !important;
      min-height: 220px !important;
    }
    
    .preview-placeholder h2 {
      font-size: 1.5em !important;
      margin-bottom: 10px !important;
    }
    
    .preview-placeholder p {
      font-size: 0.95em !important;
      line-height: 1.25 !important;
    }
  }
  
}

/* Tablet Landscape - Test with broader range */
@media (min-width: 1024px) and (max-width: 1200px) and (orientation: landscape) {
  /* Force remove borders with MAXIMUM specificity */
  body .notation-toolbar .generate-btn,
  body .notation-toolbar .random-btn,
  body .notation-toolbar .download-btn,
  body .notation-toolbar .play-btn,
  body .notation-toolbar .stop-btn,
  body .notation-toolbar .sidebar-menu-button,
  body .notation-toolbar .mobile-sidebar-toggle,
  body .generate-btn,
  body .random-btn,
  body .download-btn,
  body .play-btn,
  body .stop-btn,
  body .sidebar-menu-button,
  body .mobile-sidebar-toggle {
    border: 0px solid transparent !important;
    border-width: 0 !important;
    background: transparent !important;
    padding: 25px !important;
    width: auto !important;
    height: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  
  .generate-btn:hover,
  .random-btn:hover,
  .download-btn:hover,
  .sidebar-menu-button:hover,
  .mobile-sidebar-toggle:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    box-shadow: none !important;
    transform: none !important;
  }
  
  .generate-btn svg,
  .random-btn svg,
  .download-btn svg,
  .sidebar-menu-button svg,
  .mobile-sidebar-toggle svg {
    color: #343a40 !important;
    width: 32px !important;
    height: 32px !important;
  }
  
  /* Tablet Landscape Scrolling Fixes */
  * {
    -webkit-overflow-scrolling: touch !important;
  }
  
  /* Configure Sidebar Scrolling */
  .sidebar {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-height: 100vh !important;
    overscroll-behavior: contain !important;
  }
  
  .sidebar .controls {
    padding-bottom: 100px !important;
  }
  
  /* Utility Sidebar Scrolling */
  .utilities-sidebar {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-height: 100vh !important;
    overscroll-behavior: contain !important;
  }
  
  .utilities-sidebar .controls {
    padding-bottom: 100px !important;
  }
  
  /* Sheet Music Viewport Scrolling */
  #notation-display {
    overflow-x: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    min-height: 400px !important;
    padding: 15px 15px 100px 15px !important;
  }
  
  /* Main Content Area */
  .main-content {
    overflow: auto !important;
    -webkit-overflow-scrolling: touch !important;
    height: 100% !important;
  }
  
  /* Notation Container */
  .notation-container {
    overflow: auto !important;
    -webkit-overflow-scrolling: touch !important;
    height: 100% !important;
  }
  
  /* Tablet Landscape Preview Placeholder */
  .preview-placeholder {
    padding: 45px 35px !important;
    min-height: 320px !important;
  }
  
  .preview-placeholder h2 {
    font-size: 1.9em !important;
    margin-bottom: 16px !important;
    line-height: 1.3 !important;
  }
  
  .preview-placeholder p {
    font-size: 1.15em !important;
    line-height: 1.4 !important;
    max-width: 550px !important;
  }
}

/* Desktop & Large Screens */
@media (min-width: 1024px) {
  /* Ensure configure icon shows for all desktop sizes */
  .sidebar-menu-button {
    display: flex !important;
  }
  .main-navigation {
    padding: var(--nav-padding-desktop);
  }
  
  .nav-brand h1 {
    font-size: var(--brand-font-size-desktop);
  }
  
  .nav-brand h1::first-letter {
    font-size: var(--brand-first-letter-desktop);
  }
  
  /* Desktop Sidebar - restore default behavior */
  .sidebar {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    width: var(--sidebar-width-desktop) !important;
    height: 100vh !important;
    transform: none !important;
    transition: none !important;
    z-index: auto !important;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1) !important;
  }
  
  .main-content {
    margin-left: var(--sidebar-width-desktop) !important;
    width: calc(100% - var(--sidebar-width-desktop)) !important;
    padding-top: 0 !important;
  }
  
  /* Desktop Buttons - no borders, larger size */
  .sidebar-menu-button,
  .generate-btn,
  .random-btn,
  .download-btn,
  .play-btn,
  .stop-btn,
  .metronome-btn {
    display: flex !important;
    border: none !important;
    background: white !important;
    padding: 20px 30px !important;
    border-radius: 8px !important;
    width: 160px !important;
    height: 80px !important;
    font-size: 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    box-shadow: none !important;
  }
  
  .sidebar-menu-button:hover,
  .generate-btn:hover,
  .random-btn:hover,
  .download-btn:hover,
  .play-btn:hover,
  .stop-btn:hover {
    background: white !important;
    color: #343a40 !important;
    box-shadow: 0 6px 20px 0 rgba(220, 53, 69, 0.8) !important;
    transform: translateY(-1px) !important;
  }
  
  .sidebar-menu-button svg,
  .sidebar-menu-button .icon-placeholder svg,
  .generate-btn svg,
  .generate-btn .icon-placeholder svg,
  .random-btn svg,
  .random-btn .icon-placeholder svg,
  .download-btn svg,
  .download-btn .icon-placeholder svg {
    color: #343a40;
    width: 32px;
    height: 32px;
  }
  
  /* Desktop Preview Placeholder */
  .preview-placeholder {
    padding: 60px 40px !important;
    min-height: 400px !important;
  }
  
  .preview-placeholder h2 {
    font-size: 2.2em !important;
    margin-bottom: 20px !important;
    line-height: 1.4 !important;
  }
  
  .preview-placeholder p {
    font-size: 1.3em !important;
    line-height: 1.5 !important;
    max-width: 600px !important;
  }
}

/* Tablet Portrait - Second Navigation Bar Buttons */
@media (min-width: 768px) and (max-width: 1023px) and (orientation: portrait) {
  /* Force utilities sidebar closed by default with maximum specificity */
  body .sidebar.utilities-sidebar:not(.open) {
    right: -350px !important;
    left: auto !important;
    transform: translateX(0) !important;
  }
  .sidebar-menu-button,
  .mobile-sidebar-toggle,
  .generate-btn,
  .random-btn,
  .download-btn,
  .play-btn,
  .stop-btn {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 20px !important;
    width: auto !important;
    height: auto !important;
    border-radius: 0 !important;
    color: #343a40 !important;
  }
  
  .sidebar-menu-button:hover,
  .mobile-sidebar-toggle:hover,
  .generate-btn:hover,
  .random-btn:hover,
  .download-btn:hover,
  .play-btn:hover,
  .stop-btn:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    box-shadow: none !important;
    transform: none !important;
    border: none !important;
    color: #343a40 !important;
  }
  
  .sidebar-menu-button:active,
  .mobile-sidebar-toggle:active,
  .generate-btn:active,
  .random-btn:active,
  .download-btn:active {
    background: rgba(0, 0, 0, 0.1) !important;
    box-shadow: none !important;
    transform: none !important;
    border: none !important;
    color: #343a40 !important;
  }
  
  .sidebar-menu-button:focus,
  .mobile-sidebar-toggle:focus,
  .generate-btn:focus,
  .random-btn:focus,
  .download-btn:focus {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
    color: #343a40 !important;
  }
  
  .sidebar-menu-button svg,
  .sidebar-menu-button .icon-placeholder svg,
  .mobile-sidebar-toggle svg,
  .mobile-sidebar-toggle .icon-placeholder svg,
  .generate-btn svg,
  .generate-btn .icon-placeholder svg,
  .random-btn svg,
  .random-btn .icon-placeholder svg,
  .download-btn svg,
  .download-btn .icon-placeholder svg {
    color: #343a40 !important;
    width: 32px !important;
    height: 32px !important;
  }
  
  .sidebar-menu-button .icon-placeholder,
  .mobile-sidebar-toggle .icon-placeholder,
  .generate-btn .icon-placeholder,
  .random-btn .icon-placeholder,
  .download-btn .icon-placeholder,
  .play-btn .icon-placeholder,
  .stop-btn .icon-placeholder {
    color: #343a40 !important;
  }
  
  /* Tablet Portrait Scrolling Fixes */
  * {
    -webkit-overflow-scrolling: touch !important;
  }
  
  /* Configure Sidebar Scrolling */
  .sidebar {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-height: 100vh !important;
    overscroll-behavior: contain !important;
  }
  
  .sidebar .controls {
    padding-bottom: 100px !important;
  }
  
  /* Utility Sidebar Scrolling */
  .utilities-sidebar {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-height: 100vh !important;
    overscroll-behavior: contain !important;
  }
  
  .utilities-sidebar .controls {
    padding-bottom: 100px !important;
  }
  
  /* Sheet Music Viewport Scrolling */
  #notation-display {
    overflow-x: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    min-height: 400px !important;
    padding: 15px 15px 100px 15px !important;
  }
  
  /* Main Content Area */
  .main-content {
    overflow: auto !important;
    -webkit-overflow-scrolling: touch !important;
    height: 100% !important;
  }
  
  /* Notation Container */
  .notation-container {
    overflow: auto !important;
    -webkit-overflow-scrolling: touch !important;
    height: 100% !important;
  }
  
  /* Piano Quote Positioning - Copy Mobile Approach */
  .quote-display {
    padding: 150px 15px 20px 15px !important;
    min-height: 200px !important;
    height: auto !important;
    justify-content: center !important;
    overflow-y: auto !important;
    max-height: calc(100vh - 140px) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }
  
  .quote-text {
    font-size: 1.6rem !important;
    line-height: 1.5 !important;
    margin-bottom: 20px !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
  }
  
  .quote-author {
    font-size: 1.1rem !important;
    margin-top: 10px !important;
  }
  
  /* Utilities Sidebar Fix for Tablet Portrait */
  .sidebar.utilities-sidebar:not(.open) {
    right: -350px !important;
    left: auto !important;
  }
  
  .sidebar.utilities-sidebar.open {
    right: 0 !important;
    left: auto !important;
  }
  
  /* Tablet Portrait Preview Placeholder */
  .preview-placeholder {
    padding: 50px 30px !important;
    min-height: 350px !important;
  }
  
  .preview-placeholder h2 {
    font-size: 2.0em !important;
    margin-bottom: 18px !important;
    line-height: 1.3 !important;
  }
  
  .preview-placeholder p {
    font-size: 1.2em !important;
    line-height: 1.4 !important;
    max-width: 500px !important;
  }
}