/* HAHUMI 7.36 — phone room, variant C from HAHUMI Studio (Figma): «talk is at hand».
 * The room takes the top of the screen; right under it a paper sheet slides up with the quick replies and the input,
 * so talking needs no scrolling. Chat history, the «remember» switch, mood and shelf follow below. Phones only (≤740 px). */
@media (max-width:740px){
  /* 1. the room: shorter, so the sheet fits on the first screen (nav bar ≈ 81 px, visible sheet ≈ 220 px) */
  #homeView .stage{height:calc(100dvh - var(--rail728,60px) - var(--head728,65px) - 81px - 222px)!important;min-height:280px!important;max-height:540px}
  #homeView .stage .hero-art{bottom:15%!important;width:min(64%,270px)!important}
  #homeView .stage .care69-btn{min-height:46px!important;height:46px}

  /* 2. order: room → talk sheet → neighbours note → the rest */
  #homeView .home-grid>.stage{order:1}
  #homeView .home-grid>.chat-panel{order:2}
  #homeView .home-grid>#stageNote628{order:3}

  /* 3. the sheet: paper, rounded top, a grip, lifted over the bottom of the room */
  #homeView .chat-panel{margin-top:-26px!important;position:relative;z-index:3;border-radius:28px 28px 22px 22px!important;
    padding:8px 14px 14px!important;box-shadow:0 -8px 18px rgba(60,40,20,.16),0 3px 0 #d4b07f,0 5px 0 #8a6340!important}
  #homeView .chat-panel::before{content:"";display:block;width:44px;height:5px;margin:2px auto 6px;border-radius:3px;background:#d4b07f;flex:none}
  html body #homeView .chat-panel>.chat-heading{order:0;min-height:0!important;padding:0 0 6px!important;margin:0!important;border:0!important;gap:8px!important;flex-wrap:nowrap!important}
  html body #homeView .chat-panel>.chat-heading .chat62-clear{min-height:34px!important;padding:4px 12px!important;font-size:12px!important}
  #homeView .chat-panel>.chat-heading .chat-hero621{display:none!important}
  #homeView .chat-panel>.chat-heading h2,#homeView .chat-panel>.chat-heading strong{font-size:17px!important}
  /* all four quick actions in ONE visible row (6.99 rule: never hide them in a carousel); the style picker below */
  html body #homeView .chat-panel>.quick-row{order:1;display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:6px!important;
    padding:0 0 8px!important;overflow:visible!important}
  html body #homeView .chat-panel>.quick-row>button{min-height:44px!important;padding:4px 3px!important;font-size:12px!important;line-height:1.15!important}
  html body #homeView .chat-panel>.quick-row>.chat-mode66{grid-column:1/-1!important;margin:0!important}
  html body #homeView .chat-panel>.chat-form{order:2;margin:0!important;padding:0!important}
  #homeView .chat-panel>.chat-log{order:3;margin-top:10px}
  #homeView .chat-panel>.chat-note{order:4}
  /* the empty-chat postcard steps aside: the hero already speaks in the room bubble */
  #homeView .chat-panel>.chat-log:has(>.chat716-hint:only-child){display:none}
}
/* short phones (iPhone SE and alike): the room gives a little more so the input stays above the nav bar */
@media (max-width:740px) and (max-height:700px){
  #homeView .stage{min-height:236px!important}
  #homeView .stage .hero-art{width:min(46%,180px)!important;bottom:22%!important}
}
/* 7.36 street top bar: the «★ Name · Favourite · home now» chip never runs past the right edge */
body[data-welcome="1"] .pet-rail{max-width:min(46vw,420px);min-width:0;overflow:hidden}
body[data-welcome="1"] .pet-rail .rail624-txt{min-width:0;overflow:hidden}
body[data-welcome="1"] .pet-rail .rail624-txt small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
