/* TRK-1036: the settings panel folds away, and Ask AI sits in the middle of the top bar after the device buttons */
.pe-body.is-settings-hidden { --pe-inspector: 0px; }
.pe-body.is-settings-hidden .pe-inspector { display: none; }
.pe-inspector-head .pe-settings-fold-head { margin-left: auto; }
.pe-top-mid { gap: 8px; }
.pe-top-mid .pe-ask-ai { margin-right: 0; }

/* Narrower: the device buttons go, Ask AI stays */
@media (max-width: 960px) {
  .pe-top { grid-template-columns: minmax(0, 1fr) auto auto; }
  .pe-top-mid { display: flex; }
  .pe-top-mid .pe-devices { display: none; }
}

/* Phone-sized: settings open as a sheet from the bottom, so there's nothing to fold */
@media (max-width: 760px) {
  .pe-settings-fold, .pe-settings-fold-head { display: none; }
  .pe-body.is-settings-hidden .pe-inspector.is-open { display: block; }
}

/* A phone: the page's name gives way (rather than shrinking to a stray letter), so nothing runs under Ask AI */
@media (max-width: 480px) {
  .pe-top { gap: 6px; }
  .pe-top-start { overflow: hidden; }
  .pe-top-start .pe-name-box, .pe-top-start .funnel-step-pick { display: none; }
}
