/* Espace Paramètres plus grand : le panneau utilise mieux la largeur et la hauteur disponibles. */
.settings-fit-screen {
  padding-top: max(0.35rem, env(safe-area-inset-top)) !important;
  padding-right: max(0.5rem, env(safe-area-inset-right)) !important;
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom)) !important;
  padding-left: max(0.5rem, env(safe-area-inset-left)) !important;
}

.settings-fit-screen > .relative.z-10 {
  max-width: min(96rem, calc(100vw - 1rem)) !important;
  gap: 0.65rem !important;
}

.settings-fit-screen > .relative.z-10 > header {
  min-height: 3.15rem;
  padding-top: 0.45rem !important;
  padding-bottom: 0.45rem !important;
}

.settings-space-shell {
  flex: 1 1 auto;
  min-height: 0;
  gap: clamp(0.55rem, 1vw, 0.85rem) !important;
  padding: clamp(0.65rem, 1.4vw, 1.25rem) !important;
  border-radius: clamp(1.35rem, 2vw, 2rem) !important;
}

.settings-space-shell > div:first-child {
  padding: clamp(0.65rem, 1.2vw, 1rem) !important;
}

.settings-space-shell > div:first-child h1 {
  font-size: clamp(1.7rem, 3.1vw, 2.75rem);
  line-height: 1.05;
}

.settings-space-content {
  min-height: 0;
  padding: 0.25rem 0.35rem 0.75rem 0.25rem;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.settings-space-content > form,
.settings-space-content > section {
  min-height: 100%;
}

.settings-space-content article,
.settings-space-content aside,
.settings-space-content > form {
  border-radius: clamp(1.35rem, 2vw, 2rem) !important;
}

.settings-fit-screen [role="tablist"] {
  gap: 0.6rem !important;
  padding: 0.45rem !important;
}

.settings-fit-screen [role="tab"] {
  min-height: 3.35rem !important;
  border-radius: 1rem !important;
  font-size: clamp(0.95rem, 1.05vw, 1.06rem) !important;
}

@media (min-width: 1024px) {
  .settings-space-content > form,
  .settings-space-content > section {
    grid-template-columns: minmax(0, 1fr) minmax(22rem, 28rem) !important;
  }
}

@media (max-width: 640px) {
  .settings-fit-screen {
    padding-top: max(0.25rem, env(safe-area-inset-top)) !important;
    padding-right: max(0.35rem, env(safe-area-inset-right)) !important;
    padding-bottom: max(0.35rem, env(safe-area-inset-bottom)) !important;
    padding-left: max(0.35rem, env(safe-area-inset-left)) !important;
  }

  .settings-fit-screen > .relative.z-10 {
    max-width: calc(100vw - 0.7rem) !important;
    gap: 0.45rem !important;
  }

  .settings-fit-screen > .relative.z-10 > header {
    min-height: 2.85rem;
    border-radius: 1.25rem !important;
    padding: 0.35rem 0.55rem !important;
  }

  .settings-fit-screen > .relative.z-10 > header a {
    min-height: 2.55rem !important;
  }

  .settings-fit-screen > .relative.z-10 > header div {
    min-height: 2.5rem !important;
    max-width: 50vw;
    overflow: hidden;
    padding: 0.45rem 0.6rem !important;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .settings-space-shell {
    gap: 0.45rem !important;
    padding: 0.55rem !important;
  }

  .settings-space-shell > div:first-child {
    padding: 0.55rem !important;
  }

  .settings-space-shell > div:first-child p:last-child {
    display: none;
  }

  .settings-space-shell > div:first-child h1 {
    font-size: 1.55rem;
  }

  .settings-fit-screen [role="tablist"] {
    gap: 0.35rem !important;
    padding: 0.35rem !important;
  }

  .settings-fit-screen [role="tab"] {
    min-height: 3rem !important;
    padding: 0.45rem 0.35rem !important;
    font-size: 0.86rem !important;
  }

  .settings-space-content {
    padding: 0.15rem 0.1rem 1rem 0.1rem;
  }
}

@media (max-height: 700px) {
  .settings-fit-screen > .relative.z-10 > header {
    min-height: 2.75rem;
    padding-top: 0.3rem !important;
    padding-bottom: 0.3rem !important;
  }

  .settings-space-shell > div:first-child {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
  }

  .settings-space-shell > div:first-child p:last-child {
    display: none;
  }

  .settings-space-shell > div:first-child h1 {
    font-size: clamp(1.4rem, 3vw, 2rem);
  }
}
