/* Mobile layout: keep the desktop dashboard unchanged. */
@media (max-width: 820px) {
  html, body { touch-action: auto; }
  body { font-size: 16px; line-height: 1.5; font-family: "DM Sans", system-ui, sans-serif; }
  body :is(h1,h2,h3,h4,b,strong,.cc-logo,.cc-tier,.cc-number,.initials) { font-family: "Plus Jakarta Sans", system-ui, sans-serif; }
  button,input,select,textarea { font-family: inherit; }
  main { padding: 0 16px 32px; }
  main > *, .panel-head > div, .profile-data, .wallet-info,
  .movement .mv-left, .quick-card > div, .internal-info > div { min-width: 0; }
  main section { scroll-margin-top: 84px; }
  .topline { height: auto; min-height: 112px; padding: 20px 0; }
  .topline h1 { font-size: 26px; line-height: 1.25; overflow-wrap: anywhere; }
  .topline p, .hero-copy > p, .wallet-info > p { font-size: 15px; }
  .eyebrow, .status, .tier-pill { font-size: 12px; }
  .mobile-right button { min-width: 44px; min-height: 44px; }
  .mobile-right { gap: 4px; }
  .mobile-right .avatar { width: 36px; height: 36px; font-size: 13px; }
  .hero-balance { min-height: 0; height: auto; padding: 24px 20px; border-radius: 20px; }
  .hero-copy { width: 100%; }
  .hero-copy h2 { font-size: clamp(28px, 8vw, 44px); letter-spacing: -1px; flex-wrap: wrap; gap: 5px; }
  .hero-copy h2 strong { min-width: 0; overflow-wrap: anywhere; }
  .hero-copy h2 span, .hero-copy h2 small { font-size: 18px; }
  .balance-caption { font-size: 12px; opacity: .9; gap: 12px; flex-wrap: wrap; }
  .hero-actions { gap: 10px; }
  .hero-actions a, .hero-actions button { flex: 1; min-height: 48px; height: auto; padding: 12px; font-size: 15px; justify-content: center; text-decoration: none; }
  .hero-right { position: relative; inset: auto; width: 100%; height: auto; margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; transform: none; }
  .hero-ring { position: relative; inset: auto; grid-column: 1 / -1; grid-row: 1; width: 160px; height: 160px; margin: 0 auto 8px; transform: none; animation: none; }
  .ring-center span, .ring-center small { font-size: 12px; opacity: .9; }
  .ring-center b { font-size: 32px; }
  .floating-chip { position: static; padding: 10px; gap: 7px; animation: none; box-shadow: none; }
  .floating-chip i { flex: 0 0 28px; }
  .floating-chip b { font-size: 12px; }
  .floating-chip small { font-size: 11px; color: #52675b; }
  .quick-card, .due-card { padding: 16px; gap: 12px; }
  .quick-icon, .due-icon, .bank-symbol, .transfer-orb, .mini-icon { flex-shrink: 0; }
  .quick-card span, .quick-card small, .due-card span, .due-card small,
  .metrics span, .metrics small, .bank-main span, .bank-main small,
  .bank-number span, .internal-info p, .internal-number small,
  .section-top p, .credit-row span, .features span { font-size: 13px; color: #52675b; }
  .quick-card b, .due-card b, .metrics b, .bank-main b, .bank-number b { font-size: 16px; overflow-wrap: anywhere; }
  .due-icon span { font-size: 20px; }
  .due-icon small { font-size: 11px; }
  .due-icon { height: 58px; }
  .quick-card button, .bank-number button, .close { min-width: 44px; min-height: 44px; flex-shrink: 0; }
  .status-panel, .bank-panel, .client-section { padding: 18px; }
  .panel-head { gap: 10px; flex-wrap: wrap; }
  .panel-head h3, .client-section .panel-head h3 { font-size: 17px; }
  .panel-head p, .client-section .panel-head p { font-size: 13px; color: #52675b; }
  .active-badge { font-size: 11px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metrics > div { padding: 12px; min-width: 0; }
  .text-btn, .internal-number button { min-height: 44px; font-size: 14px; }
  .internal { padding: 18px; }
  .internal-info { align-items: flex-start; }
  .internal-info > div:last-child > span { font-size: 11px; }
  .internal-info h3 { font-size: 16px; }
  .internal-number strong { font-size: 17px; margin-left: 0; overflow-wrap: anywhere; }
  .section-top { flex-wrap: wrap; gap: 12px; }
  .section-top p { max-width: none; }
  .section-top > a { font-size: 14px; min-height: 44px; display: inline-flex; align-items: center; }
  .card-wrap { padding: 8px 0 20px; }
  .credit-card { transform: none; width: 100%; height: 230px; }
  .cc-number { font-size: 14px; letter-spacing: 1px; }
  .cc-tier, .cc-bottom b { font-size: 12px; }
  .cc-tier small, .cc-bottom small { font-size: 10px; }
  .cc-bottom { gap: 12px; }
  .cc-bottom > div { min-width: 0; }
  .cc-bottom b { overflow-wrap: anywhere; }
  .credit-row { gap: 16px; flex-wrap: wrap; }
  .credit-row b { font-size: 18px; }
  .profile-data { min-width: 0; width: 100%; grid-template-columns: 1fr; }
  .data-item span, .photo-hint, .movement small, .ticket-item small,
  .mv-tag, .bubble small, .chat-head small { font-size: 12px; }
  .data-item b, .movement strong, .ticket-item strong, .mv-right b { font-size: 15px; }
  .photo-btn, .hfilter, .help-btn { font-size: 14px; min-height: 44px; padding: 12px 14px; }
  .movement { flex-wrap: wrap; gap: 10px; }
  .movement .mv-left { flex: 1 1 160px; }
  .mv-right { margin-left: auto; }
  .help-card h4 { font-size: 17px; }
  .help-card p, .faq summary, .faq p, .empty, .bubble { font-size: 14px; }
  .faq summary { min-height: 44px; display: flex; align-items: center; }
  .modal { padding: 12px; }
  .modal-box { width: 100%; max-width: 470px; max-height: calc(100dvh - 24px); overflow-y: auto; padding: 24px 18px; }
  .modal-box h2 { padding-right: 38px; font-size: 23px; }
  .modal-box p, .modal-box label, .available-note span, .field-error { font-size: 14px; }
  .modal-box label[style] { font-size: 14px !important; }
  .support-form, .withdraw-fields, .third-party.show { grid-template-columns: 1fr; }
  .support-form input, .support-form select, .support-form textarea,
  .withdraw-fields input, .withdraw-fields select, .withdraw-fields textarea,
  .chat-input input { font-size: 16px; min-height: 44px; min-width: 0; }
  .withdraw-fields input[type="checkbox"] { min-height: 24px; width: 24px !important; flex-shrink: 0; }
  .confirm { font-size: 15px; min-height: 48px; height: auto; padding: 12px; }
  .available-note { gap: 12px; flex-wrap: wrap; }
  .available-note b { font-size: 17px; }
  .chat-box { padding: 0; }
  .chat-head b { font-size: 17px; padding-right: 38px; }
  .chat-thread { min-height: 120px; }
  .late-alert, .late-alert span, .late-alert a { font-size: 14px; }
  footer { margin-left: 0; width: 100%; padding: 32px 20px calc(130px + env(safe-area-inset-bottom)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 18px; }
  .footer-grid p { font-size: 14px; color: #b8c9bf; }
  .footer-grid h4 { font-size: 15px; margin-bottom: 10px; }
  .footer-grid > div > a { font-size: 14px; color: #c0cec6; min-height: 44px; margin: 0; padding: 10px 0; overflow-wrap: anywhere; }
  .social { flex-wrap: wrap; gap: 8px; }
  .social a { width: 44px !important; height: 44px; font-size: 16px; text-decoration: none; }
  .footer-bottom { font-size: 12px; color: #b8c9bf; line-height: 1.7; }
  .footer-bottom span + span { margin-top: 8px; }
  body .bottom-nav { bottom: 0; left: 0; right: 0; height: auto; min-height: 72px; border-radius: 18px 18px 0 0; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  body .bottom-nav a { min-width: 0; padding: 4px 2px; font-size: 22px; text-decoration: none; line-height: 1.25; }
  body .bottom-nav a small { font-size: 11px; line-height: 1.25; margin-top: 4px; }
  body[data-view="profile"] main, body[data-view="history"] main { padding-bottom: 150px; }
  .sidebar.client-menu-open { bottom: calc(78px + env(safe-area-inset-bottom)); }
  .sidebar nav a, .sidebar .logout { font-size: 14px; min-height: 48px; height: auto; }
  .sidebar .side-label { font-size: 11px; }
  .sidebar .support-card b { font-size: 14px; }
  .sidebar .support-card small, .sidebar .support-card a { font-size: 12px; }
  .chat-launcher { bottom: calc(86px + env(safe-area-inset-bottom)); right: 12px; padding: 12px 15px; }
  .conversation-hub { right: 12px; bottom: calc(146px + env(safe-area-inset-bottom)); max-height: calc(100dvh - 170px); }
  .toast { bottom: calc(146px + env(safe-area-inset-bottom)); left: 16px; right: 16px; font-size: 14px; }
}
@media (max-width: 360px) {
  .floating-chip { flex-direction: column; align-items: flex-start; }
  .metrics { grid-template-columns: 1fr; }
  .credit-card { padding: 18px; }
}
