/* Paleta do profissional e contraste explícito nos dois temas. */
:root{--apn-photo-bg:#fff;--apn-photo-row:#f7f8fa;--apn-photo-text:#17191d;--apn-photo-muted:#4b5563;--apn-photo-border:#cbd2da}
html[data-theme=dark]{--apn-photo-bg:#1b1d21;--apn-photo-row:#25282e;--apn-photo-text:#f3f4f6;--apn-photo-muted:#c5cbd4;--apn-photo-border:#4b515c}
html body .apn-pro-home-actions{display:flex;align-items:stretch;gap:10px;flex-shrink:0}
html body .apn-pro-home-actions>.apn-pro-new{flex:1 1 0;width:135px;min-width:0;min-height:44px;white-space:normal;justify-content:center;gap:8px;line-height:1.2}
html body .apn-pro-home-actions>.apn-pro-new svg{flex:0 0 20px;width:20px;height:20px}
html body .apn-image-card,html body .apn-photo-dialog,html body .apn-photo-results{background:var(--apn-photo-bg)!important;color:var(--apn-photo-text)!important;border:1px solid var(--apn-photo-border)!important}
html body .apn-photo-dialog{width:min(820px,calc(100vw - 24px));max-height:calc(100dvh - 32px);padding:24px;border-radius:18px;box-sizing:border-box;overflow:auto}
.apn-photo-dialog::backdrop{background:#0009}
html body .apn-photo-close{display:block;margin:0 0 8px auto;width:40px;height:40px;background:transparent;color:var(--apn-photo-text);border:1px solid var(--apn-photo-border);border-radius:10px;font-size:26px}
html body .apn-photo-editor{display:grid;gap:16px}
html body .apn-photo-editor h3,html body .apn-photo-dialog h2,html body .apn-photo-result h4{color:var(--apn-photo-text)!important;margin:0;font-weight:700}
html body .apn-photo-editor p,html body .apn-photo-editor small,html body .apn-photo-result p,html body .apn-photo-result small,html body .apn-image-head p,html body .apn-photo-history-row small{color:var(--apn-photo-muted)!important;opacity:1;line-height:1.5}
html body .apn-photo-editor label,html body .apn-photo-dialog>label{display:grid;gap:6px;font-weight:400}
html body .apn-photo-editor input:not([type=checkbox]):not([type=file]),html body .apn-photo-dialog input[type=search]{box-sizing:border-box;width:100%;min-width:0;min-height:42px;background:var(--apn-photo-row)!important;color:var(--apn-photo-text)!important;border:1px solid var(--apn-photo-border);border-radius:9px;padding:9px;font-weight:400}
html[data-theme=dark] .apn-photo-editor input[type=date]{color-scheme:dark}
html body .apn-photo-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
html body .apn-photo-editor .apn-photo-card{display:grid;gap:8px;padding:12px;min-width:0;background:var(--apn-photo-row)!important;color:var(--apn-photo-text)!important;border:1px solid var(--apn-photo-border);border-radius:14px}
html body .apn-photo-editor .apn-photo-stage{position:relative;display:grid;place-items:center;min-height:110px;height:180px;background:transparent}
html body .apn-photo-editor .apn-photo-stage img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
html body .apn-photo-buttons{display:flex;gap:6px;flex-wrap:wrap}
html body .apn-photo-buttons label{display:flex;justify-content:center;align-items:center;position:relative;flex:1;padding:9px 6px;border-radius:9px;background:var(--brand-gradient,var(--brand-primary,#7025d6));color:var(--brand-primary-text,#fff)!important;cursor:pointer;font-size:13px;overflow:hidden}
html body .apn-photo-buttons input[type=file]{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;display:block}
html body .apn-photo-editor .apn-rfm-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
html body .apn-photo-editor .apn-image-consent{display:flex;align-items:flex-start;gap:9px}
html body .apn-photo-editor .apn-image-consent input{flex:0 0 18px;width:18px;height:18px;margin-top:3px}
html body .apn-photo-editor .apn-image-publish{min-height:44px;white-space:normal;background:var(--brand-gradient,var(--brand-primary,#7025d6));color:var(--brand-primary-text,#fff)}
html body .apn-photo-patient{display:block;width:100%;padding:14px;margin-top:8px;background:var(--apn-photo-row);color:var(--apn-photo-text);border:1px solid var(--apn-photo-border);border-radius:10px;text-align:left}
html body .apn-photo-results{padding:16px;border-radius:16px;margin:16px 0}
html body .apn-photo-results>summary{cursor:pointer;font-weight:700;font-size:18px;color:var(--apn-photo-text)}
html body .apn-photo-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-top:16px}
html body .apn-photo-result{min-width:0;padding:14px;border:1px solid var(--apn-photo-border);border-radius:12px;background:var(--apn-photo-bg);color:var(--apn-photo-text)}
html body .apn-photo-result>img{display:block;width:100%;height:auto;border-radius:10px;margin:12px 0}
html body .apn-photo-result dl{display:grid;gap:8px;margin:12px 0}
html body .apn-photo-result dl>div{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px;background:var(--apn-photo-row);border-radius:9px}
html body .apn-photo-result dt{color:var(--apn-photo-muted);font-size:13px}
html body .apn-photo-result dd{margin:0;font-weight:700;color:var(--apn-photo-text);white-space:nowrap}
html body .apn-photo-history-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px;border-bottom:1px solid var(--apn-photo-border)}
html body .apn-photo-history-row span{display:grid;gap:5px}
html body .apn-photo-history-row button{color:var(--apn-photo-text);background:var(--apn-photo-row);border:1px solid var(--apn-photo-border);padding:8px;border-radius:8px}
html body .apn-photo-slot:empty{display:none}
html body .apn-photo-comparison{color:var(--apn-photo-muted);line-height:1.5}
html body .apn-photo-editor [hidden],html body .apn-photo-dialog [hidden]{display:none!important}
@media(max-width:760px){
 html body .apn-pro-home .apn-pro-nav-badge{display:none!important}
 html body .apn-pro-home-actions{width:48%;gap:6px}
 html body .apn-pro-home-actions>.apn-pro-new{width:auto;padding:10px 6px;font-size:13px;gap:5px}
 html body .apn-pro-home-actions>.apn-pro-new svg{width:17px;flex-basis:17px}
 html body .apn-photo-pair{grid-template-columns:1fr}
 html body .apn-photo-dialog{padding:16px}
 html body .apn-photo-editor .apn-photo-stage{height:130px}
 html body .apn-photo-buttons svg{display:none}
}
@media(max-width:760px){
 html body .apn-pro-home .apn-pro-titlebar{display:flex!important;align-items:flex-start!important;flex-wrap:nowrap!important;gap:10px!important}
 html body .apn-pro-home .apn-pro-titlebar>div:first-child{flex:1 1 0;min-width:0}
 html body .apn-pro-home .apn-pro-title-actions{flex:0 0 48%;width:48%;min-width:0}
 html body .apn-pro-home .apn-pro-home-actions{width:100%}
}
html body .apn-photo-editor .apn-photo-card{grid-template-rows:auto auto auto;justify-items:stretch}
html body .apn-photo-editor .apn-photo-card>strong{text-align:center}
html body .apn-photo-editor .apn-rfm-fields label{align-content:start}
html body .apn-photo-editor .apn-rfm-fields input{height:44px}
@media(max-width:480px){html body .apn-photo-buttons{display:grid;grid-template-columns:1fr}html body .apn-photo-buttons label{min-height:36px;box-sizing:border-box}}
html body .hf-professional-anthropometry-results:has(.apn-photo-results)>.hf-professional-results-empty{display:none}
/* v123 — captura simples, busca e espaço para Novo paciente. */
html body .apn-photo-dialog{position:fixed;inset:0;margin:auto;padding:24px;max-height:calc(100dvh - 32px)}
html body .apn-photo-close{position:absolute;right:16px;top:16px;margin:0;z-index:2;border-radius:50%;width:40px;height:40px;line-height:1;display:grid;place-items:center}
html body .apn-photo-editor h3,html body .apn-photo-picker h2{padding-right:48px;font-size:23px;line-height:1.25}
html body .apn-photo-editor{gap:12px}
html body .apn-photo-subtitle{margin:0;color:var(--apn-photo-muted)!important;line-height:1.4;font-size:16px}
html body .apn-photo-date{display:grid;grid-template-columns:1fr 1fr;align-items:center;gap:12px;margin:6px 0}
html body .apn-photo-date label{font-weight:600}
html body .apn-photo-editor .apn-photo-card{padding:0;background:transparent!important;border:0;border-radius:0;gap:0;grid-template-rows:auto auto auto}
html body .apn-photo-editor .apn-photo-stage{height:210px;border:1px solid var(--apn-photo-border);border-bottom:0;border-radius:18px 18px 0 0;background:var(--apn-photo-bg)}
html body .apn-photo-stage>span{display:grid;place-items:center;height:100%;width:100%}
html body .apn-photo-silhouette{height:80%;max-height:190px;width:100px;color:var(--apn-photo-muted)}
html body .apn-photo-editor .apn-photo-stage img{background:var(--apn-photo-bg);border-radius:18px 18px 0 0;padding:8px;box-sizing:border-box}
html body .apn-photo-editor .apn-photo-card>strong{padding:10px 4px 20px;border:1px solid var(--apn-photo-border);border-top:0;border-radius:0 0 18px 18px;font-size:16px}
html body .apn-photo-buttons{display:grid;grid-template-columns:1fr;gap:7px;margin-top:10px}
html body .apn-photo-buttons label{min-height:38px;padding:9px 4px;font-size:14px;font-weight:600;box-sizing:border-box}
html body .apn-photo-editor .apn-photo-guidance{font-size:14px;margin:0;line-height:1.45}
html body .apn-photo-editor [data-reference]{font-size:13px;margin:0;line-height:1.45}
html body .apn-photo-editor .apn-image-consent{font-size:13px;line-height:1.4}
html body .apn-photo-editor .apn-image-publish{font-size:16px;padding:12px;min-height:46px}
html body .apn-photo-editor .apn-image-notice:empty{display:none}
html body .apn-photo-picker{width:min(540px,calc(100vw - 24px));padding:24px}
html body .apn-photo-picker h2{margin-bottom:8px}
html body .apn-photo-picker .apn-photo-search{display:flex;align-items:center;gap:10px;margin:22px 0 16px;border:1px solid var(--apn-photo-border);border-radius:14px;padding:0 14px}
html body .apn-photo-picker .apn-photo-search svg{flex:0 0 22px}
html body .apn-photo-picker .apn-photo-search input{border:0;background:transparent!important;padding:14px 0;outline-offset:2px;font-size:16px}
html body .apn-photo-picker [data-list]{min-height:90px;padding:12px 0;color:var(--apn-photo-muted);font-size:15px}
html body .apn-photo-picker [data-list]:not(:has(button)){display:grid;place-items:center;text-align:center}
@media(max-width:760px){
 html body .apn-pro-home .apn-pro-title-actions{flex:0 0 55%;width:55%}
 html body .apn-pro-home-actions>.apn-pro-new:first-child{flex:1.3 1 0}
 html body .apn-pro-home-actions>.apn-pro-photo{flex:1 1 0}
 html body .apn-photo-dialog{padding:20px 16px}
 html body .apn-photo-editor .apn-photo-stage{height:180px}
 html body .apn-photo-grid{gap:10px}
 html body .apn-photo-picker{padding:24px 20px}
}
@media(min-width:761px){html body .apn-pro-home-actions>.apn-pro-photo{display:none!important}html body .apn-pro-home-actions>.apn-pro-new:first-child{width:auto;min-width:150px;white-space:nowrap}}
html body .apn-photo-empty{padding:16px;color:var(--apn-photo-muted);border:1px solid var(--apn-photo-border);border-radius:12px}
html body .apn-photo-toast{position:fixed;bottom:22px;left:50%;transform:translateX(-50%);z-index:2147483647;width:max-content;max-width:calc(100vw - 40px);padding:14px 18px;border-radius:12px;background:var(--apn-photo-bg);color:var(--apn-photo-text);border:1px solid var(--apn-photo-border);box-shadow:0 6px 24px #0003;font-size:14px}
html body .apn-photo-history-row{justify-content:flex-end}
html body .apn-image-card>.apn-photo-slot{margin-top:12px}
/* v125: cabeçalhos recolhíveis, histórico compacto e gráfico. */
html body .apn-photo-results>summary{display:flex;align-items:center;gap:14px;list-style:none;font-size:16px}
html body .apn-photo-results>summary::-webkit-details-marker,html body .apn-photo-history-entry summary::-webkit-details-marker{display:none}
html body .apn-photo-section-icon{display:grid;place-items:center;flex:0 0 42px;width:42px;height:42px;border-radius:12px;background:var(--brand-gradient,var(--brand-primary,#7025d6));color:var(--brand-primary-text,#fff)}
html body .apn-photo-section-copy{display:grid;gap:4px;flex:1;min-width:0}
html body .apn-photo-section-copy small{font-size:12px;font-weight:400;line-height:1.4;color:var(--apn-photo-muted)}
html body .apn-photo-chevron{flex:0 0 20px;transition:transform .2s;color:var(--apn-photo-muted)}
html body details[open]>summary>.apn-photo-chevron{transform:rotate(90deg)}
html body .apn-photo-history-list{display:grid;gap:10px}
html body .apn-photo-history-entry{display:flex;align-items:flex-start;gap:12px;border:1px solid var(--apn-photo-border);border-radius:12px;background:var(--apn-photo-row);padding:14px;color:var(--apn-photo-text)}
html body .apn-photo-history-entry>details{flex:1;min-width:0}
html body .apn-photo-history-entry summary{display:flex;align-items:center;gap:18px;list-style:none;cursor:pointer;min-height:42px}
html body .apn-photo-history-date{display:grid;gap:4px;flex:0 0 160px}
html body .apn-photo-history-date small,html body .apn-photo-history-metrics small{font-size:10px;text-transform:uppercase;color:var(--apn-photo-muted);font-weight:400}
html body .apn-photo-history-date strong,html body .apn-photo-history-metrics b{font-size:13px}
html body .apn-photo-history-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;flex:1}
html body .apn-photo-history-metrics>span{display:grid;gap:4px}
html body .apn-photo-history-row{padding:0;border:0;flex-shrink:0}
html body .apn-photo-history-row button{min-height:40px;padding:8px 14px}
html body .apn-photo-history-entry .apn-photo-result{margin-top:16px;max-width:680px}
html body .apn-photo-pdf-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:10px;margin-top:16px}
html body .apn-photo-pdf-actions button{white-space:normal;min-height:40px;padding:10px 16px;border-radius:10px;background:var(--brand-gradient,var(--brand-primary,#7025d6));color:var(--brand-primary-text,#fff)}
html body .apn-photo-pdf-actions p{color:var(--apn-photo-muted);font-size:13px;margin:0}
html body .apn-photo-pdf-actions p:empty{display:none}
html body .apn-photo-chart{padding:16px;margin-top:18px;border:1px solid var(--apn-photo-border);border-radius:12px;background:var(--apn-photo-row);color:var(--apn-photo-text)}
html body .apn-photo-chart h4{margin:0;font-size:16px;color:var(--apn-photo-text)}
html body .apn-photo-chart svg{display:block;width:100%;max-height:310px}
html body .apn-photo-chart text{fill:var(--apn-photo-muted);font-size:13px}
html body .apn-photo-chart .apn-photo-chart-value{font-weight:700;fill:var(--apn-photo-text)}
html body .apn-photo-chart-grid{stroke:var(--apn-photo-border);stroke-dasharray:4 5}
html body .apn-photo-chart-line{stroke:var(--brand-primary,#7025d6);stroke-width:3}
html body .apn-photo-chart circle{fill:var(--brand-primary,#7025d6)}
html body .apn-photo-chart p{font-size:13px;line-height:1.5;color:var(--apn-photo-muted);margin-bottom:0}
@media(max-width:760px){
 html body .apn-photo-history-entry{gap:8px;padding:12px}
 html body .apn-photo-history-entry summary{flex-wrap:wrap;gap:12px}
 html body .apn-photo-history-date{flex:1 1 calc(100% - 40px)}
 html body .apn-photo-history-metrics{order:3;flex:1 1 100%;gap:8px}
 html body .apn-photo-history-row button{padding:8px 10px}
 html body .apn-photo-section-copy small{font-size:11px}
 html body .apn-photo-chart{padding:12px 6px}
 html body .apn-photo-chart text{font-size:15px}
}
html body .apn-photo-history .admin-assessment-group-title small{color:var(--apn-photo-muted);opacity:1}
/* v126: histórico resumido e foco contido no campo de busca. */
html body .apn-photo-history{border-top:1px solid var(--apn-photo-text);margin-top:20px;padding-top:16px}
html body .apn-photo-history-entry{align-items:center}
html body .apn-photo-history-entry .anthro-history-delete{display:inline-flex;align-items:center;gap:6px;color:#c43a4d;border:1px solid #c43a4d55;background:#c43a4d0d}
html body .apn-photo-picker .apn-photo-search input:focus{outline:none!important;box-shadow:none!important;border:0!important}
html body .apn-photo-search:has(input:focus-visible){outline:2px solid var(--brand-primary,#7025d6);outline-offset:3px}
@media(pointer:coarse){html body .apn-photo-search:has(input:focus-visible){outline:none}}
@media(max-width:760px){
 html body #root>.app>header .theme-toggle{flex:0 0 46px!important;width:46px!important;min-width:46px!important;max-width:46px!important;height:46px!important;padding:0!important}
 html body #root>.app>header .account>button.icon{flex:0 0 48px!important;width:48px!important;min-width:48px!important;height:46px!important;padding:0!important}
 html body .apn-photo-history-entry{flex-wrap:wrap}
 html body .apn-photo-history-entry>.apn-photo-history-date{flex:1 1 50%}
 html body .apn-photo-history-entry>.anthro-history-actions{margin-left:auto}
}

/* v127: uma única ação, alinhada à borda direita; ordem dos resultados. */
html body .apn-photo-history-entry>.anthro-history-actions{display:flex;flex:0 0 auto;justify-content:flex-end;min-width:0;width:auto;margin-left:auto}
html body .apn-photo-history-entry>.anthro-history-actions button{width:auto}
html body .hf-professional-anthropometry-results>.assessments>.apn-photo-results{order:4}
html body .hf-professional-anthropometry-results>.assessments>.hf-complete-assessment-download{order:5}

/* Ação de criação, independente dos controles de expandir seções. */
html body .apn-image-card>.apn-image-head>.apn-image-open{display:inline-flex!important;align-items:center;justify-content:center;flex:0 0 auto;margin-left:auto;width:auto;min-height:42px;padding:10px 16px;border-radius:11px;white-space:nowrap}
