.tariftool-editor-form textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.tt-page-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
  border: 1px solid #dfe3e7;
  border-radius: 14px;
}
.tt-page-title {
  margin: 0 0 6px;
  font-size: 28px;
}
.tt-page-intro {
  color: #5c6670;
  max-width: 900px;
}
.tt-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tt-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.tt-progress-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #dfe3e7;
  background: #fff;
  color: #5f6b76;
  font-weight: 600;
}
.tt-progress-item.is-active {
  border-color: #86b7fe;
  background: #eef5ff;
  color: #0a58ca;
}
.tt-progress-num {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e9edf2;
  color: #44515d;
  font-size: 13px;
}
.tt-progress-item.is-active .tt-progress-num {
  background: #0d6efd;
  color: #fff;
}
.tt-sticky-card {
  position: sticky;
  top: 12px;
}
.tt-help-box {
  padding: 10px 12px;
  border-radius: 10px;
  background: #f5f8fb;
  color: #50606d;
  font-size: 14px;
}
.tt-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.tt-section-title {
  font-size: 18px;
  font-weight: 700;
}
.tt-section-subtitle,
.tt-json-hint {
  color: #62707d;
  font-size: 13px;
}
.tt-tariff-nav {
  display: grid;
  gap: 8px;
}
.tt-nav-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #dfe3e7;
  background: #fff;
}
.tt-nav-item:hover {
  border-color: #86b7fe;
  background: #f7fbff;
}
.tt-nav-index {
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eef2f6;
  font-weight: 700;
}
.tt-nav-text {
  display: flex;
  flex-direction: column;
}
.tt-nav-text small {
  color: #61707d;
}
.tt-tariff-card {
  border: 1px solid #dfe3e7;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 18px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}
.tt-card-flash {
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.18);
}
.tt-tariff-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.tt-tariff-kicker {
  color: #5f6c79;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 4px;
}
.tt-tariff-title {
  margin: 0 0 4px;
  font-size: 22px;
}
.tt-tariff-subtitle {
  color: #576674;
}
.tt-tariff-head-actions {
  justify-content: flex-end;
}

.tt-tariff-head {
  position: sticky;
  top: calc(var(--tt-progress-sticky-height, 88px) + 12px);
  z-index: 950;
  padding: 14px 0 12px;
  background: #fff;
  border-bottom: 1px solid #e7ebef;
}
.tt-tariff-card.is-collapsed-card .tt-tariff-head {
  position: static;
  padding: 0;
  border-bottom: 0;
}
.tt-tariff-body {
  margin-top: 18px;
}
@media (max-width: 900px) {
  .tt-tariff-head {
    position: static;
    top: auto;
    padding: 0;
    border-bottom: 0;
  }
  .tt-tariff-body {
    margin-top: 14px;
  }
}
.tt-tariff-body.is-collapsed {
  display: none;
}
.tt-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.tt-grid-meta {
  margin-bottom: 16px;
}
.tt-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.tt-panel {
  margin-top: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: #fbfcfe;
}
.tt-panel > summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  list-style: none;
  padding: 14px 16px;
  font-weight: 700;
}
.tt-panel > summary::-webkit-details-marker {
  display: none;
}
.tt-panel-help {
  font-weight: 400;
  color: #63717e;
  font-size: 13px;
}
.tt-panel-content {
  padding: 0 16px 16px;
}
.tt-price-row {
  border: 1px dashed #c7ced6;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  background: #fff;
}
.tt-price-row-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.tt-actions-inline {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tt-small-label {
  font-size: 12px;
  color: #667;
  margin-bottom: 4px;
}
.tt-grid-4-price-row {
  align-items: start;
}
.tt-span-2 {
  grid-column: span 2;
}
.tt-choice-tools {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.tt-choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tt-choice-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 7px 10px;
  border: 1px solid #c7ced6;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.tt-choice-box:hover {
  border-color: #6ea8fe;
}
.tt-choice-box.is-selected {
  border-color: #0d6efd;
  background: #eaf2ff;
  color: #0a58ca;
  font-weight: 600;
}
.tt-choice-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
@media (max-width: 1200px) {
  .tt-sticky-card {
    position: static;
  }
}
@media (max-width: 900px) {
  .tt-page-head,
  .tt-tariff-head,
  .tt-progress,
  .tt-grid,
  .tt-grid-4,
  .tt-panel > summary {
    grid-template-columns: 1fr;
  }
  .tt-page-head,
  .tt-tariff-head,
  .tt-panel > summary {
    display: block;
  }
  .tt-head-actions,
  .tt-tariff-head-actions {
    margin-top: 12px;
  }
  .tt-span-2 {
    grid-column: span 1;
  }
}

.tt-progress-sticky {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #f4f6f9;
  padding: 10px 0 12px;
  margin-top: 0;
}
.tt-progress-sticky::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 10px;
  background: #dfe3e7;
}
.tt-progress-sticky .tt-progress-item {
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}
.tt-progress-item {
  appearance: none;
  cursor: pointer;
}
.tt-progress-item.is-done {
  border-color: #b7dfc3;
  background: #edf9f1;
  color: #1f6b35;
}
.tt-editor-stack {
  display: block;
}
.tt-editor-section {
  scroll-margin-top: 86px;
}
.tt-grid-stammdaten {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.tt-tariff-card.is-collapsed-card .tt-tariff-head {
  margin-bottom: 0;
}
.tt-tariff-card.is-collapsed-card {
  padding-bottom: 14px;
}
@media (max-width: 1200px) {
  .tt-grid-stammdaten {
    grid-template-columns: 1fr;
  }
}


@media (max-width: 900px) {
  .tt-progress-sticky {
    top: 0;
    padding-top: 8px;
  }
}

.tt-import-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:16px;}

.tt-inline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.tt-choice-box.is-disabled {
  opacity: 0.85;
  cursor: not-allowed;
}
.tt-price-row-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tt-row-warning {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #a94442;
  font-weight: 600;
}
.tt-price-row-warning {
  border-color: #dc3545;
  background: #fff5f5;
}
.tt-price-row-warning .tt-small-label,
.tt-price-row-warning .tt-row-warning {
  color: #a94442;
}
@media (max-width: 900px) {
  .tt-inline-grid {
    grid-template-columns: 1fr;
  }
}

.tt-validation-box {
  display: block;
}
.tt-validation-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.tt-validation-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: #fff3cd;
  border: 1px solid #ffe69c;
  font-weight: 700;
}
.tt-invalid-field,
.tt-invalid-field.form-control,
.tt-invalid-field.form-select {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 0.18rem rgba(220, 53, 69, 0.12) !important;
  background-image: none;
}
.tt-required-field,
.tt-required-field.form-control,
.tt-required-field.form-select {
  border-color: #f0ad4e;
  box-shadow: 0 0 0 0.18rem rgba(240, 173, 78, 0.12);
}
.tt-field-wrap {
  position: relative;
}
.tt-field-alert {
  margin-top: 4px;
  font-size: 12px;
  color: #b02a37;
  display: none;
}
.tt-field-wrap.has-error .tt-field-alert {
  display: block;
}
.tt-field-wrap.has-error .tt-small-label::after {
  content: " !";
  color: #b02a37;
  font-weight: 700;
}
.tt-nav-item.has-errors {
  border-color: #dc3545;
  background: #fff5f5;
}
.tt-nav-item.has-errors .tt-nav-index {
  background: #dc3545;
  color: #fff;
}
.tt-tariff-card.has-errors {
  border-color: #f1aeb5;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.08);
}
.tt-tariff-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tt-card-local-errors {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #f3c2bf;
  border-radius: 10px;
  background: #fff4f3;
}
.tt-card-local-errors-title {
  font-weight: 700;
  color: #9b2c2c;
  margin-bottom: 6px;
}
.tt-card-local-errors-list {
  margin: 0;
  padding-left: 18px;
  color: #7b241c;
}
.tt-card-local-errors-list li + li {
  margin-top: 4px;
}
.tt-card-alert-badge {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff3cd;
  color: #8a3d00;
  font-size: 12px;
  font-weight: 700;
}
.tt-tariff-card.has-errors .tt-card-alert-badge {
  display: inline-flex;
}


.tt-progress-shell {
  border: 1px solid #dfe3e7;
  border-radius: 14px;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(6px);
  padding: 10px;
  box-shadow: 0 4px 18px rgba(16, 24, 40, 0.08);
}
.tt-progress-meta {
  font-size: 13px;
  font-weight: 700;
  color: #4b5a68;
  margin: 0 4px 10px;
}
.tt-progress-item {
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.tt-progress-item.is-done {
  border-color: #b9d6c1;
  background: #f3fbf5;
  color: #255b34;
}
.tt-progress-item.is-done .tt-progress-num {
  background: #198754;
  color: #fff;
}
.tt-progress-item.is-active {
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.16);
}
.tt-editor-section {
  scroll-margin-top: 150px;
  transition: box-shadow .18s ease, border-color .18s ease;
}
.tt-editor-section.tt-section-active,
.tt-editor-section.tt-section-active.card,
.tt-editor-section.tt-section-active.alert {
  border-color: #86b7fe;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.12);
}

.tt-dso-field-stack {
  display: grid;
  gap: 8px;
}
.tt-dso-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -4px;
}
.tt-dso-helper {
  padding: 10px 12px;
  border: 1px solid #dfe3e7;
  border-radius: 10px;
  background: #f7f9fc;
  color: #52606d;
  font-size: 13px;
}
.tt-dso-helper.is-success {
  border-color: #7cc39a;
  background: #edf8f1;
  color: #1d6d3e;
}
.tt-dso-helper.is-warning {
  border-color: #f0b560;
  background: #fff8ec;
  color: #8a5a10;
}
.tt-dso-helper.is-error {
  border-color: #dc6b7b;
  background: #fff1f3;
  color: #8f2231;
}

.tt-overview-card {
  border: 1px solid #d7e0ea;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
  overflow: hidden;
}
.tt-overview-card + .tt-overview-card {
  margin-top: 12px;
}
.tt-overview-card.has-errors {
  border-color: #f1aeb5;
  box-shadow: 0 0 0 3px rgba(220,53,69,.08);
}
.tt-overview-card-head {
  width: 100%;
  border: 0;
  background: #eef4fb;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  text-align: left;
  gap: 16px;
}
.tt-overview-card-head:hover {
  background: #e7f0fc;
}
.tt-overview-title-wrap {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.tt-overview-index {
  min-width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #cbd8e6;
  font-weight: 700;
  color: #314255;
}
.tt-overview-title {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}
.tt-overview-meta {
  display: block;
  color: #5d6d7d;
  font-size: 13px;
  margin-bottom: 8px;
}
.tt-overview-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tt-overview-badge {
  display: inline-flex;
  border-radius: 999px;
  border: 1px solid #c8d7ea;
  background: #fff;
  color: #294261;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 700;
}
.tt-overview-chevron {
  font-size: 18px;
  color: #375277;
  transition: transform .18s ease;
}
.tt-overview-card.is-open .tt-overview-chevron {
  transform: rotate(180deg);
}
.tt-overview-card-body {
  padding: 16px;
}
.tt-overview-component-table {
  border: 1px solid #d9e2ec;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.tt-overview-component-head,
.tt-overview-component-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr .9fr;
  gap: 12px;
  padding: 10px 14px;
}
.tt-overview-component-head {
  background: #eef4fb;
  font-weight: 700;
  color: #314255;
}
.tt-overview-component-row {
  border-top: 1px solid #e6edf5;
  align-items: center;
}
.tt-overview-section-block {
  border-top: 1px solid #e6edf5;
  padding: 14px;
}
.tt-overview-section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #314255;
}
.tt-overview-chart {
  border: 1px solid #d9e2ec;
  border-radius: 14px;
  padding: 10px 12px;
  background: #f9fbfd;
  margin-bottom: 12px;
}
.tt-overview-hours {
  margin-left: 112px;
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 2px;
  color: #6a7b8e;
  font-size: 10px;
  font-weight: 700;
  margin-bottom: 8px;
}
.tt-overview-line {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}
.tt-overview-labels strong,
.tt-overview-labels small {
  display: block;
}
.tt-overview-labels strong { font-size: 13px; }
.tt-overview-labels small { color: #6b7c8d; }
.tt-overview-track {
  position: relative;
  height: 28px;
  border-radius: 999px;
  background: #edf3f8;
  overflow: hidden;
}
.tt-overview-segment {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  padding: 0 6px;
}
.tt-overview-segment.is-energy { background: #2f9e44; }
.tt-overview-segment.is-power { background: #1c7ed6; }
.tt-overview-segment.is-reactive { background: #9775fa; }
.tt-overview-table-wrap {
  overflow-x: auto;
}
.tt-overview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tt-overview-table th,
.tt-overview-table td {
  padding: 9px 10px;
  border-top: 1px solid #e6edf5;
  text-align: left;
}
.tt-overview-table thead th {
  background: #eef4fb;
  font-weight: 700;
  color: #314255;
  border-top: 0;
}
.tt-overview-pill {
  display: inline-flex;
  min-width: 62px;
  justify-content: center;
  border-radius: 999px;
  background: #eaf1ff;
  border: 1px solid #cad7fb;
  color: #294b90;
  padding: 2px 10px;
  font-weight: 700;
}
@media (max-width: 900px) {
  .tt-overview-component-head,
  .tt-overview-component-row,
  .tt-overview-line {
    grid-template-columns: 1fr;
  }
  .tt-overview-hours {
    margin-left: 0;
  }
}


.tt-progress {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.tt-summary-card {
  border: 1px solid #dfe3e7;
  border-radius: 14px;
  background: #fff;
  margin-bottom: 18px;
  overflow: hidden;
}
.tt-summary-card.has-errors {
  border-color: #dc3545;
}
.tt-summary-card-head {
  padding: 14px 16px;
  background: #f7f9fc;
  border-bottom: 1px solid #e7ebef;
}
.tt-summary-card-head h3 {
  margin: 0 0 4px;
  font-size: 20px;
}
.tt-summary-kicker {
  color: #5f6c79;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 4px;
}
.tt-summary-meta {
  color: #5c6670;
  font-size: 13px;
}
.tt-summary-table-wrap .table {
  margin-bottom: 0;
}
.tt-summary-table thead th {
  background: #eef3f8;
  border-bottom-width: 1px;
  white-space: nowrap;
}
.tt-summary-table td, .tt-summary-table th {
  vertical-align: middle;
}

.tt-overview-unit-note {
  margin-top: 8px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
}


.tt-overview-component-table-visual {
  display: grid;
  gap: 14px;
}
.tt-fachblock + .tt-fachblock {
  margin-top: 22px;
}
.tt-fachblock-title {
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 10px;
}
.tt-fachtable {
  border: 1px solid #cfd8e3;
  background: #fff;
}
.tt-fachtable thead th {
  background: #dfe9f6;
  border-bottom: 1px solid #c7d3e4;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}
.tt-fachtable .tt-fachtable-units th {
  background: #eef4fb;
  font-weight: 600;
  font-size: 12px;
}
.tt-fachtable td,
.tt-fachtable th {
  padding: 7px 8px;
  border-color: #d7e0ea;
}
.tt-fachtable tbody td:first-child {
  width: 40px;
  text-align: right;
}
.tt-fachtable tbody td:not(:nth-child(2)) {
  text-align: center;
}
.tt-empty-cell {
  color: transparent;
}


.tt-price-row.is-compact {
  border-style: solid;
  border-color: #d9e3f3;
  background: #fbfcff;
}
.tt-row-shared-compact {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.tt-row-shared-summary {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  color: #5f6b7a;
}
.tt-row-shared-summary strong {
  color: #2f3a49;
  font-size: 12px;
}
.tt-row-shared-editor {
  margin-top: 8px;
}
.tt-row-shared-editor summary {
  cursor: pointer;
  font-size: 12px;
  color: #0d6efd;
  user-select: none;
}
.tt-row-shared-grid {
  margin-top: 10px;
}
.tt-row-main-grid {
  margin-top: 4px;
}
