/* getModelldaten. */

.macro-params-block .macro-group-title {
  font-size: var(--ui-font-size-lg);
  font-weight: 600;
}

.macro-params-block .macro-panel-head {
  padding: 0.1rem 0 0.45rem;
  background: transparent;
  border: none;
}

.macro-input-group .macro-group-title {
  font-size: var(--ui-font-size-md);
}

.macro-panel {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-panel-radius);
}

#macroToolPanel,
.macro-form,
.macro-panel,
.macro-rep-mode-table {
  --macro-demo-0: #0f6b5c;
  --macro-demo-1: #9a4a16;
  --macro-demo-2: #3a4e8a;
}

.macro-panel-head {
  display: flex;
  align-items: center;
  padding: 0.6rem 0.9rem 0.45rem;
}

.macro-panel-body {
  padding: 0 0.9rem 0.85rem;
}

.macro-collapsible-card:has(> .collapse:not(.show)) {
  border-bottom-left-radius: var(--app-panel-radius);
  border-bottom-right-radius: var(--app-panel-radius);
}

.macro-panel {
  background: var(--app-surface);
}

/* getModelldaten configuration tab */
.macro-group-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.macro-group-title:not(:first-child) {
  margin-top: 0.25rem;
}

.macro-group-divider {
  margin: 1.35rem 0 1.1rem;
  border: 0;
  border-top: 1px solid var(--app-border);
  opacity: 1;
}

.macro-section-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.5rem;
}

.macro-params-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.macro-input-group {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-panel-radius);
  padding: 0.65rem 0.75rem;
}

.macro-input-group > .macro-group-title,
.macro-input-group > .macro-section-header {
  margin-bottom: 0;
}

.macro-input-group .macro-section-body {
  padding-top: 0.75rem;
}

.macro-input-group--nested {
  background: var(--app-surface-muted);
  margin-top: 0.75rem;
  padding: 0.65rem 0.7rem 0.75rem;
  border-radius: var(--ui-radius-control);
}

.macro-input-group--nested > .macro-section-header,
.macro-input-group--nested > .macro-group-title {
  margin-bottom: 0.55rem;
}

.macro-input-group--nested > .macro-group-title {
  font-size: 0.875rem;
  font-weight: 650;
}

.macro-group-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.7rem;
  width: 100%;
  min-height: 1.55rem;
  text-align: left;
}

.macro-group-toggle-heading {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
  min-width: 0;
}

.macro-group-toggle .macro-group-title {
  margin-bottom: 0;
  flex: 0 0 auto;
}

.macro-group-trace {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
  flex: 1 1 auto;
}

.macro-input-group--collapsible:has(> .collapse:not(.show):not(.collapsing)) .macro-group-trace:not([hidden]) {
  display: flex;
}

.macro-group-trace-text,
.macro-group-trace-chip {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 400;
  font-family: var(--font-mono);
  line-height: 1.35;
  letter-spacing: 0;
  color: var(--app-muted);
  background: transparent;
  border: none;
  padding: 0;
}

.macro-fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.macro-field {
  --macro-label-width: 18rem;
  --macro-label-offset: 0.15rem;
  display: grid;
  grid-template-columns: minmax(10rem, var(--macro-label-width)) minmax(0, 1fr);
  column-gap: 1rem;
  row-gap: 0.3rem;
  align-items: start;
}

/* Label an die Textkante, nicht an den Control-Padding-Rand. */
.macro-field:has(> .macro-field-control > :is(.form-control, .form-select, .input-group, textarea, select):first-child),
.macro-field:has(> .macro-field-control > .macro-gated-body:not(.d-none) > :is(.form-control, .form-select, .input-group, textarea, select):first-child) {
  --macro-label-offset: 0.5rem;
}

.macro-field-label {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
  padding-top: var(--macro-label-offset, 0.15rem);
  line-height: 1.3;
  text-align: right;
}

.macro-field-label .form-label {
  display: inline;
  margin: 0;
}

.macro-field-label .macro-help-btn {
  flex-shrink: 0;
}

.macro-field-control {
  min-width: 0;
}

.macro-field-control--xs {
  max-width: 6.5rem;
}

.macro-field-control--sm {
  max-width: 10.5rem;
}

.macro-field-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
}

.macro-field-stack .form-check {
  min-height: 1.5rem;
  display: flex;
  align-items: center;
}

.macro-field-stack .form-check-input {
  margin-top: 0;
}

.macro-field-stack .form-check-label {
  margin-left: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.3;
}

.macro-field-control--pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem 1rem;
  align-items: start;
}

.macro-control-slot {
  min-width: 0;
}

.macro-date-control {
  position: relative;
}

.macro-date-control .form-control {
  padding-right: 2.5rem;
  font-variant-numeric: tabular-nums;
}

.macro-date-picker-btn {
  position: absolute;
  top: 50%;
  right: 0.15rem;
  z-index: 1;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--app-muted);
  cursor: pointer;
  transform: translateY(-50%);
}

.macro-date-picker-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2.5rem;
  height: 2.5rem;
  transform: translate(-50%, -50%);
}

.macro-date-picker-btn:hover,
.macro-date-picker-btn:focus-visible {
  color: var(--app-text);
}

.macro-date-picker {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
  border: 0;
  padding: 0;
}

.macro-control-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-height: 1.35rem;
  margin-bottom: 0.35rem;
}

.macro-control-caption {
  display: inline;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 650;
  color: var(--app-muted);
  line-height: 1.3;
}

.macro-control-head .macro-help-btn {
  margin-left: 0.35rem;
}

.macro-field--switch {
  --macro-label-offset: 0px;
  align-items: center;
}

.macro-field--switch .macro-field-label {
  padding-top: 0;
}

.macro-field--switch .form-check {
  min-height: 1.5rem;
  display: flex;
  align-items: center;
  margin-bottom: 0;
}

.macro-field--switch .form-check-input {
  margin-top: 0;
}

.macro-form .macro-field .form-control,
.macro-form .macro-field .form-select,
.macro-form .macro-field .input-group,
.macro-form .macro-field .macro-uid-props,
.macro-form .macro-field .macro-uid-source,
.macro-form .macro-field .macro-rep-mode,
.macro-form .macro-field-control--pair .form-control {
  margin-top: 0;
}

.macro-field .macro-gated-note {
  margin-top: 0;
  padding-top: 0.45rem;
}

@media (max-width: 991.98px) {
  .macro-field {
      --macro-label-width: 14.5rem;
    }
}

@media (max-width: 767.98px) {
  .macro-field {
      grid-template-columns: minmax(0, 1fr);
    }

  .macro-field-label {
      padding-top: 0;
      justify-content: flex-start;
      text-align: left;
    }

  .macro-field-label .macro-rep-mode-toolbar {
      justify-content: flex-start;
    }

  .macro-field-control--pair {
      grid-template-columns: minmax(0, 1fr);
    }

  .macro-field-control--xs,
    .macro-field-control--sm {
      max-width: none;
    }

  .macro-form .macro-field .form-control,
    .macro-form .macro-field .form-select,
    .macro-form .macro-field .input-group,
    .macro-form .macro-field .macro-uid-props {
      margin-top: 0.35rem;
    }

  .macro-field--switch .form-check {
      margin-top: 0.15rem;
    }
}

.macro-section-header--sub {
  margin-top: 0.15rem;
}

.macro-section-header--sub .macro-group-title {
  font-size: 0.875rem;
  font-weight: 650;
}

.macro-section-header .macro-group-title {
  margin-bottom: 0;
}

.macro-section-header .form-check {
  padding-left: 2.2em;
  min-height: 1.25rem;
  display: flex;
  align-items: center;
}

.macro-section-header .form-check-input {
  margin-top: 0;
  cursor: pointer;
}

.macro-gated-block.is-compact-disabled {
  opacity: 0.72;
}

.macro-gated-block.is-compact-disabled .macro-gated-body {
  display: none;
}

.macro-gated-note {
  font-size: 0.8125rem;
  color: var(--app-muted);
  margin-top: 0.35rem;
}

.macro-subgroup-label {
  font-size: 0.8125rem;
  font-weight: 650;
  color: var(--app-muted);
  margin: 0.15rem 0 0;
  letter-spacing: 0.01em;
}

.macro-form .form-label,
.macro-form [data-macro-help-title].fw-semibold {
  display: inline;
  margin-bottom: 0;
}

.macro-form .form-control,
.macro-form .form-select,
.macro-form .macro-uid-props {
  margin-top: 0.35rem;
}

.macro-form .input-group {
  margin-top: 0.35rem;
}

.macro-form .input-group .form-control {
  margin-top: 0;
}

.macro-form .form-control::placeholder {
  color: var(--app-muted);
  opacity: 0.42;
}

.macro-form textarea.macro-id-list {
  min-height: 2.6rem;
  max-height: 14rem;
  overflow-y: auto;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.4;
  white-space: pre;
}

.macro-form .macro-field-feedback {
  margin-top: 0.4rem;
  margin-bottom: 0.2rem;
  font-size: 0.8125rem;
}

.macro-form .input-group > .macro-field-feedback,
.macro-form .input-group > .invalid-feedback {
  flex: 1 0 100%;
  width: 100%;
  order: 10;
}

.macro-form .macro-field-warn {
  color: var(--bs-warning-text-emphasis, #997404);
}

.macro-form .is-macro-warn {
  border-color: var(--bs-warning, #ffc107);
}

.macro-form .macro-uid-source.is-invalid,
.macro-form .macro-uid-props.is-invalid {
  outline: 1px solid var(--bs-form-invalid-border-color, #dc3545);
  border-radius: 0.3rem;
  padding: 0.35rem 0.5rem;
}

.macro-form .macro-uid-source.is-macro-warn,
.macro-form .macro-uid-props.is-macro-warn {
  outline: 1px solid var(--bs-warning, #ffc107);
  border-radius: 0.3rem;
  padding: 0.35rem 0.5rem;
}

.macro-panel-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
}

.macro-panel-toggle .macro-group-title {
  margin: 0;
  flex: 1 1 auto;
}

.macro-collapsible-card.card {
  overflow: hidden;
}

.macro-collapsible-card .card-header .macro-group-title {
  margin: 0;
}

.macro-group-lead {
  color: var(--app-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.macro-sas-name {
  display: inline-block;
  margin-left: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--app-muted);
}

.macro-help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.45rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--app-muted);
  line-height: 1;
  vertical-align: -0.05em;
}

.macro-help-btn:hover,
.macro-help-btn:focus-visible {
  color: var(--app-primary);
}

.macro-help-btn:focus-visible {
  outline: 2px solid rgba(var(--bs-primary-rgb), 0.35);
  outline-offset: 2px;
  border-radius: 0.2rem;
}

.macro-field-disabled {
  opacity: 0.55;
}

.macro-field-disabled .form-label,
.macro-field-disabled .form-check-label {
  color: var(--app-muted);
}

.macro-form .form-check-input:disabled + .form-check-label {
  color: var(--app-muted);
}

.macro-form .form-control:disabled,
.macro-form .form-select:disabled {
  background-color: #f3f5f7;
  opacity: 1;
}

.macro-help-popover {
  --bs-popover-max-width: 26rem;
  font-size: 0.82rem;
}

.macro-help-popover .popover-body {
  color: var(--app-text);
}

.macro-help-popover .popover-body p:last-child {
  margin-bottom: 0;
}

.macro-help-section + .macro-help-section,
.macro-help-section + p {
  margin-top: 0.7rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--app-border);
}

.macro-help-section-title {
  margin-bottom: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--app-muted);
}

.macro-help-modes {
  margin: 0;
}

.macro-help-mode {
  margin: 0 0 0.45rem;
}

.macro-help-mode:last-child {
  margin-bottom: 0;
}

.macro-help-mode dt {
  margin: 0;
  font-weight: 650;
  color: var(--app-text);
  line-height: 1.3;
}

.macro-help-mode-code {
  margin-left: 0.25rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--app-muted);
}

.macro-help-mode dd {
  margin: 0.12rem 0 0;
  color: color-mix(in srgb, var(--app-text) 82%, var(--app-muted));
  line-height: 1.35;
}

.macro-help-points {
  margin: 0;
  padding-left: 1.05rem;
}

.macro-help-points li {
  margin-bottom: 0.3rem;
  line-height: 1.35;
}

.macro-help-points li:last-child {
  margin-bottom: 0;
}

.macro-form .form-text {
  color: var(--app-muted);
}

.macro-filter-matches {
  color: var(--app-muted);
  line-height: 1.45;
}

.macro-filter-matches-status {
  display: block;
  font-weight: 600;
  color: var(--app-text);
}

.macro-filter-matches.is-complete .macro-filter-matches-status {
  color: var(--status-equal);
}

.macro-filter-matches.is-partial .macro-filter-matches-status,
.macro-filter-matches.is-none .macro-filter-matches-status {
  color: var(--status-partial);
}

.macro-filter-matches-hits,
.macro-filter-matches-missed,
.macro-filter-matches-extra {
  display: block;
}

.macro-filter-matches-label {
  margin-right: 0.15rem;
}

.macro-filter-matches-missed .macro-filter-matches-label,
.macro-filter-matches-extra .macro-filter-matches-label {
  color: #7a5c00;
}

.macro-filter-match {
  display: inline-block;
  margin: 0.15rem 0.25rem 0 0;
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--app-border);
  border-radius: 0.25rem;
  background: #f8f9fb;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--app-text);
}

.macro-filter-match.is-warn {
  border-color: #c9a027;
  background: #fff8e1;
  color: #7a5c00;
}

.macro-uid-source {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.75rem;
}

.macro-uid-source-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--app-border);
  border-radius: var(--ui-radius-control);
  background: var(--app-surface);
  box-shadow: none;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.macro-uid-source-card:hover {
  border-color: color-mix(in srgb, var(--app-primary) 45%, var(--app-border));
}

.macro-uid-source-card.is-disabled {
  cursor: not-allowed;
  opacity: 0.6;
  background: var(--app-surface);
}

.macro-uid-source-card.is-disabled:hover {
  border-color: var(--app-border);
}

.macro-uid-source-card:has(.macro-uid-source-input:checked) {
  border-color: var(--app-primary);
  box-shadow: none;
  background: var(--app-primary-light);
}

.macro-uid-source-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.macro-uid-source-card-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  font-size: 0.8125rem;
  line-height: 1.25;
  color: var(--app-text);
}

.macro-uid-source-card-title::before {
  display: none;
}

.macro-uid-source-card:has(.macro-uid-source-input:checked) .macro-uid-source-card-title {
  color: var(--app-primary);
}

.macro-uid-source-card:has(.macro-uid-source-input:checked) .macro-uid-source-card-title::before {
  display: none;
}

.macro-uid-source-card-text {
  font-size: 0.7rem;
  line-height: 1.35;
  color: var(--app-muted);
  padding-left: 0;
}

.macro-uid-output:not(.is-viz-off) {
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.macro-uid-output.is-viz-off .macro-rep-mode-diagrams {
  display: none;
}

.macro-uid-source-card .macro-rep-mode-diagrams {
  margin-top: 0.45rem;
}

.macro-kv-options {
  margin-top: 0.75rem;
  padding: 0.65rem 0.75rem 0.25rem;
  border-radius: var(--ui-radius-control);
  background: var(--app-surface-muted);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--app-border) 78%, transparent);
}

.macro-kv-options-title {
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--app-muted);
}

.macro-kv-option {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-height: 2.75rem;
  margin: 0;
  padding: 0.55rem 0.2rem;
  cursor: pointer;
}

.macro-kv-option + .macro-kv-option {
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--app-border) 65%, transparent);
}

.macro-kv-option .form-check-input {
  flex: 0 0 auto;
  margin: 0.15rem 0 0;
  cursor: pointer;
}

.macro-kv-option-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.macro-kv-option-name {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--app-text);
  text-wrap: pretty;
}

.macro-kv-option-text {
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--app-muted);
  text-wrap: pretty;
}

.macro-rep-mode-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex: 1 0 100%;
  margin: 0.4rem 0 0;
}

.macro-gated-block.is-compact-disabled .macro-rep-mode-toolbar {
  display: none;
}

.macro-rep-mode-viz-switch {
  display: flex;
  align-items: center;
  padding-left: 2.7em;
  min-height: 1.25rem;
}

.macro-rep-mode-viz-switch .form-check-input {
  margin-top: 0;
  cursor: pointer;
}

.macro-rep-mode-viz-switch .form-check-label {
  margin-left: 0.2rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--app-muted);
  cursor: pointer;
}

.macro-gated-block.is-compact-disabled .macro-rep-mode-viz-switch {
  display: none;
}

.macro-rep-mode.is-viz-off .macro-rep-mode-diagrams {
  display: none;
}

.macro-rep-mode-scroller:has(.macro-rep-mode.is-viz-off) {
  overflow-x: hidden;
}

.macro-rep-mode.is-viz-off {
  width: 100%;
  flex-wrap: wrap;
}

.macro-rep-mode.is-viz-off .macro-rep-mode-card {
  flex: 1 1 0;
  min-width: 9.5rem;
  max-width: none;
}

.macro-rep-mode.is-viz-off .macro-rep-mode-card-note {
  display: block;
}

.macro-rep-mode-scroller {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.35rem;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}

.macro-rep-mode {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.55rem;
  margin-top: 0.35rem;
  box-sizing: border-box;
  width: max-content;
  min-width: 100%;
}

.macro-rep-mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--app-border);
  border-radius: var(--app-panel-radius);
  background: var(--app-surface);
  cursor: pointer;
  flex: 1 0 auto;
  min-width: max-content;
  scroll-snap-align: start;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.macro-rep-mode-card:hover {
  border-color: color-mix(in srgb, var(--app-primary) 45%, var(--app-border));
}

.macro-rep-mode-card:has(.macro-rep-mode-input:checked) {
  border-color: var(--app-primary);
  box-shadow: inset 0 0 0 1px var(--app-primary);
  background: var(--app-primary-light);
}

.macro-rep-mode-card.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.macro-rep-mode-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.macro-rep-mode-card-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 650;
  font-size: 0.88rem;
  line-height: 1.25;
  color: var(--app-text);
}

.macro-rep-mode-card-title::before {
  content: "";
  flex: 0 0 0.85rem;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  border: 1.5px solid #adb5bd;
  background: var(--app-surface);
  box-shadow: inset 0 0 0 0 var(--app-primary);
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.macro-rep-mode-card:has(.macro-rep-mode-input:checked) .macro-rep-mode-card-title::before {
  border-color: var(--app-primary);
  box-shadow: inset 0 0 0 0.26rem var(--app-primary);
}

.macro-rep-mode-card-code {
  display: block;
  padding: 0 0 0.05rem 1.3rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--app-muted);
  background: none;
  border-radius: 0;
}

.macro-rep-mode-card:has(.macro-rep-mode-input:checked) .macro-rep-mode-card-code {
  color: var(--app-primary);
}

.macro-rep-mode-card-note {
  display: none;
  font-size: 0.72rem;
  line-height: 1.3;
  color: var(--app-muted);
  padding-left: 1.3rem;
  white-space: normal;
}

.macro-rep-mode-diagrams {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.15rem;
}

.macro-rep-mode-table-title {
  font-size: 0.7rem;
  font-weight: 650;
  color: var(--app-text);
  margin-bottom: 0.2rem;
}

.macro-rep-mode-table.is-accent .macro-rep-mode-table-title {
  color: var(--app-primary);
}

.macro-rep-mode-table-scroll {
  position: relative;
  overflow: visible;
}

.macro-rep-mode-table table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  line-height: 1.2;
  border: 1px solid #b7c2cd;
  border-radius: 3px;
  overflow: hidden;
  background: var(--app-surface);
}

.macro-rep-mode-table th,
.macro-rep-mode-table td {
  border-right: 1px solid #d5dde5;
  border-bottom: 1px solid #d5dde5;
  padding: 0.16rem 0.28rem;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.macro-rep-mode-table th:last-child,
.macro-rep-mode-table td:last-child {
  border-right: 0;
}

.macro-rep-mode-table tbody tr:last-child td {
  border-bottom: 0;
}

.macro-rep-mode-table th {
  background: linear-gradient(#eef2f6, #e2e8ee);
  border-bottom: 2px solid #8fa0b0;
  color: #334554;
  font-weight: 700;
  font-size: 0.6rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.macro-rep-mode-table th.is-omitted {
  width: 0.85rem;
  min-width: 0.85rem;
  max-width: 0.95rem;
  padding-left: 0.08rem;
  padding-right: 0.08rem;
  text-align: center;
  letter-spacing: 0;
  color: #7b8b9a;
  background:
    linear-gradient(90deg, #d7dee6 0%, #eef2f6 55%, #e2e8ee 100%);
  box-shadow: inset 3px 0 0 #c2ccd6;
}

.macro-rep-mode-table td.is-omitted {
  width: 0.85rem;
  min-width: 0.85rem;
  max-width: 0.95rem;
  padding-left: 0.08rem;
  padding-right: 0.08rem;
  text-align: center;
  font-weight: 650;
  color: #9aa8b5 !important;
  opacity: 1;
  background:
    linear-gradient(90deg, #e4e9ee 0%, color-mix(in srgb, var(--app-surface) 70%, #eef2f6) 100%);
  box-shadow: inset 3px 0 0 #d0d8e0;
}

.macro-rep-mode-table th.is-context {
  color: #5c6b7a;
  background: linear-gradient(#f3f5f7, #e8ecf0);
  font-weight: 650;
}

.macro-rep-mode-table th.is-context.is-omitted {
  background:
    linear-gradient(90deg, #d7dee6 0%, #f3f5f7 55%, #e8ecf0 100%);
}

.macro-rep-mode-table th.is-focus {
  background: linear-gradient(#e4eef6, #d3e2ef);
  color: var(--app-primary-active);
  border-bottom-color: var(--app-primary);
}

.macro-rep-mode-table td.is-context {
  font-weight: 500;
  opacity: 0.78;
}

.macro-rep-mode-table td.is-focus {
  font-weight: 650;
}

.macro-rep-mode-table tr.is-demo-0 td {
  color: var(--macro-demo-0);
}

.macro-rep-mode-table tr.is-demo-1 td {
  color: var(--macro-demo-1);
}

.macro-rep-mode-table tr.is-demo-2 td {
  color: var(--macro-demo-2);
}

.macro-rep-mode-table tr[class*="is-demo-"] td.is-empty {
  color: transparent;
}

.macro-rep-mode-table td.is-empty {
  color: transparent;
  background-color: color-mix(in srgb, var(--app-muted) 8%, var(--app-surface));
}

@media (max-width: 767.98px) {
  .macro-uid-source {
      grid-template-columns: 1fr;
    }
}

.macro-uid-props {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.macro-validation .alert {
  margin-bottom: 0.5rem;
}

.macro-sas-call-wrap {
  position: relative;
  border: 1px solid var(--app-border);
  border-radius: var(--ui-radius-control);
  background: var(--app-surface-muted);
  overflow: hidden;
}

.macro-sas-copy {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 1;
}

.macro-sas-copy.is-copied,
.macro-sas-copy.is-copied:hover,
.macro-sas-copy.is-copied:focus-visible {
  background-color: var(--status-equal);
  border-color: var(--status-equal);
  color: #fff;
}

.macro-sas-call {
  background: transparent;
  border: 0;
  border-radius: 0.35rem;
  padding: 0.75rem 6.5rem 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--app-text);
}

.macro-sas-call.is-blocked {
  opacity: 0.7;
}

.macro-preview-col-switch {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 0;
  padding-left: 0;
  flex-shrink: 0;
}

.macro-preview-switches {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem 0.9rem;
  min-height: 40px;
  min-width: 0;
}

.macro-preview-col-switch .form-check-input {
  float: none;
  margin: 0;
  flex-shrink: 0;
  background-color: var(--app-primary);
  border-color: var(--app-primary);
  --bs-form-switch-bg: var(--form-switch-bg-on);
}

.macro-preview-col-switch .form-check-input:hover:not(:disabled):not(:focus-visible),
.macro-preview-col-switch .form-check-input:not(:checked):hover:not(:disabled):not(:focus-visible),
.macro-preview-col-switch .form-check-input:checked:hover:not(:disabled):not(:focus-visible) {
  background-color: var(--app-primary-hover);
  border-color: var(--app-primary-hover);
  --bs-form-switch-bg: var(--form-switch-bg-on);
}

.macro-preview-col-switch .form-check-input:focus:not(:focus-visible),
.macro-preview-col-switch .form-check-input:not(:checked):focus:not(:focus-visible),
.macro-preview-col-switch .form-check-input:checked:focus:not(:focus-visible) {
  background-color: var(--app-primary);
  border-color: var(--app-primary);
  --bs-form-switch-bg: var(--form-switch-bg-on);
}

.macro-preview-col-switch .form-check-input:focus-visible,
.macro-preview-col-switch .form-check-input:not(:checked):focus-visible,
.macro-preview-col-switch .form-check-input:checked:focus-visible {
  background-color: var(--app-primary);
  border-color: var(--app-primary);
  --bs-form-switch-bg: var(--form-switch-bg-on);
}

.macro-preview-col-switch .form-check-label {
  padding: 0;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--app-muted);
  cursor: pointer;
  user-select: none;
}

.macro-preview-col-switch:not(:has(.form-check-input:checked)) .macro-preview-col-switch-off,
.macro-preview-col-switch:has(.form-check-input:checked) .macro-preview-col-switch-on {
  color: var(--app-text);
  font-weight: 600;
}

.macro-preview-record-switch {
  display: flex;
  align-items: center;
  padding-left: 2.7em;
  min-height: 0;
  flex-shrink: 0;
}

.macro-preview-record-switch .form-check-input {
  margin-top: 0;
  cursor: pointer;
}

.macro-preview-record-switch .form-check-label {
  margin-left: 0.2rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--app-muted);
  cursor: pointer;
  user-select: none;
}

.macro-preview-stale-hint {
  font-size: 0.84rem;
}

#macroPreviewSection.is-stale .macro-preview-stale-body {
  opacity: 0.42;
  filter: grayscale(0.2);
  transition: opacity 0.18s ease, filter 0.18s ease;
}

#macroPreviewSection:not(.is-stale) .macro-preview-stale-body {
  opacity: 1;
  filter: none;
  transition: opacity 0.18s ease, filter 0.18s ease;
}

.macro-preview-table-block + .macro-preview-table-block {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--app-border);
}

.macro-preview-table-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.macro-preview-meta {
  color: var(--app-muted);
  font-size: 0.8rem;
  margin: 0 0 0.65rem;
}

.macro-preview-wrap {
  overflow-x: auto;
  border: 1px solid var(--app-border);
  border-radius: 0.35rem;
  background: var(--app-surface);
}

.macro-preview-wrap:has(.macro-preview-table--grouped) {
  padding-top: 0.3rem;
}

.macro-preview-wrap:has(.macro-preview-table--attention) {
  padding-top: 1.75rem;
}

.macro-preview-table {
  font-size: 0.78rem;
  margin-bottom: 0;
}

.macro-preview-table thead th {
  vertical-align: middle;
  background: var(--app-primary-light);
  border-bottom: 1px solid var(--app-border);
  min-width: 6.5rem;
  white-space: nowrap;
  font-weight: 600;
}

.macro-preview-table:not(.macro-preview-table--labels) thead tr:not(.macro-preview-group-row) th {
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.macro-preview-table--grouped {
  --macro-group-edge: color-mix(in srgb, var(--app-primary) 22%, var(--app-border));
  --macro-group-bar-0: color-mix(in srgb, var(--app-primary-light) 86%, var(--app-primary) 14%);
  --macro-group-bar-1: color-mix(in srgb, var(--app-primary-light) 74%, var(--app-primary) 26%);
  --macro-group-head-0: color-mix(in srgb, var(--app-primary-light) 92%, var(--app-primary) 8%);
  --macro-group-head-1: color-mix(in srgb, var(--app-primary-light) 82%, var(--app-primary) 18%);
  --macro-group-body-0: color-mix(in srgb, var(--app-primary-light) 48%, transparent);
  --macro-group-body-1: color-mix(in srgb, var(--app-primary-light) 36%, transparent);
  border-collapse: separate;
  border-spacing: 0;
}

.macro-preview-table thead .macro-preview-group-row th {
  padding: 0.2rem 0.45rem 0.15rem;
  border-top: none !important;
  border-bottom: none !important;
  border-bottom-width: 0 !important;
  vertical-align: bottom;
  min-width: 0;
  white-space: nowrap;
  font-family: var(--font-ui);
  box-shadow: none !important;
}

.macro-preview-group-gap {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  min-width: 0 !important;
}

.macro-preview-group-bar {
  text-align: center;
  color: var(--app-primary);
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.01em;
  line-height: 1.25;
  border-radius: 0.3rem 0.3rem 0 0;
  border: none !important;
  border-left: 1px solid var(--macro-group-edge) !important;
  border-right: 1px solid var(--macro-group-edge) !important;
  box-shadow: none !important;
}

.macro-preview-group-bar--tone-0 {
  background: var(--macro-group-bar-0) !important;
}

.macro-preview-group-bar--tone-1 {
  background: var(--macro-group-bar-1) !important;
}

.macro-preview-group-bar-label {
  display: inline-block;
  margin-right: 0.35rem;
}

.macro-preview-group-bar-meta {
  display: inline-block;
  font-weight: 600;
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}

.macro-preview-table--grouped thead tr:not(.macro-preview-group-row) th.macro-col-indexed {
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  border-bottom: 1px solid var(--macro-group-edge) !important;
  box-shadow: none !important;
}

.macro-preview-table--grouped thead th.macro-col-indexed--tone-0 {
  background: var(--macro-group-head-0) !important;
}

.macro-preview-table--grouped thead th.macro-col-indexed--tone-1 {
  background: var(--macro-group-head-1) !important;
}

.macro-preview-table--grouped td.macro-col-indexed {
  border-left: none !important;
  border-right: none !important;
  box-shadow: none !important;
}

.macro-preview-table--grouped td.macro-col-indexed--tone-0 {
  background: var(--macro-group-body-0) !important;
}

.macro-preview-table--grouped td.macro-col-indexed--tone-1 {
  background: var(--macro-group-body-1) !important;
}

.macro-preview-table--grouped thead th.macro-col-indexed--start,
.macro-preview-table--grouped td.macro-col-indexed--start {
  border-left: 1px solid var(--macro-group-edge) !important;
}

.macro-preview-table--grouped thead th.macro-col-indexed--end,
.macro-preview-table--grouped td.macro-col-indexed--end {
  border-right: 1px solid var(--macro-group-edge) !important;
}

.macro-preview-table--grouped thead .macro-preview-group-bar--break,
.macro-preview-table--grouped thead th.macro-col-indexed--break,
.macro-preview-table--grouped td.macro-col-indexed--break {
  border-left: 1px solid var(--app-surface) !important;
}

.macro-preview-table--grouped thead .macro-preview-group-bar--before-break,
.macro-preview-table--grouped thead th.macro-col-indexed--before-break,
.macro-preview-table--grouped td.macro-col-indexed--before-break {
  border-right: none !important;
}

.macro-preview-table--grouped tbody tr:last-child td.macro-col-indexed {
  border-bottom: 1px solid color-mix(in srgb, var(--macro-group-edge) 55%, var(--app-border));
}

.macro-preview-table td {
  font-variant-numeric: tabular-nums;
  color: var(--app-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.macro-preview-record--tone-0 {
  --macro-record-mark: var(--macro-demo-0);
}

.macro-preview-record--tone-1 {
  --macro-record-mark: var(--macro-demo-1);
}

.macro-preview-record--tone-2 {
  --macro-record-mark: var(--macro-demo-2);
}

.macro-preview--record-colors .macro-preview-record--tone-0 td {
  color: var(--macro-demo-0);
}

.macro-preview--record-colors .macro-preview-record--tone-1 td {
  color: var(--macro-demo-1);
}

.macro-preview--record-colors .macro-preview-record--tone-2 td {
  color: var(--macro-demo-2);
}

.macro-preview--record-colors .macro-preview-record-key {
  font-weight: 600;
}

.macro-preview--record-colors .macro-preview-record td {
  transition-property: color;
  transition-duration: 0.18s;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

@media (prefers-reduced-motion: reduce) {
  .macro-preview--record-colors .macro-preview-record td {
    transition: none;
  }
}

.macro-preview-table td.macro-dummy-custom {
  outline: 1px dashed var(--status-partial);
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 6px,
    rgba(154, 103, 0, 0.06) 6px,
    rgba(154, 103, 0, 0.06) 12px
  );
}

.macro-preview-th-attention {
  position: relative;
}

.macro-preview-table .macro-preview-attention-btn {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.2rem);
  z-index: 3;
  transform: translateX(-50%);
  flex-shrink: 0;
  font-size: 0.68rem;
  line-height: 1.2;
  font-family: var(--ui-font-sans, inherit);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  padding: 0.14rem 0.32rem 0.14rem 0.36rem;
  white-space: nowrap;
}

.macro-preview-table .macro-preview-attention-btn:active {
  transform: translateX(-50%) scale(0.96);
}

.macro-preview-table--grouped .macro-preview-attention-btn {
  bottom: calc(100% + 1.4rem);
}

.macro-col-overview-table .macro-preview-attention-btn {
  margin-left: 0.35rem;
  vertical-align: middle;
}

.macro-preview-table .macro-col-ellipsis {
  color: var(--app-muted);
  font-style: italic;
  min-width: 5rem;
  background: #f6f7f9;
}

.macro-preview-table thead th.macro-col-ellipsis.macro-col-indexed {
  background: color-mix(in srgb, #f6f7f9 70%, var(--app-primary-light));
}

.macro-preview-table--grouped thead th.macro-col-ellipsis.macro-col-indexed--tone-0 {
  background: color-mix(in srgb, #f6f7f9 35%, var(--macro-group-head-0)) !important;
}

.macro-preview-table--grouped thead th.macro-col-ellipsis.macro-col-indexed--tone-1 {
  background: color-mix(in srgb, #f6f7f9 35%, var(--macro-group-head-1)) !important;
}

.macro-preview-table--grouped td.macro-col-ellipsis.macro-col-indexed--tone-0 {
  background: color-mix(in srgb, #f6f7f9 40%, var(--macro-group-body-0)) !important;
}

.macro-preview-table--grouped td.macro-col-ellipsis.macro-col-indexed--tone-1 {
  background: color-mix(in srgb, #f6f7f9 40%, var(--macro-group-body-1)) !important;
}

.macro-origin-badge {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--app-muted);
  text-transform: uppercase;
}

.macro-custom-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--status-partial);
}

.macro-col-overview {
  padding: 0.5rem 0 0;
}

.macro-col-overview-table {
  font-size: 0.75rem;
}

.macro-col-overview-table code {
  font-size: 0.72rem;
}
