/* Sofia on a phone, drawn for a phone.
   The glass cards, the sky and the plane stay: that is the brand. What changes is
   the order of things. Four controls of one weight made a staircase, so each now
   has its own voice: the tabs are plain text with a rule under the active one, the
   mode switch is a glass pill on the sky, Flights and Hotels are the one loud
   gradient control, and the trip type is a quiet row of chips. The fields scroll,
   the action stays put, and the keyboard takes room from the chrome, never from
   the field being typed in. Loaded after app.css; desktop is untouched. */

@media (max-width: 899px) {
  #view-assistant {
    --glass: rgba(255, 255, 255, 0.72);
    --glass-edge: rgba(255, 255, 255, 0.95);
    --ink: #10224f;
    --ink-soft: #6b7a9c;
  }

  #view-assistant .desk {
    padding: 0.2rem 0.55rem 0.5rem;
    row-gap: 0.3rem;
  }

  /* --- Tabs: plain text, one gradient rule under the open one ------------- */
  #view-assistant .desk-tabs {
    gap: 0;
    padding: 0 0.25rem;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }

  #view-assistant .desk-tab {
    min-height: 2.5rem;
    padding: 0 0.4rem;
    border-radius: 0;
    background: none;
    color: var(--ink-soft);
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: none;
  }

  #view-assistant .desk-tab[aria-selected="true"] {
    background: none;
    color: var(--ink);
    box-shadow: none;
  }

  #view-assistant .desk-tab::before {
    content: "";
    position: absolute;
    inset-inline: 22%;
    bottom: 0.15rem;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, #3d6bff, #7a3bf0);
    transform: scaleX(0);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  }

  #view-assistant .desk-tab[aria-selected="true"]::before {
    transform: scaleX(1);
  }

  /* --- Search header: the sky, the title and the mode pill on one row ------ */
  #view-assistant .desk-main-head {
    display: block;
    min-height: 0;
    padding: 0.55rem 0.7rem 0.4rem;
  }

  #view-assistant .desk-head-top {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
  }

  #view-assistant .desk-main-head .desk-head-plane {
    display: none;
  }

  #view-assistant .desk-main-head .desk-head-copy {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
  }

  #view-assistant .desk-main-head .desk-title {
    overflow: hidden;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #view-assistant .desk-modes {
    display: block;
    flex: 0 1 auto;
    min-width: 0;
  }

  #view-assistant .desk-mode-pair {
    display: inline-grid;
    grid-auto-flow: column;
    grid-auto-columns: auto;
    max-width: 100%;
    gap: 1px;
    padding: 3px;
    border: 1px solid var(--glass-edge);
    background: var(--glass);
    box-shadow: 0 6px 18px rgba(40, 80, 140, 0.1);
    backdrop-filter: blur(14px) saturate(1.3);
  }

  #view-assistant .desk-mode {
    min-height: 2rem;
    padding: 0 0.6rem;
    font-size: 0.82rem;
  }

  #view-assistant .desk-mode-sofia {
    padding-inline: 0.25rem 0.6rem;
  }

  #view-assistant .desk-search-bar {
    margin-top: 0.45rem;
  }

  /* --- Phone: the kind and trip-type row is a little tighter ---------------- */
  #view-assistant .classic-tools {
    padding: 0.1rem 0.75rem 0.35rem;
  }

  #view-assistant .classic-tools .classic-switch-option {
    padding: 0.15rem 0.2rem;
    font-size: 0.68rem;
    line-height: 1.1;
  }

  /* --- The form: the fields scroll, the action stays put ------------------- */
  #view-assistant .desk-main-body,
  #view-assistant .classic-tools,
  #view-assistant .classic-fields,
  #view-assistant .classic-foot {
    min-width: 0;
    max-width: 100%;
  }

  #view-assistant .desk-classic {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
  }

  #view-assistant .classic-card {
    padding: 0.4rem 0 0.15rem;
  }

  #view-assistant .classic,
  #view-assistant .classic-card,
  #view-assistant .classic-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
  }

  #view-assistant .classic-form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
  }

  #view-assistant .classic-fields {
    flex: 1 1 auto;
    min-height: 0;
    gap: 0.7rem;
    padding: 0 0.75rem 1rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }

  #view-assistant .classic-fields::-webkit-scrollbar {
    display: none;
  }

  #view-assistant .classic-foot {
    flex: none;
    padding: 0.5rem 0.75rem 0.3rem;
  }

  /* Together folds the form to one line and leaves the rest to the chat. */
  #view-assistant .classic.is-shut .classic-body {
    display: none;
  }

  /* --- Options and the trip: lighter headers ------------------------------ */
  #view-assistant .desk-offers-head,
  #view-assistant .desk-trip-head {
    min-height: 0;
    padding: 0.7rem 0.85rem 0.5rem;
  }

  #view-assistant .desk-offers-head .desk-title {
    font-size: 1.5rem;
  }

  #view-assistant .desk-trip-case {
    width: auto;
    height: 3.8rem;
  }

  #view-assistant .desk-scroll {
    overscroll-behavior: contain;
  }

  /* --- Keyboard up: the chrome steps aside, the field keeps the room ------- */
  html.is-keyboard:has(#view-assistant.is-active) .mobar {
    height: var(--safe-t, 0px);
    min-height: var(--safe-t, 0px);
    padding: 0;
    overflow: hidden;
  }

  html.is-keyboard:has(#view-assistant.is-active) .mobar > * {
    display: none;
  }

  html.is-keyboard #view-assistant .desk-tabs,
  html.is-keyboard #view-assistant .desk-main-head,
  html.is-keyboard #view-assistant .classic-tools {
    display: none;
  }

  html.is-keyboard #view-assistant .desk {
    padding: 0;
  }

  html.is-keyboard #view-assistant .desk-main,
  html.is-keyboard #view-assistant .desk-offers,
  html.is-keyboard #view-assistant .desk-trip {
    border-radius: 0;
  }
}
