/* Phone layout of the fixed bottom area: one bar with "Browse plans" and "Chat" (partials/mobile-bar.html).
   The floating chat bubble is hidden on phones so nothing covers the plan cards or the comparison table; while the
   cookie bar is open (html.it4-consent-open) it alone owns the bottom of the screen; the proactive greeting waits for
   the cookie answer (marketing-chat-proactive.js) and sits above the bar. */
.it4-mbar {
  display: none;
}

@media (max-width: 640px) {
  .it4-mbar {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 9988;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 8px 12px max(8px, env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, .14);
  }

  .it4-mbar-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1.5px solid var(--blue);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
  }

  .it4-mbar-chat {
    background: var(--blue-fill);
    color: #fff;
  }

  .it4-mbar-unread {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
  }

  .it4-mbar-unread[hidden] {
    display: none;
  }

  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }

  #chat-btn {
    display: none !important;
  }

  .it4-consent-open .it4-mbar,
  .it4-consent-open .chat-proactive {
    display: none;
  }

  .chat-proactive {
    bottom: calc(72px + env(safe-area-inset-bottom)) !important;
  }

  #chat-modal.minimized {
    bottom: calc(72px + env(safe-area-inset-bottom)) !important;
  }
}
