/* Treppenrechner: Felder, Zusatzanzeigen und Treppenskizze. Grundstil wie der Gefaelle-Rechner (.gr-*). */
.tr-calc {
  margin: 6px 0 22px;
  padding-top: 18px;
  border-top: 1px solid #d2d9e3;
}

.tr-block-title {
  margin: 0 0 4px;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5d6b83;
}

.tr-formula {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: var(--muted);
}

.tr-grid-3,
.tr-grid-2 {
  display: grid;
}

.tr-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tr-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.tr-field {
  padding: 6px 20px 14px;
  border-left: 1px solid #d7dee8;
  box-shadow: inset 0 0 0 0 transparent;
  transition: box-shadow 0.15s ease;
}

.tr-field:first-child {
  padding-left: 2px;
  border-left: 0;
}

.tr-field.is-calculated {
  box-shadow: inset 4px 0 0 #2f6a53;
  padding-left: 24px;
}

.tr-field:first-child.is-calculated {
  padding-left: 20px;
}

.tr-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.tr-field-head label {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
}

.tr-field-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tr-unit {
  flex: 0 0 auto;
  font-size: 0.85rem;
  font-weight: 700;
  color: #52627d;
}

.tr-input {
  flex: 1 1 90px;
  min-width: 0;
  height: 40px;
  padding: 0 10px;
  border: 1px solid #c7cfdb;
  border-radius: 9px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}

.tr-input:focus-visible {
  outline: 2px solid rgba(192, 35, 24, 0.35);
  outline-offset: 1px;
}

.tr-badge[hidden] { display: none; }

.tr-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(47, 106, 83, 0.12);
  color: #2f6a53;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.tr-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #d7dee8;
}

.tr-status {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.tr-status.is-ok { color: #2f6a53; font-weight: 600; }
.tr-status.is-error { color: #9a2039; font-weight: 600; }

.tr-reset-btn {
  height: 36px;
  padding: 0 16px;
  border: 1px solid #c7cfdb;
  border-radius: 999px;
  background: #ffffff;
  color: #314663;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.tr-reset-btn:hover,
.tr-reset-btn:focus-visible {
  background: #f0f3f6;
  outline: none;
}

.tr-info {
  min-height: 1.3em;
  margin: 8px 0 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.tr-info.is-in { color: #2f6a53; font-weight: 600; }
.tr-info.is-out { color: #9a6a1c; font-weight: 600; }

.tr-divider {
  margin: 14px 0 12px;
  border: 0;
  border-top: 1px solid #d7dee8;
}

.tr-diagram-wrap {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #d7dee8;
}

.tr-diagram {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  margin: 0 auto;
}

.tr-stair {
  fill: none;
  stroke: #C02318;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tr-ground {
  stroke: #24324b;
  stroke-width: 2;
  stroke-linecap: round;
}

.tr-dim {
  fill: none;
  stroke: #52627d;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.tr-diagram-label {
  font-size: 11px;
  font-weight: 700;
  fill: #314663;
  font-family: inherit;
}

.tr-diagram.is-empty .tr-stair,
.tr-diagram.is-empty .tr-dim {
  stroke-dasharray: 5 5;
  opacity: 0.55;
}

.tr-diagram-note {
  margin: 10px 0 0;
  font-size: 0.78rem;
  color: #5d6b83;
  text-align: center;
}

@media (max-width: 640px) {
  .tr-actions { flex-direction: column; align-items: stretch; }
  .tr-reset-btn { width: 100%; }

  .tr-grid-3,
  .tr-grid-2 {
    grid-template-columns: 1fr;
  }

  .tr-field {
    padding: 12px 2px;
    border-left: 0;
    border-top: 1px solid #d7dee8;
    box-shadow: none;
  }

  .tr-field:first-child {
    border-top: 0;
    padding-top: 0;
  }

  .tr-field.is-calculated {
    box-shadow: inset 4px 0 0 #2f6a53;
    padding-left: 14px;
  }
}
