@media (max-width: 1320px) {
  :root {
    --settings-width: clamp(320px, 34vw, 400px);
    --content-gutter: 20px;
  }

  .top-header {
    padding-inline: 20px;
  }

  .list-navbar li a {
    padding-inline: 12px;
  }
}

@media (max-width: 1140px) {
  body {
    overflow: auto;
  }

  body.is-overlay-open {
    overflow: hidden;
  }

  .top-header__inner {
    padding-block: 12px;
    align-items: flex-start;
  }

  .nav-left,
  .nav-right {
    flex-wrap: wrap;
  }

  .credits-subtext {
    display: none;
  }

  .contain-generating {
    padding: 20px;
    min-height: auto;
    height: auto;
    overflow: visible;
    
  }

  .generate-lp {
    overflow: visible;
  }

  .setting {
    height: calc(100vh - var(--header-height) - (var(--content-gutter) * 2));
    max-height: calc(100vh - var(--header-height) - (var(--content-gutter) * 2));
  }
}

@media (max-width: 1024px) {
  body {
    overflow: auto;
  }

  body.is-overlay-open {
    overflow: hidden;
  }

  .app-shell {
    display: block;
  }

  .side-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(320px, 86vw);
    min-width: min(320px, 86vw);
    z-index: var(--z-sidebar);
    transform: translateX(-100%);
    box-shadow: var(--shadow-drawer);
  }

  .side-bar.open {
    transform: translateX(0);
  }

  .side-bar.collapsed {
    width: min(320px, 86vw);
    min-width: min(320px, 86vw);
    padding: 20px;
  }

  .side-bar.collapsed .sidebar-logo {
    display: flex;
  }

  .side-bar.collapsed .sidebar-link-text {
    width: auto;
    opacity: 1;
    visibility: visible;
  }

  .side-bar.collapsed .list-sidebar li a,
  .side-bar.collapsed .log-Out {
    justify-content: flex-start;
    padding-left: 10px;
    padding-right: 10px;
  }

  .sidebar-mobile-only {
    display: list-item;
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    display: block;
    background: var(--color-overlay);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: var(--z-sidebar-overlay);
  }

  .sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
  }

  .top-header {
    padding-inline: 18px;
  }

  .top-header__inner {
    min-height: auto;
    align-items: center;
    gap: 14px;
  }

  .header-sidebar-toggle {
    display: inline-flex;
  }

  .nav-left {
    flex: 1;
    min-width: 0;
  }

  .nav-right {
    margin-left: 0;
    flex-wrap: nowrap;
    gap: 10px;
    flex-shrink: 0;
  }

  .list-navbar {
    width: auto;
    gap: 10px;
  }

  .nav-mobile-hidden,
  .Sign-in_buttons {
    display: none !important;
  }

  .profile-mobile-only {
    display: flex;
  }

  .profile-dropdown-divider {
    display: block;
  }

  .credits-btn {
    min-width: 180px;
    min-height: 40px;
    padding: 4px 8px 4px 9px;
    gap: 8px;
  }

  .credits-copy::after {
    height: 18px;
    padding-inline: 6px;
    font-size: 9.5px;
  }

  .credits-text {
    font-size: 11px;
  }

  .credits-subtext {
    display: none;
  }

  .profile-dropdown {
    width: min(252px, calc(100vw - 20px));
    max-width: calc(100vw - 20px);
  }

  .contain-generating {
    grid-template-columns: 1fr;
    min-height: auto;
    height: auto;
    overflow: visible;
  }

  .generate-lp {
    overflow: visible;
    padding-right: 0;
  }

  .setting {
    position: fixed;
    top: 0;
    right: 0;
    width: min(420px, 92vw);
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    z-index: var(--z-settings);
    border-radius: 24px 0 0 24px;
    transform: translateX(100%);
    opacity: 0;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.08);
    transition:
      transform var(--transition-slow),
      opacity var(--transition-slow);
  }

  .setting.open {
    transform: translateX(0);
    opacity: 1;
  }

  .settings-overlay {
    position: fixed;
    inset: 0;
    display: block;
    background: var(--color-overlay);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: var(--z-settings-overlay);
  }

  .settings-overlay.show {
    opacity: 1;
    visibility: visible;
  }

  .settings-fab {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--color-dark-elevated);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-surface);
    box-shadow: var(--shadow-fab);
    cursor: pointer;
    z-index: var(--z-fab);
  }

  .settings-fab svg {
    width: 24px;
    height: 24px;
  }

  .close-settings {
    width: 40px;
    height: 40px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: #fafafa;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
  }
}

@media (max-width: 640px) {
  .top-header {
    padding-inline: 12px;
  }

  .top-header__inner {
    gap: 8px;
    flex-wrap: nowrap;
  }

  .nav-left,
  .nav-right {
    flex-wrap: nowrap;
  }

  .list-navbar {
    gap: 8px;
    flex-wrap: nowrap;
  }


  .list-navbar li a {
    padding: 9px 12px;
  }

  #bimoToolsDropdown .dropdown-btn {
    width: 40px;
    min-width: 40px;
    padding: 0;
    justify-content: center;
  }

  #bimoToolsDropdown .dropdown-btn span,
  #bimoToolsDropdown .dropdown-btn .chevron {
    display: none;
  }

  .new-btn {
    width: 40px;
    min-width: 40px;
    padding: 0;
    justify-content: center;
  }

  .new-btn span:last-child {
    display: none;
  }
  .top-header{
    display: flex;
    align-items: center;
    justify-content: center;
   
  }

  .top-header__inner {
    width: 100%;
    align-items: center;
    gap: 6px;
    padding-block: 0px;
  }

  .nav-left,
  .nav-right {
    align-items: center;
    gap: 8px;
  }

  .nav-left {
    min-width: 0;
    flex: 1;
  }

  .nav-right {
    margin-left: auto;
    flex-shrink: 0;
  }

  .list-navbar {
    gap: 6px;
  }

  .list-navbar li {
    flex: 0 0 auto;
  }

  .header-icon-btn,
  #bimoToolsDropdown .dropdown-btn,
  .new-btn,
  .profile-trigger {
    width: 36px;
    min-width: 36px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .header-icon-btn img,
  #bimoToolsDropdown .dropdown-btn .btn-icon,
  .new-btn .nav-icon,
  .new-btn .nav-icon svg {
    width: 16px;
    height: 16px;
  }

  .new-btn .nav-icon {
    margin: 0;
  }

  .header-action-btn {
    min-width: fit-content;
    height: 40px;
    min-height: 40px;
    padding: 0 10px;
    border-radius: 11px;
    gap: 6px;
    font-size: 12px;
  }

  .header-action-btn__icon {
    width: 15px;
    height: 15px;
    flex-basis: 15px;
  }

  .header-action-btn__plus {
    font-size: 15px;
    line-height: 1;
  }

  .credits-copy {
    display: none;
  }

  .credits-btn {
    min-width: auto;
    height: 40px;
    min-height: 40px;
    padding: 0 10px;
    gap: 6px;
    border-radius: 11px;
  }

  .credits-icon {
    width: 24px;
    height: 24px;
  }

  .credits-number {
    min-width: 26px;
    height: 24px;
    padding-inline: 6px;
    font-size: 11.5px;
  }

  .header-icon-btn,
  .profile-trigger {
    width: 36px;
    height: 36px;
  }

  .profile-menu {
    position: relative;
  }

  .profile-dropdown {
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    width: min(252px, calc(100vw - 20px));
    max-width: calc(100vw - 20px);
    transform-origin: top right;
  }

  .contain-generating {
    padding: 12px;
  }

  .landing-actions {
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap;

  }

  .action-btn {
    min-width: auto;
    flex-wrap: nowrap;
    
  }
    .action-btn:hover{
      transform: translateY(0px);
    }

  .setting {
    width: 100vw;
    border-radius: 0;
    width: 100%;
  }

  .settings-fab {
    right: 12px;
    bottom: 12px;
    width: 52px;
    height: 52px;
  }

  .quick-row,
  .option-grid.two-cols {
    grid-template-columns: 1fr;
    display: grid;
  }

  .generate-lp-card {
    padding: 18px 18px 16px;
    border-radius: 18px;
  }

  .generate-main-text h2 {
    font-size: 17px;
  }

  .generate-main-text p {
    font-size: 12px;
  }

  .generate-feature-item span:last-child {
    font-size: 12px;
  }

  .generate-feature-item {
    min-height: 44px;
    padding: 11px 14px;
  }
        .sidebar-head{
          width: 100%;
        }
}

@media (max-width: 480px) {
  .top-header {
    padding-inline: 10px;
  }

  .list-navbar li a {
    padding: 8px 11px;
    font-size: 12px;
  }

  .header-icon-btn,
  #bimoToolsDropdown .dropdown-btn,
  .new-btn,
  .profile-trigger {
    width:38px;
    min-width: 38px;
    height: 38px;
    min-height: 38x;
    border-radius: 11px;
  }
    .top-header__inner{
      padding-block: 0px;
      align-items: center;
      
    }

  .header-action-btn {
    min-width: fit-content;
    height: 38px;
    min-height: 38px;
    padding: 0 8px;
    gap: 6px;
    font-size: 11.5px;
  }

  .header-action-btn__icon {
    width: 14px;
    height: 14px;
    flex-basis: 14px;
  }

  .profile-dropdown {
    width: min(252px, calc(100vw - 20px));
    max-width: calc(100vw - 20px);
  }

}


/* Clarity cleanup: header responsive refinement */
@media (max-width: 1140px) {
  .top-header__inner {
    padding-block: 10px;
  }
}

@media (max-width: 1024px) {
  .top-header__inner {
    gap: 12px;
  }

  .list-navbar {
    gap: 8px;
  }

  .credits-btn {
    min-width: 168px;
    min-height: 36px;
    padding: 3px 7px 3px 8px;
    gap: 7px;
  }

  .credits-icon {
    width: 26px;
    height: 26px;
  }

  .credits-number {
    min-width: 30px;
    height: 26px;
  }
}


/* Strict header cleanup responsive */
@media (max-width: 1024px) {
  .credits-btn {
    min-width: 156px;
    min-height: 34px;
    padding: 3px 6px;
  }

  .credits-icon {
    width: 22px;
    height: 22px;
  }

  .credits-number {
    min-width: 26px;
    height: 22px;
  }
}


/* Header action credits button responsive */
@media (max-width: 1024px) {
  .header-action-btn {
    min-width: 104px;
    height: 36px;
    padding: 0 11px;
    gap: 7px;
    font-size: 12.5px;
  }

  .header-action-btn__icon {
    width: 15px;
    height: 15px;
    flex-basis: 15px;
  }

  .header-action-btn__plus {
    font-size: 15px;
  }
}

/* ─── Credits pill: phone-only compact mode ─────────────────────────────────
   This block MUST remain at the very end of this file.
   All .credits-btn and .header-action-btn min-width rules above (same
   specificity 0,1,0) are defeated by source-order: the latest rule wins.
   On mobile, the pill must shrink to icon + number + plus — no extra space.
────────────────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .header-action-btn {
    min-width: 0;
    width: auto;
    height: 36px;
    min-height: 36px;
    padding: 0 9px;
    gap: 5px;
    justify-content: center;
    align-items: center;
    font-size: 13px;
  }

  .header-action-btn .credits-label {
    display: none;
  }

  .header-action-btn__icon {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
  }

  .header-action-btn__text {
    display: inline-flex;
    align-items: center;
    line-height: 1;
  }

  .header-action-btn__plus {
    font-size: 14px;
    line-height: 1;
    margin-left: 0;
  }
}
