/* HAHUMI 6.99 — mobile chat should show all meaningful actions.
 * The 6.13 horizontal carousel hid the third and fourth actions on phones.
 * This is a layout-only fix: labels, actions, hero state, storage are unchanged. */
@media (max-width: 740px) {
  #homeView .chat-panel .quick-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px 16px 0;
    box-sizing: border-box;
    width: 100%;
    overflow: visible;
    align-items: stretch;
    justify-content: stretch;
  }
  #homeView .chat-panel .quick-row > button {
    flex: none;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    min-height: 44px;
    padding: 6px 7px;
    white-space: normal;
    font-size: clamp(12px, 3.55vw, 14px);
    line-height: 1.2;
    text-align: center;
    text-wrap: balance;
  }
  /* The old 120px-wide select clipped its actual choice to two letters
     on a 320px device; give it the full width of the chat content. */
  #homeView .chat-panel .chat-mode66 {
    display: block;
    flex: 0 0 auto;
    align-self: stretch !important;
    box-sizing: border-box;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    margin: 10px 0 0;
    padding: 0 16px;
  }
  /* The app moves the style-picker INTO .quick-row at runtime.
     In a two-column grid this is the fifth child; give it its own full row. */
  #homeView .chat-panel .quick-row > .chat-mode66 {
    grid-column: 1 / -1;
    display: block;
    justify-self: stretch;
    align-self: stretch;
    box-sizing: border-box;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    margin: 2px 0 0;
    padding: 0;
  }
  #homeView .chat-panel .quick-row > .chat-mode66 select {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 44px;
    min-width: 0;
  }
  #homeView .chat-panel .chat-mode66 select,
  #homeView .chat-panel #chatMode66 {
    display: block;
    box-sizing: border-box;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 44px;
    padding-inline: 14px 36px;
    font-size: 14px;
    text-overflow: ellipsis;
  }
  /* Chat is calm, not wastefully empty. Long conversations still scroll. */
  #homeView .chat-panel .chat-log {
    min-height: 116px;
    max-height: min(44svh, 390px);
    padding: 14px 16px 10px;
    gap: 8px;
  }
  #homeView .chat-panel .chat-form {
    min-width: 0;
    padding-inline: 16px;
  }
  #homeView .chat-panel .chat-form input {
    min-width: 0;
    flex: 1 1 auto;
  }
}
@media (min-width: 741px) and (max-width: 990px) {
  #homeView .chat-panel .quick-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: visible;
    gap: 8px;
    padding-inline: 18px;
  }
  #homeView .chat-panel .chat-log {
    min-height: 125px;
    max-height: min(46svh, 430px);
    padding: 14px 18px 10px;
  }
  #homeView .chat-panel .quick-row > .chat-mode66 {
    grid-column: span 2;
    min-width: 0;
    width: 100%;
  }
  #homeView .chat-panel .quick-row > .chat-mode66 select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  #homeView .chat-panel .quick-row > button {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 44px;
    white-space: normal;
    padding: 6px 8px;
    text-wrap: balance;
  }
}
