/* 3D-Konfigurator des Treppenrechners. Keine verschachtelten Kaesten: Trennlinien, Spalten, Segmentschalter. */
.kf {
  margin-top: 14px;
}

.kf-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 12px 0;
  border-top: 1px solid #d2d9e3;
}

.kf-tabs {
  display: inline-flex;
  padding: 3px;
  border: 1px solid #c7cfdb;
  border-radius: 999px;
  background: #f0f3f6;
}

.kf-tabs button,
.kf-pills button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #52627d;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.kf-tabs button[aria-pressed="true"],
.kf-pills button[aria-pressed="true"] {
  background: #ffffff;
  color: #24324b;
  box-shadow: 0 1px 0 rgba(36, 50, 75, 0.1), 0 0 0 1px rgba(192, 35, 24, 0.0);
}

.kf-tabs button:hover,
.kf-pills button:hover {
  color: #24324b;
}

.kf-tabs button:focus-visible,
.kf-pills button:focus-visible,
.kf-tool:focus-visible,
.kf-link:focus-visible,
.kf-zoom button:focus-visible {
  outline: 2px solid rgba(192, 35, 24, 0.4);
  outline-offset: 1px;
}

.kf-root.is-flat .kf-proj,
.kf.is-flat .kf-proj {
  opacity: 0.4;
  pointer-events: none;
}

.kf-tools {
  display: inline-flex;
  gap: 8px;
  margin-left: auto;
}

.kf-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #d7dee8;
  border-radius: 10px;
  background: #f4f6fb;
  color: #314663;
  cursor: pointer;
}

.kf-tool svg {
  width: 18px;
  height: 18px;
}

.kf-tool:hover {
  background: #ffffff;
  border-color: #C02318;
  color: #C02318;
}

.kf-tool[aria-pressed="true"] {
  background: #ffffff;
  color: #C02318;
  border-color: rgba(192, 35, 24, 0.5);
}

.kf-tool.is-done {
  color: #2f6a53;
  border-color: #2f6a53;
}

.kf-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 300px;
  max-height: 640px;
  border-top: 1px solid #d2d9e3;
  border-bottom: 1px solid #d2d9e3;
  background: #f6f8fb;
  overflow: hidden;
}

.kf-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
  outline: none;
}

.kf-stage canvas:active {
  cursor: grabbing;
}

.kf-stage canvas:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(192, 35, 24, 0.35);
}

.kf-zoom {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kf-zoom button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #d7dee8;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.92);
  color: #314663;
  font: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.kf-zoom button:hover {
  border-color: #C02318;
  color: #C02318;
}

.kf-hint {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: #5d6b83;
}

.kf-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
  border-top: 1px solid #d2d9e3;
}

.kf-group {
  padding: 16px 20px 6px;
  border-left: 1px solid #d7dee8;
}

.kf-group:first-child {
  padding-left: 2px;
  border-left: 0;
}

.kf-group h3,
.kf-facts h3 {
  margin: 0 0 12px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5d6b83;
}

.kf-field {
  margin-bottom: 14px;
}

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

.kf-field-head > label:first-child,
.kf-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
}

.kf-field-head > label:first-child {
  margin-bottom: 0;
}

.kf-auto {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.kf-auto input {
  accent-color: #C02318;
}

.kf-num {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kf-num input[type="range"] {
  flex: 1 1 auto;
  min-width: 0;
  accent-color: #C02318;
}

.kf-num input[type="number"] {
  flex: 0 0 76px;
  width: 76px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid #c7cfdb;
  border-radius: 9px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}

.kf-num input[type="number"]:focus-visible {
  outline: 2px solid rgba(192, 35, 24, 0.35);
  outline-offset: 1px;
}

.kf-unit {
  flex: 0 0 auto;
  min-width: 18px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #52627d;
}

.kf-pills {
  display: inline-flex;
  flex-wrap: wrap;
  padding: 3px;
  border: 1px solid #c7cfdb;
  border-radius: 18px;
  background: #f0f3f6;
}

.kf-pills button {
  padding: 0 12px;
}

.kf-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(36, 50, 75, 0.3);
}

.kf-link {
  margin: 2px 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: #C02318;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.kf-msg {
  min-height: 1.3em;
  margin: 6px 0 10px;
  font-size: 0.82rem;
  color: var(--muted);
}

.kf-facts {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid #d2d9e3;
}

.kf-facts dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 32px;
  margin: 0;
}

.kf-fact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #e3e8ef;
}

.kf-fact dt {
  font-size: 0.86rem;
  color: var(--muted);
}

.kf-fact dd {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  text-align: right;
}

.kf-fact.is-in dd { color: #2f6a53; }
.kf-fact.is-out dd { color: #9a6a1c; }

.kf-note {
  margin: 10px 0 0;
  font-size: 0.78rem;
  color: #5d6b83;
}

@media (max-width: 860px) {
  .kf-controls {
    grid-template-columns: 1fr;
  }

  .kf-group,
  .kf-group:first-child {
    padding: 14px 2px 4px;
    border-left: 0;
    border-top: 1px solid #d7dee8;
  }

  .kf-group:first-child {
    border-top: 0;
  }

  .kf-facts dl {
    grid-template-columns: 1fr;
  }

  .kf-tools {
    margin-left: 0;
  }

  .kf-stage {
    aspect-ratio: 4 / 3;
    min-height: 260px;
  }
}

/* Export-Schaltflaechen mit Text (DXF, PDF) und Auswahlkaestchen */
.kf-tool.kf-tool-text {
  width: auto;
  padding: 0 12px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.kf-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 12px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.kf-check input {
  width: 17px;
  height: 17px;
  accent-color: #C02318;
}

.kf-straight-only {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed #d7dee8;
}
