.health-target-grid { --tile-height: 159px; }
.health-target-card {
  --target-track: var(--sep);
  --target-band: #4579a9;
  --target-current: #4c7300;
  --target-goal: #7544a4;
  cursor: default;
}
:root[data-theme="dark"] .health-target-card, :root[data-theme="dark"] .health-target-legend {
  --target-band: #81add8;
  --target-current: #c8ff31;
  --target-goal: #c6a2fb;
}
.health-target-card:hover { background:var(--card); }
.health-target-card .compact-card-head { color:var(--text); }
.health-target-card.compact-card .compact-card-value {
  white-space:normal; overflow-wrap:anywhere; font-size:clamp(16px, 3vw, 22px);
}
.health-target-caption { font-size:11px; color:var(--muted); font-weight:600; }
.health-target-values {
  display:flex; flex:1; min-width:0; flex-direction:column; gap:4px; font-size:12px; line-height:1.25;
}
.health-target-values p { margin:0; overflow-wrap:anywhere; }
.health-target-rec { font-weight:600; }
.health-target-values .health-target-goal { margin-top:auto; }
.health-target-goal a { color:var(--target-goal); }
.health-target-bar {
  position:relative; display:block; flex:none; height:6px; margin:7px 7px 5px; border-radius:4px;
  background:var(--target-track);
}
.health-target-range, .health-target-actual, .health-target-marker {
  display:block; background:var(--target-band, #4579a9);
}
.health-target-bar > span { position:absolute; }
.health-target-range { height:6px; min-width:4px; border-radius:3px; }
.health-target-actual, .health-target-marker {
  width:10px; height:10px; box-sizing:border-box; border:1px solid var(--card);
}
.health-target-actual { top:-4px; transform:translateX(-50%); border-radius:50%; background:var(--target-current, #4c7300); }
.health-target-marker { top:0; transform:translateX(-50%) rotate(45deg); border-radius:2px; background:var(--target-goal, #7544a4); }
.health-target-legend { display:flex; flex-wrap:wrap; gap:6px 14px; margin:0 0 12px; }
.health-target-legend > span { display:inline-flex; align-items:center; gap:6px; }
.health-target-legend i { border:0; transform:none; width:10px; }
.health-target-legend .health-target-range { width:16px; }
.health-target-legend .health-target-marker { transform:rotate(45deg); width:9px; height:9px; }
.health-target-detail { margin:0 0 12px; }
.health-target-detail .health-target-card { max-width:420px; }
.health-target-detail:empty { display:none; }
.health-target-link { margin:6px 0; }
.health-target-link a { color:var(--accent); }

.health-goal-panel {
  --goal-reference: #315f8c;
  --goal-link: #7544a4;
  margin:20px 0;
}
:root[data-theme="dark"] .health-goal-panel {
  --goal-reference:#8fb6e0;
  --goal-link:#c6a2fb;
}
.health-goal-panel h3 { margin:0 0 12px; }
.health-goal-editor {
  padding:12px; margin-top:10px; border:1px solid var(--sep); border-radius:14px; background:var(--card);
}
.health-goal-title { display:flex; align-items:center; gap:6px; margin:0 0 8px; }
.health-goal-title .compact-card-info { position:relative; flex:none; }
.health-level-segments {
  /* Gap of 6 px or more: layout-guard.js leaves the three buttons alone instead of folding them into a «⋯» menu. */
  display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px;
  padding:3px; border:1px solid var(--sep); border-radius:12px; background:var(--bg);
}
.health-level-segments button {
  margin:0; min-height:44px; min-width:0; padding:4px 1px;
  border:1px solid transparent; border-radius:9px; color:var(--muted);
  font-size:clamp(11px, 3.3vw, 14px);
}
.health-level-segments button[aria-pressed="true"] {
  border-color:var(--accent); background:var(--raised); color:var(--text); font-weight:700;
}
.health-level-editor > p { margin:6px 0 0; }
.health-level-explanation { display:grid; gap:12px; padding:0; list-style:none; }
.health-level-explanation li { display:grid; gap:2px; }
.health-level-table { width:100%; border-collapse:collapse; text-align:left; font-size:.9rem; }
.health-level-table :is(th, td) { padding:6px 3px; border-bottom:1px solid var(--sep); }
.health-level-table tr > :last-child { text-align:right; }
.health-level-table .selected { color:var(--accent); font-weight:700; }
.health-goal-dialog-value { font-size:1.4rem; font-weight:700; }
.health-goal-fields {
  display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); align-items:start; gap:8px;
  min-width:0; padding:0; margin:0; border:0;
}
.health-goal-fields .field { margin:0; min-width:0; }
.health-goal-fields input { box-sizing:border-box; width:100%; min-width:0; }
.health-goal-fields .field > span, .health-goal-fields .small { color:var(--muted); font-size:.75rem; }
.health-goal-fields small:empty, .health-goal-feedback:empty { display:none; }
.health-goal-actual, .health-goal-reference { display:grid; gap:2px; min-width:0; overflow-wrap:anywhere; }
.health-goal-reference strong { color:var(--goal-reference); }
.health-goal-actions { grid-column:1 / -1; display:flex; align-items:center; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
.health-goal-actions button { margin:0; min-height:44px; }
.health-goal-actions a, .health-goal-actions .quiet:not(:disabled) { color:var(--goal-link); }
.health-goal-feedback { margin:6px 0 0; }
@media (min-width:700px) {
  .health-goal-fields { gap:8px 14px; }
  .health-goal-fields input { max-width:12rem; }
}
