/* Patient portal only: compact spacing and readable touch targets. */
html[data-theme] body main.portal{font-size:14px;padding-top:22px}
html[data-theme] body main.portal .welcome{padding:16px 20px;border-radius:18px;gap:12px}
html[data-theme] body main.portal .welcome h1{font-size:18px;line-height:1.35;letter-spacing:0;margin:0 0 4px}
html[data-theme] body main.portal .welcome .welcome-caption{font-size:12px;line-height:1.45;font-weight:400;margin:0;color:var(--muted)}
html[data-theme] body main.portal .tabs{margin:14px 0;padding:4px;border-radius:14px}
html[data-theme] body main.portal .tabs button{min-height:44px;padding:8px 12px;font-size:14px;gap:7px;border-radius:10px}
html[data-theme] body main.portal .tabs button svg{width:20px;height:20px}
html[data-theme] body main.portal .timeline{margin-top:0;padding-top:0}
html[data-theme] body main.portal .timeline .meal{margin-bottom:10px}
html[data-theme] body main.portal .timeline .meal-toggle{min-height:62px;padding:12px 14px;gap:10px}
html[data-theme] body main.portal .meal-toggle .time{font-size:14px}
html[data-theme] body main.portal .meal-copy b{font-size:15px}
html[data-theme] body main.portal .meal-copy small{font-size:10px}
html[data-theme] body main.portal .meal-icon{width:32px;height:32px;flex-basis:32px}
html[data-theme] body main.portal .meal-icon svg{width:21px;height:21px}
html[data-theme] body main.portal .assessments,
html[data-theme] body main.portal .apn-photo-slot{background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important;border-radius:0}
html[data-theme] body main.portal .assessment-card{padding:16px;margin-top:12px;border-radius:18px}
html[data-theme] body main.portal .assessment-title{gap:10px}
html[data-theme] body main.portal .assessment-title[aria-expanded="false"]{padding-bottom:0;border-bottom:0}
html[data-theme] body main.portal .assessment-title h3,
html[data-theme] body main.portal .apn-photo-section-copy strong{font-size:15px;line-height:1.35}
html[data-theme] body main.portal .assessment-title p,
html[data-theme] body main.portal .apn-photo-section-copy small{font-size:11px;line-height:1.4}
html[data-theme] body main.portal .assessment-title>span:first-child,
html[data-theme] body main.portal .apn-photo-section-icon{width:36px;height:36px;flex-basis:36px;border-radius:11px}
html[data-theme] body main.portal .apn-photo-section-icon,
html[data-theme] body main.portal .apn-photo-section-icon svg{color:#fff!important;-webkit-text-fill-color:#fff!important}
html[data-theme] body main.portal .apn-photo-section-icon svg{stroke:#fff!important;width:21px;height:21px}
html[data-theme] body main.portal .apn-photo-results{border-radius:18px;margin-top:12px}
html[data-theme] body main.portal .apn-photo-results>summary{padding:16px;gap:10px}
html[data-theme] body main.portal .apn-photo-section-copy{gap:3px}
html[data-theme] body main.portal .patient-download-card{padding:18px;margin-top:16px}
html[data-theme] body main.portal .patient-download-card h2,
html[data-theme] body main.portal .patient-diet-calculation h3{font-size:17px}
html[data-theme] body main.portal .patient-download-card p{font-size:13px;line-height:1.5}
html[data-theme] body main.portal .patient-download-card button{font-size:14px;min-height:44px}
@media(max-width:600px){
 html[data-theme] body main.portal{padding:16px 14px 64px}
 html[data-theme] body main.portal .welcome{padding:14px 16px}
 html[data-theme] body main.portal .assessment-card{padding:14px}
 html[data-theme] body main.portal .apn-photo-results>summary{padding:14px}
}
/* v130: one horizontal nutrition summary, with aligned nutrient rows. */
html[data-theme] body main.portal .patient-diet-calculation{display:block;padding:16px 12px;margin-top:14px}
html[data-theme] body main.portal .patient-diet-macro-chart{
 display:grid;grid-template-columns:minmax(0,1fr) 84px minmax(0,1fr);
 grid-template-rows:repeat(3,minmax(24px,auto));column-gap:8px;row-gap:4px;align-items:center
}
html[data-theme] body main.portal .patient-diet-macro-legend,
html[data-theme] body main.portal .patient-diet-macro-legend>span{display:contents}
html[data-theme] body main.portal .patient-diet-macro-legend>span>i{display:none}
html[data-theme] body main.portal .patient-diet-macro-legend>span>b{grid-column:1;font-size:10px;line-height:1.3;white-space:nowrap;display:flex;align-items:center;gap:4px}
html[data-theme] body main.portal .patient-diet-macro-legend>span>b:before{content:"";width:6px;height:6px;border-radius:50%;flex:0 0 6px}
html[data-theme] body main.portal .patient-diet-macro-legend>span:nth-child(1)>b:before{background:#2457d6}
html[data-theme] body main.portal .patient-diet-macro-legend>span:nth-child(2)>b:before{background:#a90f24}
html[data-theme] body main.portal .patient-diet-macro-legend>span:nth-child(3)>b:before{background:#d28a22}
html[data-theme] body main.portal .patient-diet-macro-legend>span>small{grid-column:3;font-size:10px;line-height:1.3;white-space:nowrap;text-align:right}
html[data-theme] body main.portal .patient-diet-macro-legend>span:nth-child(1)>:is(b,small){grid-row:1}
html[data-theme] body main.portal .patient-diet-macro-legend>span:nth-child(2)>:is(b,small){grid-row:2}
html[data-theme] body main.portal .patient-diet-macro-legend>span:nth-child(3)>:is(b,small){grid-row:3}
html[data-theme] body main.portal .patient-diet-macro-pie{grid-column:2;grid-row:1/4;width:84px;height:84px;min-width:0;flex-basis:auto;padding:0;align-self:center;justify-self:center;box-shadow:none}
html[data-theme] body main.portal .patient-diet-macro-pie-svg>span{inset:14px;width:auto;height:auto}
html[data-theme] body main.portal .patient-diet-macro-pie b{font-size:17px}
html[data-theme] body main.portal .patient-diet-macro-pie small{font-size:9px}
html[data-theme] body main.portal .apn-photo-results{padding:0;margin:12px 0 0}
html[data-theme] body main.portal .apn-photo-results>summary{padding:16px;min-height:64px}
html[data-theme] body main.portal .assessment-title h3,
html[data-theme] body main.portal .apn-photo-section-copy strong{font-family:inherit;font-size:15px;font-weight:700;line-height:1.35;letter-spacing:normal}
html[data-theme] body main.portal .apn-photo-section-copy small{margin:3px 0 0}
html[data-theme] body main.portal .apn-photo-section-copy{gap:0}
html[data-theme] body main.portal .apn-photo-results>summary>.apn-photo-chevron{width:20px;height:20px;margin-left:auto}
html[data-theme] body main.portal .apn-photo-results>:not(summary){margin-left:14px;margin-right:14px}
html[data-theme] body main.portal .apn-photo-results>:last-child:not(summary){margin-bottom:14px}
@media(max-width:600px){
 html[data-theme] body main.portal .apn-photo-results>summary{padding:14px}
}
@media(max-width:370px){
 html[data-theme] body main.portal .patient-diet-macro-chart{grid-template-columns:minmax(0,1fr) 64px minmax(0,1fr);column-gap:4px}
 html[data-theme] body main.portal .patient-diet-macro-pie{width:64px;height:64px}
 html[data-theme] body main.portal .patient-diet-macro-pie-svg>span{inset:11px}
 html[data-theme] body main.portal .patient-diet-macro-pie b{font-size:14px}
 html[data-theme] body main.portal .patient-diet-macro-legend>span>:is(b,small){font-size:9px}
}
/* v131: native full-card controls for documents, feedback and custom actions. */
html[data-theme] body main.portal .patient-download-card.apn-compact-action,
html[data-theme] body main.portal .apn-pulse-card.apn-pulse-patient-summary{display:block;padding:0!important;margin:12px 0 0;border-radius:18px;overflow:hidden}
html[data-theme] body main.portal .apn-custom-patient-actions{display:grid;gap:12px;margin-top:12px}
html[data-theme] body main.portal .apn-custom-patient-actions .apn-compact-action{margin:0}
html[data-theme] body main.portal :is(.apn-compact-action,.apn-pulse-patient-summary)>.apn-patient-action{
 display:flex!important;align-items:center;gap:10px;width:100%;min-height:72px;margin:0;padding:16px;
 border:0!important;border-radius:0!important;background:transparent!important;background-image:none!important;
 box-shadow:none!important;color:inherit!important;-webkit-text-fill-color:currentColor!important;text-align:left;
 font-family:inherit;white-space:normal;cursor:pointer;transform:none!important
}
html[data-theme] body main.portal .apn-patient-action .apn-action-icon{
 display:grid;place-items:center;flex:0 0 36px;width:36px;height:36px;border-radius:11px;
 background:var(--brand-gradient,var(--brand-primary,#191b20))!important;color:#fff!important;-webkit-text-fill-color:#fff!important
}
html[data-theme] body main.portal .apn-patient-action .apn-action-icon svg{width:21px;height:21px;color:#fff!important;stroke:currentColor!important}
html[data-theme] body main.portal .apn-patient-action .apn-action-copy{display:grid;gap:3px;flex:1;min-width:0}
html[data-theme] body main.portal .apn-patient-action .apn-action-copy strong{font-family:inherit;font-size:15px;font-weight:700;line-height:1.35}
html[data-theme] body main.portal .apn-patient-action .apn-action-copy>span{font-size:11px;font-weight:400;line-height:1.4}
html[data-theme] body main.portal .apn-patient-action .apn-action-end{width:20px;flex:0 0 20px;font-size:26px;font-weight:400;text-align:center;line-height:1;transition:transform .2s}
html[data-theme] body main.portal .apn-patient-action .apn-action-end svg{width:19px;height:19px}
html[data-theme] body main.portal .apn-patient-action[aria-expanded="true"] .apn-action-end{transform:rotate(90deg)}
html[data-theme] body main.portal .apn-patient-action:focus-visible{outline:2px solid var(--brand-primary,#191b20)!important;outline-offset:-3px}
html[data-theme] body main.portal .apn-patient-action:hover:not(:disabled){background:rgba(127,127,127,.06)!important}
html[data-theme] body main.portal .apn-patient-action:disabled{opacity:.6;cursor:wait}
html[data-theme] body main.portal .apn-compact-action>small{display:block;padding:0 14px 12px;font-size:11px}
html[data-theme] body main.portal .apn-pulse-patient-summary>.apn-pulse-patient-metrics{margin:0;padding:0 14px 14px}
html[data-theme] body main.portal .apn-pulse-patient-summary>[hidden]{display:none!important}
@media(max-width:600px){
 html[data-theme] body main.portal :is(.apn-compact-action,.apn-pulse-patient-summary)>.apn-patient-action{padding:14px}
}
/* HF-specific components and neutral identity. */
html[data-theme] body main.portal .assessment-title>span:first-child,
html[data-theme] body main.portal .apn-patient-action .apn-action-icon{background:linear-gradient(145deg,#41464c,#17191c)!important;color:#fff!important;-webkit-text-fill-color:#fff!important}
html[data-theme] body main.portal .assessment-title>span:first-child svg{width:21px;height:21px;color:#fff!important;stroke:currentColor!important}
html[data-theme] body main.portal .hf-photo-results{padding:16px!important;margin-top:12px!important;border-radius:18px!important}
html[data-theme] body main.portal .hf-photo-results-title{font-family:inherit}
html[data-theme] body main.portal .hf-photo-results-title[aria-expanded="false"]{border-bottom:0!important;padding-bottom:0!important;margin-bottom:0!important}
html[data-theme] body main.portal .hf-photo-results-title h3{font-size:15px!important;font-weight:700!important;line-height:1.35}
html[data-theme] body main.portal .hf-photo-results-title p{font-size:11px!important;line-height:1.4}
html[data-theme] body main.portal .hf-photo-results-icon{display:grid;place-items:center}
html[data-theme] body main.portal .apn-patient-action{text-decoration:none}
html[data-theme="light"] body main.portal .apn-patient-action{color:#17191c!important}
html[data-theme="dark"] body main.portal .apn-patient-action{color:#f1f2f3!important}
html[data-theme] body main.portal .apn-patient-action .apn-action-copy :is(strong,span){color:inherit!important;-webkit-text-fill-color:currentColor!important}
@media(max-width:600px){html[data-theme] body main.portal .hf-photo-results{padding:14px!important}}

/* v339: light action surfaces and a single spacing owner per group. */
html[data-theme="light"] body:has(main.portal) main.portal .patient-download-card.apn-compact-action {
 background:#fff!important;color:#17191c!important;border-color:#34383d!important;
}
html[data-theme="light"] body:has(main.portal) main.portal :is(.apn-compact-action,.apn-pulse-patient-summary)>.apn-patient-action {
 background:transparent!important;background-color:transparent!important;background-image:none!important;color:#17191c!important;
}
html[data-theme="light"] body:has(main.portal) main.portal .apn-patient-action :is(.apn-action-copy,.apn-action-copy strong,.apn-action-copy>span,.apn-action-end,.apn-action-end svg) {
 color:#17191c!important;-webkit-text-fill-color:currentColor!important;
}
html[data-theme="light"] body:has(main.portal) main.portal .apn-patient-action .apn-action-copy>span {
 color:#687079!important;
}
html[data-theme="light"] body:has(main.portal) main.portal .apn-patient-action:hover:not(:disabled) {
 background:rgba(127,127,127,.06)!important;
}
html[data-theme] body main.portal :is(.apn-custom-patient-actions,.mobile-resource-cards) {
 margin:12px 0 0!important;gap:12px;
}
html[data-theme] body main.portal :is(.apn-custom-patient-actions,.mobile-resource-cards)>.patient-download-card.apn-compact-action {
 margin:0!important;
}
html[data-theme] body main.portal .apn-pulse-card {
 margin:12px 0 0!important;
}
