/* BallisticCore – Rechner. Ergänzt style.css (Farben, Knöpfe, Kopfzeile). */

.calc-head { padding: calc(var(--nav-h) + clamp(28px, 4vw, 44px)) 0 clamp(20px, 3vw, 30px);
  background: linear-gradient(170deg, var(--paper-2) 0%, var(--paper) 100%);
  border-bottom: 1px solid var(--line-soft); }
.calc-head h1 { font-size: clamp(28px, 3.6vw, 44px); }
.calc-head .lead { margin-top: 14px; }

.mode-hint { font-size: 13.5px; line-height: 1.7; color: var(--ink-mid); max-width: 68ch; }

/* ── Zweispaltig: Eingabe / Ergebnis ────────────────────── */
.calc-grid { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: clamp(24px, 3.5vw, 52px); align-items: start; }
@media (max-width: 980px) { .calc-grid { grid-template-columns: 1fr; } }
/* Ohne min-width:0 sprengt die Ergebnistabelle (min-width 520px) am Handy die
   Seite, statt in ihrem Kasten zu scrollen. */
.calc-grid > * { min-width: 0; }
/* Nebeneinander stehende Kästen sind Rasterkinder, keine gestapelten
   Geschwister – der Abstand aus `.panel + .panel` würde den rechten Kasten
   sonst 22 px tiefer setzen als den linken. */
.calc-grid > .panel + .panel { margin-top: 0; }
.calc-grid .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.panel {
  background: #fff; border: 1px solid var(--line-soft); border-radius: 20px;
  padding: clamp(18px, 2vw, 26px); box-shadow: 0 18px 44px rgba(27,45,19,0.05);
}
.panel + .panel { margin-top: 22px; }
.panel > h2 { font-size: 15px; letter-spacing: 0.02em; margin-bottom: 4px; }
.panel-sub { font-size: 12.5px; color: var(--ink-mid); margin-bottom: 16px; }
@media (min-width: 981px) { .calc-form { position: sticky; top: calc(var(--nav-h) + 16px); } }

/* fieldset schrumpft von sich aus nicht unter seine min-content-Breite –
   ohne min-width:0 schiebt eine lange Option die Seite auf schmalen Schirmen auf. */
.fieldset { border: 0; padding: 0; margin: 0 0 4px; min-width: 0; }
.fieldset legend {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); padding: 18px 0 6px;
}
.fieldset:first-of-type legend { padding-top: 0; }

.row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid rgba(44,69,32,0.07);
}
.row:last-child { border-bottom: 0; }
.row { min-width: 0; }
.row > label { font-size: 14px; color: var(--ink); flex: 1 1 auto; min-width: 0; }
.row .unit { font-size: 12.5px; color: var(--ink-mid); min-width: 34px; text-align: left; }
.row input[type="number"], .row input[type="text"], .row select {
  font-family: inherit; font-size: 14px; font-weight: 600; color: var(--forest);
  text-align: right; border: 0; border-bottom: 1.5px solid rgba(44,69,32,0.18);
  background: transparent; padding: 5px 2px; width: 84px; border-radius: 0;
  -moz-appearance: textfield;
}
.row input::-webkit-outer-spin-button, .row input::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
.row input:focus, .row select:focus { outline: 0; border-bottom-color: var(--green); }
.row select { width: auto; max-width: 210px; text-align: left; text-align-last: right;
  appearance: none; cursor: pointer; padding-right: 16px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M1 1l4 4 4-4' fill='none' stroke='%236E9C37' stroke-width='1.6'/></svg>") right center no-repeat; }
.row--wide { flex-wrap: wrap; }
.row--wide select { max-width: 100%; width: 100%; text-align: left; text-align-last: left; margin-top: 6px; }
.row-note { flex-basis: 100%; font-size: 12px; color: var(--ink-mid); margin-top: 4px; }

.warn-row {
  display: flex; gap: 9px; align-items: flex-start; margin: 8px 0 2px; padding: 10px 12px;
  border-radius: 10px; background: rgba(176,68,43,0.10); font-size: 12.5px; line-height: 1.5;
  color: #8C3520;
}
.warn-row--mild { background: rgba(131,181,69,0.13); color: var(--forest); }

/* ── Ergebnis ───────────────────────────────────────────── */
.res-head { display: flex; flex-wrap: wrap; gap: 10px 30px; align-items: baseline;
  padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.res-head .big { font-size: clamp(22px, 2.4vw, 30px); font-weight: 700; color: var(--forest);
  letter-spacing: -0.02em; }
.res-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 12.5px; color: var(--ink-mid); }
.res-meta b { color: var(--forest); font-variant-numeric: tabular-nums; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 14px; margin-bottom: 22px; }
.kpi { border-top: 2px solid var(--line); padding-top: 12px; }
.kpi .k { font-size: clamp(22px, 2.4vw, 30px); font-weight: 700; color: var(--accent);
  line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi .k small { font-size: 0.45em; margin-left: 3px; }
.kpi .l { font-size: 12px; color: var(--ink-mid); margin-top: 6px; line-height: 1.45; }

table.res { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 520px; }
table.res th { padding: 9px 8px; font-size: 12px; font-weight: 700; color: var(--forest);
  border-bottom: 1.5px solid rgba(44,69,32,0.16); text-align: right; white-space: nowrap; }
table.res th:first-child, table.res td:first-child { text-align: left; }
table.res td { padding: 9px 8px; text-align: right; white-space: nowrap;
  border-bottom: 1px solid rgba(44,69,32,0.06); font-variant-numeric: tabular-nums; }
table.res tr:last-child td { border-bottom: 0; }
table.res td.neg { color: var(--ink); }
table.res tr.sub td { color: #8C3520; }
table.res tr.sub td:first-child::after { content: ' ·'; }
table.res .dim { color: var(--muted); font-size: 12.5px; }

.chart-wrap { margin-top: 20px; background: rgba(195,212,182,0.28); border-radius: 16px;
  padding: 16px 16px 10px; }
.chart-wrap svg { width: 100%; height: auto; display: block; }

/* Kleiner Knopf in einer Eingabezeile (z. B. GEE neben der Einschussdistanz) */
.row-btn {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--line); border-radius: 20px;
  padding: 5px 12px; white-space: nowrap; transition: all 0.25s var(--ease);
}
.row-btn:hover { background: var(--green); border-color: var(--green); color: #fff; }
.row-btn::after { content: ' ›'; }
.legend { display: flex; gap: 18px; font-size: 11.5px; color: var(--ink-mid); margin-top: 8px; }
.legend i { display: inline-block; width: 14px; height: 2.5px; vertical-align: 3px; margin-right: 6px; }

.res-foot { margin-top: 18px; font-size: 12px; line-height: 1.65; color: #8a927f; }

/* Hinweiszeile unter dem Ergebnis – bewusst zurückhaltend, wie die
   Fußnoten unter KI-Antworten: da, aber nicht im Weg. */
.res-hinweis {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft);
  font-size: 11.5px; line-height: 1.6; color: #9aa291;
}
.res-hinweis a { color: #9aa291; text-decoration: underline; text-underline-offset: 2px; }
.res-hinweis a:hover { color: var(--green-dark); }
