/* PsicoOn — arquitetura responsiva consolidada.
 * Mobile < 640px | Tablet 640–1023px | Desktop >= 1024px.
 * Carregado por último: concentra todos os ajustes de viewport. */
:root{--po-sidebar-admin:17rem;--po-sidebar-clinical:15rem;--po-touch:2.75rem;--po-page-gutter:clamp(.75rem,2.4vw,2.75rem);--po-section-gap:clamp(1rem,2vw,1.5rem)}
html,body{width:100%;max-width:100%;overflow-x:hidden;-webkit-text-size-adjust:100%}
*,*::before,*::after{box-sizing:border-box}
img,svg,video,canvas,iframe{max-width:100%;height:auto}
.psicoon-app,.psicoon-layout,.psicoon-main,.po-control-shell,.po-control-main,.po-control-content,.psicoon-sales-page,.pso-modal,.po-profile-layout,.po-dashboard-grid{min-width:0;max-width:100%}
.psicoon-app :where(p,li,dd,td,th,a,span,strong,small),.po-control-shell :where(p,li,dd,td,th,a,span,strong,small),.pso-modal :where(p,li,label){overflow-wrap:anywhere;word-break:break-word}

/* Interação e formulários fluidos. */
.psicoon-app :where(button,.button,.psicoon-btn,.po-control-primary),.po-control-shell :where(button,.button,.po-control-primary),.pso-modal :where(button,.button,.pso-button){min-height:var(--po-touch)}
.psicoon-app :where(input:not([type=checkbox]):not([type=radio]):not([type=button]):not([type=submit]):not([type=reset]):not([type=hidden]):not([type=file]):not([type=color]),select,textarea),.po-control-shell :where(input:not([type=checkbox]):not([type=radio]):not([type=button]):not([type=submit]):not([type=reset]):not([type=hidden]):not([type=file]):not([type=color]),select,textarea),.pso-modal :where(input:not([type=checkbox]):not([type=radio]):not([type=button]):not([type=submit]):not([type=reset]):not([type=hidden]):not([type=file]):not([type=color]),select,textarea){width:100%;max-width:100%;min-height:var(--po-touch);font-size:1rem}
.psicoon-app :where(input[type=checkbox],input[type=radio]),.po-control-shell :where(input[type=checkbox],input[type=radio]),.pso-modal :where(input[type=checkbox],input[type=radio]){min-width:1.375rem;min-height:1.375rem}
textarea{resize:vertical}

/* Cards e indicadores se reorganizam sem largura rígida. */
.psicoon-card-grid,.psicoon-tool-grid,.psicoon-script-list,.psicoon-upgrade-grid,.po-metric-grid,.po-review-stats,.psicoon-plan-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,17.5rem),1fr));gap:var(--po-section-gap)}
.psicoon-stats,.psicoon-subscription-card,.po-overview-aside{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,14rem),1fr));gap:var(--po-section-gap)}
.psicoon-page-head,.po-overview-title,.po-panel-head,.po-review-toolbar,.po-migration-heading,.po-storage-card,.po-control-top,.po-review-welcome,.po-admin-review-summary,.po-admin-cancellation-summary,.pso-form-footer{flex-wrap:wrap;min-width:0;gap:clamp(.625rem,1.5vw,1.125rem)}
.psicoon-page-head>*,.po-overview-title>*,.po-panel-head>*,.po-control-heading,.po-review-toolbar>*,.po-migration-heading>*{min-width:0}
.psicoon-page-head h1,.po-overview-title h2,.po-detail-heading h2{font-size:clamp(1.75rem,2vw + 1rem,2.875rem);line-height:1.08}

/* O scroll horizontal pertence à tabela, nunca à janela. */
.po-review-table-wrap,.po-members-table-wrap,.po-migration-table-wrap,.psicoon-table-wrap,.psicoon-payment-history>div,.po-control-content>.wrap,.po-directory{width:100%;max-width:100%;min-width:0}
.po-review-table-wrap,.po-members-table-wrap,.po-migration-table-wrap,.psicoon-payment-history>div,.po-directory{overflow-x:auto;overflow-y:visible;-webkit-overflow-scrolling:touch;overscroll-behavior-inline:contain;scrollbar-gutter:stable}
.po-review-table,.po-members-table,.po-migration-access-table,.psicoon-payment-history table{width:100%;max-width:100%}

/* Modais e drawers permanecem dentro da viewport. */
.po-member-dialog,.po-review-box,.pso-modal,.po-member-editor[open]>.po-member-form{width:min(90vw,56.25rem);max-width:90vw;max-height:90dvh;overflow-y:auto;overscroll-behavior:contain}
.po-member-dialog{margin:auto;padding:0;border-radius:1.125rem}
.po-member-dialog .po-member-form{position:static;width:100%;max-width:none;max-height:none;margin:0;padding:clamp(3.75rem,6vw,4.5rem) clamp(1rem,3vw,2rem) 2rem;overflow:visible;transform:none}
.po-member-dialog-close{position:sticky;top:.75rem;z-index:6;float:right;min-width:4.75rem;min-height:var(--po-touch);margin:.75rem .75rem -3.5rem 0}
body.po-member-modal-open{overflow:hidden}
.po-member-grid,.po-json-import-form,.pso-fields-grid,.pso-payment-grid,.po-grid{min-width:0}
.po-form-actions,.po-nav,.po-nav-actions,.po-decision-buttons,.psicoon-upgrade-actions{flex-wrap:wrap;gap:.625rem}

/* Editores incorporados: moldura fluida e canvas interno escalável. */
.psicoon-studio-shell{width:min(100%,70rem)!important;max-width:70rem!important;min-width:0;margin-inline:auto;overflow:hidden}
.psicoon-studio-shell--flyer{width:min(100%,66rem)!important;max-width:66rem!important}
.psicoon-studio-frame{display:block;width:100%;max-width:100%;height:min(72dvh,46rem)!important;min-height:36rem!important;border:0}
.po-review-pagination{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.75rem;padding:1rem 1.25rem;border-top:1px solid #e8e2d8;background:#fff}
.po-review-pagination>span{color:#66736b;font-size:.8125rem}.po-review-pagination ul{display:flex;align-items:center;flex-wrap:wrap;gap:.375rem;margin:0;padding:0;list-style:none}.po-review-pagination a,.po-review-pagination .current{display:grid;place-items:center;min-width:2.75rem;min-height:2.75rem;padding:.375rem .75rem;border:1px solid #ded6ca;border-radius:.625rem;text-decoration:none}.po-review-pagination .current{background:#1a2e22;border-color:#1a2e22;color:#fff}

/* Desktop — sidebar estável sem empurrar o conteúdo para fora. */
@media (min-width:1024px){
 body.psicoon-fullscreen-dashboard .po-control-shell{display:grid;grid-template-columns:var(--po-sidebar-admin) minmax(0,1fr);width:100%;max-width:100%}
 body.psicoon-fullscreen-dashboard .po-control-sidebar{position:sticky;top:0;align-self:start;width:var(--po-sidebar-admin);min-width:0;height:100dvh;overflow-y:auto}
 body.psicoon-fullscreen-dashboard .po-control-main{width:100%;min-width:0}
 body.psicoon-fullscreen-dashboard .po-control-content{width:100%;max-width:107.5rem;margin-inline:auto;padding:clamp(1.5rem,2.4vw,2.625rem)}
 body.psicoon-fullscreen-dashboard .po-control-top{position:relative;top:auto;width:100%;min-height:4.75rem;padding:.75rem var(--po-page-gutter);flex-wrap:nowrap!important}
 body.psicoon-fullscreen-dashboard .po-control-heading{flex:1 1 20rem;min-width:12rem}
 body.psicoon-fullscreen-dashboard .po-global-search{flex:1 1 18rem;min-width:10rem;max-width:35rem;margin-left:0}
 body.psicoon-fullscreen-dashboard .po-control-user{display:grid;place-items:center;align-self:center;margin:0}
 body.psicoon-fullscreen-dashboard .po-control-menu{display:none}
 body.psicoon-standalone-shell .psicoon-layout{display:grid;grid-template-columns:var(--po-sidebar-clinical) minmax(0,1fr);width:100%}
 body.psicoon-standalone-shell .po-clinical-sidebar,body.psicoon-standalone-shell .psicoon-sidebar{position:sticky;top:0;align-self:start;width:var(--po-sidebar-clinical);min-width:0;height:100dvh;overflow-y:auto}
 body.psicoon-standalone-shell .psicoon-main{width:100%;min-width:0;padding:clamp(1.75rem,3vw,3.375rem)}
}

/* Tablet — navegação em drawer e conteúdo com 100% da largura útil. */
@media (max-width:1023px){
 body.psicoon-fullscreen-dashboard .po-control-shell,body.psicoon-standalone-shell .psicoon-layout{display:block;width:100%}
 body.psicoon-fullscreen-dashboard .po-control-sidebar,body.psicoon-standalone-shell .po-clinical-sidebar,body.psicoon-standalone-shell .psicoon-sidebar{position:fixed!important;inset:0 auto 0 0!important;left:0!important;width:min(86vw,18.25rem)!important;max-width:18.25rem;height:100dvh!important;padding:1.5rem 1.125rem!important;overflow-y:auto;transform:translateX(-105%);transition:transform .22s ease;z-index:100001!important}
 body.psicoon-standalone-shell .po-clinical-sidebar,body.psicoon-standalone-shell .psicoon-sidebar{top:3.75rem!important;height:calc(100dvh - 3.75rem)!important;z-index:9999!important}
 body.psicoon-fullscreen-dashboard .po-control-shell.is-menu-open .po-control-sidebar,body.psicoon-standalone-shell .psicoon-app.menu-open .po-clinical-sidebar,body.psicoon-standalone-shell .psicoon-app.menu-open .psicoon-sidebar{transform:translateX(0)}
 body.psicoon-fullscreen-dashboard .po-control-shell.is-menu-open::after,body.psicoon-standalone-shell .psicoon-app.menu-open::after{content:"";position:fixed;inset:0;z-index:100000;background:rgb(8 20 13/48%);backdrop-filter:blur(2px)}
 body.psicoon-standalone-shell .psicoon-app.menu-open::after{top:3.75rem;z-index:9998}
 body.psicoon-fullscreen-dashboard .po-control-menu,body.psicoon-standalone-shell .psicoon-menu-toggle{display:inline-flex!important;align-items:center;justify-content:center;flex:0 0 var(--po-touch);width:var(--po-touch);height:var(--po-touch)}
 body.psicoon-fullscreen-dashboard .po-control-main,body.psicoon-standalone-shell .psicoon-main{width:100%;min-width:0}
 body.psicoon-fullscreen-dashboard .po-control-top,body.psicoon-standalone-shell .po-clinical-top,body.psicoon-standalone-shell .psicoon-top{position:sticky!important;top:0!important;width:100%;min-height:3.75rem;padding:.5rem 1rem!important;z-index:10000!important}
 body.psicoon-fullscreen-dashboard .po-control-content,body.psicoon-standalone-shell .psicoon-main{width:100%;padding:clamp(1rem,3vw,1.75rem)!important}
 body.psicoon-fullscreen-dashboard .po-global-search{order:4;flex:1 1 100%;width:100%;max-width:none;margin:0}
 body.psicoon-fullscreen-dashboard .po-control-heading{flex:1 1 14rem;min-width:0!important}
 body.psicoon-fullscreen-dashboard .po-control-top h1{margin:0;font-size:clamp(1.125rem,3vw,1.375rem);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 body.psicoon-fullscreen-dashboard .po-control-heading small,body.psicoon-fullscreen-dashboard .po-control-heading p{display:none}
 body.psicoon-fullscreen-dashboard .po-review-layout,body.psicoon-fullscreen-dashboard .po-review-columns,body.psicoon-fullscreen-dashboard .psicoon-import-grid,body.psicoon-fullscreen-dashboard .po-overview-grid,body.psicoon-fullscreen-dashboard .po-chart-grid,body.psicoon-standalone-shell .po-profile-layout,body.psicoon-standalone-shell .po-dashboard-grid{grid-template-columns:minmax(0,1fr)!important}
 .po-public-preview{position:static!important}
 .po-review-table,.po-members-table,.po-migration-access-table,.psicoon-payment-history table{min-width:47.5rem}
}

/* Listagens administrativas: tabela no desktop, cartões legíveis em telas menores. */
.po-members-table th,.po-members-table td,.po-review-table th,.po-review-table td,.po-directory table th,.po-directory table td{word-break:normal;overflow-wrap:normal;hyphens:none}
.po-members-table td:first-child,.po-review-person{overflow-wrap:anywhere}
@media(max-width:1024px){
 .po-members-table-wrap,.po-review-table-wrap,.po-directory .po-review-table-wrap{overflow:visible!important;scrollbar-gutter:auto}
 .po-members-table,.po-review-table,.po-directory table{display:block!important;width:100%!important;min-width:0!important;border:0!important;background:transparent!important}
 .po-members-table thead,.po-review-table thead,.po-directory table thead{display:none}
 .po-members-table tbody,.po-review-table tbody,.po-directory table tbody{display:grid;gap:14px;width:100%}
 .po-members-table tbody tr,.po-review-table tbody tr,.po-directory table tbody tr{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 20px;width:100%;padding:16px;border:1px solid #e7e1d8;border-radius:12px;background:#fff!important;box-shadow:0 8px 24px rgba(26,46,34,.05)}
 .po-members-table tbody td,.po-review-table tbody td,.po-directory table tbody td{position:static!important;display:grid!important;grid-template-columns:112px minmax(0,1fr);align-items:start;gap:9px;min-width:0;padding:10px 0!important;border:0!important;border-bottom:1px solid #eee9e2!important;background:transparent!important;box-shadow:none!important;white-space:normal!important;overflow-wrap:anywhere}
 .po-members-table tbody td::before,.po-review-table tbody td::before,.po-directory table tbody td::before{color:#68766e;font-size:10px;font-weight:800;letter-spacing:.05em;text-transform:uppercase}
 .po-members-table tbody td:first-child,.po-review-table tbody td:first-child,.po-directory table tbody td:first-child{grid-column:1/-1;padding-top:0!important;font-size:15px}
 .po-members-table tbody td:last-child,.po-review-table tbody td:last-child,.po-directory table tbody td:last-child{border-bottom:0!important}
 .po-members-table tbody td:nth-child(1)::before{content:"Psicólogo(a)"}.po-members-table tbody td:nth-child(2)::before{content:"Plano"}.po-members-table tbody td:nth-child(3)::before{content:"Origem"}.po-members-table tbody td:nth-child(4)::before{content:"Pagamento"}.po-members-table tbody td:nth-child(5)::before{content:"Validade"}.po-members-table tbody td:nth-child(6)::before{content:"Tempo restante"}.po-members-table tbody td:nth-child(7)::before{content:"Assinatura"}.po-members-table tbody td:nth-child(8)::before{content:"Última atividade"}.po-members-table tbody td:nth-child(9)::before{content:"Ação"}
 .po-review-table tbody td:nth-child(1)::before{content:"Psicólogo(a)"}.po-review-table tbody td:nth-child(2)::before{content:"Situação"}.po-review-table tbody td:nth-child(3)::before{content:"Assinatura"}.po-review-table tbody td:nth-child(4)::before{content:"Último envio"}.po-review-table tbody td:nth-child(5)::before{content:"Ação"}
 .po-directory table tbody td:nth-child(1)::before{content:"Psicólogo(a)"}.po-directory table tbody td:nth-child(2)::before{content:"CRP"}.po-directory table tbody td:nth-child(3)::before{content:"Cidade/UF"}.po-directory table tbody td:nth-child(4)::before{content:"Perfil"}.po-directory table tbody td:nth-child(5)::before{content:"Assinatura"}.po-directory table tbody td:nth-child(6)::before{content:"Ação"}
 .po-members-table .button,.po-review-table .button,.po-directory table .button{width:max-content;max-width:100%;min-height:40px}
 .po-review-person{min-width:0}.po-review-person img{flex:0 0 auto}
}
@media(max-width:680px){
 .po-members-table tbody tr,.po-review-table tbody tr,.po-directory table tbody tr{grid-template-columns:1fr;padding:14px}
 .po-members-table tbody td,.po-review-table tbody td,.po-directory table tbody td{grid-column:1!important;grid-template-columns:104px minmax(0,1fr)}
 .po-members-table tbody td:first-child,.po-review-table tbody td:first-child,.po-directory table tbody td:first-child{grid-column:1!important}
 .po-members-filters{display:grid!important;grid-template-columns:1fr!important}.po-members-filters label,.po-members-filters input,.po-members-filters select,.po-members-filters .button{width:100%!important;max-width:none!important;box-sizing:border-box}
 .po-members-count{text-align:center}.po-members-registration-toggle .button{width:100%;min-height:46px;text-align:center;line-height:44px}
}
@media(max-width:420px){
 .po-members-table tbody td,.po-review-table tbody td,.po-directory table tbody td{display:block!important}
 .po-members-table tbody td::before,.po-review-table tbody td::before,.po-directory table tbody td::before{display:block;margin-bottom:5px}
 .po-review-person{align-items:flex-start}.po-review-person img{width:42px;height:42px}
}

/* Mobile — coluna única, ações tocáveis e modais quase em tela cheia. */
@media (max-width:639px){
 :root{--po-page-gutter:.75rem}
 body.psicoon-fullscreen-dashboard .po-control-content,body.psicoon-standalone-shell .psicoon-main{padding:1rem .625rem 2.5rem!important}
 body.psicoon-fullscreen-dashboard .po-control-top{gap:.5rem;padding-inline:.625rem!important}
 body.psicoon-fullscreen-dashboard .po-global-search,body.psicoon-fullscreen-dashboard .po-top-alert{display:none!important}
 body.psicoon-fullscreen-dashboard .po-control-user{width:2.5rem;height:2.5rem;flex:0 0 2.5rem;font-size:.75rem}
 .psicoon-page-head,.po-overview-title,.po-panel-head,.po-review-toolbar,.po-migration-heading,.po-storage-card,.po-review-welcome,.po-admin-review-summary,.po-admin-cancellation-summary,.po-detail-heading{align-items:stretch!important;flex-direction:column!important}
 .psicoon-page-head h1,.po-overview-title h2,.po-detail-heading h2{font-size:clamp(1.75rem,9vw,2.25rem)!important}
 .psicoon-card-grid,.psicoon-tool-grid,.psicoon-script-list,.psicoon-upgrade-grid,.psicoon-stats,.psicoon-subscription-card,.po-metric-grid,.po-review-stats,.psicoon-plan-grid,.po-overview-aside,.po-grid,.po-checks,.po-member-grid,.po-json-import-form,.pso-fields-grid,.pso-payment-grid{grid-template-columns:minmax(0,1fr)!important}
 .psicoon-card,.psicoon-feature,.psicoon-tool-form,.psicoon-preview,.psicoon-script,.po-profile-step,.po-step{padding:1rem .875rem!important;border-radius:.875rem!important}
 .po-control-primary,.po-overview-title .po-control-primary,.po-migration-heading .button{width:100%}
 .po-member-dialog,.po-review-box,.pso-modal,.po-member-editor[open]>.po-member-form{width:calc(100vw - .75rem)!important;max-width:calc(100vw - .75rem)!important;max-height:calc(100dvh - .75rem)!important;border-radius:.875rem!important}
 .pso-modal{inset:.375rem!important;height:calc(100dvh - .75rem)!important;margin:0!important}
 .pso-modal .pso-form{min-height:100%;padding:3.5rem .875rem 1.25rem!important;overflow-y:auto!important}
 .po-member-dialog .po-member-form{padding:3.875rem .875rem 1.25rem!important}
 .po-nav{display:flex;flex-direction:column;align-items:stretch}
 .po-nav-actions{display:grid;grid-template-columns:minmax(0,1fr)!important;width:100%}
 .po-nav button,.po-nav a,.po-review-actions button{width:100%!important;min-width:0!important}
 .po-photo-upload{grid-template-columns:4.5rem minmax(0,1fr)!important}
 .po-formation,.po-repeat{grid-template-columns:minmax(0,1fr)!important}
 .po-formation button,.po-repeat button{min-height:var(--po-touch)}
 .po-profile-hero{grid-template-columns:4.5rem minmax(0,1fr)!important;padding:.875rem!important}
 .po-profile-hero>img{width:4.5rem!important;height:5.75rem!important}
 .po-profile-facts{grid-template-columns:minmax(0,1fr)!important}
 /* Conteúdo didático vira cartões legíveis. */
 .psicoon-article-content table,.psicoon-checklist-table{display:block!important;width:100%!important;min-width:0!important;border:0!important;background:transparent!important}
 .psicoon-article-content table thead,.psicoon-checklist-table thead{display:none!important}
 .psicoon-article-content table tbody,.psicoon-checklist-table tbody{display:grid!important;gap:.75rem!important;width:100%!important}
 .psicoon-article-content table tr,.psicoon-checklist-table tr{display:block!important;width:100%!important;padding:.875rem!important;border:1px solid #e8e2d8!important;border-radius:.875rem!important;background:#fff!important}
 .psicoon-article-content table td,.psicoon-checklist-table td{display:block!important;width:100%!important;max-width:100%!important;padding:.3125rem 0!important;border:0!important;white-space:normal!important;overflow-wrap:anywhere!important}
 .psicoon-article-content :where(h1,h2,h3,p,li,pre,code){max-width:100%;overflow-wrap:anywhere}
 .psicoon-article-content :where(iframe,video){display:block;width:100%!important;height:auto;aspect-ratio:16/9}
 .psicoon-studio-shell,.psicoon-studio-shell--flyer{width:100%!important;max-width:100%!important}
 .psicoon-studio-frame{height:min(72dvh,36rem)!important;min-height:27rem!important}
 .po-review-pagination{align-items:stretch;flex-direction:column}.po-review-pagination nav,.po-review-pagination ul{width:100%}.po-review-pagination ul{justify-content:center}
 .floating-bar{left:.5rem!important;right:.5rem!important;bottom:.5rem!important;width:auto!important;max-width:none!important}
}

@media (max-width:380px){body.psicoon-fullscreen-dashboard .po-control-user{display:none}body.psicoon-fullscreen-dashboard .po-control-top h1{font-size:1rem}.po-profile-hero{grid-template-columns:4rem minmax(0,1fr)!important}.po-profile-hero>img{width:4rem!important;height:5.125rem!important}}
@media (min-width:1600px){body.psicoon-fullscreen-dashboard .po-control-content{max-width:112rem}body.psicoon-standalone-shell .psicoon-app{max-width:100%}}
@media (prefers-reduced-motion:reduce){.psicoon-app *,.po-control-shell *,.psicoon-sales-page *{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}
