/* ============================================================
   PROFINANCE HUB V55.95 — HOME MOBILE RESPONSIVA
   Escopo: somente Home/Portal em telas <= 760px.
   Desktop preservado. Mesmas cores, cards e ícones já aprovados.
   ============================================================ */

.pf-mobile-menu-btn,
.pf-mobile-drawer,
.pf-mobile-backdrop{display:none}

@media (max-width:760px){
  html,body{width:100%;max-width:100%;overflow-x:hidden}
  body[data-module="portal"]{background:
    radial-gradient(ellipse 520px 320px at 12% -8%,rgba(139,63,240,.25),transparent 62%),
    radial-gradient(ellipse 430px 330px at 100% 0,rgba(245,121,42,.15),transparent 62%),
    var(--bg)}

  /* Cabeçalho: mesma identidade, composição própria para toque. */
  .topbar{position:sticky;top:0;z-index:40}
  .topbar-inner{width:100%;max-width:none;padding:10px 12px;gap:10px;min-width:0}
  .topbar-inner>img{width:150px!important;max-width:42vw;height:auto;min-width:0}
  .pf-mobile-menu-btn{
    display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;
    border:1px solid var(--border);border-radius:13px;background:var(--surface);
    color:var(--text);cursor:pointer;padding:0
  }
  .pf-mobile-menu-btn svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
  .userbox{margin-left:auto;gap:0;min-width:44px}
  .userbox .user-meta,
  .userbox>a.profile-btn,
  .userbox>button.profile-btn,
  .userbox>.pf-home-link,
  .userbox>.theme-icon-standard,
  .userbox>.logout{display:none!important}
  .userbox .avatar-frame{width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;max-width:44px!important;max-height:44px!important}

  /* Conteúdo principal */
  body[data-module="portal"] main{width:100%;max-width:none;margin:0;padding:22px 14px 64px;overflow:visible}
  .notice{margin-bottom:16px}

  /* Hero: mantém o mesmo card, apenas reorganiza. */
  .hero-shell{display:grid;grid-template-columns:1fr;gap:12px;margin-bottom:16px;min-width:0}
  .hero-card,.hero-stats,.tool-section{min-width:0;border-radius:22px}
  .hero-card{padding:22px 18px 20px;min-height:0}
  .hero-brand-mark{width:175px!important;height:175px!important;right:-62px!important;bottom:-48px!important;opacity:.16!important}
  .eyebrow{font-size:10px;letter-spacing:.14em}
  .hero-card h1{font-size:clamp(27px,8vw,34px)!important;line-height:1.06;margin:9px 0 10px;padding-right:12px}
  .hero-card p{font-size:13px;line-height:1.62;padding-right:8px}
  .hero-chips{gap:7px;margin-top:16px}
  .hero-chip{padding:8px 10px;font-size:10px}
  .hero-actions{margin-top:16px;display:block}
  .hero-btn{display:flex;min-height:44px;width:100%;justify-content:center;padding:10px 12px}

  /* Resumo em 2x2, igual ao desktop, sem desperdício vertical. */
  .hero-stats{padding:17px 15px}
  .stats-title{align-items:flex-start;gap:8px;margin-bottom:12px}
  .stats-title h2{font-size:15px}
  .stats-title p{font-size:11px;line-height:1.45}
  .access-pill{padding:7px 9px;font-size:9px;flex:0 0 auto}
  .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px!important}
  .stat-card{min-width:0;padding:13px 11px;border-radius:16px}
  .stat-card span{font-size:8.7px;letter-spacing:.055em;white-space:normal}
  .stat-card strong{font-size:17px;line-height:1.16;overflow-wrap:anywhere}
  .stat-card small{font-size:10.5px;line-height:1.4}

  /* Central de Operações: mesmo card e cores, composição vertical. */
  .central-launchpad{margin:0 0 16px!important;padding:0!important;min-width:0}
  .central-head{gap:10px;margin-bottom:12px!important}
  .central-head h2{font-size:20px!important}
  .central-head p{font-size:12px!important;line-height:1.5!important}
  .central-flow-pill{width:100%;white-space:normal!important;text-align:center;line-height:1.4;padding:8px 10px!important}
  .central-master-card{padding:16px!important;border-radius:21px!important;gap:14px!important;min-width:0}
  .central-master-brand{display:grid!important;grid-template-columns:62px minmax(0,1fr)!important;align-items:start!important;gap:12px!important;min-width:0}
  .central-master-logo{width:62px!important;height:62px!important;min-width:62px!important;border-radius:18px!important}
  .central-master-logo img{width:50px!important;height:50px!important}
  .central-master-brand h3{font-size:17px!important;margin:3px 0 6px!important}
  .central-master-brand p{font-size:11.5px!important;line-height:1.5!important;margin:0!important}
  .central-master-modules{grid-template-columns:1fr!important;gap:7px!important;padding:9px!important}
  .central-master-modules>b,.central-master-modules .or{display:none!important}
  .central-master-modules span:not(.or){justify-content:flex-start!important;min-height:46px!important;padding:6px 9px!important;font-size:9px!important}
  .central-master-modules img{width:32px!important;height:32px!important}
  .central-master-footer{gap:10px!important}
  .central-master-footer .central-tags{gap:6px!important}
  .central-master-footer .central-tags span{font-size:9px!important;padding:7px 9px!important}
  .central-master-footer .central-open{width:100%;min-width:0!important;min-height:44px;display:flex!important;align-items:center;justify-content:center;text-align:center;font-size:9.5px!important}

  /* Seções e cards: exatamente a mesma família visual do desktop. */
  .tool-section{padding:16px 14px 17px;margin-top:12px;border-radius:22px}
  .section-head{align-items:flex-start;flex-direction:column;gap:8px;margin-bottom:13px}
  .section-title{font-size:17px}
  .section-desc{font-size:11.5px;line-height:1.5;margin-top:4px}
  .section-pill{padding:7px 9px;font-size:8.5px;white-space:normal;line-height:1.35}
  .cards{grid-template-columns:1fr!important;gap:11px!important;min-width:0}
  .card{width:100%;min-width:0;min-height:0!important;padding:18px 17px 16px!important;border-radius:21px!important}
  .card:hover{transform:none}
  .card-top{margin-bottom:14px}
  #businessCards .card .tool-icon,
  #operationCards .card .tool-icon{width:62px!important;height:62px!important;min-width:62px!important;border-radius:19px!important}
  #businessCards .card .tool-icon>svg{width:32px!important;height:32px!important}
  #operationCards .card .tool-icon>img.brand-logo{width:46px!important;height:46px!important}
  .card-badge{padding:6px 9px;font-size:8.5px}
  .card h3{font-size:16.5px;margin-bottom:7px}
  .card p{font-size:12px;line-height:1.52;margin-bottom:13px}
  .card-tags{gap:6px;margin-bottom:13px}
  .card-tags span{padding:6px 8px;font-size:9.5px}
  .open{font-size:10px;line-height:1.4;overflow-wrap:anywhere}
  .footer{margin-top:26px;padding:0 8px;font-size:9px;line-height:1.5}

  /* Login e perfil também não podem estourar a largura. */
  .profile-panel,.profile-modal-body,.profile-modal-head,.profile-modal-actions{max-width:100%;min-width:0}
  .profile-modal-actions button{min-height:44px}

  /* Drawer mobile */
  .pf-mobile-backdrop{
    display:block;position:fixed;inset:0;z-index:90;background:rgba(5,3,18,.72);
    opacity:0;visibility:hidden;pointer-events:none;transition:opacity .18s ease,visibility .18s ease
  }
  .pf-mobile-drawer{
    display:flex;position:fixed;z-index:91;left:0;top:0;bottom:0;width:min(86vw,330px);
    flex-direction:column;padding:16px 14px calc(18px + env(safe-area-inset-bottom));
    background:linear-gradient(165deg,rgba(29,20,65,.995),rgba(13,9,32,.998));
    border-right:1px solid var(--border);box-shadow:26px 0 70px rgba(0,0,0,.42);
    transform:translateX(-104%);transition:transform .2s ease;overflow-y:auto
  }
  .pf-mobile-drawer.open{transform:translateX(0)}
  .pf-mobile-backdrop.open{opacity:1;visibility:visible;pointer-events:auto}
  .pf-mobile-drawer-head{display:flex;align-items:center;gap:12px;padding:2px 2px 15px;border-bottom:1px solid rgba(155,123,255,.14)}
  .pf-mobile-drawer-head img{width:142px;height:auto;min-width:0}
  .pf-mobile-drawer-close{margin-left:auto;width:44px;height:44px;flex:0 0 44px;border-radius:13px;border:1px solid var(--border);background:var(--surface2);color:var(--text);font-size:22px;cursor:pointer}
  .pf-mobile-nav{display:grid;gap:8px;padding-top:14px}
  .pf-mobile-nav a,.pf-mobile-nav button{
    min-height:48px;width:100%;display:flex;align-items:center;gap:11px;padding:10px 12px;
    border:1px solid rgba(155,123,255,.17);border-radius:14px;
    background:linear-gradient(155deg,rgba(36,25,80,.86),rgba(17,11,43,.88));
    color:var(--text);text-decoration:none;text-align:left;font-weight:700;font-size:12px;cursor:pointer
  }
  .pf-mobile-nav svg{width:20px;height:20px;flex:0 0 20px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;color:var(--purple)}
  .pf-mobile-nav .danger{color:#ff9cab}
  .pf-mobile-nav .danger svg{color:#ff6e82}
  body.pf-mobile-menu-open{overflow:hidden}
}

@media (max-width:365px){
  .topbar-inner>img{width:132px!important}
  .stats-grid{grid-template-columns:1fr!important}
  .central-master-brand{grid-template-columns:54px minmax(0,1fr)!important}
  .central-master-logo{width:54px!important;height:54px!important;min-width:54px!important}
  .central-master-logo img{width:43px!important;height:43px!important}
}
