:root {
  --ink: #17352a;
  --muted: #6d7e76;
  --line: #dfe8e3;
  --paper: #f6f8f5;
  --green: #126548;
  --lime: #d9f38a;
  --soft: #eaf5ef;
  --red: #b6463e;
  --shadow: 0 18px 55px #12372a1a;
}

/* Planejamento energético e metas nutricionais — v120 */
.energy-planning{margin:18px 0;padding:18px;border:1px solid #34383e;border-radius:18px;background:linear-gradient(145deg,#17191c,#0d0e10);color:#f4f5f6}.energy-planning.active{border-color:var(--brand-primary);box-shadow:0 12px 34px color-mix(in srgb,var(--brand-primary) 18%,transparent)}.energy-planning-head,.energy-subhead{display:flex;align-items:center;justify-content:space-between;gap:16px}.energy-planning-head h3,.energy-subhead h4{margin:3px 0 4px}.energy-planning-head p,.energy-subhead p{margin:0;color:#aeb3ba;font-size:11px}.energy-planning-head>div>small{color:var(--brand-primary);font-size:9px;font-weight:900;letter-spacing:.12em}.energy-planning-head-actions{display:flex;align-items:center;gap:10px}.energy-enable{display:flex!important;align-items:center;gap:8px;color:#d9dce0!important;white-space:nowrap}.energy-enable input{width:18px!important;height:18px!important;min-height:0!important}.energy-planning-body{display:grid;gap:15px;margin-top:16px;padding-top:16px;border-top:1px solid #34383e}.energy-grid{display:grid;grid-template-columns:repeat(4,minmax(145px,1fr));gap:10px}.energy-grid label,.energy-exercise-row label,.energy-subhead label{display:grid;gap:6px;color:#aeb3ba;font-size:10px;font-weight:850}.energy-grid input,.energy-grid select,.energy-exercise-row input,.energy-exercise-row select,.energy-subhead select,.energy-weight-manual{width:100%;min-height:41px;padding:8px 10px;border:1px solid #41464d;border-radius:9px;background:#0a0b0d;color:#fff}.energy-readonly{display:grid;align-content:center;gap:4px;padding:9px 11px;border:1px solid #3f444a;border-radius:10px;background:#202329}.energy-readonly small{color:#9fa5ad;font-size:9px}.energy-readonly b{font-size:17px}.energy-readonly.accent{border-color:var(--brand-primary);background:color-mix(in srgb,var(--brand-primary) 15%,#111315)}.energy-exercises,.energy-macro-section{display:grid;gap:10px;padding:14px;border:1px solid #353a40;border-radius:13px;background:#121417}.energy-exercise-row{display:grid;grid-template-columns:1.4fr 1fr 1fr auto;gap:9px;align-items:end}.energy-result-strip,.energy-adequacy{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.energy-result-strip span,.energy-adequacy span{display:grid;gap:3px;padding:10px;border:1px solid #3e434a;border-radius:10px;background:#202329}.energy-result-strip small,.energy-adequacy small{color:#9fa5ad;font-size:9px;font-weight:850}.energy-result-strip b{font-size:16px}.energy-macro-editor{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}.energy-macro-editor>div{display:grid;grid-template-columns:1fr 1.25fr 1fr auto;gap:7px;align-items:center;padding:9px;border:1px solid #3b4046;border-radius:10px;background:#1c1f23}.energy-macro-editor input,.energy-macro-editor select{width:100%;min-width:0;min-height:38px;padding:7px;border:1px solid #444a51;border-radius:8px;background:#0a0b0d;color:#fff}.energy-macro-editor strong{white-space:nowrap}.energy-adequacy{grid-template-columns:repeat(4,1fr)}.energy-adequacy span{border-left:4px solid #687079}.energy-adequacy span.good{border-left-color:#32a665}.energy-adequacy span.warn{border-left-color:#d19b35}.energy-adequacy span.bad{border-left-color:#d34d5d}.energy-adequacy em{color:#aeb3ba;font-size:9px;font-style:normal}.energy-weight-manual{max-width:110px}
@media(max-width:1000px){.energy-grid{grid-template-columns:1fr 1fr}.energy-macro-editor{grid-template-columns:1fr}.energy-adequacy{grid-template-columns:1fr 1fr}}@media(max-width:620px){.energy-planning-head,.energy-subhead{align-items:stretch;flex-direction:column}.energy-planning-head-actions{align-items:stretch;flex-direction:column}.energy-grid,.energy-result-strip,.energy-adequacy{grid-template-columns:1fr}.energy-exercise-row{grid-template-columns:1fr 1fr}.energy-exercise-row label:first-child{grid-column:1/-1}.energy-macro-editor>div{grid-template-columns:1fr 1fr}.energy-macro-editor>div>b,.energy-macro-editor>div>strong{grid-column:1/-1}}
body:has(main.admin) .energy-planning{background:linear-gradient(145deg,#fff,#f1f3f4)!important;color:#17191c!important;border-color:#ccd1d6!important}body:has(main.admin) .energy-planning.active{border-color:var(--brand-primary)!important}body:has(main.admin) :is(.energy-planning-head p,.energy-subhead p,.energy-grid label,.energy-exercise-row label,.energy-subhead label,.energy-adjustment-row label,.energy-adequacy em){color:#606871!important}body:has(main.admin) :is(.energy-grid input,.energy-grid select,.energy-exercise-row input,.energy-exercise-row select,.energy-subhead select,.energy-adjustment-row select,.energy-weight-manual,.energy-macro-editor input,.energy-macro-editor select){background:#fff!important;color:#17191c!important;border-color:#c8cdd2!important}body:has(main.admin) :is(.energy-readonly,.energy-session-kcal,.energy-exercises,.energy-macro-section,.energy-result-strip span,.energy-adequacy span,.energy-macro-editor>div){background:#f4f6f7!important;color:#17191c!important;border-color:#d0d5da!important}body:has(main.admin) .energy-readonly.accent{background:color-mix(in srgb,var(--brand-primary) 9%,#fff)!important;border-color:var(--brand-primary)!important}body:has(main.admin) .energy-enable{color:#30363c!important}
.energy-brand-button{min-height:38px;padding:8px 16px;border:1px solid var(--brand-primary)!important;border-radius:10px;background:var(--brand-gradient)!important;color:#fff!important;font-weight:900;cursor:pointer;box-shadow:0 6px 16px color-mix(in srgb,var(--brand-primary) 22%,transparent)}.energy-exercise-row{grid-template-columns:1.35fr .8fr .8fr .8fr auto}.energy-session-kcal{display:grid;align-content:center;gap:3px;min-height:41px;padding:7px 10px;border:1px solid #41464d;border-radius:9px;background:#202329}.energy-session-kcal small{color:#9fa5ad;font-size:9px}.energy-session-kcal b{white-space:nowrap}.energy-adjustment-row{display:grid;grid-template-columns:minmax(210px,1fr) minmax(210px,1fr);gap:10px}.energy-adjustment-row label{display:grid;gap:6px;color:#aeb3ba;font-size:10px;font-weight:850}.energy-adjustment-row select{min-height:41px;padding:8px 10px;border:1px solid #41464d;border-radius:9px;background:#0a0b0d;color:#fff}
html[data-theme="dark"] body:has(main.admin) .energy-planning{background:linear-gradient(145deg,#17191c,#0d0e10)!important;color:#f4f5f6!important;border-color:#34383e!important}html[data-theme="dark"] body:has(main.admin) .energy-planning.active{border-color:var(--brand-primary)!important}html[data-theme="dark"] body:has(main.admin) :is(.energy-planning-head p,.energy-subhead p,.energy-grid label,.energy-exercise-row label,.energy-subhead label,.energy-adjustment-row label,.energy-adequacy em,.energy-enable){color:#aeb3ba!important}html[data-theme="dark"] body:has(main.admin) :is(.energy-grid input,.energy-grid select,.energy-exercise-row input,.energy-exercise-row select,.energy-subhead select,.energy-adjustment-row select,.energy-weight-manual,.energy-macro-editor input,.energy-macro-editor select){background:#0a0b0d!important;color:#fff!important;border-color:#41464d!important}html[data-theme="dark"] body:has(main.admin) :is(.energy-readonly,.energy-session-kcal,.energy-exercises,.energy-macro-section,.energy-result-strip span,.energy-adequacy span,.energy-macro-editor>div){background:#202329!important;color:#f4f5f6!important;border-color:#3e434a!important}
@media(max-width:760px){.energy-exercise-row{grid-template-columns:1fr 1fr}.energy-exercise-row label:first-child,.energy-session-kcal{grid-column:auto}.energy-adjustment-row{grid-template-columns:1fr}}
.energy-planning-head>div>small{color:#17191c!important}.energy-publish-button{min-height:38px;padding:8px 16px;border:1px solid #168348!important;border-radius:10px;background:linear-gradient(135deg,#168348,#0d6737)!important;color:#fff!important;font-weight:900;cursor:pointer;box-shadow:0 6px 16px #16834838}.energy-publish-button:disabled{opacity:.68;cursor:default}.energy-summary-five{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}.energy-summary-five>span,.energy-summary-five>label{display:grid;align-content:center;gap:3px;min-height:62px;padding:9px 10px;border:1px solid #d0d5da;border-radius:10px;background:#f4f6f7;color:#17191c}.energy-summary-five small{color:#606871;font-size:9px;font-weight:850}.energy-summary-five b{font-size:15px}.energy-summary-five select{width:100%;min-width:0;border:0;background:transparent;color:inherit;font-weight:800}.energy-summary-five .accent{border-color:var(--brand-primary);background:color-mix(in srgb,var(--brand-primary) 9%,#fff)}.energy-macro-editor{grid-template-columns:repeat(4,minmax(0,1fr))}.energy-macro-editor>div{grid-template-columns:auto minmax(64px,.8fr) minmax(52px,.55fr);padding:8px}.energy-macro-editor>div.energy-weight-card{grid-template-columns:1fr}.energy-weight-card select,.energy-weight-card input{width:100%}.energy-adequacy span.good{border-left-color:#1f9d59!important;background:#e9f8ef!important}.energy-adequacy span.warn{border-left-color:#d59724!important;background:#fff6df!important}.energy-adequacy span.bad{border-left-color:#d44555!important;background:#fff0f1!important}.energy-adequacy span.good b{color:#126e3d}.energy-adequacy span.warn b{color:#8a5b08}.energy-adequacy span.bad b{color:#a52534}
html[data-theme="dark"] body:has(main.admin) .energy-planning-head>div>small{color:#fff!important}html[data-theme="dark"] body:has(main.admin) .energy-summary-five>span,html[data-theme="dark"] body:has(main.admin) .energy-summary-five>label{background:#202329;color:#f4f5f6;border-color:#3e434a}html[data-theme="dark"] body:has(main.admin) .energy-summary-five small{color:#9fa5ad}html[data-theme="dark"] body:has(main.admin) .energy-summary-five .accent{border-color:var(--brand-primary);background:color-mix(in srgb,var(--brand-primary) 15%,#111315)}html[data-theme="dark"] body:has(main.admin) .energy-adequacy span.good{background:#163a27!important}html[data-theme="dark"] body:has(main.admin) .energy-adequacy span.warn{background:#3c3018!important}html[data-theme="dark"] body:has(main.admin) .energy-adequacy span.bad{background:#3b1d22!important}html[data-theme="dark"] body:has(main.admin) .energy-adequacy span.good b{color:#72dfa0}html[data-theme="dark"] body:has(main.admin) .energy-adequacy span.warn b{color:#f0c665}html[data-theme="dark"] body:has(main.admin) .energy-adequacy span.bad b{color:#ff8b98}
@media(max-width:1100px){.energy-summary-five{grid-template-columns:repeat(3,1fr)}.energy-macro-editor{grid-template-columns:repeat(2,1fr)}}@media(max-width:620px){.energy-summary-five,.energy-macro-editor{grid-template-columns:1fr}}
.energy-planning.active{box-shadow:none!important}.energy-macro-editor>div.energy-macro-card{display:grid;grid-template-columns:1fr;align-content:start;gap:8px;padding:11px}.energy-macro-controls{display:grid;grid-template-columns:minmax(96px,.85fr) minmax(118px,1.15fr);gap:8px;align-items:stretch}.energy-weight-card .energy-macro-controls{grid-template-columns:1fr}.energy-macro-number{position:relative;min-width:0}.energy-macro-number input{height:100%;padding-right:31px!important}.energy-macro-arrows{position:absolute;top:1px;right:1px;bottom:1px;width:27px;display:grid;grid-template-rows:1fr 1fr;border-left:1px solid #c8cdd2;border-radius:0 7px 7px 0;overflow:hidden}.energy-macro-arrows button{min-width:0!important;min-height:0!important;padding:0!important;border:0!important;border-radius:0!important;background:#e9ecef!important;color:#30363c!important;font-size:8px!important;line-height:1!important;box-shadow:none!important}.energy-macro-arrows button+button{border-top:1px solid #c8cdd2!important}.energy-macro-arrows button:hover{background:var(--brand-primary)!important;color:#fff!important}.energy-adequacy{margin-top:15px}.energy-adequacy-collapsed{margin-top:14px;padding-top:14px;border-top:1px solid #d0d5da}body:has(main.admin) .energy-planning.active{border-color:#ccd1d6!important}html[data-theme="dark"] body:has(main.admin) .energy-planning.active{border-color:#34383e!important}html[data-theme="dark"] .energy-macro-arrows{border-color:#41464d}html[data-theme="dark"] .energy-macro-arrows button{background:#25292e!important;color:#fff!important}html[data-theme="dark"] .energy-macro-arrows button+button{border-color:#41464d!important}html[data-theme="dark"] .energy-adequacy-collapsed{border-color:#34383e}@media(max-width:620px){.energy-macro-controls{grid-template-columns:minmax(90px,.8fr) minmax(130px,1.2fr)}}

/* V23: gráfico móvel, edição de pacientes e ajuda de instalação */
.patient-diet-macro-pie-svg {
  position: relative;
  padding: 0 !important;
  background: transparent !important;
  overflow: visible;
}
.patient-diet-macro-pie-svg > svg {
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
}
.patient-diet-macro-pie-svg > span {
  position: absolute;
  inset: 19px;
  width: auto !important;
  height: auto !important;
  z-index: 2;
}
.macro-ring-track,
.macro-ring-segment {
  fill: none;
  stroke-width: 13;
}
.macro-ring-track { stroke: #2b2e33; }
.macro-ring-segment {
  stroke-linecap: butt;
  transition: stroke-dasharray .25s ease, stroke-dashoffset .25s ease;
}
.macro-ring-carb { stroke: #2457d6; }
.macro-ring-protein { stroke: #a90f24; }
.macro-ring-fat { stroke: #d28a22; }

.patient-list > .patient-row {
  padding: 0;
  gap: 0;
}
.patient-row-open {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 17px 12px 17px 20px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.patient-edit-button {
  flex: 0 0 auto;
  margin-right: 18px;
  padding: 9px 14px;
  border: 1px solid #555b61;
  border-radius: 10px;
  background: #292d31;
  color: #f4f5f6;
  font-weight: 800;
  cursor: pointer;
}
.patient-edit-button:hover { background: #3a3f44; }
.patient-edit-warning {
  margin: 0;
  padding: 11px 12px;
  border: 1px solid #675b31;
  border-radius: 10px;
  background: #2c2818;
  color: #e7d58a;
  font-size: 12px;
  line-height: 1.45;
}
.install-menu-dots {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  margin: 0 2px;
  border: 1px solid #555a60;
  border-radius: 7px;
  background: #2a2d31;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  vertical-align: middle;
}
@media (max-width: 640px) {
  .patient-row-open {
    gap: 10px;
    padding: 14px 8px 14px 12px;
  }
  .patient-edit-button {
    margin-right: 10px;
    padding: 8px 10px;
    font-size: 12px;
  }
  .patient-row-open .status { display: none; }
  .patient-diet-macro-pie-svg > span { inset: 17px; }
}

.diet-group-observation {
  display: grid;
  gap: 7px;
  margin: 10px 0 4px;
  padding: 0 10px 8px;
  color: #c7cbd0;
  font-size: 12px;
  font-weight: 800;
}
.diet-group-observation textarea {
  width: 100%;
  min-height: 58px;
  resize: vertical;
  padding: 11px 13px;
  border: 1px solid #454a50;
  border-radius: 11px;
  background: #0b0c0e;
  color: #fff;
  font: inherit;
  font-weight: 600;
  line-height: 1.45;
}
.diet-group-observation textarea:focus {
  outline: 2px solid #737a83;
  outline-offset: 1px;
}
.meal li.observation-only {
  display: block;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid #565b61;
  border-radius: 10px;
  background: #202328;
}
.meal li.observation-only .meal-observation {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.patient-diet-macro-legend { min-width: 210px; }
.patient-diet-macro-legend small { white-space: nowrap; }
@media (max-width: 430px) {
  .patient-diet-macro-legend { min-width: 0; }
}

.diet-builder{margin:22px 0;padding:24px;border:1px solid #303237;border-radius:22px;background:linear-gradient(145deg,#151618,#0d0e10);box-shadow:0 20px 60px #0005;color:#f5f5f5}.diet-builder-title{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:18px}.diet-builder-title h2{margin:3px 0 6px}.diet-plan-meta{display:grid;grid-template-columns:1.2fr .7fr 1fr;gap:12px;margin-bottom:14px}.diet-plan-meta label,.diet-builder-item label{display:grid;gap:6px;color:#aeb1b6;font-size:12px;font-weight:700}.diet-builder input,.diet-builder select{width:100%;min-height:42px;padding:9px 11px;border:1px solid #393c41;border-radius:10px;background:#0b0c0e;color:#fff}.diet-total{display:grid;grid-template-columns:repeat(4,1fr);gap:9px;margin:14px 0 18px}.diet-total span{display:grid;gap:4px;padding:13px;border-radius:12px;background:#eceef1;color:#101114}.diet-total small{color:#656a72;font-weight:800;text-transform:uppercase}.diet-builder-meal{overflow:hidden;margin:14px 0;border:1px solid #383b40;border-radius:17px;background:#111214}.diet-builder-meal-head{display:grid;grid-template-columns:105px minmax(180px,1fr) 145px auto auto;gap:9px;align-items:center;padding:14px;background:#070809}.diet-builder-group{padding:13px}.diet-builder-group.substitution{margin:10px;border:1px solid #61656d;border-radius:13px;background:#1a1c20}.diet-builder-group-head{display:flex;justify-content:space-between;gap:12px;margin-bottom:9px;color:#fff}.diet-builder-group-head span{color:#aeb1b6;font-size:12px}.diet-builder-item{display:grid;grid-template-columns:1.1fr 130px 1.7fr auto auto;gap:9px;align-items:end;padding:10px;border-top:1px solid #2e3034}.diet-display{min-width:0}.diet-amount{position:relative}.diet-amount small{position:absolute;right:8px;bottom:12px;color:#8e9299}.diet-item-macros{align-self:center;color:#b9bdc3;font-size:11px;white-space:nowrap}.diet-remove{padding:9px 12px;border:1px solid #693d43;border-radius:9px;background:#251317;color:#ff9ca7}.diet-add-food,.diet-add-sub{margin:9px 0 0}.diet-add-sub{margin:0 13px 14px}.diet-add-meal{width:100%;margin-top:10px}
.admin-head-actions{display:flex;gap:10px;align-items:center}.admin-head-actions .ghost,.diet-builder-meal-head .ghost,.diet-add-food,.diet-add-sub,.secondary-button{display:inline-flex;align-items:center;justify-content:center;min-height:42px;padding:10px 16px;border:1px solid #747983;border-radius:11px;background:linear-gradient(145deg,#2b2e33,#17191d);color:#fff;font-weight:800;box-shadow:inset 0 1px #ffffff18,0 6px 18px #0004;cursor:pointer}.admin-head-actions .ghost:hover,.diet-builder-meal-head .ghost:hover,.diet-add-food:hover,.diet-add-sub:hover,.secondary-button:hover{border-color:#fff;background:#30343a}.template-admin-list{display:grid;gap:10px}.template-admin-list article{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px;border:1px solid #303237;border-radius:15px;background:#141517}.template-admin-list h3{margin:4px 0}.template-admin-list p,.template-admin-list small{color:#9da1a8}.template-creator{margin-bottom:26px;padding:22px;border:1px solid #35383e;border-radius:20px;background:linear-gradient(145deg,#17181b,#0e0f11)}.template-creator h2{margin-top:0}.template-creator-meta{display:grid;grid-template-columns:1fr 160px 180px;gap:12px;margin-bottom:14px}.template-creator label{display:grid;gap:6px;color:#b8bbc1;font-size:12px;font-weight:800}.template-creator input,.template-creator select{min-height:43px;padding:9px 11px;border:1px solid #3b3e44;border-radius:10px;background:#090a0c;color:#fff}.template-creator-item{display:grid;grid-template-columns:1fr 135px 1.5fr auto;gap:10px;align-items:end;padding:12px 0;border-top:1px solid #303238}.template-creator-item label{position:relative}.template-creator-item label small{position:absolute;right:9px;bottom:12px;color:#8c9199}.template-creator-actions{display:flex;justify-content:center;gap:12px;margin-top:16px}.template-saved-title{margin-top:26px}.diet-total span{border:1px solid #41454c;background:linear-gradient(145deg,#24272c,#17191d);color:#fff}.diet-total small{color:#aeb3bb}.diet-item-macros{display:grid;grid-template-columns:1fr 1fr;gap:5px;min-width:190px}.diet-item-macros small{display:flex;justify-content:space-between;gap:8px;padding:5px 7px;border:1px solid #3b3e44;border-radius:7px;background:#1d2024;color:#aeb2b9;font-size:10px}.diet-item-macros b{color:#fff}.diet-meal-actions{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:0 13px 15px}.diet-meal-actions .diet-add-food,.diet-meal-actions .diet-add-sub{width:100%;margin:0}
.page-head:has(.admin-head-actions){align-items:stretch;flex-direction:column;gap:22px}.admin-head-actions{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;width:100%}.admin-head-actions .primary{display:inline-flex;align-items:center;justify-content:center;gap:8px;width:100%;min-width:0;min-height:56px;padding:11px 9px;border-radius:15px;white-space:nowrap;line-height:1.1}.admin-head-actions .hf-action-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 24px;width:24px;height:24px}.admin-head-actions .hf-action-icon svg{display:block;flex:0 0 auto;max-width:24px;max-height:24px}.admin-head-actions .hf-action-text{display:block;min-width:0;text-align:center;font-size:clamp(11px,.92vw,15px)}.admin-head-actions .hf-export-button:disabled{cursor:wait;opacity:.72}
@media(max-width:1100px){.admin-head-actions{grid-template-columns:repeat(2,minmax(160px,1fr));width:100%}}@media(max-width:520px){.admin-head-actions{grid-template-columns:1fr}.admin-head-actions .primary{white-space:normal}}
.diet-builder-title-actions{display:flex;align-items:center;gap:14px}.diet-publish-button{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:11px 17px;border:1px solid #337a55;border-radius:10px;background:linear-gradient(145deg,#173c29,#0c2418);color:#7ff0ad;font-weight:900;box-shadow:inset 0 1px #a8ffca1f,0 7px 20px #001f0d66;cursor:pointer}.diet-publish-button:hover{border-color:#5fd28d;background:#1c4a31;color:#b8ffd2}.diet-publish-button:disabled{opacity:.55;cursor:wait}.diet-macro-chart{display:flex;align-items:center;gap:10px;margin-right:4px}.diet-macro-pie{flex:0 0 82px;width:82px;height:82px;padding:7px;border-radius:50%;box-shadow:0 0 0 1px #4a4e55,0 8px 22px #0007}.diet-macro-pie>span{display:flex;width:100%;height:100%;align-items:center;justify-content:center;flex-direction:column;border-radius:50%;background:#111316;color:#fff}.diet-macro-pie b{font-size:15px}.diet-macro-pie small{color:#9499a1;font-size:9px}.diet-macro-legend{display:grid;min-width:112px;gap:5px;color:#d0d3d8;font-size:10px}.diet-macro-legend span{display:flex;align-items:center;gap:5px;white-space:nowrap}.diet-macro-legend i{flex:0 0 9px;width:9px;height:9px;border-radius:50%}.diet-macro-legend .carb{background:#2457d6}.diet-macro-legend .protein{background:#a90f24}.diet-macro-legend .fat{background:#d28a22}.diet-amount{min-width:0!important}.diet-quantity-control{position:relative;display:grid;width:100%;max-width:100%;min-width:0;grid-template-columns:minmax(34px,1fr) minmax(20px,auto) 28px;align-items:center;min-height:42px;border:1px solid #393c41;border-radius:10px;background:#0b0c0e;overflow:hidden}.diet-quantity-control input{width:100%!important;min-width:0!important;min-height:40px;padding:9px 3px 9px 9px!important;border:0!important;border-radius:0!important;background:transparent!important;-moz-appearance:textfield}.diet-quantity-control input::-webkit-inner-spin-button,.diet-quantity-control input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.diet-quantity-unit{display:block;max-width:47px;overflow:hidden;padding:0 4px;color:#aeb2b9;font-size:9.5px;font-weight:800;line-height:1;white-space:nowrap;text-overflow:clip}.diet-quantity-arrows{display:grid;width:28px;min-width:28px;align-self:stretch;border-left:1px solid #383b41}.diet-quantity-arrows button{display:flex;width:28px;min-width:28px;min-height:20px;align-items:center;justify-content:center;padding:0;border:0;background:#24272c;color:#d7d9dd;font-size:8px;cursor:pointer}.diet-quantity-arrows button+button{border-top:1px solid #3d4147}.diet-quantity-arrows button:hover{background:#3a3e45;color:#fff}.diet-delete-sub{margin-left:auto;white-space:nowrap}.diet-sub-comparison{display:grid;grid-template-columns:1.35fr repeat(4,1fr);gap:6px;align-items:center;margin:0 0 10px;padding:8px;border:1px solid #555a62;border-radius:9px;background:#111316;color:#b7bbc1;font-size:10px}.diet-sub-comparison strong,.diet-sub-comparison span{padding:5px 6px;border-radius:6px;background:#202329}.diet-sub-comparison b{color:#fff}.diet-sub-comparison.close{border-color:#347b55}.diet-sub-comparison.close strong{color:#70e6a0}.diet-sub-comparison.above{border-color:#86515a}.diet-sub-comparison.above strong{color:#ff9ba8}.diet-sub-comparison.below{border-color:#8b7542}.diet-sub-comparison.below strong{color:#f2d17d}
@media(max-width:850px){.diet-builder{padding:15px;border-radius:17px}.diet-builder-title{align-items:stretch;flex-direction:column}.diet-plan-meta,.diet-total{grid-template-columns:1fr 1fr}.diet-builder-meal-head{grid-template-columns:90px 1fr}.diet-builder-meal-head button{width:100%}.diet-builder-item{grid-template-columns:1fr 110px}.diet-display{grid-column:1/-1}.diet-item-macros{grid-column:1/-1;white-space:normal}.diet-builder-group-head{align-items:flex-start;flex-direction:column}}@media(max-width:520px){.diet-plan-meta,.diet-total{grid-template-columns:1fr}.diet-builder-meal-head{grid-template-columns:1fr}.diet-builder-item{grid-template-columns:1fr}.diet-display,.diet-item-macros{grid-column:auto}.diet-builder-group{padding:8px}.diet-builder-group.substitution{margin:8px}}
@media(max-width:850px){.template-creator-meta{grid-template-columns:1fr 1fr}.template-creator-meta label:first-child{grid-column:1/-1}.template-creator-item{grid-template-columns:1fr 120px}.template-creator-item label:nth-child(3){grid-column:1/-1}.admin-head-actions{width:100%;flex-wrap:wrap}.admin-head-actions button{flex:1}}@media(max-width:520px){.template-creator{padding:15px}.template-creator-meta,.template-creator-item,.template-creator-actions,.diet-meal-actions{grid-template-columns:1fr;display:grid}.template-creator-meta label:first-child,.template-creator-item label:nth-child(3){grid-column:auto}.diet-item-macros{grid-template-columns:1fr 1fr;min-width:0}.template-admin-list article{align-items:stretch;flex-direction:column}}
@media(max-width:850px){.diet-builder-title-actions{justify-content:space-between}.diet-sub-comparison{grid-template-columns:1fr 1fr}.diet-sub-comparison strong{grid-column:1/-1}.diet-quantity-control{grid-template-columns:minmax(70px,1fr) auto 31px}}@media(max-width:520px){.diet-builder-title-actions{align-items:stretch;flex-direction:column}.diet-macro-chart{justify-content:center}.diet-publish-button{width:100%}.diet-sub-comparison{grid-template-columns:1fr}.diet-sub-comparison strong{grid-column:auto}.diet-macro-pie{width:76px;height:76px}}
.diet-sub-head-actions{display:flex;align-items:center;gap:8px;margin-left:auto}.diet-load-sub-template{width:auto!important;min-width:190px;min-height:36px!important;padding:7px 30px 7px 10px!important;border-color:#4b5058!important;background-color:#24272c!important;color:#f2f3f5!important;font-size:11px;font-weight:800;cursor:pointer}.diet-delete-sub{margin-left:0;white-space:nowrap}@media(max-width:850px){.diet-sub-head-actions{width:100%;margin-left:0;flex-wrap:wrap}.diet-load-sub-template{flex:1 1 210px}.diet-delete-sub{flex:1 1 190px}}@media(max-width:520px){.diet-sub-head-actions{display:grid;grid-template-columns:1fr}.diet-load-sub-template,.diet-delete-sub{width:100%!important;min-width:0}}
.anthro-actions{display:grid;grid-template-columns:1.25fr 1fr 1fr;gap:10px;margin-top:18px}.anthro-actions .anthro-save{width:100%;margin:0}.anthro-download-one,.anthro-download-all{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:10px 14px;border:1px solid #62666d;border-radius:11px;background:linear-gradient(145deg,#2a2d31,#17191c);color:#f5f6f7;font-weight:850;cursor:pointer}.anthro-download-one:hover,.anthro-download-all:hover{border-color:#aeb2b8;background:#34383e}.anthro-actions button:disabled{opacity:.5;cursor:wait}.diet-builder-meal-head{grid-template-columns:105px minmax(160px,1fr) 130px minmax(190px,auto) auto auto}.diet-builder-meal.collapsed .diet-builder-meal-head{border-bottom:0}.diet-collapse-meal{min-width:104px}.diet-builder-group.substitution{margin:12px 12px 14px 42px;padding:11px;border-left:3px solid #626871}.diet-builder-group.substitution .diet-builder-item{grid-template-columns:minmax(150px,.9fr) 116px minmax(190px,1.25fr) minmax(174px,auto) auto;padding:9px 7px}.diet-builder-group.substitution .diet-item-macros{min-width:174px}.diet-builder-group.substitution .diet-item-macros small{padding:5px;font-size:9.5px}@media(max-width:980px){.anthro-actions{grid-template-columns:1fr 1fr}.anthro-actions .anthro-save{grid-column:1/-1}.diet-builder-group.substitution{margin-left:28px}.diet-builder-meal-head{grid-template-columns:90px 1fr}.diet-builder-group.substitution .diet-builder-item{grid-template-columns:1fr 110px}.diet-builder-group.substitution .diet-display,.diet-builder-group.substitution .diet-item-macros{grid-column:1/-1}}@media(max-width:520px){.anthro-actions{grid-template-columns:1fr}.anthro-actions .anthro-save{grid-column:auto}.diet-builder-group.substitution{margin:10px 4px 12px 16px;padding:8px}.diet-builder-group.substitution .diet-builder-item{grid-template-columns:1fr}.diet-builder-group.substitution .diet-display,.diet-builder-group.substitution .diet-item-macros{grid-column:auto}.diet-collapse-meal{min-width:0}}
.meal li.substitution{margin-left:28px;padding-left:14px;padding-right:10px;border-left:3px solid #646a70;background:#1b1e21}.meal li.substitution-group-start{margin-top:9px;border-top:1px solid #555b61;border-radius:12px 12px 0 0}.meal li .substitution-heading{grid-column:1/-1;display:block;margin:-5px -2px 5px -5px;padding:8px 10px;border:1px solid #555b61;border-radius:9px;background:linear-gradient(145deg,#363a3f,#25282c);box-shadow:0 5px 14px #0005;color:#fff;font-size:12px;font-weight:900;letter-spacing:.03em}.meal li.substitution>span{padding-left:5px}@media(max-width:520px){.meal li.substitution{margin-left:14px;padding-left:10px}.meal li .substitution-heading{font-size:11px}}
.anthro-section-toggle,.diet-plan-toggle{display:inline-flex;align-items:center;justify-content:center;min-height:42px;padding:10px 15px;border:1px solid #747983;border-radius:11px;background:linear-gradient(145deg,#2b2e33,#17191d);color:#fff;font-weight:850;box-shadow:inset 0 1px #ffffff18,0 6px 18px #0004;cursor:pointer;white-space:nowrap}.anthro-section-toggle:hover,.diet-plan-toggle:hover{border-color:#fff;background:#30343a}.diet-supplement-editor{display:grid;gap:8px;margin:14px;padding:15px;color:#d7dade;font-size:12px;font-weight:800}.diet-supplement-editor textarea{width:100%;min-height:110px;resize:vertical;padding:13px 14px;border:1px solid #454a50;border-radius:12px;background:#090a0c;color:#fff;font:inherit;line-height:1.55}.diet-builder input[type=time]{min-width:0;padding-right:40px!important}.diet-quantity-unit{max-width:26px!important;text-align:center}.diet-builder-title-actions{justify-content:flex-end}.anthro-fixed-card:not(:has(.visible-fixed-fields)),.anthro-admin:not(:has(form)),.anthro-history-card:not(:has(.anthro-history-list)){padding-bottom:20px}@media(max-width:1200px){.diet-builder-meal-head{grid-template-columns:minmax(120px,.42fr) minmax(0,1fr);gap:10px}.diet-builder-meal-head>*{min-width:0}.diet-builder-meal-head button{width:100%;margin:0!important}.diet-quantity-control{grid-template-columns:minmax(38px,1fr) 24px 30px}.diet-quantity-arrows,.diet-quantity-arrows button{width:30px;min-width:30px}.diet-builder-title-actions{display:grid;grid-template-columns:minmax(205px,1fr) auto auto;align-items:center;width:100%}.diet-macro-chart{justify-self:start;margin-right:0}.diet-plan-toggle,.diet-publish-button{height:100%}}@media(max-width:700px){.anthro-fixed-head,.anthro-admin-head,.anthro-history-head{display:grid;grid-template-columns:1fr;gap:12px}.anthro-section-toggle{width:100%}.diet-builder-title-actions{grid-template-columns:1fr}.diet-macro-chart{justify-self:center}.diet-plan-toggle,.diet-publish-button{width:100%;min-height:44px}.diet-builder-meal-head{grid-template-columns:1fr}.diet-builder input[type=time]{padding-right:48px!important}.diet-supplement-editor{margin:10px;padding:10px}}
.diet-builder input[type=time],.template-creator input[type=time],.appointment-admin input[type=time]{padding-right:12px!important;-webkit-appearance:none;appearance:none}.diet-builder input[type=time]::-webkit-calendar-picker-indicator,.template-creator input[type=time]::-webkit-calendar-picker-indicator,.appointment-admin input[type=time]::-webkit-calendar-picker-indicator{display:none!important;-webkit-appearance:none!important;opacity:0!important;width:0!important;margin:0!important}.appointment-toggle{grid-column:5}.appointment-admin>input[type=date]{grid-column:2;grid-row:2}.appointment-admin>input[type=time]{grid-column:3;grid-row:2}.appointment-admin>.primary{grid-column:4/6;grid-row:2}.appointment-current{grid-row:3}.template-creator-meta-simple{grid-template-columns:minmax(0,1fr) 180px}.template-supplement-card{margin-top:18px}.template-supplement-editor{display:grid;gap:8px;color:#b8bbc1;font-size:12px;font-weight:800}.template-supplement-editor textarea{width:100%;min-height:130px;resize:vertical;padding:13px 14px;border:1px solid #3b3e44;border-radius:11px;background:#090a0c;color:#fff;font:inherit;line-height:1.55}.diet-total>span:nth-child(2){border-color:#2457d688;background:linear-gradient(145deg,#2457d64d,#142755)}.diet-total>span:nth-child(3){border-color:#a90f2488;background:linear-gradient(145deg,#a90f244d,#4b131d)}.diet-total>span:nth-child(4){border-color:#d28a2288;background:linear-gradient(145deg,#d28a224d,#543916)}.diet-total>span:nth-child(n+2) small{color:#e8ebef}@media(max-width:850px){.appointment-admin{grid-template-columns:auto minmax(0,1fr) auto}.appointment-toggle{grid-column:3;grid-row:1;width:auto;justify-self:end}.appointment-admin>input[type=date],.appointment-admin>input[type=time],.appointment-admin>.primary{grid-column:1/-1;grid-row:auto}.appointment-current{grid-row:auto}.template-creator-meta-simple{grid-template-columns:1fr 150px}.template-supplement-editor textarea{min-height:115px}}@media(max-width:560px){.appointment-admin{grid-template-columns:auto minmax(0,1fr)}.appointment-toggle{grid-column:2;grid-row:2}.template-creator-meta-simple{grid-template-columns:1fr}}
.diet-meal-actions-three{grid-template-columns:1fr 1fr 1fr}.diet-load-section-template{width:100%;min-height:42px;padding:10px 34px 10px 16px;border:1px solid #747983;border-radius:11px;background:linear-gradient(145deg,#2b2e33,#17191d);color:#fff;font-weight:800;box-shadow:inset 0 1px #ffffff18,0 6px 18px #0004;cursor:pointer;text-align:center}.diet-load-section-template:hover{border-color:#fff;background-color:#30343a}.diet-supplement-content{display:grid;gap:12px;padding:0 14px 15px}.diet-supplement-content .diet-supplement-editor{margin:0;padding:15px}.diet-load-supplement-template{display:block;width:100%}@media(max-width:900px){.diet-meal-actions-three{grid-template-columns:1fr 1fr}.diet-meal-actions-three .diet-load-section-template{grid-column:1/-1}}@media(max-width:520px){.diet-meal-actions-three{grid-template-columns:1fr}.diet-meal-actions-three .diet-load-section-template{grid-column:auto}}
.template-saved-actions{display:flex;align-items:center;gap:10px}.template-saved-actions button{min-width:96px}.template-creator-item>*{min-width:0}.template-creator-item input,.template-creator-item select{width:100%;box-sizing:border-box}@media(max-width:1300px){.template-creator-item{grid-template-columns:minmax(0,1fr) 165px}.template-creator-item>label:nth-child(3){grid-column:1}.template-creator-item>.diet-remove{grid-column:2;width:100%;align-self:end}}@media(max-width:520px){.template-creator-item{grid-template-columns:1fr}.template-creator-item>label:nth-child(3),.template-creator-item>.diet-remove{grid-column:1}.template-saved-actions{width:100%}.template-saved-actions button{flex:1}}
.diet-drag-handle{display:inline-flex;align-items:center;justify-content:center;width:34px;min-width:34px;height:42px;padding:0;border:1px solid #555a62;border-radius:9px;background:linear-gradient(145deg,#30343a,#191b1f);color:#d7dbe0;font-size:20px;line-height:1;cursor:grab;user-select:none}.diet-drag-handle:active{cursor:grabbing}.diet-builder-item{grid-template-columns:34px 1.1fr 130px 1.7fr auto auto}.diet-builder-group.substitution .diet-builder-item{grid-template-columns:34px minmax(150px,.9fr) 116px minmax(190px,1.25fr) minmax(174px,auto) auto}.template-creator-item{grid-template-columns:34px minmax(0,1fr) 135px minmax(0,1.5fr) auto}.template-drag-handle{align-self:end}@media(max-width:1300px){.template-creator-item{grid-template-columns:34px minmax(0,1fr) 165px}.template-drag-handle{grid-column:1;grid-row:1}.template-food-field{grid-column:2;grid-row:1}.template-amount-field{grid-column:3;grid-row:1}.template-display-field{grid-column:2;grid-row:2}.template-creator-item>.diet-remove{grid-column:3;grid-row:2;width:100%}}@media(max-width:980px){.diet-builder-item,.diet-builder-group.substitution .diet-builder-item{grid-template-columns:34px minmax(0,1fr) 110px}.diet-builder-item>.diet-drag-handle{grid-column:1;grid-row:1}.diet-builder-item>label:first-of-type{grid-column:2;grid-row:1}.diet-builder-item>.diet-amount{grid-column:3;grid-row:1}.diet-builder-item>.diet-display,.diet-builder-item>.diet-item-macros{grid-column:2/4}.diet-builder-item>.diet-remove{grid-column:3;width:100%}}@media(max-width:520px){.template-creator-item{grid-template-columns:34px minmax(0,1fr)}.template-drag-handle{grid-column:1;grid-row:1}.template-food-field{grid-column:2;grid-row:1}.template-amount-field{grid-column:2;grid-row:2}.template-display-field{grid-column:2;grid-row:3}.template-creator-item>.diet-remove{grid-column:2;grid-row:4}.diet-builder-item,.diet-builder-group.substitution .diet-builder-item{grid-template-columns:34px minmax(0,1fr)}.diet-builder-item>.diet-drag-handle{grid-column:1;grid-row:1}.diet-builder-item>label:first-of-type{grid-column:2;grid-row:1}.diet-builder-item>.diet-amount{grid-column:2;grid-row:2}.diet-builder-item>.diet-display{grid-column:2;grid-row:3}.diet-builder-item>.diet-item-macros{grid-column:2;grid-row:4}.diet-builder-item>.diet-remove{grid-column:2;grid-row:5}}
.patient-clinical-flow{display:flex;flex-direction:column}.patient-clinical-flow>.anthro-admin{order:1}.patient-clinical-flow>.diet-builder{order:2}.patient-clinical-flow>.patient-prescriptions-card{order:3}.patient-clinical-flow>.anthro-history-card{order:4}.patient-clinical-flow>.anthro-fixed-card{order:5}@media(max-width:900px){.template-creator-item{grid-template-columns:34px minmax(0,1fr)}.template-drag-handle{grid-column:1;grid-row:1}.template-food-field{grid-column:2;grid-row:1}.template-amount-field{grid-column:2;grid-row:2}.template-display-field{grid-column:2;grid-row:3}.template-creator-item>.diet-remove{grid-column:2;grid-row:4;width:100%}.template-amount-field small{right:12px;bottom:13px}}
@media(max-width:1000px){.template-creator-item{display:grid!important;grid-template-columns:38px minmax(0,1fr) 155px!important;grid-template-areas:"drag food amount" ". display display" ". . remove"!important;column-gap:10px!important;row-gap:10px!important}.template-creator-item>.template-drag-handle{display:inline-flex!important;grid-area:drag!important;align-self:end!important;visibility:visible!important;opacity:1!important}.template-creator-item>label.template-food-field{grid-area:food!important;min-width:0!important}.template-creator-item>label.template-amount-field{grid-area:amount!important;min-width:0!important}.template-creator-item>label.template-display-field{grid-area:display!important;min-width:0!important}.template-creator-item>button.diet-remove{grid-area:remove!important;width:100%!important}.template-creator-item>label.template-amount-field small{right:12px!important;bottom:13px!important}}@media(max-width:560px){.template-creator-item{grid-template-columns:38px minmax(0,1fr)!important;grid-template-areas:"drag food" ". amount" ". display" ". remove"!important}.template-creator-item>label.template-amount-field,.template-creator-item>button.diet-remove{width:100%!important}}
.hf-food-draggable-row{position:relative;transition:transform .2s cubic-bezier(.2,.8,.2,1),opacity .18s ease,box-shadow .2s ease,background-color .2s ease}.hf-food-row-dragging{opacity:.32;transform:scale(.985);background:#22262b!important;box-shadow:inset 0 0 0 1px #8b929c66}.hf-food-drop-before{transform:translateY(9px);box-shadow:0 -3px 0 #d9dde3,0 -12px 22px #0008}.hf-food-drop-after{transform:translateY(-9px);box-shadow:0 3px 0 #d9dde3,0 12px 22px #0008}.hf-food-drag-ghost{position:fixed!important;left:-10000px!important;top:-10000px!important;z-index:99999!important;pointer-events:none!important;opacity:.96!important;transform:rotate(.35deg) scale(1.015)!important;border:1px solid #aeb4bd!important;border-radius:12px!important;background:linear-gradient(145deg,#292d33,#17191d)!important;box-shadow:0 22px 55px #000c,0 0 0 1px #ffffff20!important}.hf-food-drag-ghost .diet-drag-handle{cursor:grabbing;background:#4a5058;color:#fff}@media(prefers-reduced-motion:reduce){.hf-food-draggable-row{transition:none}}
.diet-builder-meal-head{grid-template-columns:105px minmax(150px,1fr) 125px auto minmax(190px,auto) auto auto}.diet-duplicate-meal{min-width:92px}@media(max-width:1200px){.diet-builder-meal-head{grid-template-columns:minmax(120px,.42fr) minmax(0,1fr)}.diet-builder-meal-head>*{min-width:0}.diet-builder-meal-head button{width:100%}}
.patient-diet-calculation{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:28px;align-items:center;margin-top:20px;padding:24px;border:1px solid #34373b;border-radius:22px;background:linear-gradient(145deg,#17191c,#0d0e10);color:#f4f5f6;box-shadow:0 16px 42px #0005}.patient-diet-calculation h3{margin:3px 0 7px;font-size:23px}.patient-diet-calculation p:not(.kicker){max-width:460px;margin:0;color:#aeb2b7;font-size:12px;line-height:1.5}.patient-diet-macro-chart{display:flex;align-items:center;gap:16px}.patient-diet-macro-pie{flex:0 0 118px;width:118px;height:118px;padding:9px;border-radius:50%;box-shadow:0 0 0 1px #565b62,0 12px 28px #0009}.patient-diet-macro-pie>span{display:flex;width:100%;height:100%;align-items:center;justify-content:center;flex-direction:column;border-radius:50%;background:#111316}.patient-diet-macro-pie b{font-size:22px}.patient-diet-macro-pie small{color:#979ca4;font-size:10px}.patient-diet-macro-legend{display:grid;gap:8px;min-width:150px}.patient-diet-macro-legend span{display:grid;grid-template-columns:10px 1fr auto;gap:7px;align-items:center}.patient-diet-macro-legend i{width:10px;height:10px;border-radius:50%}.patient-diet-macro-legend i.carb{background:#2457d6}.patient-diet-macro-legend i.protein{background:#a90f24}.patient-diet-macro-legend i.fat{background:#d28a22}.patient-diet-macro-legend b{font-size:11px}.patient-diet-macro-legend small{color:#9da2aa;font-size:10px}.assessment-title[type=button]{width:100%;padding:0 0 17px;border:0;border-bottom:1px solid var(--line);background:transparent;color:inherit;text-align:left;cursor:pointer}.assessment-title[type=button]>div{flex:1}.assessment-chevron{flex:0 0 auto!important;width:auto!important;height:auto!important;margin-left:auto;background:transparent!important;transition:transform .22s ease}.assessment-chevron.open{transform:rotate(180deg)}.patient-trend-card{margin-top:18px;padding:16px 17px 12px;border:1px solid #34383b;border-radius:16px;background:linear-gradient(145deg,#17191c,#101113);overflow:hidden}.patient-trend-head{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;margin-bottom:4px}.patient-trend-head small{color:#979ca3;font-size:9px;font-weight:850;text-transform:uppercase;letter-spacing:.08em}.patient-trend-head h4{margin:3px 0 0;color:#f4f5f6;font-size:16px}.patient-trend-head strong{font-size:15px}.patient-trend-svg{display:block;width:100%;height:auto;max-height:240px;overflow:visible}.patient-trend-grid{stroke:#3a3e44;stroke-width:1;stroke-dasharray:5 6}.patient-trend-value{fill:#f1f3f5;font-size:11px;font-weight:850}.patient-trend-date{fill:#92979f;font-size:9px;font-weight:700}@media(max-width:760px){.patient-diet-calculation{grid-template-columns:1fr;padding:19px}.patient-diet-macro-chart{justify-content:center}.patient-diet-macro-pie{width:104px;height:104px;flex-basis:104px}.patient-trend-card{padding:13px 10px 8px}.patient-trend-date{font-size:8px}}@media(max-width:430px){.patient-diet-macro-chart{align-items:stretch;flex-direction:column}.patient-diet-macro-pie{align-self:center}.patient-diet-macro-legend{width:100%}.patient-trend-head{align-items:flex-start;flex-direction:column}.patient-trend-svg{min-width:520px}.patient-trend-card{overflow-x:auto}}
.admin-assessment-groups{display:grid;gap:14px}.admin-assessment-group-title{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;padding:4px 2px 0}.admin-assessment-group-title h3{margin:0;color:#f5f5f5;font-size:17px}.admin-assessment-group-title small{color:#a9adb3;font-size:11px}.admin-assessment-group-title.calorimetry{margin-top:12px;padding-top:20px;border-top:1px solid #34373b}.calorimetry-row .anthro-history-metrics small{min-height:24px}.calorimetry-row .anthro-history-metrics b{white-space:nowrap}@media(max-width:700px){.admin-assessment-group-title{align-items:flex-start;flex-direction:column;gap:4px}.calorimetry-row .anthro-history-metrics{grid-template-columns:1fr}.calorimetry-row .anthro-history-metrics small{min-height:0}}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.6;
}
.app {
  min-height: 100vh;
}
.app > header {
  height: 76px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brandmark,
.mobile-logo {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--lime);
  display: grid;
  place-items: center;
  font-weight: 900;
}
.brand span:last-child,
.account > div {
  display: flex;
  flex-direction: column;
}
.brand b {
  font-size: 15px;
}
.brand small,
.account small {
  font-size: 11px;
  color: var(--muted);
}
.account {
  display: flex;
  align-items: center;
  gap: 14px;
}
.account > div {
  text-align: right;
}
.account b {
  font-size: 13px;
}
.icon,
.back,
.ghost {
  border: 0;
  background: transparent;
  color: var(--ink);
}
.icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--paper);
  display: grid;
  place-items: center;
}
.primary {
  border: 0;
  border-radius: 13px;
  background: var(--green);
  color: #fff;
  padding: 13px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 750;
}
.splash,
.center {
  min-height: 100vh;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--muted);
}
.pulse {
  width: 70px;
  height: 70px;
  border-radius: 24px;
  background: var(--ink);
  color: var(--lime);
  display: grid;
  place-items: center;
  margin: auto;
  font-size: 24px;
  font-weight: 900;
}
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}
.login-intro {
  padding: 58px clamp(38px, 7vw, 110px);
  background:
    radial-gradient(circle at 80% 18%, #d9f38a2e, transparent 28%),
    linear-gradient(150deg, #15392d, #0d271f);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-intro .brandmark {
  background: var(--lime);
  color: var(--ink);
}
.login-intro .brand small {
  color: #b7c8c0;
}
.login-intro h1 {
  font-size: clamp(44px, 5vw, 72px);
  line-height: 1.02;
  letter-spacing: -3.5px;
  max-width: 660px;
  margin: 20px 0;
}
.login-intro p {
  color: #c7d7cf;
  font-size: 18px;
  line-height: 1.7;
  max-width: 590px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 12px;
  font-weight: 800;
  color: var(--lime);
}
.trust {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 35px;
}
.login-intro > small {
  color: #9fb4ab;
}
.login-panel {
  display: grid;
  place-items: center;
  padding: 35px;
}
.login-card {
  width: min(420px, 100%);
  background: #fff;
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.login-card h2,
.modal-card h2 {
  font-size: 32px;
  letter-spacing: -1px;
  margin: 3px 0;
}
.login-card p {
  margin: 0;
  color: var(--muted);
}
.login-card label,
.modal-card label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
}
.modal-card select {
  border: 1px solid var(--line);
  background: #fbfcfb;
  border-radius: 13px;
  padding: 14px 15px;
  outline: 0;
}
.login-card input,
.modal-card input,
.search input {
  border: 1px solid var(--line);
  background: #fbfcfb;
  border-radius: 13px;
  padding: 14px 15px;
  outline: 0;
}
.login-card .primary {
  width: 100%;
}
.help {
  text-align: center;
  font-size: 12px !important;
}
.mobile-logo {
  display: none;
}
.kicker {
  font-size: 11px !important;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--green) !important;
  font-weight: 850;
  margin: 0;
}
.form-error {
  background: #fff0ee;
  color: var(--red) !important;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
}
.admin,
.portal {
  max-width: 1180px;
  margin: auto;
  padding: 46px 24px 80px;
}
.page-head,
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}
.page-head h1,
.patient-title h1 {
  font-size: 40px;
  letter-spacing: -1.7px;
  margin: 5px 0;
}
.page-head p,
.patient-title p,
.upload-copy p {
  color: var(--muted);
  margin: 0;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 30px 0;
}
.summary {
  background: #fff;
  border: 1px solid var(--line);
  padding: 20px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
}
.summary > span,
.assessment-title > span {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: var(--soft);
  color: var(--green);
  display: grid;
  place-items: center;
}
.summary strong {
  font-size: 26px;
}
.summary p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.search {
  height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 0 15px;
  margin-bottom: 16px;
}
.search input {
  border: 0;
  padding: 0;
  background: transparent;
  flex: 1;
}
.patient-list {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
}
.patient-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 17px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  text-align: left;
  color: var(--ink);
}
.avatar {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--lime);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 900;
}
.avatar.big {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  font-size: 18px;
}
.patient-main {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.patient-main small {
  color: var(--muted);
  margin-top: 3px;
}
.status {
  font-size: 11px;
  font-weight: 800;
  border-radius: 999px;
  padding: 7px 10px;
}
.status.ok {
  background: var(--soft);
  color: var(--green);
}
.status.pending {
  background: #fff6d9;
  color: #87681a;
}
.empty {
  padding: 65px 25px;
  text-align: center;
  color: var(--muted);
}
.empty svg {
  color: var(--green);
  width: 38px;
  height: 38px;
}
.empty h3 {
  color: var(--ink);
  margin-bottom: 7px;
}
.modal {
  position: fixed;
  inset: 0;
  background: #0819139e;
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 50;
}
.modal-card {
  width: min(460px, 100%);
  background: #fff;
  border-radius: 24px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.back {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  font-weight: 750;
}
.patient-title {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
}
.patient-title h1 {
  font-size: 31px;
}
.patient-name-line{display:flex;align-items:baseline;gap:16px;flex-wrap:wrap;}
.patient-name-line h1{margin-right:2px;}
.patient-latest-summary{display:flex;align-items:center;flex-wrap:wrap;color:inherit;font-size:13px;font-weight:800;}
.patient-latest-summary span{display:inline-flex;align-items:center;white-space:nowrap;}
.patient-latest-summary span+span:before{content:"|";margin:0 9px;color:#7d8288;font-weight:500;}
@media(max-width:700px){.patient-name-line{display:block}.patient-latest-summary{margin-top:8px;gap:0;font-size:12px}.patient-latest-summary span+span:before{margin:0 6px}}
.upload-card,
.preview,
.assessment-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 23px;
  padding: 25px;
  margin-top: 18px;
}
.upload-copy {
  display: flex;
  gap: 15px;
}
.upload-copy h2,
.preview h2,
.section-head h2 {
  margin: 3px 0;
  font-size: 24px;
}
.upload-icon {
  width: 48px;
  height: 48px;
  background: var(--soft);
  border-radius: 16px;
  color: var(--green);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.drop {
  border: 1.5px dashed #a9bbb2;
  background: #f8fbf9;
  border-radius: 18px;
  min-height: 155px;
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  color: var(--green);
  cursor: pointer;
}
.drop input {
  display: none;
}
.drop small {
  color: var(--muted);
}
.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}
.preview-grid article {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
}
.preview-grid h3 {
  font-size: 14px;
  margin: 9px 0;
  word-break: break-word;
}
.preview-grid p {
  color: var(--muted);
  font-size: 12px;
}
.doc-type {
  color: var(--green);
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 850;
}
.notice {
  max-width: 800px;
  margin: 18px auto;
  padding: 14px;
  border-radius: 14px;
}
.notice.success {
  background: var(--soft);
  color: var(--green);
}
.notice.error {
  background: #fff0ee;
  color: var(--red);
}
.privacy {
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.portal {
  max-width: 940px;
}
.welcome {
  background: linear-gradient(135deg, #15392d, #0f2b22);
  color: #fff;
  border-radius: 26px;
  padding: 32px;
}
.welcome p {
  color: var(--lime);
  font-weight: 700;
  margin: 0;
}
.welcome h1 {
  font-size: 34px;
  letter-spacing: -1.3px;
  margin: 8px 0;
}
.welcome span {
  font-size: 12px;
  color: #b8cbc2;
}
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #e8eeea;
  border-radius: 16px;
  padding: 5px;
  margin: 22px 0;
}
.tabs button {
  border: 0;
  background: transparent;
  border-radius: 12px;
  padding: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}
.tabs button.active {
  background: #fff;
  color: var(--green);
  box-shadow: 0 4px 15px #13362a14;
}
.date-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--soft);
  color: var(--green);
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 12px;
}
.timeline {
  position: relative;
  margin-top: 22px;
}
.meal {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.time {
  font-size: 13px;
  font-weight: 850;
  background: var(--ink);
  color: var(--lime);
  border-radius: 999px;
  padding: 8px 10px;
  height: 34px;
  text-align: center;
}
.meal-body {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
}
.meal.supplement .meal-body {
  background: #f3f9ec;
}
.meal-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.meal-title > span {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: var(--soft);
  color: var(--green);
  display: grid;
  place-items: center;
}
.meal-title small {
  font-size: 10px;
  color: var(--green);
  font-weight: 850;
  text-transform: uppercase;
}
.meal-title h3 {
  margin: 2px 0;
  font-size: 18px;
}
.meal ul {
  list-style: none;
  padding: 0;
  margin: 15px 0 0;
}
.meal li {
  border-top: 1px solid var(--line);
  padding: 13px 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
  font-size: 14px;
}
.meal li > small {
  color: var(--muted);
}
.meal li > b {
  grid-column: 1/-1;
  color: var(--green);
  font-size: 11px;
}
.assessment-title {
  display: flex;
  align-items: center;
  gap: 13px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 17px;
}
.assessment-title h3 {
  margin: 0;
}
.assessment-title p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 18px;
}
.metrics.three {
  grid-template-columns: repeat(3, 1fr);
}
.metric {
  background: var(--paper);
  border-radius: 16px;
  padding: 17px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.metric p {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 8px;
}
.metric strong {
  font-size: 21px;
}
.metric > small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  margin-top: 11px;
}
.delta {
  font-size: 10px;
  font-weight: 850;
  border-radius: 999px;
  padding: 5px 8px;
  margin-top: 8px;
}
.delta.good {
  background: var(--soft);
  color: var(--green);
}
.delta.bad {
  background: #fff0ee;
  color: var(--red);
}
.delta.neutral {
  background: #e9eeeb;
  color: var(--muted);
}
@media (max-width: 760px) {
  .login-page {
    display: block;
    padding: 22px;
  }
  .login-intro {
    display: none;
  }
  .login-panel {
    padding: 0;
    min-height: calc(100vh - 44px);
  }
  .login-card {
    padding: 28px 22px;
  }
  .mobile-logo {
    display: grid;
  }
  .app > header {
    height: 66px;
    padding: 0 16px;
  }
  .account > div,
  .brand small {
    display: none;
  }
  .admin,
  .portal {
    padding: 28px 15px 95px;
  }
  .page-head,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .page-head h1 {
    font-size: 34px;
  }
  .page-head .primary,
  .section-head .primary {
    width: 100%;
  }
  .summary-grid {
    grid-template-columns: 1fr;
  }
  .status {
    display: none;
  }
  .patient-main {
    min-width: 0;
  }
  .patient-main small {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }
  .modal-card {
    padding: 24px;
  }
  .patient-title h1 {
    font-size: 25px;
  }
  .upload-card,
  .preview {
    padding: 18px;
  }
  .upload-copy {
    display: block;
  }
  .upload-icon {
    margin-bottom: 12px;
  }
  .preview-grid {
    grid-template-columns: 1fr;
  }
  .welcome {
    padding: 25px 21px;
  }
  .welcome h1 {
    font-size: 27px;
  }
  .meal {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .time {
    width: 78px;
  }
  .meal-body {
    padding: 17px;
  }
  .metrics,
  .metrics.three {
    grid-template-columns: 1fr 1fr;
  }
  .metric strong {
    font-size: 18px;
  }
  .assessment-card {
    padding: 18px;
  }
}
@media (max-width: 410px) {
  .metrics,
  .metrics.three {
    grid-template-columns: 1fr;
  }
}
:root {
  --ink: #111214;
  --muted: #6d7176;
  --line: #d3d5d7;
  --paper: #f1f2f3;
  --green: #34383c;
  --green2: #191b1e;
  --lime: #d9dbdd;
  --soft: #e7e9eb;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.13);
}
body {
  background: linear-gradient(145deg, #f7f7f7, #ebedef);
}
.login-intro {
  background:
    radial-gradient(
      circle at 80% 18%,
      rgba(255, 255, 255, 0.13),
      transparent 30%
    ),
    linear-gradient(145deg, #191a1c, #050506);
}
.login-intro .brandmark {
  background: #050506;
  border: 1px solid #777b80;
}
.login-intro .brand small,
.login-intro p,
.welcome span {
  color: #b9bdc1;
}
.eyebrow {
  color: #e3e5e7;
}
.primary {
  background: linear-gradient(135deg, #4a4e52, #17191b);
  box-shadow: 0 10px 22px #0003;
}
.primary:hover {
  background: linear-gradient(135deg, #62676c, #202326);
}
.brandmark,
.mobile-logo,
.pulse {
  border-radius: 50%;
  border: 1px solid #70757a;
  box-shadow: 0 5px 14px #0000002e;
  object-fit: cover;
}
.welcome {
  background:
    radial-gradient(
      circle at 90% 10%,
      rgba(255, 255, 255, 0.12),
      transparent 25%
    ),
    linear-gradient(135deg, #292c2f, #08090a);
}
.welcome p {
  color: #e1e3e5;
}
.time,
.avatar {
  background: linear-gradient(145deg, #2d3033, #08090a);
  color: #e6e8ea;
}
.summary > span,
.assessment-title > span,
.upload-icon,
.meal-title > span {
  background: linear-gradient(145deg, #f1f2f3, #d8dbde);
  color: #26292c;
}
.meal.supplement .meal-body {
  background: #f0f1f2;
  border-color: #d5d7d9;
}
.tabs button.active,
.date-pill,
.doc-type,
.kicker,
.meal-title small {
  color: #25282b !important;
}
.delta.good,
.status.ok {
  background: #e5f4eb;
  color: #17683f;
}
.delta.bad {
  background: #fff0ee;
  color: #b6463e;
}
:root {
  --ink: #f3f4f5;
  --muted: #a4a8ad;
  --line: #34373b;
  --paper: #090a0b;
  --green: #c2c5c8;
  --green2: #eceeef;
  --lime: #e0e2e4;
  --soft: #24272a;
}
html,
body,
.app,
.admin,
.portal,
.login-page,
.login-panel {
  background: #090a0b;
  color: #f3f4f5;
}
.app > header {
  background: #111315;
  border-color: #303337;
}
.brand b,
.account b,
.page-head h1,
.patient-title h1,
.section-head h2,
.empty h3 {
  color: #f3f4f5;
}
.icon {
  background: #24272a;
  color: #e6e8ea;
}
.login-card,
.modal-card,
.summary,
.patient-list,
.patient-row,
.upload-card,
.preview,
.assessment-card,
.meal-body {
  background: #151719;
  color: #f3f4f5;
  border-color: #34373b;
}
.login-card input,
.modal-card input,
.search input {
  background: #202326;
  color: #f4f5f6;
  border-color: #41454a;
}
.login-card input::placeholder,
.modal-card input::placeholder,
.search input::placeholder {
  color: #83888d;
}
.search {
  background: #151719;
  border-color: #34373b;
  color: #cfd2d5;
}
.patient-row {
  border-color: #303337;
}
.patient-row:hover {
  background: #1d2023;
}
.status.pending {
  background: #403719;
  color: #f1d578;
}
.drop {
  background: #111315;
  border-color: #51565b;
  color: #e1e3e5;
}
.preview-grid article {
  background: #1b1e21;
  border-color: #3b3f43;
}
.tabs {
  background: #1d2023;
}
.tabs button {
  color: #aeb2b6;
}
.tabs button.active {
  background: #3a3e42;
  color: #fff !important;
}
.date-pill {
  background: #292c2f;
  color: #e5e7e9 !important;
}
.meal.supplement .meal-body {
  background: #1b1e21;
  border-color: #3d4145;
}
.meal li {
  border-color: #34373b;
}
.meal li.substitution {
  background: #202326;
}
.metric {
  background: #202326;
  color: #f3f4f5;
}
.metric strong {
  color: #fff;
}
.summary > span,
.assessment-title > span,
.upload-icon,
.meal-title > span {
  background: linear-gradient(145deg, #555a5f, #24272a);
  color: #f1f2f3;
}
.privacy,
.muted,
.page-head p,
.patient-title p,
.upload-copy p,
.summary p,
.preview-grid p {
  color: #a4a8ad;
}
.kicker,
.doc-type,
.meal-title small {
  color: #d8dadd !important;
}
.delta.neutral {
  background: #363a3e;
  color: #d6d9dc;
}
.delta.good,
.status.ok {
  background: #173b2a;
  color: #78d7a6;
}
.delta.bad {
  background: #482523;
  color: #ff9992;
}
.form-success {
  background: #173b2a;
  color: #8ce0b3 !important;
  padding: 11px 13px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
}
.auth-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.auth-links button {
  border: 0;
  background: transparent;
  color: #c8cbd0;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.auth-links button:hover {
  color: #fff;
}
.summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.memory-summary > div {
  min-width: 0;
  flex: 1;
}
.memory-track {
  height: 7px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #34383c;
}
.memory-track i {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: linear-gradient(90deg, #858b90, #eceeef);
}
.assessment-table-wrap {
  margin-top: 22px;
  overflow-x: auto;
  border: 1px solid #34373b;
  border-radius: 14px;
}
.assessment-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  text-align: left;
}
.assessment-table th,
.assessment-table td {
  padding: 14px 15px;
  border-bottom: 1px solid #303337;
  vertical-align: middle;
}
.assessment-table thead th {
  background: #202326;
  color: #cfd2d5;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.assessment-table tbody th {
  color: #f3f4f5;
  font-size: 13px;
  white-space: nowrap;
  background: #191b1e;
}
.assessment-table tbody td strong {
  display: block;
  margin-bottom: 6px;
  color: #fff;
  font-size: 14px;
  white-space: nowrap;
}
.assessment-table tbody tr:last-child th,
.assessment-table tbody tr:last-child td {
  border-bottom: 0;
}
.assessment-table tbody tr:hover {
  background: #1c1f22;
}
.assessment-table .delta {
  display: inline-flex;
  font-size: 10px;
  padding: 4px 7px;
}
.scroll-hint {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin: 7px 3px 0;
  color: #8f9499;
  font-size: 10px;
  font-weight: 750;
}
.assessment-help {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.assessment-help p {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  background: #202326;
  color: #aeb2b6;
  font-size: 11px;
  line-height: 1.5;
}
.assessment-help b {
  color: #eceeef;
}
@media (max-width: 820px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }
  .assessment-card {
    padding: 18px 14px;
  }
  .assessment-table-wrap {
    margin-left: -4px;
    margin-right: -4px;
  }
  .assessment-help {
    grid-template-columns: 1fr;
  }
}
.welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.welcome > div {
  min-width: 0;
}
.welcome-actions {
  flex: 0 0 min(390px, 100%);
  display: flex;
  align-items: stretch;
  flex-direction: column;
  gap: 9px;
}
.patient-preview-button {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #4b4f55;
  border-radius: 13px;
  padding: 12px 16px;
  background: linear-gradient(145deg, #24272b, #101214);
  color: #f5f6f7;
  font-weight: 800;
}
.patient-preview-button:hover {
  border-color: #737982;
  background: #2d3035;
}
.preview-banner {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 18px 0;
  padding: 15px 18px;
  border: 1px solid #565b60;
  border-radius: 15px;
  background: linear-gradient(135deg, #24272a, #151719);
}
.preview-banner > svg {
  flex: 0 0 auto;
  color: #f0f1f2;
}
.preview-banner b {
  color: #fff;
}
.preview-banner p {
  margin: 3px 0 0;
  color: #aeb3b8;
}
.parsed-values {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}
.parsed-values span {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid #3b3f43;
  border-radius: 9px;
  color: #c7cbcf;
  font-size: 12px;
  line-height: 1.4;
}
.parsed-values b {
  color: #fff;
}
.patient-download-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-top: 24px;
  padding: 22px 24px;
  border: 1px solid #484d52;
  border-radius: 21px;
  background: linear-gradient(135deg, #202326, #111315);
}
.patient-download-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 1px solid #686e73;
  border-radius: 16px;
  background: linear-gradient(145deg, #555b60, #25282b);
  color: #fff;
}
.patient-download-card > div {
  min-width: 0;
}
.patient-download-card .kicker {
  margin: 0 0 5px;
  color: #bfc3c7;
}
.patient-download-card h2 {
  margin: 0;
  color: #f5f6f7;
  font-size: 19px;
  line-height: 1.25;
}
.patient-download-card p:not(.kicker) {
  max-width: 720px;
  margin: 7px 0 0;
  color: #aeb3b8;
  font-size: 13px;
  line-height: 1.5;
}
.patient-download-card > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 16px;
  border: 1px solid #858a8f;
  border-radius: 13px;
  background: linear-gradient(135deg, #f4f5f6, #bfc3c7);
  color: #111315;
  font-weight: 850;
  white-space: nowrap;
}
.patient-download-card > button:hover:not(:disabled) {
  filter: brightness(1.08);
}
.patient-download-card .download-success,
.patient-download-card .download-error {
  display: block;
  margin-top: 7px;
  font-size: 11px;
}
.patient-download-card .download-success {
  color: #8ee8ae;
}
.patient-download-card .download-error {
  color: #ff9b94;
}
.guide-action {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.guide-action small {
  max-width: 390px;
  color: #aeb3b8;
  font-size: 11px;
  line-height: 1.35;
}
.guide-action .guide-error {
  color: #ff8d8d;
}
.guide-download {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #858a8f;
  border-radius: 13px;
  padding: 12px 15px;
  background: linear-gradient(135deg, #f4f5f6, #bfc3c7);
  color: #101214;
  font-weight: 850;
}
.guide-download:hover:not(:disabled) {
  filter: brightness(1.08);
}
.guide-download:disabled {
  cursor: wait;
  opacity: 0.62;
}
.install-app {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #6c7176;
  border-radius: 13px;
  padding: 12px 15px;
  background: #e8eaec;
  color: #111315;
  font-weight: 800;
}
.supplement-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #74797e;
  border-radius: 13px;
  padding: 12px 15px;
  background: #34383c;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}
.supplement-link {
  background: linear-gradient(135deg, #f4f5f6, #bfc3c7);
  color: #111315;
}
.supplement-link:hover {
  filter: brightness(1.08);
}
.avatar-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #74797e;
  border-radius: 13px;
  padding: 11px 15px;
  background: #34383c;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
.avatar-upload:hover {
  background: #484d52;
}
.avatar-upload input {
  display: none;
}
.avatar-notice {
  color: #c6cacf;
  font-size: 11px;
  text-align: center;
}
.avatar.has-photo {
  overflow: hidden;
  padding: 0;
  border-radius: 50%;
  background: #151719;
}
.avatar.has-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.avatar.header-avatar {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
}
.install-app:hover {
  background: #fff;
}
.install-help {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  align-items: center;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid #3b3f43;
  border-radius: 14px;
  background: #17191b;
}
.install-help b {
  color: #f3f4f5;
}
.install-help p {
  grid-column: 1;
  margin: 0;
  color: #aeb2b6;
  font-size: 12px;
  line-height: 1.5;
}
.install-help button {
  grid-column: 2;
  grid-row: 1 / span 2;
  border: 0;
  border-radius: 10px;
  padding: 9px 12px;
  background: #34383c;
  color: #fff;
  font-weight: 750;
}
.appointment-admin {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 15px;
  margin: 0 0 18px;
  padding: 20px;
  border: 1px solid #34373b;
  border-radius: 20px;
  background: #151719;
}
.appointment-admin h2 {
  margin: 0 0 4px;
  color: #f3f4f5;
  font-size: 19px;
}
.appointment-admin p {
  margin: 0;
  color: #a4a8ad;
  font-size: 12px;
}
.appointment-admin input {
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid #41454a;
  border-radius: 12px;
  background: #202326;
  color: #f4f5f6;
  color-scheme: dark;
}
.appointment-current {
  grid-column: 2 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 13px;
  border-top: 1px solid #34373b;
}
.appointment-current span {
  display: flex;
  flex-direction: column;
}
.appointment-current small {
  color: #92979c;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.appointment-current strong {
  margin-top: 2px;
  color: #fff;
}
.appointment-current button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #693632;
  border-radius: 10px;
  padding: 8px 10px;
  background: #2b1c1b;
  color: #ff9992;
  font-size: 11px;
  font-weight: 800;
}
.appointment-alert {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  padding: 16px 18px;
  border: 1px solid #4a5055;
  border-radius: 18px;
  background: linear-gradient(135deg, #272b2f, #17191b);
}
.appointment-alert > span {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #e8eaec;
  color: #17191b;
}
.appointment-alert > div:not(.calendar-action) {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 2px 10px;
}
.appointment-alert small {
  color: #aeb2b6;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.appointment-alert strong {
  color: #fff;
  font-size: 17px;
}
.appointment-alert p {
  grid-column: 1 / -1;
  margin: 3px 0 0;
  color: #d6d9dc;
  font-size: 13px;
}
.appointment-alert.past {
  border-color: #5a3431;
  background: #2b1c1b;
}
.calendar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-left: auto;
  padding: 10px 13px;
  border: 1px solid #71767b;
  border-radius: 11px;
  background: #e8eaec;
  color: #17191b;
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}
.calendar-link:hover {
  background: #fff;
}
.calendar-action {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  margin-left: auto;
  max-width: 265px;
}
.calendar-action .calendar-link {
  margin-left: 0;
}
.calendar-action small {
  color: #b8bdc1;
  font-size: 9px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0;
  text-align: center;
  text-transform: none;
}
.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 34px;
  padding: 18px 20px;
  border: 1px solid #57302d;
  border-radius: 18px;
  background: #211615;
}
.danger-zone b {
  color: #ffaaa4;
}
.danger-zone p {
  margin: 4px 0 0;
  color: #bd918e;
  font-size: 12px;
}
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
  border: 1px solid #81413c;
  border-radius: 12px;
  padding: 11px 14px;
  background: transparent;
  color: #ffaaa4;
  font-weight: 800;
}
.danger-button:hover {
  background: #3c211f;
}
.danger-button.solid {
  background: #9f342d;
  border-color: #b9433b;
  color: #fff;
}
.danger-button.solid:hover {
  background: #b33b33;
}
.delete-confirm {
  text-align: center;
}
.delete-confirm > p {
  color: #aeb2b6;
  line-height: 1.55;
}
.delete-confirm .kicker {
  color: #ff9992 !important;
}
.delete-warning {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border-radius: 50%;
  background: #482523;
  color: #ff9992;
}
.meal {
  display: block;
  margin-bottom: 12px;
}
.meal-toggle {
  width: 100%;
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 16px 12px 0;
  border: 1px solid #34373b;
  border-radius: 18px;
  background: #151719;
  color: #f3f4f5;
  text-align: left;
  overflow: hidden;
}
.meal-toggle:hover {
  background: #1d2023;
}
.meal-toggle .time {
  margin-left: 0;
  width: auto;
  height: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #f3f4f5;
}
.meal-toggle .meal-title {
  min-width: 0;
  width: 100%;
}
.meal-toggle .meal-title > .meal-icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
}
.meal-toggle .meal-title > .meal-copy {
  min-width: 0;
  width: auto;
  height: auto;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  border-radius: 0;
  background: transparent;
  color: inherit;
}
.meal-toggle .meal-copy small {
  display: block;
}
.meal-toggle .meal-copy b {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  color: #f3f4f5;
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.meal-toggle .meal-chevron {
  flex: 0 0 auto;
}
.meal-chevron {
  color: #aeb2b6;
  transition: transform 0.2s ease;
}
.meal.expanded .meal-chevron {
  transform: rotate(90deg);
}
.meal .meal-body {
  margin: 7px 0 0 104px;
  border-radius: 16px;
  padding: 4px 18px 10px;
}
.meal .meal-body ul {
  margin-top: 0;
}
.meal-observation {
  grid-column: 1 / -1;
  margin-top: 12px;
  padding: 13px 14px;
  border: 1px solid #4a4f54;
  border-radius: 12px;
  background: #282b2e;
}
.meal-observation b {
  display: block;
  margin-bottom: 6px;
  color: #e3e5e7 !important;
  font-size: 10px !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.meal-observation span {
  display: block;
  color: #c5c8cb;
  font-size: 12px;
  line-height: 1.55;
}
.meal li.observation-only {
  padding-top: 0;
  border-top: 0;
}
.meal li.observation-only .meal-observation {
  margin-top: 8px;
}
.not-identified strong {
  display: block;
  color: #aeb3b8;
  font-size: 12px !important;
}
.not-identified small {
  display: block;
  margin-top: 5px;
  color: #777d82;
  font-size: 9px;
}
@media (max-width: 760px) {
  .patient-download-card {
    grid-template-columns: 1fr;
    padding: 19px 17px;
    gap: 13px;
  }
  .patient-download-icon,
  .patient-download-card .kicker {
    display: none;
  }
  .patient-download-card h2 {
    font-size: 17px;
  }
  .patient-download-card > button {
    width: 100%;
  }
.patient-title {
    flex-wrap: wrap;
  }
  .patient-preview-button {
    width: 100%;
    margin-left: 0;
  }
  .welcome {
    align-items: stretch;
    flex-direction: column;
    gap: 18px;
  }
  .install-app,
  .welcome-actions,
  .supplement-link {
    width: 100%;
  }
  .install-help {
    grid-template-columns: 1fr;
  }
  .install-help p,
  .install-help button {
    grid-column: 1;
    grid-row: auto;
  }
  .appointment-admin {
    grid-template-columns: auto 1fr;
    padding: 17px;
  }
  .appointment-admin input,
  .appointment-admin .primary {
    grid-column: 1 / -1;
    width: 100%;
  }
  .appointment-current {
    grid-column: 1 / -1;
  }
  .appointment-alert {
    align-items: flex-start;
    padding: 14px;
  }
  .appointment-alert > div:not(.calendar-action) {
    grid-template-columns: 1fr;
  }
  .appointment-alert p {
    grid-column: 1;
  }
  .appointment-alert {
    flex-wrap: wrap;
  }
  .calendar-action {
    width: 100%;
    max-width: none;
    margin-left: 0;
  }
  .calendar-link {
    width: 100%;
    margin-left: 0;
  }
  .danger-zone {
    align-items: stretch;
    flex-direction: column;
  }
  .danger-button {
    width: 100%;
  }
  .install-help button {
    margin-top: 7px;
  }
  .meal-toggle {
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 10px 11px 10px 0;
  }
  .meal-toggle .time {
    width: auto;
    font-size: 12px;
  }
  .meal-toggle .meal-title {
    gap: 9px;
  }
  .meal-toggle .meal-title > .meal-icon {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }
  .meal-toggle .meal-copy b {
    font-size: 15px;
  }
  .meal .meal-body {
    margin: 6px 0 0;
    padding: 3px 15px 9px;
  }
}
/* Avaliação antropométrica calculada no sistema */
.anthro-admin {
  margin: 24px 0;
  padding: 26px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #343434;
  border-radius: 22px;
  background: linear-gradient(145deg, #151515, #080808);
  color: #f7faf8;
  box-shadow: 0 18px 50px #0005;
}
.anthro-admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.anthro-admin-head h2 {
  margin: 4px 0 7px;
}
.anthro-admin-head p:last-child {
  margin: 0;
  color: #c9c9c9;
}
.anthro-badge {
  white-space: nowrap;
  padding: 8px 12px;
  border: 1px solid #555;
  border-radius: 999px;
  background: #262626;
  color: #f3f3f3;
  font-size: 12px;
  font-weight: 800;
}
.anthro-admin form > h3 {
  margin: 24px 0 12px;
  font-size: 14px;
  color: #ffffff;
}
.anthro-fields {
  display: grid;
  gap: 13px;
  min-width: 0;
}
.anthro-fields.fixed {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.anthro-fixed-action{display:flex;align-items:flex-end;min-width:0;}
.anthro-fixed-action .anthro-fixed-save{width:100%;min-height:43px;}
.anthro-admin form > h3.anthro-variable-title{margin-top:34px;}
.anthro-admin .anthro-fixed-notice{margin-top:12px;}
.anthro-fields.variables {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.anthro-fields label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #e5e5e5;
  font-size: 12px;
  font-weight: 700;
}
.anthro-fields input,
.anthro-fields select {
  width: 100%;
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid #484848;
  border-radius: 12px;
  background: #050706;
  color: #ffffff;
  font: inherit;
  outline: none;
}
.anthro-fields input:focus,
.anthro-fields select:focus {
  border-color: #65df91;
  box-shadow: 0 0 0 3px #65df9128;
}
.anthro-results {
  margin-top: 22px;
  border: 1px solid #363636;
  border-radius: 16px;
  overflow: hidden;
  background: #080b09;
}
.anthro-result-top {
  display: flex;
  gap: 28px;
  padding: 15px 17px;
  border-bottom: 1px solid #363636;
  background: #202020;
}
.anthro-result-top span {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: #c9c9c9;
  font-size: 11px;
}
.anthro-result-top strong {
  color: #ffffff;
  font-size: 14px;
}
.anthro-result-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.anthro-result-table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
}
.anthro-result-table th,
.anthro-result-table td {
  padding: 11px 14px;
  border-bottom: 1px solid #2a332e;
  text-align: left;
  font-size: 12px;
}
.anthro-result-table thead th {
  background: #202020;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 10px;
}
.anthro-result-table tbody th {
  color: #ffffff;
}
.anthro-result-table td {
  color: #e5e5e5;
}
.anthro-admin .kicker,
.anthro-fixed-card .kicker {
  color: #d0d0d0;
}
.anthro-admin form > h3:first-child,
.anthro-admin form > .anthro-fields.fixed {
  display: grid;
}
.anthro-admin form > h3:first-child { display:block; }
.anthro-fixed-save-inline{margin:12px 0 6px;}
.anthro-fixed-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 24px 0;
  padding: 24px 26px;
  border: 1px solid #343434;
  border-radius: 22px;
  background: linear-gradient(145deg, #171717, #0a0a0a);
  color: #ffffff;
  box-shadow: 0 18px 50px #0005;
}
.anthro-fixed-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.anthro-fixed-head h2 {
  margin: 4px 0 7px;
}
.anthro-fixed-head p:last-child {
  margin: 0;
  color: #c9c9c9;
}
.anthro-saved-badge {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid #555;
  border-radius: 999px;
  background: #262626;
  color: #f3f3f3;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.anthro-history-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 24px 0;
  padding: 24px 26px;
  border: 1px solid #343434;
  border-radius: 22px;
  background: linear-gradient(145deg, #171717, #0a0a0a);
  color: #ffffff;
  box-shadow: 0 18px 50px #0005;
}
.anthro-history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.anthro-history-head h2 {
  margin: 4px 0 7px;
}
.anthro-history-head p:last-child {
  margin: 0;
  color: #c9c9c9;
}
.anthro-history-head .kicker {
  color: #d0d0d0;
}
.anthro-history-count {
  flex: 0 0 auto;
  min-width: 58px;
  padding: 8px 12px;
  border: 1px solid #555;
  border-radius: 999px;
  background: #262626;
  color: #f3f3f3;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}
.anthro-history-list {
  display: grid;
  gap: 10px;
}
.anthro-history-row {
  display: grid;
  grid-template-columns: minmax(145px, 0.85fr) minmax(360px, 2fr) auto;
  align-items: center;
  gap: 18px;
  padding: 15px 16px;
  border: 1px solid #343434;
  border-radius: 14px;
  background: #101010;
}
.anthro-history-date,
.anthro-history-metrics span {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.anthro-history-date small,
.anthro-history-metrics small {
  color: #a9a9a9;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.anthro-history-date strong {
  font-size: 15px;
}
.anthro-history-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  gap: 16px;
}
.anthro-history-metrics b {
  color: #f3f3f3;
  font-size: 13px;
}
.anthro-history-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #76423e;
  border-radius: 10px;
  background: #291514;
  color: #ffaaa4;
  font-size: 12px;
  font-weight: 800;
}
.anthro-history-delete:hover {
  background: #3a1b19;
}
.anthro-history-empty {
  margin: 0;
  padding: 18px;
  border: 1px dashed #444;
  border-radius: 14px;
  color: #c9c9c9;
  text-align: center;
}
.anthro-history-card .notice {
  margin-top: 14px;
}
.anthro-result-table tbody tr:last-child th,
.anthro-result-table tbody tr:last-child td {
  border-bottom: 0;
}
.anthro-save {
  margin-top: 18px;
  width: 100%;
  justify-content: center;
}
.anthro-admin .notice {
  margin-top: 18px;
}
@media (max-width: 980px) {
  .anthro-fields.fixed {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .anthro-fields.variables {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .anthro-history-row {
    grid-template-columns: 1fr auto;
  }
  .anthro-history-metrics {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}
@media (max-width: 620px) {
  .anthro-fixed-card {
    padding: 16px;
    margin: 18px 0;
    border-radius: 18px;
  }
  .anthro-fixed-head {
    display: block;
  }
  .anthro-saved-badge {
    display: inline-flex;
    margin-top: 12px;
  }
  .anthro-history-card {
    padding: 16px;
    margin: 18px 0;
    border-radius: 18px;
  }
  .anthro-history-head {
    display: block;
  }
  .anthro-history-count {
    display: inline-flex;
    justify-content: center;
    margin-top: 12px;
  }
  .anthro-history-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 13px;
    padding: 14px;
  }
  .anthro-history-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 12px 0;
    border-top: 1px solid #2f2f2f;
    border-bottom: 1px solid #2f2f2f;
  }
  .anthro-history-metrics b {
    font-size: 12px;
  }
  .anthro-history-delete {
    width: 100%;
  }
  .anthro-admin {
    padding: 16px;
    margin: 18px 0;
    border-radius: 18px;
  }
  .anthro-admin-head {
    display: block;
  }
  .anthro-badge {
    display: inline-flex;
    margin-top: 12px;
  }
  .anthro-fields.fixed,
  .anthro-fields.variables {
    grid-template-columns: 1fr;
  }
  .anthro-result-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 13px;
  }
  .anthro-fields input,
  .anthro-fields select {
    min-height: 46px;
    font-size: 16px;
  }
  .anthro-result-table {
    min-width: 620px;
  }
  .anthro-result-table th,
  .anthro-result-table td {
    padding: 10px;
  }
}

/* Prescrições profissionais e do prontuário */
.rx-template-supplement,.rx-template-compound{margin-top:18px}.rx-items{display:grid;gap:10px;margin:14px 0}.rx-item{display:grid;grid-template-columns:40px minmax(0,1fr) minmax(180px,.65fr) auto;gap:10px;align-items:end;padding:12px;border:1px solid #3a3d43;border-radius:14px;background:#17191d;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}.rx-item label{min-width:0}.rx-item input{width:100%}.rx-item .diet-drag-handle{align-self:center}.rx-add-item{margin:2px 0 16px}.patient-prescriptions-card{margin:18px 0;padding:22px;border:1px solid #3b3e44;border-radius:24px;background:linear-gradient(145deg,#191b1f,#111316);box-shadow:0 18px 42px #0004}.patient-prescriptions-head{display:flex;align-items:center;justify-content:space-between;gap:18px}.patient-prescriptions-head h2{margin:4px 0 6px}.patient-prescriptions-head p{margin:0;color:#b8bac0}.patient-prescriptions-body{margin-top:18px;padding-top:18px;border-top:1px solid #34373c}.rx-draft-toolbar,.rx-draft-meta{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:12px}.rx-draft-toolbar label,.rx-draft-meta label,.rx-instructions{display:grid;gap:7px;font-weight:700;color:#e9e9eb}.rx-draft-toolbar select,.rx-draft-meta input,.rx-instructions textarea,.rx-template-compound input{width:100%;border:1px solid #484b52;border-radius:12px;background:#0d0f12;color:#f5f5f6;padding:12px}.rx-instructions textarea{min-height:92px;resize:vertical}.rx-publish-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:14px}.rx-published-list{margin-top:24px;display:grid;gap:10px}.rx-published-list>h3{margin:0 0 4px}.rx-published-list article{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:14px 16px;border:1px solid #373a40;border-radius:14px;background:#111316}.rx-published-list h4{margin:3px 0 5px;font-size:16px}.rx-published-list p,.rx-published-list small{margin:0;color:#aaaeb5}.rx-empty{margin-top:18px}.prescription-download-card{margin-top:16px}
@media(max-width:900px){.rx-item{grid-template-columns:36px minmax(0,1fr) minmax(135px,.7fr)}.rx-item>.diet-remove{grid-column:2/4;width:100%}}
@media(max-width:620px){.patient-prescriptions-card{padding:16px;border-radius:18px}.patient-prescriptions-head{align-items:flex-start;flex-direction:column}.patient-prescriptions-head .anthro-section-toggle{width:100%}.rx-draft-toolbar,.rx-draft-meta{grid-template-columns:1fr}.rx-item{grid-template-columns:34px 1fr}.rx-item>label{grid-column:2}.rx-item>.diet-remove{grid-column:2;width:100%}.rx-publish-actions{flex-direction:column}.rx-publish-actions button{width:100%}.rx-published-list article{align-items:stretch;flex-direction:column}.rx-published-list .diet-remove{width:100%}}
/* V29 - pontos 4, 5 e 6 */
.diet-total-with-loader{
  grid-template-columns:.72fr repeat(3,minmax(0,1fr)) .82fr;
  gap:8px;
}
.diet-total-with-loader>span{
  min-width:0;
  padding:11px 10px;
}
.diet-total-with-loader>span b{
  font-size:12px;
  line-height:1.25;
}
.diet-total-loader{
  display:flex!important;
  align-items:stretch!important;
  justify-content:center;
  background:linear-gradient(145deg,#2b2e33,#17191d)!important;
  border:1px solid #747983!important;
  padding:0!important;
  overflow:hidden;
}
.diet-total-loader select{
  width:100%;
  height:100%;
  min-height:58px!important;
  border:0!important;
  border-radius:11px!important;
  background:transparent!important;
  color:#fff!important;
  font-weight:850;
  text-align:center;
  cursor:pointer;
}
.diet-total-loader select option{
  background:#17191d;
  color:#fff;
}
.diet-builder-meal-head{
  grid-template-columns:105px minmax(180px,1fr) 145px repeat(3,minmax(105px,auto));
}
.diet-builder-meal-head>.diet-remove,
.diet-builder-meal-head>.ghost{
  white-space:nowrap;
}
@media(max-width:1200px){
  .diet-total-with-loader{grid-template-columns:repeat(2,minmax(0,1fr));}
  .diet-total-loader{grid-column:1/-1;}
  .diet-builder-meal-head{grid-template-columns:minmax(120px,.42fr) minmax(0,1fr);}
}
@media(max-width:700px){
  .diet-total-with-loader{grid-template-columns:1fr;}
  .diet-total-loader{grid-column:auto;}
  .diet-total-with-loader>span b{font-size:13px;}
}

/* APN V129 — seleção de protocolo antropométrico. */
.anthro-head-actions{display:flex;align-items:center;justify-content:flex-end;gap:12px}.anthro-protocol-picker{display:grid!important;grid-template-columns:auto minmax(220px,1fr);align-items:center;gap:9px;margin:0!important}.anthro-protocol-picker>span{color:var(--muted);font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.08em}.anthro-protocol-picker select{min-height:44px;padding:8px 34px 8px 12px;border:1px solid var(--line);border-radius:12px;background:#fff;color:var(--ink);font-weight:800}.anthro-head-actions>.hf-card-action{flex:0 0 auto}@media(max-width:760px){.anthro-admin-head{align-items:stretch!important;flex-direction:column}.anthro-head-actions{align-items:stretch;flex-direction:column}.anthro-protocol-picker{grid-template-columns:1fr}.anthro-head-actions>.hf-card-action,.anthro-protocol-picker select{width:100%!important;max-width:none!important}}
html[data-theme="dark"] .anthro-protocol-picker>span{color:#aeb3ba}html[data-theme="dark"] .anthro-protocol-picker select{border-color:#41464d;background:#0a0b0d;color:#fff}

/* V30 - pontos 7 e 8 */
.diet-publish-button{white-space:nowrap;}
.anthro-fixed-save-row{
  grid-column:1/-1;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:12px;
  margin-top:4px;
}
.anthro-fixed-save-row .notice{flex:1;margin:0;}
.anthro-fixed-save{min-width:132px;}
@media(max-width:700px){
  .anthro-fixed-save-row{align-items:stretch;flex-direction:column;}
  .anthro-fixed-save{width:100%;}
}

/* V31 - tema claro EXCLUSIVO do profissional.
   Este bloco fica propositalmente no fim do arquivo para vencer o tema escuro
   anterior sem alterar o portal do paciente (.portal). */
body:has(main.admin){
  --ink:#17191c;--muted:#687079;--line:#d8dce0;--paper:#f4f5f6;
  --green:#34383c;--green2:#17191c;--lime:#d9dbdd;--soft:#eceef0;
  background:#f4f5f6!important;color:#17191c!important;color-scheme:light;
}
body:has(main.admin) .app{background:linear-gradient(145deg,#fafafa,#eef0f2)!important;color:#17191c!important}
body:has(main.admin) .app>header{background:#fff!important;border-color:#d8dce0!important;box-shadow:0 5px 22px #1014180f}
body:has(main.admin) :is(.brand b,.account b,.page-head h1,.patient-title h1,.section-head h2,.empty h3){color:#17191c!important}
body:has(main.admin) :is(.brand small,.account small,.page-head p,.patient-title p,.upload-copy p){color:#687079!important}
body:has(main.admin) :is(.icon,.back){color:#202327!important}
body:has(main.admin) .icon{background:#eceef0!important;border-color:#d8dce0!important}

body:has(main.admin) :is(.summary,.search,.patient-list,.patient-row,.upload-card,.preview,.assessment-card,.modal-card){
  background:#fff!important;color:#17191c!important;border-color:#d8dce0!important;box-shadow:0 12px 34px #12161a0f
}
body:has(main.admin) .patient-row{border-color:#e0e3e6!important}
body:has(main.admin) .patient-row:hover{background:#f5f6f7!important}
body:has(main.admin) .patient-row-open{color:#17191c!important}
body:has(main.admin) :is(.patient-main small,.summary p,.empty,.privacy){color:#687079!important}
body:has(main.admin) :is(.search input,.modal-card input){background:transparent!important;color:#17191c!important}
body:has(main.admin) :is(.search input,.modal-card input)::placeholder{color:#8b9198!important}

body:has(main.admin) .preview-grid article{
  background:#fff!important;
  color:#17191c!important;
  border:1px solid #34383c!important;
  box-shadow:0 6px 18px #12161a0a!important;
}
body:has(main.admin) .preview-grid h3{color:#17191c!important}
body:has(main.admin) .preview-grid p{color:#687079!important}
body:has(main.admin) .preview-grid .doc-type{color:#34383c!important}
body:has(main.admin) .preview-grid .parsed-values span{
  background:#f5f6f7!important;
  color:#17191c!important;
  border-color:#cfd3d7!important;
}
body:has(main.admin) .preview-grid .parsed-values b{color:#17191c!important}

body:has(main.admin) :is(.patient-edit-button,.secondary-button,.admin-head-actions .ghost){
  border-color:#c6cbd0!important;background:linear-gradient(145deg,#f8f9fa,#e5e8ea)!important;color:#202327!important;box-shadow:0 5px 14px #14181c14!important
}
body:has(main.admin) :is(.patient-edit-button,.secondary-button,.admin-head-actions .ghost):hover{border-color:#979ea5!important;background:#fff!important}

body:has(main.admin) :is(.appointment-admin,.appointment-alert){background:#fff!important;color:#17191c!important;border-color:#d8dce0!important;box-shadow:0 12px 34px #12161a0f!important}
body:has(main.admin) :is(.appointment-admin h2,.appointment-alert strong,.appointment-current strong){color:#17191c!important}
body:has(main.admin) :is(.appointment-admin p,.appointment-alert p,.appointment-alert small,.appointment-current small){color:#687079!important}
body:has(main.admin) .appointment-admin input{background:#f8f9fa!important;color:#17191c!important;border-color:#cfd3d7!important;color-scheme:light!important}
body:has(main.admin) .appointment-current{border-color:#dfe2e5!important}

body:has(main.admin) :is(.anthro-admin,.anthro-fixed-card,.anthro-history-card,.diet-builder,.patient-prescriptions-card,.template-creator,.template-admin-list article){
  background:#fff!important;color:#17191c!important;border-color:#d8dce0!important;box-shadow:0 14px 38px #12161a12!important
}
body:has(main.admin) :is(.anthro-admin h2,.anthro-admin h3,.anthro-fixed-card h2,.anthro-history-card h2,.diet-builder h2,.diet-builder h3,.patient-prescriptions-card h2,.patient-prescriptions-card h3,.patient-prescriptions-card h4,.template-creator h2,.template-admin-list h3){color:#17191c!important}
body:has(main.admin) :is(.anthro-admin-head p:last-child,.anthro-fixed-head p:last-child,.anthro-history-head p:last-child,.patient-prescriptions-head p,.template-admin-list p,.template-admin-list small){color:#687079!important}

body:has(main.admin) :is(.anthro-section-toggle,.diet-plan-toggle,.anthro-download-one,.anthro-download-all,.diet-builder-meal-head .ghost,.diet-add-food,.diet-add-sub,.diet-load-section-template,.diet-drag-handle){
  border-color:#c5cacf!important;background:linear-gradient(145deg,#f7f8f9,#e4e7e9)!important;color:#202327!important;box-shadow:0 5px 14px #14181c14!important
}
body:has(main.admin) :is(.anthro-section-toggle,.diet-plan-toggle,.anthro-download-one,.anthro-download-all,.diet-builder-meal-head .ghost,.diet-add-food,.diet-add-sub,.diet-load-section-template):hover{border-color:#979ea5!important;background:#fff!important;color:#111316!important}

body:has(main.admin) :is(.anthro-fields label,.diet-plan-meta label,.diet-builder-item label,.diet-supplement-editor,.diet-group-observation,.template-creator label,.template-supplement-editor,.rx-draft-toolbar label,.rx-draft-meta label,.rx-instructions){color:#555d65!important}
body:has(main.admin) :is(.anthro-fields input,.anthro-fields select,.diet-builder input,.diet-builder select,.diet-supplement-editor textarea,.diet-group-observation textarea,.template-creator input,.template-creator select,.template-supplement-editor textarea,.rx-draft-toolbar select,.rx-draft-meta input,.rx-instructions textarea,.rx-template-compound input){
  background:#f8f9fa!important;color:#17191c!important;border-color:#cfd3d7!important;color-scheme:light!important
}
body:has(main.admin) :is(.diet-builder select,.template-creator select,.rx-draft-toolbar select) option{background:#fff!important;color:#17191c!important}

body:has(main.admin) :is(.anthro-results,.anthro-history-row,.diet-builder-meal,.diet-builder-group.substitution,.rx-item,.rx-published-list article){background:#f8f9fa!important;color:#17191c!important;border-color:#d8dce0!important}
body:has(main.admin) :is(.anthro-result-top,.anthro-result-table thead th,.diet-builder-meal-head){background:#eceef0!important;color:#17191c!important;border-color:#d4d8dc!important}
body:has(main.admin) :is(.anthro-result-top strong,.anthro-result-table thead th,.anthro-result-table tbody th,.anthro-result-table td,.anthro-history-metrics b,.diet-builder-group-head,.diet-item-macros b,.rx-published-list h4){color:#17191c!important}
body:has(main.admin) :is(.anthro-result-top span,.anthro-history-date small,.anthro-history-metrics small,.rx-published-list p,.rx-published-list small){color:#687079!important}
body:has(main.admin) :is(.anthro-result-table th,.anthro-result-table td,.diet-builder-item,.patient-prescriptions-body){border-color:#dfe2e5!important}
body:has(main.admin) :is(.anthro-badge,.anthro-saved-badge,.anthro-history-count){background:#eceef0!important;color:#272a2e!important;border-color:#cbd0d4!important}

body:has(main.admin) :is(.diet-quantity-control,.diet-item-macros small,.diet-sub-comparison,.diet-sub-comparison strong,.diet-sub-comparison span){background:#f1f3f4!important;color:#555d65!important;border-color:#d1d5d9!important}
body:has(main.admin) .diet-quantity-arrows{border-color:#cbd0d4!important}
body:has(main.admin) .diet-quantity-arrows button{background:#e5e8ea!important;color:#34383c!important}
body:has(main.admin) .diet-quantity-arrows button:hover{background:#d9dde0!important;color:#111316!important}
body:has(main.admin) :is(.diet-quantity-unit,.diet-amount small,.template-creator-item label small){color:#747b82!important}
body:has(main.admin) .diet-total>span:first-child{background:#f3f4f5!important;color:#17191c!important;border-color:#d4d8dc!important}
body:has(main.admin) .diet-total>span:first-child small{color:#687079!important}
body:has(main.admin) .diet-total-loader{background:linear-gradient(145deg,#f7f8f9,#e4e7e9)!important;border-color:#c5cacf!important}
body:has(main.admin) .diet-total-loader select{color:#202327!important}
body:has(main.admin) .diet-macro-pie>span{background:#fff!important;color:#17191c!important}
body:has(main.admin) .diet-macro-legend{color:#454b51!important}
body:has(main.admin) .admin-assessment-group-title h3{color:#17191c!important}
body:has(main.admin) .admin-assessment-group-title small{color:#687079!important}
body:has(main.admin) .admin-assessment-group-title.calorimetry{border-color:#d8dce0!important}

/* Preserva vermelho/verde das ações e as três cores dos macronutrientes. */
body:has(main.admin) :is(.diet-remove,.anthro-history-delete){color:#b33742}
body:has(main.admin) .kicker{color:#555d65!important}

@media(max-width:700px){
  body:has(main.admin) .app>header{background:#fff!important}
  body:has(main.admin) main.admin{background:transparent!important}
}

/* V32 - acabamento do tema profissional claro */
body:has(main.admin),
body:has(main.admin) .app,
body:has(main.admin) main.admin{
  background:#fff!important;
  color:#17191c!important;
}
body:has(main.admin) main.admin :is(.page-head,.patient-title,.section-head){color:#17191c!important}
body:has(main.admin) main.admin :is(.page-head h1,.patient-title h1,.section-head h2,.page-head .kicker,.patient-title .kicker,.back){color:#17191c!important}
body:has(main.admin) main.admin :is(.page-head p,.patient-title p,.section-head p){color:#687079!important}

/* Botões secundários: cinza sólido, texto branco. */
body:has(main.admin) :is(
  .patient-edit-button,
  .secondary-button,
  .admin-head-actions .ghost,
  .anthro-section-toggle,
  .diet-plan-toggle,
  .anthro-download-one,
  .anthro-download-all,
  .diet-builder-meal-head .ghost,
  .diet-add-food,
  .diet-add-sub,
  .diet-load-section-template,
  .diet-drag-handle
){
  border-color:#4b5056!important;
  background:#454a50!important;
  color:#fff!important;
  box-shadow:none!important;
}
body:has(main.admin) :is(
  .patient-edit-button,
  .secondary-button,
  .admin-head-actions .ghost,
  .anthro-section-toggle,
  .diet-plan-toggle,
  .anthro-download-one,
  .anthro-download-all,
  .diet-builder-meal-head .ghost,
  .diet-add-food,
  .diet-add-sub,
  .diet-load-section-template
):hover{
  border-color:#30343a!important;
  background:#33383e!important;
  color:#fff!important;
}
body:has(main.admin) .diet-load-section-template option{background:#fff!important;color:#17191c!important}

/* Exclusão continua semanticamente vermelha, mas sem fundo preto. */
body:has(main.admin) :is(.diet-remove,.anthro-history-delete){
  border-color:#a74651!important;
  background:#a74651!important;
  color:#fff!important;
}
body:has(main.admin) :is(.diet-remove,.anthro-history-delete):hover{
  border-color:#8f3540!important;
  background:#8f3540!important;
  color:#fff!important;
}

/* Macros no painel claro: mesmas cores funcionais em tons claros. */
body:has(main.admin) .diet-total>span:nth-child(2){
  border-color:#9bb2ef!important;background:#e9efff!important;color:#173d96!important;
}
body:has(main.admin) .diet-total>span:nth-child(3){
  border-color:#d99aa5!important;background:#f7e6e9!important;color:#851d2e!important;
}
body:has(main.admin) .diet-total>span:nth-child(4){
  border-color:#ddb36d!important;background:#fff0d9!important;color:#75490d!important;
}
body:has(main.admin) .diet-total>span:nth-child(2) :is(small,b),
body:has(main.admin) .diet-total>span:nth-child(3) :is(small,b),
body:has(main.admin) .diet-total>span:nth-child(4) :is(small,b){color:inherit!important}

/* O carregador de dados vira o mesmo botão cinza do restante do prescritor. */
body:has(main.admin) .diet-total-loader{
  border-color:#4b5056!important;background:#454a50!important;color:#fff!important;
}
body:has(main.admin) .diet-total-loader select{color:#fff!important;background:#454a50!important}
body:has(main.admin) .diet-total-loader select option{background:#fff!important;color:#17191c!important}

/* Garante contraste de títulos que no tema original eram forçados para branco. */
body:has(main.admin) :is(
  .anthro-admin-head h2,
  .anthro-fixed-head h2,
  .anthro-history-head h2,
  .diet-builder-title h2,
  .patient-prescriptions-head h2,
  .template-creator h2,
  .template-saved-title,
  .admin-assessment-group-title h3
){color:#17191c!important}
body:has(main.admin) :is(.anthro-admin .kicker,.anthro-fixed-card .kicker,.anthro-history-head .kicker,.diet-builder .kicker,.patient-prescriptions-card .kicker){color:#555d65!important}

@media(max-width:700px){
  body:has(main.admin) main.admin{background:#fff!important}
}

/* V33 - refinamento de contraste do painel profissional claro */
body:has(main.admin) :is(
  .patient-edit-button,.secondary-button,.admin-head-actions .ghost,.anthro-section-toggle,
  .diet-plan-toggle,.anthro-download-one,.anthro-download-all,.diet-builder-meal-head .ghost,
  .diet-add-food,.diet-add-sub,.diet-load-section-template,.diet-drag-handle
){
  border-color:#8b9197!important;
  background:#777d83!important;
  color:#fff!important;
  box-shadow:none!important;
}
body:has(main.admin) :is(
  .patient-edit-button,.secondary-button,.admin-head-actions .ghost,.anthro-section-toggle,
  .diet-plan-toggle,.anthro-download-one,.anthro-download-all,.diet-builder-meal-head .ghost,
  .diet-add-food,.diet-add-sub,.diet-load-section-template
):hover{
  border-color:#6f757b!important;
  background:#686e74!important;
  color:#fff!important;
}
body:has(main.admin) .diet-total-loader{
  border-color:#8b9197!important;
  background:#777d83!important;
  color:#fff!important;
}
body:has(main.admin) .diet-total-loader select{background:#777d83!important;color:#fff!important}

/* Contornos finos escuros para destacar as caixas no fundo branco. */
body:has(main.admin) :is(
  .summary,.search,.patient-list,.patient-row,.upload-card,.preview,.assessment-card,
  .appointment-admin,.appointment-alert,.anthro-admin,.anthro-fixed-card,.anthro-history-card,
  .diet-builder,.patient-prescriptions-card,.template-creator,.template-admin-list article,
  .anthro-results,.anthro-history-row,.diet-builder-meal,.diet-builder-group.substitution,
  .rx-item,.rx-published-list article
){border-color:#34383d!important}
body:has(main.admin) :is(
  .search input,.modal-card input,.appointment-admin input,.anthro-fields input,.anthro-fields select,
  .diet-builder input,.diet-builder select,.diet-supplement-editor textarea,.diet-group-observation textarea,
  .template-creator input,.template-creator select,.template-supplement-editor textarea,
  .rx-draft-toolbar select,.rx-draft-meta input,.rx-instructions textarea,.rx-template-compound input
){border-color:#4f555b!important}

/* Upload da consulta deixa de ser preto. */
body:has(main.admin) .drop{
  background:#f3f4f5!important;
  border-color:#555c62!important;
  color:#272b2f!important;
}
body:has(main.admin) .drop small{color:#687079!important}

/* Exclusão continua semanticamente vermelha, sem a faixa preta. */
body:has(main.admin) .danger-zone{
  background:#fff1f2!important;
  border-color:#c76a72!important;
}
body:has(main.admin) .danger-zone b{color:#8b2933!important}
body:has(main.admin) .danger-zone p{color:#70484c!important}
body:has(main.admin) .danger-button{
  background:#fff!important;
  border-color:#b8505a!important;
  color:#9a303a!important;
}
body:has(main.admin) .danger-button:hover{background:#fdebed!important}

/* V34 - tema claro completo: portal do paciente + preview profissional. */
body:has(main.portal),
body:has(main.portal) .app,
body:has(main.portal) main.portal{
  background:#fff!important;
  color:#17191c!important;
  color-scheme:light;
}
body:has(main.portal) .app>header{
  background:#fff!important;
  border-color:#34383d!important;
  box-shadow:0 5px 22px #1014180f!important;
}
body:has(main.portal) :is(.brand b,.account b,.welcome h1,.patient-title h1,.section-head h2,.assessment-title h3,.meal-toggle .meal-copy b){color:#17191c!important}
body:has(main.portal) :is(.brand small,.account small,.patient-title p,.assessment-title p,.muted){color:#687079!important}
body:has(main.portal) .icon{background:#eceef0!important;border-color:#b8bdc2!important;color:#202327!important}

body:has(main.portal) .welcome{
  background:#f4f5f6!important;
  color:#17191c!important;
  border:1px solid #34383d!important;
  box-shadow:0 12px 34px #12161a0f!important;
}
body:has(main.portal) .welcome p{color:#343a40!important}
body:has(main.portal) .welcome span{color:#687079!important}
body:has(main.portal) .tabs{background:#e5e8ea!important;border:1px solid #6b7177!important}
body:has(main.portal) .tabs button{color:#555d65!important}
body:has(main.portal) .tabs button.active{background:#fff!important;color:#17191c!important;box-shadow:0 4px 14px #10141818!important}
body:has(main.portal) .date-pill{background:#eceef0!important;color:#34383c!important;border:1px solid #9ca2a8!important}

body:has(main.portal) :is(.meal-toggle,.meal-body,.assessment-card,.patient-download-card,.install-help,.patient-diet-calculation,.patient-trend-card){
  background:#fff!important;
  color:#17191c!important;
  border-color:#34383d!important;
  box-shadow:0 10px 28px #12161a0d!important;
}
body:has(main.portal) .meal-toggle:hover{background:#f3f4f5!important}
body:has(main.portal) .meal-toggle .time{color:#17191c!important}
body:has(main.portal) .meal-title>.meal-icon,
body:has(main.portal) .assessment-title>span{
  background:#e3e6e8!important;
  color:#34383c!important;
  border:1px solid #9ea4aa!important;
}
body:has(main.portal) .meal-title small{color:#555d65!important}
body:has(main.portal) .meal-chevron{color:#555d65!important}
body:has(main.portal) .meal li{border-color:#c7ccd0!important;color:#17191c!important}
body:has(main.portal) .meal li>small{color:#687079!important}
body:has(main.portal) .meal li>b{color:#34383c!important}
body:has(main.portal) .meal.supplement .meal-body{background:#f7f8f9!important;border-color:#34383d!important}
body:has(main.portal) .meal-observation{background:#eef0f2!important;border-color:#737a80!important}
body:has(main.portal) .meal-observation b{color:#34383c!important}
body:has(main.portal) .meal-observation span{color:#4e555c!important}
body:has(main.portal) .meal li.observation-only{background:transparent!important;border:0!important;padding:0!important;box-shadow:none!important}
body:has(main.portal) .meal li.observation-only .meal-observation{margin-top:8px!important;padding:13px 14px!important;background:#eef0f2!important;border:1px solid #737a80!important}

body:has(main.portal) .metric{background:#f1f3f4!important;color:#17191c!important;border:1px solid #9ba1a7!important}
body:has(main.portal) .metric strong{color:#17191c!important}
body:has(main.portal) .assessment-title{border-color:#a7adb2!important}
body:has(main.portal) .assessment-table-wrap{border-color:#737a80!important;background:#fff!important}
body:has(main.portal) .assessment-table :is(th,td){border-color:#c5c9cd!important;color:#17191c!important}
body:has(main.portal) .assessment-table thead th{background:#e7eaec!important;color:#17191c!important}
body:has(main.portal) .assessment-table tbody th{background:#f4f5f6!important;color:#3e444a!important}
body:has(main.portal) .assessment-help{background:#f3f4f5!important;border-color:#858c92!important}
body:has(main.portal) .assessment-help :is(p,b){color:#4b5259!important}

/* Gráficos permanecem com as cores clínicas, mas em cartões claros. */
body:has(main.portal) .patient-diet-calculation h3,
body:has(main.portal) .patient-trend-head h4{color:#17191c!important}
body:has(main.portal) .patient-diet-calculation p:not(.kicker){color:#687079!important}
body:has(main.portal) .patient-diet-macro-pie{box-shadow:0 0 0 1px #8a9096,0 8px 20px #10141818!important}
body:has(main.portal) .patient-diet-macro-pie>span,
body:has(main.portal) .patient-diet-macro-pie-svg>span{background:#fff!important;color:#17191c!important}
body:has(main.portal) .macro-ring-track{stroke:#d8dce0!important}
body:has(main.portal) .patient-diet-macro-legend{color:#343a40!important}
body:has(main.portal) .patient-diet-macro-legend small{color:#687079!important}
body:has(main.portal) .patient-trend-head small{color:#687079!important}
body:has(main.portal) .patient-trend-grid{stroke:#c6cbd0!important}
body:has(main.portal) .patient-trend-value{fill:#22262a!important}
body:has(main.portal) .patient-trend-date{fill:#5f666d!important}

body:has(main.portal) .patient-download-icon{
  background:#e2e5e7!important;
  border-color:#7c8389!important;
  color:#24282c!important;
}
body:has(main.portal) .patient-download-card .kicker{color:#555d65!important}
body:has(main.portal) .patient-download-card h2{color:#17191c!important}
body:has(main.portal) .patient-download-card p:not(.kicker){color:#687079!important}
body:has(main.portal) :is(.patient-download-card>button,.guide-download,.install-app,.supplement-link){
  background:#6f757b!important;
  border-color:#7f868c!important;
  color:#fff!important;
  box-shadow:none!important;
}
body:has(main.portal) :is(.patient-download-card>button,.guide-download,.install-app,.supplement-link):hover{background:#60666c!important}
body:has(main.portal) .guide-action small{color:#687079!important}
body:has(main.portal) .install-help b{color:#17191c!important}
body:has(main.portal) .install-help p{color:#687079!important}
body:has(main.portal) .install-help button{background:#777d83!important;color:#fff!important}

/* Tela de login também clara nesta versão candidata integralmente branca. */
body:has(.login-page),
body:has(.login-page) .app,
body:has(.login-page) .login-page,
body:has(.login-page) .login-panel{background:#fff!important;color:#17191c!important;color-scheme:light}
body:has(.login-page) .login-card{background:#fff!important;color:#17191c!important;border-color:#34383d!important;box-shadow:0 14px 38px #12161a12!important}
body:has(.login-page) .login-card input{background:#f5f6f7!important;color:#17191c!important;border-color:#555c62!important}
body:has(.login-page) .login-card input::placeholder{color:#7c8389!important}

@media(max-width:700px){
  body:has(main.portal),body:has(main.portal) .app,body:has(main.portal) main.portal{background:#fff!important}
}

/* V35 - acabamento final de contraste do tema claro */
/* Acoes neutras do profissional: cinza medio e texto branco. */
body:has(main.admin) .patient-preview-button{
  background:#777d83!important;
  border-color:#8b9197!important;
  color:#fff!important;
  box-shadow:none!important;
}
body:has(main.admin) .patient-preview-button:hover{
  background:#686e74!important;
  border-color:#6f757b!important;
  color:#fff!important;
}

/* Confirmacoes: verde legivel; exclusoes: mesmo vermelho do prescritor. */
body:has(main.admin) :is(.diet-publish-button,.anthro-fixed-save,.anthro-save,.appointment-admin>.primary),
body:has(main.admin) .rx-publish-actions .diet-publish-button{
  background:#3f9b69!important;
  border-color:#34845a!important;
  color:#fff!important;
  box-shadow:none!important;
}
body:has(main.admin) :is(.diet-publish-button,.anthro-fixed-save,.anthro-save,.appointment-admin>.primary):hover,
body:has(main.admin) .rx-publish-actions .diet-publish-button:hover{
  background:#337f56!important;
  border-color:#2c704b!important;
  color:#fff!important;
}
body:has(main.admin) :is(.diet-remove,.anthro-history-delete,.appointment-current button,.danger-button,.danger-button.solid){
  background:#a74651!important;
  border-color:#a74651!important;
  color:#fff!important;
  box-shadow:none!important;
}
body:has(main.admin) :is(.diet-remove,.anthro-history-delete,.appointment-current button,.danger-button,.danger-button.solid):hover{
  background:#8f3540!important;
  border-color:#8f3540!important;
  color:#fff!important;
}

/* Estados do cadastro: cores claras o suficiente para leitura imediata. */
body:has(main.admin) .status.ok{
  background:#3f9b69!important;
  border-color:#34845a!important;
  color:#fff!important;
}
body:has(main.admin) .status.pending{
  background:#d4a73f!important;
  border-color:#bc8e29!important;
  color:#17191c!important;
}

/* Preview profissional do portal: elimina o ultimo bloco preto. */
body:has(main.admin) .preview-banner{
  background:#eef0f2!important;
  border-color:#7e858b!important;
  color:#17191c!important;
  box-shadow:none!important;
}
body:has(main.admin) .preview-banner>svg,
body:has(main.admin) .preview-banner b{color:#25292d!important}
body:has(main.admin) .preview-banner p{color:#626a72!important}

/* Portal do paciente: titulos, rotulos e numeros sempre escuros no tema claro. */
body:has(main.portal) :is(
  .kicker,.doc-type,.section-head,.section-head h2,.assessment-card h2,.assessment-card h3,
  .assessment-card .kicker,.assessment-card .doc-type,.assessment-table tbody td strong,
  .assessment-table tbody td,.assessment-table tbody th,.scroll-hint
){color:#17191c!important}
body:has(main.portal) :is(.section-head p,.assessment-card>p,.assessment-title p){color:#687079!important}
body:has(main.portal) .assessment-table tbody tr:hover{background:#eef0f2!important}

/* Explicacoes da calorimetria: cartoes claros, borda visivel e texto escuro. */
body:has(main.portal) .assessment-help{
  background:transparent!important;
  border:0!important;
}
body:has(main.portal) .assessment-help p{
  background:#f1f3f4!important;
  border:1px solid #969da3!important;
  color:#4b5259!important;
}
body:has(main.portal) .assessment-help p b{color:#17191c!important}

/* O banner visto ao usar 'Visualizar como paciente' tambem fica neutro. */
body:has(main.portal) .preview-banner{
  background:#eef0f2!important;
  border-color:#7e858b!important;
  color:#17191c!important;
}
body:has(main.portal) .preview-banner>svg,
body:has(main.portal) .preview-banner b{color:#25292d!important}
body:has(main.portal) .preview-banner p{color:#626a72!important}

/* V36 - ultimos ajustes visuais do tema claro */
/* Comparativos: mesmas familias de verde/vermelho usadas nas acoes do painel. */
body:has(main.portal) .delta.good{
  background:#3f9b69!important;
  border:1px solid #34845a!important;
  color:#fff!important;
}
body:has(main.portal) .delta.bad{
  background:#a74651!important;
  border:1px solid #903b45!important;
  color:#fff!important;
}
body:has(main.portal) .delta.neutral{
  background:#555b61!important;
  border:1px solid #494f55!important;
  color:#fff!important;
}

/* Link de retorno no preview/portal claro. */
body:has(main.portal) .back{
  color:#17191c!important;
}
body:has(main.portal) .back:hover{
  color:#4f565d!important;
}

/* Cadastro clinico: amarelo preservado, agora com contraste branco. */
body:has(main.admin) .status.pending{
  background:#d4a73f!important;
  border-color:#bc8e29!important;
  color:#fff!important;
}

/* V37 - alternancia claro/escuro: controle no cabecalho (tema claro). */
.theme-toggle{
  min-height:42px;
  padding:0 14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  border:1px solid #aeb4b9;
  border-radius:14px;
  background:#eef0f2;
  color:#202327;
  font:inherit;
  font-weight:800;
  cursor:pointer;
  transition:background .18s ease,border-color .18s ease,transform .18s ease;
}
.theme-toggle:hover{background:#e2e5e7;border-color:#858c92;transform:translateY(-1px)}
.theme-toggle-icon{font-size:18px;line-height:1}
.theme-toggle-label{font-size:13px;line-height:1}
@media(max-width:700px){
  .theme-toggle{width:46px;height:46px;min-height:46px;padding:0;border-radius:14px}
  .theme-toggle-label{display:none}
}

/* V38 - refinamento final do tema claro no portal e no prescritor. */
/* Proxima consulta acompanha os demais cartoes claros do paciente. */
body:has(main.portal) .appointment-alert,
body:has(main.portal) .appointment-alert.past{
  background:#fff!important;
  border-color:#34383d!important;
  color:#17191c!important;
  box-shadow:0 10px 28px #12161a0d!important;
}
body:has(main.portal) .appointment-alert :is(small,strong,p){color:#17191c!important}
body:has(main.portal) .appointment-alert p,
body:has(main.portal) .calendar-action small{color:#687079!important}

/* Acoes cinza do portal claro usam texto preto para maior contraste visual. */
body:has(main.portal) :is(.patient-download-card>button,.guide-download,.install-app,.supplement-link,.calendar-link){
  background:#d7dadd!important;
  border-color:#858c92!important;
  color:#17191c!important;
  box-shadow:none!important;
}
body:has(main.portal) :is(.patient-download-card>button,.guide-download,.install-app,.supplement-link,.calendar-link):hover{
  background:#c9cdd0!important;
  border-color:#6f767c!important;
  color:#17191c!important;
}
body:has(main.portal) .install-help button{
  background:#d7dadd!important;
  border-color:#858c92!important;
  color:#17191c!important;
}
/* Cabecalho de cada refeicao: horario, nome e tipo com leitura mais forte. */
body:has(main.admin) .diet-builder-meal-head>input,
body:has(main.admin) .diet-builder-meal-head>select{
  font-weight:800!important;
}

/* O titulo do grupo principal continua escuro, sem ganhar peso extra. */
body:has(main.admin) .diet-builder-group-head>b{color:#17191c!important}

/* Adicionar refeicao: cinza neutro com texto branco, conforme o restante do prescritor. */
body:has(main.admin) .diet-add-meal{
  background:#777d83!important;
  border-color:#8b9197!important;
  color:#fff!important;
  box-shadow:none!important;
}
body:has(main.admin) .diet-add-meal:hover{
  background:#686e74!important;
  border-color:#6f757b!important;
  color:#fff!important;
}

/* V39 - recursos moveis, contornos do prescritor e acabamento final. */
.patient-list-toggle{
  width:100%;
  min-height:54px;
  margin-top:12px;
  justify-content:center;
  border-radius:14px;
  font-weight:850;
}
.patient-list-toggle + .patient-list{margin-top:16px}
.patient-list-toggle.has-visible-list{margin-bottom:18px!important}
body:has(main.admin) .search input{
  min-width:0!important;width:100%!important;height:38px!important;min-height:38px!important;
  box-sizing:border-box!important;border:0!important;border-radius:4px!important;
  padding:7px 10px!important;line-height:24px!important;overflow:visible!important;
  background:#eef0f2!important;color:#17191c!important;
}
.mobile-resource-cards{display:none}
.patient-resource-link{
  display:flex;align-items:center;justify-content:center;gap:9px;
  min-height:46px;padding:11px 15px;border:1px solid #767b82;border-radius:12px;
  background:#25282d;color:#fff;font-weight:850;text-decoration:none;
}
body:has(main.admin) .diet-total-with-loader>span,
body:has(main.admin) .diet-total-loader{
  border:1px solid #34383d!important;
}
body:has(main.portal) .patient-resource-link{
  background:#d7dadd!important;border-color:#858c92!important;color:#17191c!important;box-shadow:none!important;
}
body:has(main.portal) .patient-resource-link:hover{background:#c9cdd0!important;color:#17191c!important}
@media(max-width:700px){
  .welcome-actions>.guide-action,.welcome-actions>.supplement-link{display:none!important}
  .welcome-actions:not(:has(.install-app)){display:none!important}
  .mobile-resource-cards{display:grid;gap:16px;margin-top:16px}
  .mobile-resource-cards .patient-download-card{margin:0}
  .mobile-resource-cards .patient-resource-link{width:100%}
  .welcome-actions:empty{display:none!important}
}

/* V45 - contraste das refeicoes e substituicoes no tema claro. */
body:has(main.admin) .diet-builder-group-head,
body:has(main.admin) .diet-builder-group-head>b,
body:has(main.admin) .diet-builder-group-head>span{
  color:#111316!important;
}

body:has(main.admin) .diet-item-macros,
body:has(main.admin) .diet-item-macros small,
body:has(main.admin) .diet-item-macros small b{
  color:#111316!important;
}
body:has(main.admin) .diet-item-macros small{
  background:#f4f5f6!important;
  border-color:#c9cdd1!important;
}

body:has(main.admin) .diet-sub-comparison{
  background:#fff!important;
  color:#111316!important;
  border-color:#b9bec3!important;
}
body:has(main.admin) .diet-sub-comparison span{
  background:#f1f3f4!important;
  color:#111316!important;
  border-color:#d1d5d9!important;
}
body:has(main.admin) .diet-sub-comparison span b{
  color:#111316!important;
}

/* O percentual conserva a leitura de status existente no modo escuro. */
body:has(main.admin) .diet-sub-comparison.close{
  border-color:#5b9d73!important;
}
body:has(main.admin) .diet-sub-comparison.close>strong{
  background:#dff1e5!important;
  border:1px solid #83b894!important;
  color:#17683a!important;
}
body:has(main.admin) .diet-sub-comparison.below{
  border-color:#b79a4d!important;
}
body:has(main.admin) .diet-sub-comparison.below>strong{
  background:#f8edc9!important;
  border:1px solid #cfb667!important;
  color:#6f5400!important;
}
body:has(main.admin) .diet-sub-comparison.above{
  border-color:#b36d78!important;
}
body:has(main.admin) .diet-sub-comparison.above>strong{
  background:#f5dde1!important;
  border:1px solid #cf929b!important;
  color:#8d2634!important;
}

/* Portal do paciente: substituicoes claras, sem bloco preto residual. */
body:has(main.portal) .meal li.substitution{
  background:#f6f7f8!important;
  border-left-color:#8d949b!important;
  color:#17191c!important;
}
body:has(main.portal) .meal li.substitution-group-start{
  border-top-color:#aeb4b9!important;
}
body:has(main.portal) .meal li .substitution-heading{
  background:#e6e9eb!important;
  border-color:#aeb4b9!important;
  box-shadow:none!important;
  color:#17191c!important;
}
body:has(main.portal) .meal li.substitution>span,
body:has(main.portal) .meal li.substitution>strong,
body:has(main.portal) .meal li.substitution small,
body:has(main.portal) .meal li.substitution b{
  color:#17191c!important;
}

/* HF - cabecalhos compactos do prontuario, seguindo o bloco Proxima consulta. */
body:has(main.admin) .patient-clinical-flow > :is(.anthro-admin,.diet-builder,.patient-prescriptions-card,.anthro-history-card){
  margin:0 0 18px!important;padding:20px!important;border-radius:20px!important;
}
body:has(main.admin) :is(.anthro-admin-head,.anthro-history-head,.patient-prescriptions-head,.diet-builder-title){
  align-items:center!important;gap:15px!important;margin-bottom:0!important;
}
body:has(main.admin) :is(.anthro-admin:has(form) .anthro-admin-head,.anthro-history-card:has(.admin-assessment-groups) .anthro-history-head,.patient-prescriptions-card:has(.patient-prescriptions-body) .patient-prescriptions-head,.diet-builder:has(.diet-total) .diet-builder-title){margin-bottom:18px!important}
.hf-section-copy{display:flex;align-items:center;gap:15px;min-width:0;flex:1}.hf-section-copy>div{min-width:0}
.hf-section-symbol{display:grid;place-items:center;flex:0 0 48px;width:48px;height:48px;border-radius:16px;background:#eef0f1;color:#202326;font-size:22px;line-height:1}
body:has(main.admin) .hf-section-copy h2{margin:0 0 4px!important;color:#17191c!important;font-size:19px!important;line-height:1.15!important;font-weight:800!important}
body:has(main.admin) .hf-section-copy p{margin:0!important;color:#687079!important;font-size:12px!important;line-height:1.35!important;font-weight:400!important}
body:has(main.admin) .diet-builder-title{display:flex!important;justify-content:space-between!important}
body:has(main.admin) .diet-builder-title-actions{display:flex!important;width:auto!important;gap:10px!important;align-items:center!important;justify-content:flex-end!important}
body:has(main.admin) .diet-macro-chart{gap:7px!important;margin:0!important}
body:has(main.admin) .diet-macro-pie{flex:0 0 56px!important;width:56px!important;height:56px!important;padding:5px!important}
body:has(main.admin) .diet-macro-pie b{font-size:11px!important}.diet-macro-pie small{font-size:8px!important}
body:has(main.admin) .diet-macro-legend{min-width:96px!important;gap:3px!important;font-size:9px!important}
body:has(main.admin) .upload-card{display:grid!important;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:15px;margin-top:0!important;padding:20px!important;border-radius:20px!important}
body:has(main.admin) .upload-copy{align-items:center;gap:15px;min-width:0}
body:has(main.admin) .upload-copy h2{margin:0 0 4px!important;font-size:19px!important;line-height:1.15!important}
body:has(main.admin) .upload-copy p{margin:0!important;font-size:12px!important;line-height:1.35!important}
body:has(main.admin) .upload-section-toggle{grid-column:2;grid-row:1}
body:has(main.admin) .upload-card>.drop{grid-column:1/-1;grid-row:2;margin-top:3px!important}
@media(max-width:1100px){body:has(main.admin) .diet-builder-title{align-items:stretch!important;flex-direction:column!important}body:has(main.admin) .diet-builder-title-actions{width:100%!important;justify-content:space-between!important}}
@media(max-width:700px){body:has(main.admin) :is(.anthro-admin-head,.anthro-history-head,.patient-prescriptions-head){grid-template-columns:1fr!important;align-items:stretch!important}body:has(main.admin) .diet-builder-title-actions{display:grid!important;grid-template-columns:1fr!important}body:has(main.admin) .diet-macro-chart{justify-self:center!important}body:has(main.admin) .upload-card{grid-template-columns:1fr!important}body:has(main.admin) .upload-section-toggle{grid-column:1;grid-row:2;width:100%}body:has(main.admin) .upload-card>.drop{grid-column:1;grid-row:3}.hf-section-symbol{flex-basis:44px;width:44px;height:44px;border-radius:14px;font-size:20px}}

/* HF - plano profissional limpo + icones padronizados. */
body:has(main.admin) .hf-section-symbol{
  background:linear-gradient(145deg,#555a5f,#24272a)!important;
  color:#f1f2f3!important;
  filter:grayscale(1);
}
body:has(main.admin) .diet-builder-title-actions{display:flex!important;width:auto!important;justify-content:flex-end!important}
body:has(main.admin) .diet-builder-title-actions .diet-plan-toggle{min-width:150px}
body:has(main.admin) .diet-total-with-loader{
  grid-template-columns:.68fr repeat(3,minmax(0,1fr)) minmax(132px,.72fr)!important;
  gap:7px!important;
}
body:has(main.admin) .diet-total-with-loader>span{padding:9px 8px!important}
body:has(main.admin) .diet-total-with-loader>span b{font-size:11.5px!important;line-height:1.2!important}
body:has(main.admin) .diet-total-actions-stack{display:grid;grid-template-rows:1fr 1fr;gap:6px;min-width:0}
body:has(main.admin) .diet-total-actions-stack .diet-total-loader{grid-column:auto!important;min-width:0;min-height:0!important;border-radius:10px!important}
body:has(main.admin) .diet-total-actions-stack .diet-total-loader select{min-height:32px!important;padding:5px 7px!important;font-size:10px!important}
body:has(main.admin) .diet-publish-inline{width:100%;min-height:32px!important;padding:6px 7px!important;border-radius:10px!important;font-size:10px!important;line-height:1.1!important}
@media(max-width:1200px){
  body:has(main.admin) .diet-total-with-loader{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body:has(main.admin) .diet-total-actions-stack{grid-column:1/-1;grid-template-columns:1fr 1fr;grid-template-rows:auto}
}
@media(max-width:700px){
  body:has(main.admin) .diet-builder-title{align-items:stretch!important;flex-direction:column!important}
  body:has(main.admin) .diet-builder-title-actions{width:100%!important}
  body:has(main.admin) .diet-builder-title-actions .diet-plan-toggle{width:100%;min-width:0}
  body:has(main.admin) .diet-total-with-loader{grid-template-columns:1fr!important}
  body:has(main.admin) .diet-total-actions-stack{grid-column:auto;grid-template-columns:1fr;grid-template-rows:auto auto}
}

/* HF - refinamento de leitura e icones vetoriais. */
body:has(main.admin) .hf-section-symbol{filter:none!important}
body:has(main.admin) .hf-section-symbol svg{color:#f1f2f3!important;stroke:currentColor!important;stroke-width:2!important}
body:has(main.admin) .diet-builder-meal-head>input,
body:has(main.admin) .diet-builder-meal-head>select{font-weight:400!important}
body:has(main.admin) .anthro-admin form>h3{font-size:16px!important}
body:has(main.admin) .anthro-fields label{font-size:14px!important}
body:has(main.admin) .anthro-fields input,
body:has(main.admin) .anthro-fields select{font-size:15px!important;font-weight:600!important}
@media(max-width:700px){
  body:has(main.portal) .meal-toggle .time{font-size:16px!important;font-weight:650!important}
}

/* HF - prontuario desktop em uma unica tela (estado fechado). */
@media(min-width:901px){
  body:has(main.admin) main.admin{padding:10px 24px 14px!important}
  body:has(main.admin) .back{margin-bottom:6px!important;font-size:13px;line-height:1.2}
  body:has(main.admin) .back svg{width:18px;height:18px}
  body:has(main.admin) .patient-title{gap:12px!important;margin-bottom:8px!important}
  body:has(main.admin) .patient-title .avatar.big{flex:0 0 52px;width:52px;height:52px;border-radius:16px;font-size:15px}
  body:has(main.admin) .patient-title h1{font-size:27px!important;letter-spacing:-1px!important;margin:0!important}
  body:has(main.admin) .patient-name-line{gap:12px!important}
  body:has(main.admin) .patient-latest-summary{font-size:12px!important}
  body:has(main.admin) .patient-title>div>p{font-size:12px!important;line-height:1.2}
  body:has(main.admin) .patient-preview-button{padding:8px 12px!important;min-height:38px;border-radius:11px;font-size:12px}
  body:has(main.admin) .appointment-admin{gap:12px!important;margin:0 0 7px!important;padding:10px 14px!important;border-radius:16px!important}
  body:has(main.admin) .appointment-admin h2{font-size:18px!important;margin-bottom:2px!important}
  body:has(main.admin) .appointment-admin p{font-size:11px!important;line-height:1.25}
  body:has(main.admin) :is(.appointment-admin .upload-icon,.upload-card .upload-icon){width:42px;height:42px;flex-basis:42px;border-radius:13px}
  body:has(main.admin) .patient-clinical-flow>:is(.anthro-admin,.diet-builder,.patient-prescriptions-card,.anthro-history-card){margin:0 0 7px!important;padding:10px 14px!important;border-radius:16px!important}
  body:has(main.admin) .hf-section-copy{gap:12px!important}
  body:has(main.admin) .hf-section-symbol{flex-basis:42px;width:42px;height:42px;border-radius:13px}
  body:has(main.admin) .hf-section-symbol svg{width:22px;height:22px}
  body:has(main.admin) .hf-section-copy h2{font-size:18px!important;margin-bottom:2px!important}
  body:has(main.admin) .hf-section-copy p{font-size:11px!important;line-height:1.25!important}
  body:has(main.admin) :is(.anthro-section-toggle,.diet-plan-toggle){min-height:38px!important;padding:8px 12px!important;font-size:12px}
  body:has(main.admin) .upload-card{gap:12px!important;margin:0 0 7px!important;padding:10px 14px!important;border-radius:16px!important}
  body:has(main.admin) .upload-copy{gap:12px!important}
  body:has(main.admin) .upload-copy h2{font-size:18px!important;margin-bottom:2px!important}
  body:has(main.admin) .upload-copy p{font-size:11px!important;line-height:1.25!important}
  body:has(main.admin) .danger-zone{margin:0!important;padding:9px 14px!important;border-radius:14px!important;gap:12px!important}
  body:has(main.admin) .danger-zone p{margin-top:2px!important;font-size:10.5px!important;line-height:1.2}
  body:has(main.admin) .danger-zone b{font-size:13px}
  body:has(main.admin) .danger-button{padding:8px 12px!important;min-height:36px;font-size:12px}
}

/* HF - equilibrio final do modo uma tela: mais respiro sem perder o enquadramento. */
@media(min-width:901px){
  body:has(main.admin) .patient-title{margin-bottom:14px!important}
  body:has(main.admin) .patient-title .avatar.big{flex-basis:54px;width:54px;height:54px}
  body:has(main.admin) .patient-title h1{font-size:28px!important}
  body:has(main.admin) .patient-title>div>p{font-size:13px!important}
  body:has(main.admin) .appointment-admin{margin-bottom:10px!important;padding:13px 16px!important;border-radius:18px!important}
  body:has(main.admin) .patient-clinical-flow>:is(.anthro-admin,.diet-builder,.patient-prescriptions-card,.anthro-history-card){margin-bottom:10px!important;padding:13px 16px!important;border-radius:18px!important}
  body:has(main.admin) .upload-card{margin-bottom:10px!important;padding:13px 16px!important;border-radius:18px!important}
  body:has(main.admin) :is(.appointment-admin .upload-icon,.upload-card .upload-icon,.hf-section-symbol){width:44px;height:44px;flex-basis:44px;border-radius:14px}
  body:has(main.admin) :is(.appointment-admin h2,.hf-section-copy h2,.upload-copy h2){font-family:inherit!important;font-size:19px!important;font-weight:800!important;letter-spacing:0!important;line-height:1.15!important;margin:0 0 3px!important}
  body:has(main.admin) :is(.appointment-admin p,.hf-section-copy p,.upload-copy p){font-family:inherit!important;font-size:11.5px!important;font-weight:400!important;line-height:1.3!important}
  body:has(main.admin) :is(.anthro-section-toggle,.diet-plan-toggle){min-height:40px!important;padding:9px 13px!important;font-size:12.5px}
  body:has(main.admin) .danger-zone{padding:11px 16px!important;border-radius:16px!important}
  body:has(main.admin) .danger-zone p{font-size:11px!important}
  body:has(main.admin) .danger-button{min-height:38px;font-size:12.5px}
}

/* HF - acoes finais do prontuario: uma linguagem unica e menos etapas. */
body:has(main.admin) .anthro-admin .anthro-fields.variables{margin-top:18px}
body:has(main.admin) .hf-direct-upload-input{display:none!important}
body:has(main.admin) .hf-card-action{display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:6px!important;white-space:nowrap}
@media(min-width:901px){
  body:has(main.admin) .hf-card-action{width:128px!important;min-width:128px!important;max-width:128px!important;min-height:40px!important;padding:9px 10px!important;font-size:12.5px!important}
}
@media(max-width:700px){
  body:has(main.admin) .hf-card-action{width:100%!important;min-width:0!important;max-width:none!important}
}
body:has(main.admin) .hf-section-status{color:#343a40!important;font-weight:650!important}


/* V92 — plano alimentar mais legível e melhor aproveitamento horizontal */
body:has(main.admin) .diet-total-with-loader{grid-template-columns:minmax(92px,.68fr) repeat(3,minmax(124px,1fr)) minmax(112px,.7fr) minmax(126px,.76fr)!important;gap:8px!important}
body:has(main.admin) .diet-total-with-loader>span{min-width:0;padding:9px 7px!important}
body:has(main.admin) .diet-total-loader{position:relative;display:flex!important;min-height:54px!important;align-items:center;justify-content:center;padding:7px!important;border:1px solid #aeb4ba!important;border-radius:10px!important;background:#858b91!important;color:#fff!important;overflow:hidden;cursor:pointer}
body:has(main.admin) .diet-total-action-label{color:#fff;font-size:12.5px;font-weight:900;line-height:1.12;text-align:center;pointer-events:none}
body:has(main.admin) .diet-total-loader select{position:absolute;inset:0;width:100%;height:100%;min-height:0!important;opacity:0;cursor:pointer}
body:has(main.admin) .diet-total-loader select option{color:#17191c;background:#fff;font-size:13px}
body:has(main.admin) .diet-publish-inline{width:100%;min-height:54px!important;padding:7px!important;border-radius:10px!important;font-size:12.5px!important;line-height:1.12!important}
body:has(main.admin) :is(.diet-load-section-template,.diet-load-sub-template){font-size:13px!important}
body:has(main.admin) :is(.diet-load-section-template,.diet-load-sub-template) option{font-size:13px}
body:has(main.admin) .diet-builder-item{grid-template-columns:34px minmax(150px,1.05fr) 105px minmax(250px,2fr) minmax(174px,auto) auto!important}
body:has(main.admin) .diet-builder-group.substitution .diet-builder-item{grid-template-columns:34px minmax(145px,.9fr) 100px minmax(225px,1.55fr) minmax(174px,auto) auto!important}
body:has(main.admin) .diet-quantity-control{grid-template-columns:minmax(38px,1fr) 22px 28px!important}
body:has(main.admin) .diet-quantity-control input{padding:8px 2px 8px 7px!important}
body:has(main.admin) .diet-quantity-unit{width:22px!important;max-width:22px!important;padding:0 2px!important}
@media(max-width:1200px){body:has(main.admin) .diet-total-with-loader{grid-template-columns:repeat(3,minmax(0,1fr))!important}}
@media(max-width:980px){body:has(main.admin) .diet-builder-item,body:has(main.admin) .diet-builder-group.substitution .diet-builder-item{grid-template-columns:34px minmax(0,1fr) 105px!important}}
@media(max-width:700px){body:has(main.admin) .diet-total-with-loader{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:520px){body:has(main.admin) .diet-total-with-loader{grid-template-columns:1fr!important}body:has(main.admin) .diet-builder-item,body:has(main.admin) .diet-builder-group.substitution .diet-builder-item{grid-template-columns:34px minmax(0,1fr)!important}}

/* V93 — refinamento final dos totais e da coluna quantidade */
body:has(main.admin) .diet-total-with-loader>span b{font-size:13.5px!important;line-height:1.28!important}
body:has(main.admin) .diet-total-with-loader>span small{font-size:11.5px!important}
body:has(main.admin) .diet-total-action-label{padding:0!important;background:transparent!important;color:#fff!important;font-size:15px!important;line-height:1.08!important;box-shadow:none!important;border:0!important}
body:has(main.admin) .diet-publish-inline{font-size:15px!important;line-height:1.08!important}
body:has(main.admin) .diet-builder-item{grid-template-columns:34px minmax(150px,1.02fr) 90px minmax(275px,2.2fr) minmax(174px,auto) auto!important}
body:has(main.admin) .diet-builder-group.substitution .diet-builder-item{grid-template-columns:34px minmax(145px,.88fr) 88px minmax(250px,1.75fr) minmax(174px,auto) auto!important}
body:has(main.admin) .diet-quantity-control{grid-template-columns:minmax(36px,1fr) 18px 28px!important}
body:has(main.admin) .diet-quantity-control input{padding:8px 1px 8px 6px!important}
body:has(main.admin) .diet-quantity-unit{width:18px!important;max-width:18px!important;padding:0!important;font-size:9px!important}
@media(max-width:980px){body:has(main.admin) .diet-builder-item,body:has(main.admin) .diet-builder-group.substitution .diet-builder-item{grid-template-columns:34px minmax(0,1fr) 90px!important}}
@media(max-width:520px){body:has(main.admin) .diet-builder-item,body:has(main.admin) .diet-builder-group.substitution .diet-builder-item{grid-template-columns:34px minmax(0,1fr)!important}}

/* V94 — posição do menu de refeições prontas */
body:has(main.admin) .diet-total-loader select{inset:0 auto 0 -30px!important;width:calc(100% + 30px)!important;text-align:center!important;text-align-last:center!important}
body:has(main.admin) .diet-total-loader select option{text-align:center}

/* V97 — edição segura das avaliações salvas */
body:has(main.admin) .anthro-history-actions{display:grid;grid-template-columns:repeat(2,minmax(88px,1fr));gap:8px;min-width:190px}
body:has(main.admin) .anthro-history-actions button{width:100%;min-height:38px;padding:8px 10px;border-radius:10px;font-size:12px;font-weight:850}
body:has(main.admin) .anthro-history-edit{display:inline-flex;align-items:center;justify-content:center;gap:7px;border:1px solid #aeb4ba;background:#e9ecef;color:#30363b;cursor:pointer}
body:has(main.admin) .anthro-history-edit:hover{border-color:#747b82;background:#fff;color:#111316}
body:has(main.admin) .anthro-history-edit:disabled{opacity:.55;cursor:wait}
body:has(main.admin) .anthro-editing-banner{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:16px 0 4px;padding:11px 13px;border:1px solid #aeb4ba;border-radius:11px;background:#eef1f3;color:#30363b}
body:has(main.admin) .anthro-editing-banner>span{display:flex;align-items:center;gap:8px}
body:has(main.admin) .anthro-editing-banner button{min-height:34px;padding:7px 11px;border:1px solid #aeb4ba;border-radius:9px;background:#fff;color:#30363b;font-size:11.5px;font-weight:850;cursor:pointer}
body:has(main.admin) .anthro-editing-banner.loading{justify-content:center;color:#687079;font-weight:750}
@media(max-width:620px){body:has(main.admin) .anthro-history-actions{width:100%;min-width:0}body:has(main.admin) .anthro-editing-banner{align-items:stretch;flex-direction:column}body:has(main.admin) .anthro-editing-banner button{width:100%}}

/* V98 — proteção visual contra e-mail duplicado */
body:has(main.admin) .modal-card input.patient-email-duplicate{border-color:#c83d4d!important;box-shadow:0 0 0 3px rgba(200,61,77,.12)}
body:has(main.admin) .patient-email-duplicate-message{display:block;margin-top:7px;color:#b32636;font-size:13px;font-weight:750;line-height:1.35}

/* V99 — circunferências opcionais e leitura ampliada das avaliações */
body:has(main.admin) .anthro-actions{grid-template-columns:repeat(4,minmax(0,1fr))}
body:has(main.admin) .anthro-circumference-toggle{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:10px 14px;border:1px solid #747b82;border-radius:11px;background:#777d83;color:#fff;font-weight:850;cursor:pointer}
body:has(main.admin) .anthro-circumferences{margin-top:18px;padding:18px;border:1px solid #a4aab0;border-radius:14px;background:#f4f5f6}
body:has(main.admin) .anthro-circumferences-head{margin-bottom:14px}
body:has(main.admin) .anthro-circumferences-head h3{margin:0 0 4px;color:#17191c;font-size:17px}
body:has(main.admin) .anthro-circumferences-head p{margin:0;color:#626a72;font-size:13px}
body:has(main.admin) .circumference-fields{grid-template-columns:repeat(4,minmax(0,1fr));gap:13px}

/* Portal: somente os indicadores permanecem em negrito; datas, valores e variações ganham legibilidade. */
body:has(main.portal) .assessment-table thead th{font-size:12.5px!important;font-weight:600!important;color:#17191c!important}
body:has(main.portal) .assessment-table tbody th{font-size:14px!important;font-weight:800!important;color:#17191c!important}
body:has(main.portal) .assessment-table tbody td{font-size:15px!important;font-weight:400!important;color:#111316!important}
body:has(main.portal) .assessment-table tbody td strong{font-size:15px!important;font-weight:500!important;color:#111316!important}
body:has(main.portal) .assessment-table .delta{padding:5px 9px!important;font-size:12px!important;font-weight:400!important;color:#111316!important}
body:has(main.portal) .assessment-table .delta.good{background:#7fc79d!important;border-color:#56a879!important}
body:has(main.portal) .assessment-table .delta.bad{background:#df8992!important;border-color:#c96974!important}
body:has(main.portal) .assessment-table .delta.neutral{background:#b8bdc2!important;border-color:#969ca2!important}

@media(max-width:980px){body:has(main.admin) .anthro-actions{grid-template-columns:1fr 1fr}body:has(main.admin) .anthro-actions .anthro-save{grid-column:auto}body:has(main.admin) .circumference-fields{grid-template-columns:1fr 1fr}}
@media(max-width:560px){body:has(main.admin) .anthro-actions,body:has(main.admin) .circumference-fields{grid-template-columns:1fr}}

/* ============================================================
   APN — CAMADA ÚNICA DE IDENTIDADE VISUAL PERSONALIZÁVEL

   A IA deve substituir SOMENTE os dois marcadores abaixo pelos
   hexadecimais informados no Word. Exemplo: #2E7D32 e #145A20.

   Esta camada vem por último de propósito: ela impede que antigas
   regras cinza sobrescrevam a cor escolhida pelo comprador.
   Os fundos claro/escuro e as cores clínicas permanecem preservados.
   ============================================================ */
:root {
  --brand-primary: #5C069D;
  --brand-secondary: #46037D;
  --brand-gradient: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  --brand-gradient-hover: linear-gradient(135deg, var(--brand-secondary), var(--brand-primary));
}

/* Ações principais da plataforma, inclusive Novo paciente. */
.primary,
body:has(main.admin) .admin-head-actions .primary,
body:has(main.admin) .patient-preview-button,
body:has(main.admin) .secondary-button,
body:has(main.admin) .upload-section-toggle,
body:has(main.admin) .patient-list-toggle {
  background: var(--brand-gradient) !important;
  border-color: var(--brand-primary) !important;
  color: #fff !important;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--brand-primary) 28%, transparent) !important;
}

.primary:hover,
body:has(main.admin) .admin-head-actions .primary:hover,
body:has(main.admin) .patient-preview-button:hover,
body:has(main.admin) .secondary-button:hover,
body:has(main.admin) .upload-section-toggle:hover,
body:has(main.admin) .patient-list-toggle:hover {
  background: var(--brand-gradient-hover) !important;
  border-color: var(--brand-secondary) !important;
  color: #fff !important;
}

/* Abrir/Minimizar de todas as seções do prontuário. */
body:has(main.admin) .hf-card-action,
body:has(main.admin) :is(.anthro-section-toggle,.diet-plan-toggle,.appointment-toggle) {
  background: var(--brand-gradient) !important;
  border-color: var(--brand-primary) !important;
  color: #fff !important;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--brand-primary) 24%, transparent) !important;
}

body:has(main.admin) .hf-card-action:hover,
body:has(main.admin) :is(.anthro-section-toggle,.diet-plan-toggle,.appointment-toggle):hover {
  background: var(--brand-gradient-hover) !important;
  border-color: var(--brand-secondary) !important;
  color: #fff !important;
}

/* Ícones das seções: consulta, plano, prescrições e avaliações. */
body:has(main.admin) :is(
  .hf-section-symbol,
  .appointment-admin .upload-icon,
  .upload-card .upload-icon
) {
  background: var(--brand-gradient) !important;
  border-color: var(--brand-primary) !important;
  color: #fff !important;
  filter: none !important;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--brand-primary) 22%, transparent) !important;
}

body:has(main.admin) :is(
  .hf-section-symbol,
  .appointment-admin .upload-icon,
  .upload-card .upload-icon
) svg {
  color: #fff !important;
  stroke: currentColor !important;
}

/* Estados e detalhes institucionais. */
body:has(main.admin) :is(.kicker,.hf-section-status),
body:has(main.portal) :is(.kicker,.eyebrow) {
  color: var(--brand-primary) !important;
}

body:has(main.admin) .memory-track > i,
body:has(main.admin) .tabs button.active,
body:has(main.portal) .tabs button.active {
  background: var(--brand-gradient) !important;
  border-color: var(--brand-primary) !important;
  color: #fff !important;
}

/*
   NÃO personalizar por marca:
   - publicar/salvar/confirmar: verde funcional;
   - excluir/erro/alerta: vermelho funcional;
   - carboidrato/proteína/gordura: cores clínicas próprias;
   - body, cards e painéis: fundos branco/preto originais.
*/


/* V103 — identidade integral e alternância estável de tema. */
body:has(main.admin) :is(
  .hf-card-action,
  .anthro-section-toggle,
  .diet-plan-toggle,
  .appointment-toggle,
  .upload-section-toggle
) {
  background: var(--brand-gradient) !important;
  border-color: var(--brand-primary) !important;
  color: #fff !important;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--brand-primary) 24%, transparent) !important;
}
body:has(main.admin) :is(
  .hf-card-action,
  .anthro-section-toggle,
  .diet-plan-toggle,
  .appointment-toggle,
  .upload-section-toggle
):hover {
  background: var(--brand-gradient-hover) !important;
  border-color: var(--brand-secondary) !important;
  color: #fff !important;
}

/* Iniciais do paciente seguem a marca; fotos reais continuam preservadas. */
body:has(main.admin) .patient-title .avatar.big:not(.has-photo),
body:has(main.admin) .patient-row .avatar:not(.has-photo),
body:has(main.portal) .avatar:not(.has-photo) {
  background: var(--brand-gradient) !important;
  border-color: var(--brand-primary) !important;
  color: #fff !important;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--brand-primary) 22%, transparent) !important;
}


/* V104 — resumos na identidade da marca. */
body:has(main.admin) .summary-grid .summary > span {
  background: var(--brand-gradient) !important;
  border-color: var(--brand-primary) !important;
  color: #fff !important;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--brand-primary) 22%, transparent) !important;
}
body:has(main.admin) .summary-grid .summary > span svg {
  color: #fff !important;
  stroke: currentColor !important;
}

/* V105 — painel esquerdo da entrada na identidade do comprador. */
body:has(.login-page) .login-intro {
  background:
    radial-gradient(circle at 82% 18%, color-mix(in srgb, var(--brand-primary) 42%, transparent), transparent 31%),
    linear-gradient(145deg, var(--brand-secondary), color-mix(in srgb, var(--brand-secondary) 62%, #050506)) !important;
}
body:has(.login-page) .login-intro .eyebrow {
  color: color-mix(in srgb, var(--brand-primary) 38%, #fff) !important;
}

/* ============================================================
   V106 — identidade integral, logomarca sem corte e contraste.
   Esta camada deve permanecer por último no arquivo.
   ============================================================ */

/* A logomarca sempre aparece inteira em todos os cabeçalhos. */
img.brandmark,
img.mobile-logo,
img.pulse {
  object-fit: contain !important;
  object-position: center !important;
  padding: 0 !important;
  background: transparent !important;
  border-radius: 10px !important;
  overflow: visible !important;
}

/* Tema claro: título institucional e ações clínicas usam a marca. */
html[data-theme="light"] body:has(main.admin) .page-head .kicker {
  color: var(--brand-primary) !important;
}
html[data-theme="light"] body:has(main.admin) button.hf-card-action:not(.danger-button),
html[data-theme="light"] body:has(main.admin) button.anthro-section-toggle,
html[data-theme="light"] body:has(main.admin) button.diet-plan-toggle,
html[data-theme="light"] body:has(main.admin) button.appointment-toggle,
html[data-theme="light"] body:has(main.admin) button.upload-section-toggle {
  background: var(--brand-gradient) !important;
  border-color: var(--brand-primary) !important;
  color: #fff !important;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--brand-primary) 26%, transparent) !important;
}
html[data-theme="light"] body:has(main.admin) button.hf-card-action:not(.danger-button):hover,
html[data-theme="light"] body:has(main.admin) button.hf-card-action:not(.danger-button):focus-visible {
  background: var(--brand-gradient-hover) !important;
  border-color: var(--brand-secondary) !important;
  color: #fff !important;
}

/* Portal claro: cor da marca nos controles; textos continuam pretos. */
html[data-theme="light"] body:has(main.portal) .patient-download-card > button,
html[data-theme="light"] body:has(main.portal) .guide-download,
html[data-theme="light"] body:has(main.portal) .install-app {
  background: var(--brand-gradient) !important;
  border-color: var(--brand-primary) !important;
  color: #fff !important;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--brand-primary) 24%, transparent) !important;
}
html[data-theme="light"] body:has(main.portal) .patient-download-card > button:disabled {
  background: var(--brand-gradient) !important;
  color: #fff !important;
  opacity: .68 !important;
  cursor: not-allowed !important;
}
html[data-theme="light"] body:has(main.portal) :is(.patient-download-icon,.assessment-title > span:first-child) {
  background: var(--brand-gradient) !important;
  border-color: var(--brand-primary) !important;
  color: #fff !important;
  box-shadow: 0 5px 14px color-mix(in srgb, var(--brand-primary) 22%, transparent) !important;
}
html[data-theme="light"] body:has(main.portal) :is(.kicker,.patient-download-card .kicker,.patient-download-card h2) {
  color: #17191c !important;
}

/* V125 — gasto energético como card independente e adequação completa no modo claro. */
.energy-menu-card{margin:0;padding:18px;border-radius:18px}.energy-use-calculation{display:flex!important;align-items:center;gap:8px;min-height:38px;padding:7px 11px;border:1px solid #c8cdd2;border-radius:10px;background:#fff;color:#30363c!important;font-size:11px!important;font-weight:900!important;white-space:nowrap}.energy-use-calculation input{width:18px!important;height:18px!important;min-height:0!important;margin:0;accent-color:var(--brand-primary)}html[data-theme="light"] body:has(main.admin) .energy-adequacy span.good{border-color:#16894d!important;border-left:6px solid #0c6e3a!important;background:#2eae68!important;color:#fff!important;box-shadow:0 5px 13px #16894d33}html[data-theme="light"] body:has(main.admin) .energy-adequacy span.warn{border-color:#b17b0b!important;border-left:6px solid #8d5e00!important;background:#d7a72e!important;color:#fff!important;box-shadow:0 5px 13px #b17b0b33}html[data-theme="light"] body:has(main.admin) .energy-adequacy span.bad{border-color:#b62f42!important;border-left:6px solid #8f1d2d!important;background:#d84c60!important;color:#fff!important;box-shadow:0 5px 13px #b62f4233}html[data-theme="light"] body:has(main.admin) .energy-adequacy span :is(small,b,em){color:inherit!important}.diet-energy-adequacy{margin:12px 0 10px}html[data-theme="dark"] .energy-use-calculation{border-color:#41464d;background:#202329;color:#fff!important}@media(max-width:900px){.energy-planning-head-actions{flex-wrap:wrap}.energy-use-calculation{flex:1 1 180px}}

/* V126 — card padronizado de gasto energético e adequação suave no modo claro. */
body:has(main.admin) .energy-menu-shell{margin:22px 0;padding:24px;border:1px solid #c9cdd2;border-radius:22px;background:#fff;box-shadow:0 14px 38px #22222912;color:#17191c}
body:has(main.admin) .energy-card-title{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:0!important}
body:has(main.admin) .energy-card-title h2{margin:3px 0 6px}
body:has(main.admin) .energy-menu-content{margin:18px 0 0;border-radius:17px}
body:has(main.admin) .energy-use-row{display:flex;align-items:center;justify-content:flex-end;gap:12px}
body:has(main.admin) .energy-use-row>small{color:#687079;font-size:10px}
html[data-theme="dark"] body:has(main.admin) .energy-menu-shell{border-color:#303237;background:linear-gradient(145deg,#151618,#0d0e10);box-shadow:0 20px 60px #0005;color:#f5f5f5}
html[data-theme="dark"] body:has(main.admin) .energy-use-row>small{color:#aeb3ba}
html[data-theme="light"] body:has(main.admin) .energy-adequacy span.good{border:1px solid #b9e4ca!important;border-left:6px solid #16894d!important;background:linear-gradient(135deg,#f4fbf7,#e9f8ef)!important;color:#17191c!important;box-shadow:0 5px 13px #16894d1c!important}
html[data-theme="light"] body:has(main.admin) .energy-adequacy span.warn{border:1px solid #efdcae!important;border-left:6px solid #d59724!important;background:linear-gradient(135deg,#fffdf7,#fff6df)!important;color:#17191c!important;box-shadow:0 5px 13px #d597241c!important}
html[data-theme="light"] body:has(main.admin) .energy-adequacy span.bad{border:1px solid #efc1c7!important;border-left:6px solid #d44555!important;background:linear-gradient(135deg,#fffafa,#fff0f1)!important;color:#17191c!important;box-shadow:0 5px 13px #d445551c!important}
html[data-theme="light"] body:has(main.admin) .energy-adequacy span :is(small,b,em){color:#17191c!important}
@media(max-width:700px){body:has(main.admin) .energy-menu-shell{padding:15px;border-radius:17px}body:has(main.admin) .energy-card-title{align-items:stretch;flex-direction:column}body:has(main.admin) .energy-card-title>.hf-card-action{width:100%}body:has(main.admin) .energy-use-row{align-items:stretch;flex-direction:column}}
/* APN V128 — ordem e card do gasto energético no mesmo padrão do prontuário. */
.patient-clinical-flow>.anthro-admin{order:1}
.patient-clinical-flow>.diet-builder:not(.energy-menu-shell){order:2}
.patient-clinical-flow>.energy-menu-shell{order:3;margin:0 0 18px!important;padding:20px!important;border-radius:20px!important}
.patient-clinical-flow>.patient-prescriptions-card{order:4}
.patient-clinical-flow>.anthro-history-card{order:5}
.patient-clinical-flow>.energy-menu-shell>.energy-card-title{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:15px!important;margin-bottom:0!important}
.patient-clinical-flow>.energy-menu-shell:has(.energy-menu-content)>.energy-card-title{margin-bottom:18px!important}
@media(max-width:700px){
  .patient-clinical-flow>.energy-menu-shell{margin-bottom:10px!important;padding:13px 16px!important;border-radius:18px!important}
  .patient-clinical-flow>.energy-menu-shell>.energy-card-title{align-items:stretch!important;flex-direction:column!important}
  .patient-clinical-flow>.energy-menu-shell>.energy-card-title>.hf-card-action{width:100%!important;max-width:none!important}
}

/* APN V133 — salvamento explícito do gasto energético. */
.energy-card-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap}
.energy-save-button{min-width:150px;min-height:48px;padding:12px 20px;border:0;border-radius:12px;background:#18864b;color:#fff;font:inherit;font-weight:900;cursor:pointer;box-shadow:0 8px 20px #18864b2f;transition:filter .18s ease,transform .18s ease,opacity .18s ease}
.energy-save-button:hover:not(:disabled){filter:brightness(1.08);transform:translateY(-1px)}
.energy-save-button:disabled{background:#7c8b82;color:#fff;cursor:default;opacity:.78;box-shadow:none}
@media(max-width:700px){.energy-card-actions{width:100%;align-items:stretch;flex-direction:column}.energy-card-actions>button{width:100%!important;max-width:none!important}}

/* APN V134 — botão Salvar dados com a mesma dimensão de Minimizar. */
@media(min-width:901px){body:has(main.admin) .energy-card-actions>.energy-save-button{width:128px!important;min-width:128px!important;max-width:128px!important;min-height:40px!important;height:40px!important;padding:9px 10px!important;border-radius:11px!important;font-size:12.5px!important}}

/* APN V135 — prescrição livre e condicional de exames. */
.patient-clinical-flow>.lab-exam-prescription-card{order:5}
.patient-clinical-flow>.anthro-history-card{order:6}
.lab-exam-prescription-body{display:grid;gap:14px}
.lab-exam-prescription-body .rx-instructions{margin:0}
.lab-exam-prescription-body .rx-instructions textarea{min-height:150px;line-height:1.5}
.lab-exam-prescription-body .lab-exam-preparation textarea{min-height:105px}
.lab-exam-download-card{margin-top:16px}
@media(max-width:620px){.lab-exam-prescription-body .rx-publish-actions{align-items:stretch}.lab-exam-prescription-body .rx-publish-actions button{width:100%}}

/* APN V136 — exames prontos e painel mensal de gestão. */
.admin-head-actions{grid-template-columns:repeat(3,minmax(0,1fr))}
.rx-template-exam{margin-top:18px}
.rx-template-exam>.template-supplement-editor{margin-top:14px}
.lab-exam-template-loader select{width:100%;min-height:46px;padding:11px 13px;border:1px solid #484b52;border-radius:12px;background:#0d0f12;color:#f5f5f6;font:inherit}
.hf-management-card{padding:26px;border:1px solid #373a40;border-radius:24px;background:linear-gradient(145deg,#181a1e,#0e1012);box-shadow:0 18px 42px #0004}
.hf-management-month{display:grid;grid-template-columns:52px minmax(0,1fr) 52px;align-items:center;gap:16px;text-align:center}
.hf-management-month .secondary-button{width:52px;min-width:52px;padding:8px;font-size:30px}
.hf-management-month small{display:block;color:#9da1a8;font-weight:800;text-transform:uppercase;letter-spacing:.08em}
.hf-management-month h2{margin:5px 0;text-transform:capitalize}
.hf-management-summary{display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:14px;margin-top:24px}
.hf-management-summary article{display:grid;gap:7px;min-height:155px;padding:22px;border:1px solid #3c4046;border-radius:18px;background:linear-gradient(145deg,#25282e,#17191d)}
.hf-management-summary article:first-child{border-color:var(--hf-primary,#6d17b5);box-shadow:inset 5px 0 var(--hf-primary,#6d17b5)}
.hf-management-summary small{color:#b9bdc4;font-weight:800;text-transform:uppercase;letter-spacing:.06em}
.hf-management-summary strong{color:#fff;font-size:46px;line-height:1}
.hf-management-summary span{color:#aeb2b9}
body:has(main.admin) .hf-management-card{background:#fff;border-color:#cbd0d5;box-shadow:0 18px 38px #2222}
body:has(main.admin) .hf-management-summary article{background:#f6f7f8;border-color:#d1d5d9}
body:has(main.admin) .hf-management-summary article:first-child{border-color:var(--hf-primary,#6d17b5)}
body:has(main.admin) .hf-management-summary strong{color:#17191c}
body:has(main.admin) .hf-management-summary small,body:has(main.admin) .hf-management-summary span{color:#59616a}
body:has(main.admin) .lab-exam-template-loader select{background:#fff!important;color:#17191c!important;border-color:#c9ced3!important}
@media(max-width:850px){.admin-head-actions{grid-template-columns:repeat(2,minmax(0,1fr))}.hf-management-summary{grid-template-columns:1fr}.hf-management-summary article{min-height:120px}}
@media(max-width:520px){.admin-head-actions{grid-template-columns:1fr}.hf-management-card{padding:16px}.hf-management-month{grid-template-columns:46px minmax(0,1fr) 46px;gap:8px}.hf-management-month .secondary-button{width:46px;min-width:46px}.hf-management-month h2{font-size:20px}}

/* APN V139 — gestão analítica mensal e anual. */
.hf-management-heading{align-items:flex-end;gap:18px}.hf-management-tabs{display:flex;gap:10px;flex-wrap:wrap}.hf-management-tabs button{min-width:145px}
.hf-management-year{margin-bottom:4px}.hf-management-month-insight{display:flex;justify-content:space-between;gap:16px;margin-top:14px;padding:14px 18px;border:1px solid #d6d9dd;border-radius:14px;background:#f7f8f9;color:#59616a}.hf-management-month-insight b{color:var(--hf-primary,#6d17b5)}
.hf-management-annual-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:22px}.hf-management-annual-summary article,.hf-management-insights article{display:grid;gap:6px;padding:18px;border:1px solid #d1d5d9;border-radius:17px;background:#f6f7f8}.hf-management-annual-summary article{min-height:132px}.hf-management-annual-summary .hf-management-highlight{border-color:var(--hf-primary,#6d17b5);box-shadow:inset 5px 0 var(--hf-primary,#6d17b5)}.hf-management-annual-summary small,.hf-management-insights small{color:#59616a;font-weight:850;text-transform:uppercase;letter-spacing:.055em}.hf-management-annual-summary strong{color:#17191c;font-size:38px;line-height:1}.hf-management-annual-summary span,.hf-management-insights span{color:#626a73}
.hf-management-insights{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:12px}.hf-management-insights article{min-height:105px}.hf-management-insights strong{color:#17191c;font-size:22px;text-transform:capitalize}
.hf-management-table-wrap{margin-top:24px;padding-top:20px;border-top:1px solid #d6d9dd}.hf-management-table-wrap h3{margin:0 0 12px}.hf-management-table{width:100%;border-collapse:separate;border-spacing:0;overflow:hidden;border:1px solid #d1d5d9;border-radius:15px}.hf-management-table th,.hf-management-table td{padding:12px 14px;text-align:right;border-bottom:1px solid #e0e3e6}.hf-management-table th:first-child,.hf-management-table td:first-child{text-align:left;text-transform:capitalize}.hf-management-table th{background:#eef0f2;color:#42484f;font-size:12px;text-transform:uppercase;letter-spacing:.04em}.hf-management-table td{color:#30353a}.hf-management-table tbody tr:last-child td{border-bottom:0}.hf-management-table tbody tr:hover td{background:color-mix(in srgb,var(--hf-primary,#6d17b5) 5%,#fff)}
@media(max-width:850px){.hf-management-heading{align-items:stretch}.hf-management-tabs{width:100%}.hf-management-tabs button{flex:1}.hf-management-annual-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.hf-management-table-wrap{overflow-x:auto}.hf-management-table{min-width:610px}}
@media(max-width:560px){.hf-management-tabs{display:grid;grid-template-columns:1fr 1fr}.hf-management-tabs button{min-width:0;padding-inline:8px}.hf-management-annual-summary,.hf-management-insights{grid-template-columns:1fr}.hf-management-annual-summary article{min-height:108px}.hf-management-month-insight{align-items:flex-start;flex-direction:column}.hf-management-table th,.hf-management-table td{padding:10px 12px}}

/* V140 — respiro visual entre o cabeçalho e os indicadores da Gestão. */
.hf-management-heading{align-items:center;margin-bottom:32px;padding-bottom:4px}
.hf-management-heading>div:first-child{display:grid;gap:8px}
.hf-management-heading>div:first-child p{line-height:1.5}
@media(max-width:850px){.hf-management-heading{align-items:stretch;margin-bottom:24px;padding-bottom:0}.hf-management-heading>div:first-child{gap:6px}}
