/* AlgoLodge — mobile refinements, 23 October 2026.
   Only presentation: no changes to translations, performance data or calculations.
   Loaded at the end of the document HEAD, after existing page-specific CSS. */

@media (max-width: 640px) {
  /* A shorter, less crowded header. Keep readable 44px touch targets. */
  .al-header {
    height: auto !important;
    min-height: 72px !important;
  }
  .al-header .al-header-inner {
    height: 72px !important;
    min-height: 72px !important;
    padding: 8px 14px !important;
    gap: 8px !important;
    max-width: 100% !important;
  }
  .al-header .al-brand {
    width: clamp(128px, 39vw, 153px) !important;
    min-width: 0 !important;
    max-width: calc(100vw - 160px) !important;
    height: 52px !important;
    flex: 0 1 auto !important;
  }
  .al-header .al-brand img {
    height: 50px !important;
    max-height: 50px !important;
    width: 100% !important;
    object-fit: contain !important;
  }
  .al-header .al-controls {
    min-width: 0 !important;
    gap: 7px !important;
    flex-shrink: 0 !important;
  }
  .al-header .flag-current {
    display: inline-flex;
    justify-content: center;
    min-height: 44px !important;
    border-radius: 11px !important;
    padding: 8px 10px !important;
  }
  .al-header #menu.al-mobile {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    padding: 8px !important;
    border-radius: 11px !important;
  }
  .al-header #al-navigation {
    max-height: calc(100vh - 72px) !important;
    max-height: calc(100dvh - 72px) !important;
  }
  /* Ensure the full (but compact) language picker remains readable and anchored
     to its control, never clipped by the viewport's left edge. */
  .al-header .flag-select > .flag-menu {
    /* Align to the right edge of both controls, not the language button alone. */
    right: -51px !important;
    left: auto !important;
    max-height: calc(100dvh - 100px);
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: 0 12px 35px rgba(16,43,74,.17);
  }

  /* Home: less empty space, balanced text and buttons. */
  main .hero-active.home60-hero {
    padding-top: 26px !important;
    padding-bottom: 24px !important;
    gap: 24px !important;
  }
  .hero-active.home60-hero h1 {
    font-size: clamp(34px, 9vw, 43px) !important;
    line-height: 1.12 !important;
    letter-spacing: -.035em !important;
    margin-bottom: 14px !important;
    overflow-wrap: break-word;
  }
  .hero-active.home60-hero .lead {
    font-size: 15px !important;
    line-height: 1.57 !important;
  }
  .hero-active.home60-hero .hero-actions {
    display: grid !important;
    grid-template-columns: minmax(0,1fr) !important;
    gap: 10px !important;
    margin-top: 20px !important;
  }
  .hero-active.home60-hero .hero-actions a {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 46px !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 11px 14px !important;
    text-align: center !important;
    white-space: normal !important;
    line-height: 1.4 !important;
    box-sizing: border-box;
  }
  .hero-active.home60-hero .strategy-carousel {
    padding: 14px !important;
    border-radius: 16px !important;
  }

  /* The two interactive portfolio tools: compact top links with a featured
     full-width action, smaller gap before the first form card. */
  .adv-page .adv-hero,
  .cmp-page .cmp-hero {
    padding-top: 23px !important;
    padding-bottom: 28px !important;
  }
  .adv-page .adv-hero-row,
  .cmp-page .cmp-hero-main {
    gap: 12px !important;
  }
  .adv-page .adv-hero h1,
  .cmp-page .cmp-hero h1 {
    font-size: clamp(27px, 7.6vw, 32px) !important;
    line-height: 1.14 !important;
    letter-spacing: -.025em !important;
  }
  .adv-page .adv-hero p:not(.adv-kicker),
  .cmp-page .cmp-hero p:not(.cmp-kicker) {
    font-size: 14px !important;
    line-height: 1.5 !important;
  }
  .adv-page nav.adv-hero-actions,
  .cmp-page .cmp-hero-actions {
    display: grid !important;
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    margin-top: 0 !important;
    padding: 0 !important;
  }
  .adv-page nav.adv-hero-actions > a.adv-back,
  .cmp-page .cmp-hero-actions > a.cmp-guide-cta {
    min-width: 0 !important;
    width: 100% !important;
    min-height: 46px !important;
    margin: 0 !important;
    padding: 9px 8px !important;
    line-height: 1.35 !important;
    font-size: 12px !important;
    border-radius: 10px !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
    text-align: center !important;
  }
  .adv-page nav.adv-hero-actions > a:last-child:nth-child(odd),
  .cmp-page .cmp-hero-actions > a:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
  .adv-page .adv-content,
  .cmp-page .cmp-content {
    margin-top: -12px !important;
  }
  .adv-page .adv-panel,
  .cmp-page .cmp-panel {
    padding: 17px !important;
    border-radius: 15px !important;
    margin-bottom: 14px;
  }
  .adv-page .adv-panel h2,
  .cmp-page .cmp-panel h2 { line-height: 1.2 !important; }
  .adv-page .adv-two,
  .cmp-page .cmp-workspace { gap: 14px !important; }
  .adv-page .adv-presets { gap: 7px !important; }
  .adv-page .adv-presets button {
    min-height: 42px !important;
    padding: 10px 11px !important;
    line-height: 1.3 !important;
  }
  .adv-page .adv-weight {
    padding: 14px !important;
    border-radius: 12px !important;
  }
}
@media (max-width: 350px) {
  .al-header .al-header-inner {padding-inline: 10px !important; gap: 5px !important;}
  .al-header .al-brand {width: 125px !important;max-width: calc(100vw - 151px) !important;}
  .al-header .al-controls {gap: 4px !important;}
  .al-header .flag-current {padding: 7px 8px !important;}
  .adv-page nav.adv-hero-actions,
  .cmp-page .cmp-hero-actions {grid-template-columns: minmax(0,1fr) !important;}
  .adv-page nav.adv-hero-actions > a,
  .cmp-page .cmp-hero-actions > a {grid-column: 1 / -1;}
}
