/* Gesundheitsdaten (seit 28.11.2026): Werkzeug für Apple-Health-Exporte und Bericht für die Arztpraxis.
   Nur auf /health-data/, /apple-health-export-to-csv/, /apple-health-doctor-report/ und ihren deutschen Fassungen. */

.htool { overflow: hidden; }
.htool[data-state="start"] .htool__progress, .htool[data-state="start"] .htool__loaded,
.htool[data-state="loading"] .htool__start, .htool[data-state="loading"] .htool__loaded,
.htool[data-state="loaded"] .htool__start, .htool[data-state="loaded"] .htool__progress { display: none; }

.htool__start { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 18px 22px; padding: 18px; }
.htool__start .cs-drop { min-height: 190px; }
.htool__start .cs-drop b { font-size: 19px; }
.htool__how { margin: 0; padding: 16px 18px; border-radius: 14px; background: var(--panel); border: 1px solid var(--panel-line); font-size: 14.5px; }
.htool__how h2 { margin: 0 0 8px; font-family: var(--head); font-size: 15px; color: var(--ink); }
.htool__how ol { margin: 0; padding-left: 20px; }
.htool__how li { margin: 3px 0; }
.htool__how b { color: var(--ink); }
.htool__row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.htool__privacy { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: #0A5C3E; background: var(--green-soft); border-radius: 10px; padding: 8px 12px; }
.htool__privacy svg { flex: none; }
.htool__error { grid-column: 1 / -1; margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--red-soft); color: #8A2A12; font-size: 14.5px; }
.htool__error[hidden] { display: none; }

.htool__progress { padding: 26px 18px 28px; display: flex; flex-direction: column; gap: 12px; }
.htool__progress b { font-family: var(--head); color: var(--ink); font-size: 17px; }
.hbar { height: 10px; border-radius: 6px; background: var(--accent-soft); overflow: hidden; }
.hbar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 6px; transition: width .2s ease; }
.htool__progress p { margin: 0; font-size: 14px; color: var(--muted); }

.htool__summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: linear-gradient(#FFFFFF, #FBFBFF); font-size: 14.5px; }
.htool__summary b { color: var(--ink); }
.htool__summary .linkbtn { margin-left: auto; }
.htool .linkbtn { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; font-size: 14.5px; }
.htool .linkbtn:hover { text-decoration: underline; }

.hgrid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 18px 24px; }
.hcol { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.hbox { border: 1px solid var(--line-2); border-radius: 14px; padding: 14px 16px; }
.hbox > h3, .hbox > legend { margin: 0 0 10px; padding: 0; font-family: var(--head); font-size: 15px; color: var(--ink); }
fieldset.hbox { margin: 0; min-width: 0; }
.hperiod { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.hperiod .tool__field select { min-width: 200px; }
.hperiod input[type=date] { padding: 8px 10px; border: 1px solid #DCDCE8; border-radius: 10px; font-size: 14.5px; color: var(--ink); background: #FFFFFF; }
.hperiod__range { width: 100%; margin: 0; font-size: 13.5px; color: var(--muted); }
.hperiod[hidden] { display: none; }
.hlabel { font-size: 13px; font-weight: 600; color: var(--ink); }
.hmetrics { display: flex; flex-direction: column; gap: 12px; max-height: 560px; overflow: auto; padding-right: 4px; }
.hmetrics__group b { display: block; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.hmetrics__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 14px; }
.hmetrics .check { align-items: flex-start; line-height: 1.35; padding: 3px 0; }
.hmetrics .check input { margin-top: 1px; flex: none; }
.hmetrics .check small { display: block; font-size: 12.5px; }
.hmetrics .check.is-empty { opacity: .45; }
.hmetrics__quick { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: -2px 0 10px; font-size: 14px; }
.hopts { display: flex; flex-direction: column; gap: 12px; }
.hopts .seg { align-self: stretch; }
.hopts .seg button { flex: 1 1 auto; }
.hopts p.hint { margin: 0; font-size: 13.5px; color: var(--muted); }
.hopts .check { font-size: 14.5px; }
.hfields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.hfields .tool__field--wide { grid-column: 1 / -1; }
.htool input[type=text], .htool textarea { width: 100%; padding: 9px 12px; border: 1px solid #DCDCE8; border-radius: 10px; background: #FFFFFF; color: var(--ink); font-size: 14.5px; font-family: var(--text); }
.htool textarea { min-height: 70px; resize: vertical; line-height: 1.5; }
.hgo { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hdone { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--green-soft); color: #0A5C3E; font-size: 14px; }
.hdone[hidden] { display: none; }
.hwarn { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--amber-soft); color: var(--amber); font-size: 14px; }
.hwarn[hidden] { display: none; }

.hpreview { margin-top: 18px; padding: 20px; border-radius: 16px; background: #F1F1F8; }
.hpreview[hidden] { display: none; }
.hpreview__bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.hpreview__bar p { margin: 0; font-size: 14px; color: var(--muted); max-width: 60ch; }
.hpaper { max-width: 820px; margin: 0 auto; background: #FFFFFF; border-radius: 6px; box-shadow: 0 18px 40px -24px rgba(28, 27, 58, .45); padding: 40px 44px; }

/* ---------------------------------------------------------------- Bericht */
.hr-report { color: #1C1B3A; font-family: var(--text); font-size: 13.5px; line-height: 1.45; }
.hr-report h1 { margin: 0 0 10px; font-family: var(--head); font-size: 24px; line-height: 1.2; color: #1C1B3A; }
.hr-meta { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 0 0 10px; }
.hr-meta div { display: flex; gap: 6px; }
.hr-meta dt { color: #64647F; }
.hr-meta dt::after { content: ':'; }
.hr-meta dd { margin: 0; font-weight: 600; }
.hr-usernote { margin: 8px 0; padding: 8px 12px; border-left: 3px solid #4945FF; background: #F6F6FF; }
.hr-src { margin: 6px 0 0; color: #64647F; font-size: 12.5px; }
.hr-head { padding-bottom: 14px; border-bottom: 2px solid #1C1B3A; }
.hr-sec { padding: 16px 0 6px; border-bottom: 1px solid #E4E4F0; }
.hr-sec h2 { margin: 0 0 10px; font-family: var(--head); font-size: 18px; color: #1C1B3A; break-after: avoid; }
.hr-sec h3 { margin: 12px 0 6px; font-size: 14px; color: #1C1B3A; }
.hr-unit { font-family: var(--text); font-size: 13px; font-weight: 500; color: #64647F; }
.hr-sec--empty p { margin: 0 0 10px; color: #64647F; }
.hr-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 0 0 12px; break-inside: avoid; }
.hr-stats div { padding: 8px 10px; border: 1px solid #E4E4F0; border-radius: 8px; }
.hr-stats dt { font-size: 11.5px; color: #64647F; line-height: 1.3; }
.hr-stats dd { margin: 2px 0 0; font-size: 15px; font-weight: 700; }
.hr-stats dd small { font-weight: 400; color: #64647F; font-size: 11.5px; }
.hr-chart { margin: 0 0 12px; break-inside: avoid; }
.hr-chart svg { width: 100%; height: auto; }
.hr-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 11.5px; color: #64647F; margin-top: 2px; }
.hr-legend span { display: inline-flex; align-items: center; gap: 6px; }
.hr-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.hr-legend i.o { background: #FFFFFF; border: 2px solid; width: 10px; height: 10px; }
.hr-legend i.d { width: 16px; height: 0; border-radius: 0; border-top: 2px dashed #6B6A85; }
.hr-legend__unit { margin-left: auto; }
.hr-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 0 0 8px; font-variant-numeric: tabular-nums; }
.hr-table th { text-align: left; font-weight: 600; color: #64647F; border-bottom: 1px solid #C9C8E0; padding: 4px 8px 4px 0; }
.hr-table td { border-bottom: 1px solid #EDEDF4; padding: 3px 8px 3px 0; }
.hr-table thead { display: table-header-group; }
.hr-table tr { break-inside: avoid; }
.hr-note { margin: 4px 0 10px; font-size: 11.5px; color: #64647F; }
.hr-foot { margin-top: 14px; font-size: 11.5px; color: #64647F; }

/* Bereich: Karten zu den Werkzeugen */
.hcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.hcard { display: flex; flex-direction: column; gap: 8px; padding: 22px 22px 20px; border: 1px solid var(--line-2); border-radius: 18px; background: #FFFFFF; box-shadow: 0 30px 60px -48px rgba(28, 27, 58, .5); }
.hcard:hover { border-color: #C9C8FF; color: inherit; }
.hcard h2 { margin: 0; font-family: var(--head); font-size: 20px; color: var(--ink); }
.hcard p { margin: 0; }
.hcard ul { margin: 2px 0 0; padding-left: 18px; font-size: 14.5px; }
.hcard__go { margin-top: auto; padding-top: 8px; font-weight: 600; color: var(--accent); }
.hsteps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.hsteps li { counter-increment: s; position: relative; padding: 12px 14px 12px 52px; border: 1px solid var(--line-2); border-radius: 12px; }
.hsteps li::before { content: counter(s); position: absolute; left: 14px; top: 11px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; text-align: center; line-height: 26px; font-size: 14px; }
.hsteps b { color: var(--ink); }
.hzip { font-family: var(--mono); font-size: 13.5px; background: var(--panel); border: 1px solid var(--panel-line); border-radius: 12px; padding: 14px 16px; line-height: 1.7; overflow-x: auto; white-space: pre; }

/* Zweckbestimmung und Markenhinweis unter Werkzeug und Karten (seit 28.11.2026) */
.hlegal { margin-top: 16px; display: grid; gap: 4px; font-size: 13px; line-height: 1.5; color: var(--muted); max-width: 980px; }
.hlegal p { margin: 0; }

@media (max-width: 900px) {
  .htool__start, .hgrid { grid-template-columns: minmax(0, 1fr); }
  .hpaper { padding: 22px 16px; }
  .hfields { grid-template-columns: 1fr; }
  .hmetrics { max-height: none; }
}

/* ---------------------------------------------------------------- Druck: nur der Bericht */
@media print {
  @page { size: auto; margin: 14mm 13mm; }
  body.hr-printing { background: #FFFFFF; }
  body.hr-printing > *:not(#hr-print) { display: none !important; }
  #hr-print { display: none; }
  body.hr-printing #hr-print { display: block; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #hr-print .hr-report { font-size: 10pt; }
  #hr-print .hr-report h1 { font-size: 17pt; }
  #hr-print .hr-sec h2 { font-size: 13pt; }
  #hr-print .hr-stats { grid-template-columns: repeat(4, 1fr); }
  #hr-print .hr-stats dd { font-size: 11pt; }
  #hr-print .hr-table { font-size: 9pt; }
}
