@media (max-width: 512px) {
  * {
    box-sizing: border-box;
  }

  .mb-banner {
    display: block;
  }

  .auth-card-logo {
    display: flex;
  }

  /* Page-specific backgrounds */
  body.login-page, html.login-page {
    background: linear-gradient(rgba(0,0,0,0.5),rgba(0,0,0,0.5)), url('https://pimcoprimerealestate.com/_Resources/Persistent/acca3c4f00bd965bd62687e222569773c9c97f32/viaDellArte25_%C2%A9DiegoDePol-web-1635x1500.webp') center center no-repeat;
    background-size: cover;
    min-height: 100vh;
  }
  body.register-page, html.register-page,
  body.beta-block-page, html.beta-block-page {
    background: url('/static/img/bg.jpg') center center no-repeat;
    background-size: cover;
    min-height: 100vh;
  }
  body.reset-password-page, html.reset-password-page {
    background: url('/static/img/bg.jpg') center center no-repeat;
    background-size: cover;
    min-height: 100vh;
  }

  /* Hide image and header on mobile for auth pages - fully remove from layout */
  .l-side-image, .l-side-image-l, .l-side-image-ll {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .login-header {
    display: none !important;
  }
  .l-sides {
    min-height: 100vh;
    display: block !important;
    background: transparent !important;
    padding: 0 !important;
  }
  .l-side-login-form {
    margin: 32px auto !important;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 90vw !important;
    max-width: 340px;
    min-height: unset;
  }
  .auth-card-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 12px;
    margin-top: -8px;
  }
  .auth-card-logo img {
    width: 48px;
    height: 48px;
    margin-bottom: 4px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  }
  .auth-card-logo-text {
    font-family: "Plus Jakatra Sans", sans-serif;
    font-size: 22px;
    font-weight: bold;
    color: #151e3a;
    letter-spacing: 1px;
  }

  .container, header {
    width: 100%;
    margin: 0;
    padding: 0;
    max-width: 100%;
  }

  /* Remove forced overflow and width */
  /* body, html {
    width: 100vw;
    overflow-x: hidden;
  } */

  header {
    position: relative;
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 2%;
  }
  .logo, .login-logo {
    font-size: 22px;
    margin-bottom: 10px;
  }
  .nav_links {
    flex-direction: column;
    width: 100%;
    padding: 0;
  }
  .nav_links li {
    padding: 8px 0;
    width: 100%;
    text-align: left;
  }
  .dktl-rr, .header-btn {
    margin: 10px 0 0 0;
    width: 100%;
    text-align: left;
    padding: 10px 0;
  }
  .header-btn {
    width: 100%;
    box-sizing: border-box;
  }

  .container, .hp-h-box, .feature-grid {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 10px 0 !important;
    margin: 0 !important;
    max-width: 100vw !important;
  }
  .home-page-header {
    padding: 30px 10px;
    margin-right: 0;
  }
  .home-page-header-head {
    font-size: 24px;
    margin-bottom: 12px;
  }
  .home-page-header-text, .feature-grid-header, .feature-grid-text {
    font-size: 15px;
  }
  .hp-h-btns {
    margin-top: 24px;
    flex-direction: column;
    gap: 10px;
  }
  .primarly-btn {
    width: 100%;
    padding: 12px 0;
    font-size: 15px;
  }
  .hp-h-img img, .feature-grid-image img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
  }
  .hp-h-img, .feature-grid-image {
    width: 100%;
    overflow-x: hidden;
  }
  .feature-grid-image {
    margin-top: 20px;
  }

  /* Tables: make horizontally scrollable */
  .a-ct-track-table,
  .a-ct-track-table-whole,
  table {
    margin: 0 !important;
    width: 100% !important;
    overflow-x: auto;
    display: block;
  }
  th, td {
    font-size: 13px;
    padding: 6px 4px;
  }
  .a-ct-track-table-thumbnail {
    height: 48px;
    margin-right: 8px;
  }
  .a-ct-track-table-creator {
    height: 32px;
    margin-right: 8px;
  }

  /* Footer */
  footer, .bottom-coperate-footer-content {
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: 10px !important;
    margin: 0 !important;
  }
  .corperate-footer-socials {
    margin: 10px 0 0 0;
    padding: 10px 0;
    font-size: 13px;
  }
  .bottom-coperate-footer-content {
    padding: 10px 0 0 0;
    margin: 0;
  }
  .corperate-legal-links {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100%;
    margin: 0 auto;
  }
  .corperate-legal-links .footlink {
    padding: 0 6px !important;
    margin-bottom: 0 !important;
    font-size: 15px !important;
    border: none !important;
  }
  .corperate-legal-links .right-legal-border {
    border-right: 1px solid #222 !important;
  }
  .corperate-legal-links .no-right-padding {
    border: none !important;
  }
  .corperate-footer-copyright {
    margin-bottom: 8px;
    font-size: 12px;
  }

  /* Hide large images or unnecessary elements if needed */
  .l-img-slide-txt {
    font-size: 32px;
    margin-left: 10px;
    width: 90vw;
  }

  /* Login/Register/Reset stacked layout */
  .l-sides {
    flex-direction: column !important;
    width: 100%;
    min-height: 100vh;
    align-items: center;
    position: relative;
  }
  .l-img-slide-txt {
    font-size: 28px !important;
    color: white;
    width: 100vw;
    margin: 0;
    padding: 16px 12px 24px 12px;
    text-align: center;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.55) 60%, rgba(0,0,0,0.1) 100%);
    z-index: 3;
    display: block;
  }
  .l-side-login-form {
    width: 90vw !important;
    max-width: 340px;
    margin: -60px auto 0 auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
    z-index: 4;
    position: relative;
    padding: 32px 16px 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .l-side-login-form > form {
    width: 100%;
  }
  .l-side-login-form input[type="text"],
  .l-side-login-form input[type="email"],
  .l-side-login-form input[type="password"] {
    width: 100% !important;
    min-width: 0;
    box-sizing: border-box;
    margin-bottom: 12px;
  }
  .l-form-head {
    font-size: 24px !important;
    text-align: center;
    width: 100%;
  }

  /* Prevent image overflow */
  img, .hp-h-img img, .feature-grid-image img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
  }

  .footersocial {
    height: 24px !important;
  }

  .hp-h-img, .feature-grid-image {
    width: 100%;
    overflow-x: hidden;
  }

  /* Fix table/content tracker overflow */
  .a-ct-track-table,
  .a-ct-track-table-whole,
  table {
    margin: 0 !important;
    width: 100% !important;
    overflow-x: auto;
    display: block;
  }

  /* Dashboard/statistics */
  .statistics, .dashboard-channel-analytics-container {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .stat-box, .dashboard-channel-analytics, .dashboard-channel-analytics-realtime-statistics {
    width: 98vw !important;
    min-width: 0;
    margin: 10px 0 !important;
    padding: 10px !important;
    font-size: 14px;
  }
  #dashboard-chart, #chart {
    width: 98vw !important;
    min-width: 0;
    height: 220px !important;
  }
  .statistics-header, .app-section-header {
    padding: 10px !important;
    font-size: 16px;
  }
  .statistics-title, .app-section-header-name {
    font-size: 16px;
  }
  .statistics-values {
    margin: 0 5px;
    padding: 10px 0;
  }
  .statistics-value-value {
    font-size: 18px;
  }
  .statistics-timespan-filters {
    margin: 10px 0 0 0;
    text-align: left;
  }

  /* Misc */
  .connected-account, .connect-socials-box {
    margin: 10px 0 !important;
    padding: 10px !important;
  }
  .connected-account-details, .connected-account-metrics {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
  .connected-account-image {
    height: 28px;
    margin-right: 8px;
  }
  .connected-account-name {
    font-size: 15px;
  }
  .connected-account-subscriber-box-value, .connected-account-view-box-value, .connected-account-video-box-value {
    font-size: 16px;
  }
  .connected-account-subscriber-box, .connected-account-view-box, .connected-account-video-box {
    padding: 0 8px 0 4px;
  }
  .a-ct-form-container {
    margin-top: 10px;
  }
  .a-ct-input {
    width: 80vw;
    font-size: 13px;
  }
  .a-ct-btn {
    margin-left: 8px;
    font-size: 13px;
  }
  .reset-password-page-header {
    width: 90vw;
    max-width: 340px;
    margin: 40px auto 0 auto !important;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
    padding: 32px 16px 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .rp-h-txt, .rp-h-btns {
    width: 100%;
    text-align: center;
  }
  .reset-password-page-header input[type="password"],
  .reset-password-page-header input[type="text"],
  .reset-password-page-header input[type="email"] {
    width: 100% !important;
    min-width: 0;
    box-sizing: border-box;
    margin-bottom: 12px;
  }
  .reset-password-page-header .primarly-btn {
    width: 100%;
    margin-top: 12px;
  }
  .home-page-header-head, .home-page-header-text {
    text-align: center;
    width: 100%;
  }

  /* Hamburger menu styles */
  #mobile-nav-toggle {
    display: block !important;
    background: none;
    border: none;
    position: absolute;
    right: 20px;
    top: 18px;
    z-index: 1001;
    cursor: pointer;
    max-width: 48px;
  }
  #mobile-nav-menu {
    display: none;
    flex-direction: column;
    width: 100vw;
    background: #fff;
    position: absolute;
    left: 0;
    top: 60px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    z-index: 9999;
    padding-bottom: 16px;
    min-height: 0;
    border: none;
    transition: max-height 0.3s ease, opacity 0.2s;
    opacity: 0;
    pointer-events: none;
  }
  #mobile-nav-menu.active {
    display: flex !important;
    opacity: 1;
    pointer-events: auto;
  }
  .nav_links {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
  }
  .nav_links li {
    list-style: none;
    padding: 12px 20px;
    border-bottom: 1px solid #f2f2f2;
    width: 100%;
    text-align: left;
    background: none;
  }
  .nav_links li:last-child {
    border-bottom: none;
  }
  .header-btn {
    width: auto;
    margin: 12px 0 0 0;
    display: inline-block;
    text-align: center;
    padding: 12px 32px;
  }

  /* Center hero section and all children */
  #home-hero,
  #home-hero .home-page-header,
  #home-hero .hp-h-txt,
  #home-hero .hp-h-btns {
    align-items: center !important;
    text-align: center !important;
    justify-content: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100%;
  }
  #home-hero .primarly-btn {
    width: auto !important;
    min-width: 120px;
    max-width: 90vw;
    padding: 12px 32px;
    font-size: 15px;
    margin: 0 auto !important;
    display: inline-block;
  }

  .feature-grid-header, .feature-grid-text {
    text-align: center !important;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }

  .privacy-container {
    width: 100% !important;
    max-width: 480px !important;
    margin: 32px auto 24px auto !important;
    padding: 20px 12px 24px 12px !important;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    word-break: normal !important;
    overflow-wrap: break-word !important;
  }
  .privacyheader,
  .privacy-last-updated,
  .privacy-text,
  .privacy-sub-header {
    word-break: normal !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
  }
  .privacyheader {
    font-size: 26px !important;
    margin-bottom: 10px !important;
    text-align: center;
  }
  .privacy-last-updated {
    font-size: 13px !important;
    margin-bottom: 18px !important;
    text-align: center;
  }
  .privacy-text {
    font-size: 14px !important;
    line-height: 1.6;
    margin-bottom: 16px;
  }
  .privacy-sub-header {
    font-size: 18px !important;
    margin-top: 24px !important;
    margin-bottom: 10px !important;
  }
}
