/* 1 %-Regelung Rechner. Uses the variables from styles.css. */

.rechner {
  margin: 2rem 0 1rem;
  padding: 1.5rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
@media (min-width: 600px) { .rechner { padding: 2rem; } }

.rechner h2 { margin-top: 0; }
.rechner [hidden],
.rechner-copy-row [hidden] { display: none !important; }

.rechner-form fieldset {
  min-width: 0;
  margin: 0 0 1.25rem;
  padding: 0;
  border: 0;
  display: grid;
  gap: 1rem;
}
@media (min-width: 600px) {
  .rechner-form fieldset { grid-template-columns: 1fr 1fr; column-gap: 1.25rem; }
  .rechner-date { grid-column: 1 / -1; }
}

.rechner-form legend {
  padding: 0;
  margin-bottom: 0.75rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.rechner-field { min-width: 0; }

.rechner-field label,
.rechner-label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  color: var(--text);
}
.rechner-field .rechner-sub { font-weight: 500; font-size: 0.9rem; color: var(--muted); }

.rechner-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.rechner-form input,
.rechner-form select {
  box-sizing: border-box;
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}
.rechner-form input:focus-visible,
.rechner-form select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-color: var(--brand);
}

.rechner-hint { margin: 0.35rem 0 0; font-size: 0.85rem; color: var(--muted); }

.rechner-submit { min-height: 44px; width: 100%; }
@media (min-width: 600px) { .rechner-submit { width: auto; } }

.rechner-noscript,
.rechner-fehler {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--text);
}

.rechner-ergebnis { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.rechner-urteil { margin: 0 0 1rem; font-size: 1.2rem; }

.rechner-cards { display: grid; gap: 0.75rem; }
@media (min-width: 480px) { .rechner-cards { grid-template-columns: 1fr 1fr; } }

.rechner-card {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.rechner-card.is-lower { border-color: var(--brand); background: var(--brand-soft); }
.rechner-card p { margin: 0; }
.rechner-card-label { font-size: 0.9rem; color: var(--muted); }
.rechner-amount {
  font-size: 1.7rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.rechner-diff { margin: 1rem 0 0.5rem; }

.rechner-hinweis {
  margin-top: 1.5rem;
  padding: 1rem;
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.92rem;
  color: var(--muted);
}
.rechner-hinweis p:last-child { margin-bottom: 0; }

.rechner-snippet {
  margin: 0 0 0.75rem;
  padding: 1rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 0.85rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.rechner-copy-row .btn { min-height: 44px; }
