/* Präventionszeitenrechner – ergänzt style.css */

.calc { display: grid; gap: 24px; }

.calc-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.calc-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px clamp(18px, 3vw, 28px); background: var(--surface-alt); border-bottom: 1px solid var(--line);
}
.calc-card-head h2 { font-size: 1.25rem; margin: 0; }

.calc-body { display: grid; grid-template-columns: 1.05fr .95fr; }
.calc-inputs { padding: clamp(18px, 3vw, 28px); display: grid; gap: 22px; align-content: start; }
.calc-result {
  padding: clamp(18px, 3vw, 28px); background: linear-gradient(180deg, var(--primary-tint), #f4f9f9);
  border-left: 1px solid var(--line);
}
@media (max-width: 900px) {
  .calc-body { grid-template-columns: 1fr; }
  .calc-result { border-left: 0; border-top: 1px solid var(--line); }
}

.btn-link {
  background: none; border: 0; padding: 6px 0; font: inherit; font-size: .95rem; font-weight: 600;
  color: var(--primary); text-decoration: underline; text-underline-offset: .2em; cursor: pointer;
}
.btn-link:hover { color: var(--primary-dark); }
.btn-link[hidden] { display: none; }

/* Formularfelder */
.calc fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.calc legend { font-weight: 700; padding: 0; margin-bottom: 4px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 420px) { .field-row { grid-template-columns: 1fr; } }
.field label { display: block; font-size: .92rem; font-weight: 500; margin-bottom: 6px; }
.field .optional { color: var(--ink-soft); font-weight: 400; }
.field input {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  padding: 12px 14px; border: 1.5px solid #9db3b3; border-radius: 10px;
}
.field input:focus-visible { outline: 3px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
.field input[aria-invalid="true"] { border-color: #b3382a; }
.field-error { color: #8c2b1f; font-size: .88rem; margin: 6px 0 0; }
.field-error[hidden] { display: none; }
.hint { font-size: .88rem; color: var(--ink-soft); margin: 4px 0 12px; line-height: 1.5; }
.hint-block { margin: -8px 0 0; padding: 12px 14px; background: var(--surface-alt); border-radius: 10px; }
.calc fieldset > .hint:last-child { margin: 10px 0 0; }

.more-details summary { cursor: pointer; font-weight: 600; color: var(--primary-dark); padding: 4px 0; }
.more-details[open] summary { margin-bottom: 14px; }

/* Ergebnis */
.result-label { font-size: .82rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary-dark); margin-bottom: 6px; }
.result-empty { color: var(--ink-soft); margin: 0; }
.big-number { font-family: var(--font-head); font-weight: 700; font-size: clamp(2.6rem, 6vw, 3.4rem); line-height: 1.05; letter-spacing: -.02em; color: var(--primary-dark); margin: 0 0 18px; }
.big-number span { font-family: var(--font-body); font-size: 1rem; font-weight: 400; letter-spacing: 0; color: var(--ink-soft); }
.big-text { font-size: clamp(1.6rem, 3.4vw, 2rem); line-height: 1.2; }

.bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; margin-bottom: 18px; background: #fff; }
.bar span { display: block; height: 100%; border-right: 2px solid #fff; }
.bar span:last-child { border-right: 0; }
.seg-sfk { width: 40%; background: var(--primary); }
.seg-am { width: 35%; background: var(--accent); }
.seg-rest { width: 25%; background: #7a9aa0; }

.result-table { width: 100%; border-collapse: separate; border-spacing: 0; margin-bottom: 14px; }
.result-table th, .result-table td { padding: 11px 0; border-bottom: 1px solid #c9dcdc; vertical-align: top; text-align: left; }
.result-table tr:last-child th, .result-table tr:last-child td { border-bottom: 0; }
.result-table th { font-weight: 600; position: relative; padding-left: 22px; padding-right: 12px; }
.result-table th small { display: block; font-weight: 400; font-size: .85rem; color: var(--ink-soft); line-height: 1.4; }
.result-table td { text-align: right; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-am th, .row-am td { background: var(--accent-tint); border-bottom-color: transparent; padding-top: 15px; padding-bottom: 15px; color: var(--primary); }
.row-am th { padding-left: 40px; border-radius: 12px 0 0 12px; font-size: 1.08rem; }
.row-am td { padding-right: 16px; border-radius: 0 12px 12px 0; font-size: 1.15rem; }
.row-am th small { color: var(--ink-soft); font-size: .88rem; }
.dot { position: absolute; left: 0; top: 17px; width: 12px; height: 12px; border-radius: 50%; }
.row-am .dot { left: 16px; top: 21px; width: 14px; height: 14px; }
.hint-plan { border-left: 3px solid var(--accent); padding-left: 12px; color: var(--ink); }
.hint-afa { font-size: .82rem; margin-top: 4px; padding-top: 10px; border-top: 1px solid #c9dcdc; }
.dot-sfk { background: var(--primary); }
.dot-am { background: var(--accent); }
.dot-rest { background: #7a9aa0; }

.calc-result .check-list { margin-bottom: 14px; }
.rechenweg { margin-top: 14px; font-size: .92rem; }
.rechenweg summary { cursor: pointer; font-weight: 600; color: var(--primary-dark); }
.rechenweg ul { margin: 10px 0 0; padding-left: 1.1em; color: var(--ink-soft); }
.rechenweg li { margin-bottom: 4px; }

/* Gesamt und Aktionen */
.calc-summary { background: var(--primary-dark); color: #fff; border-radius: var(--radius); padding: clamp(20px, 3vw, 32px); }
.calc-summary[hidden] { display: none; }
.calc-summary h2 { color: #fff; font-size: 1.3rem; }
.calc-summary .big-number { color: #fff; margin-bottom: 10px; }
.calc-summary .big-number span { color: rgba(255, 255, 255, .8); }
.calc-summary p { color: rgba(255, 255, 255, .92); margin-bottom: .6em; }
.calc-summary .small { font-size: .92rem; color: rgba(255, 255, 255, .8); }

.calc-actions {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 3vw, 28px);
}
.calc-actions p { margin: 0; max-width: 34em; }
.calc-actions .btn-row { margin: 0; }

/* Erklärung */
.rule-grid { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) { .rule-grid { grid-template-columns: 1fr; } }
.rule-number { font-family: var(--font-head); font-size: 2.2rem; line-height: 1; color: var(--primary-dark); margin-bottom: 8px; }
.rule-number small { font-family: var(--font-body); font-size: .9rem; color: var(--ink-soft); font-weight: 500; }

@media print {
  .no-print, .calc-actions, #standort-hinzu, .calc-remove, .more-details { display: none !important; }
  .calc-card, .calc-summary { box-shadow: none; break-inside: avoid; }
  .calc-summary { background: #fff; color: #000; border: 1px solid #999; }
  .calc-summary h2, .calc-summary .big-number, .calc-summary .big-number span, .calc-summary p, .calc-summary .small { color: #000; }
  .calc-result { background: #fff; }
  .rechenweg:not([open]) ul { display: block; }
}
