.formula-page-title-probe {
  display: none;
}

.module-tab-panel {
  display: none;
}

.module-tab-panel.is-active {
  display: block;
}

.formula-management-page .workspace-card__body {
  padding-top: 14px;
}

.formula-shell {
  border: 1px solid rgba(221, 226, 238, 0.9);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.formula-shell__head,
.formula-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 60px;
  padding: 12px 18px;
  background: linear-gradient(90deg, #5a7dff 0%, #4d72ef 100%);
}

.formula-shell__title,
.formula-card__title {
  margin: 0;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.formula-shell__search,
.formula-card__search {
  min-width: 260px;
}

.formula-shell__search input,
.formula-card__search input {
  min-height: 32px;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.18);
}

.formula-shell__search input::placeholder,
.formula-card__search input::placeholder {
  color: rgba(255, 255, 255, 0.82);
}

.formula-shell__search .search-shell__icon,
.formula-card__search .search-shell__icon {
  color: rgba(255, 255, 255, 0.88);
}

.formula-shell__toolbar,
.formula-card__toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  min-height: 58px;
  padding: 12px 18px;
  border-bottom: 1px solid #eef1f7;
  background: #fff;
}

.formula-shell__table-shell {
  border: 0;
  border-radius: 0;
}

.formula-monitor-panel {
  border: 1px solid rgba(221, 226, 238, 0.9);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.formula-monitor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  min-height: 58px;
  padding: 16px 20px 10px;
  border-bottom: 1px solid #eef1f7;
  background: #fff;
}

.formula-monitor-toolbar__left,
.formula-monitor-toolbar__right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.formula-range {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.formula-range__label {
  color: #4b5670;
  font-size: 14px;
  font-weight: 600;
}

.formula-range__fields {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.formula-range__fields input {
  min-width: 186px;
  min-height: 34px;
}

.formula-range__split {
  color: #8894aa;
}

.formula-monitor-panel__table-shell {
  border: 0;
  border-radius: 0;
  min-height: 720px;
}

.formula-table thead th:nth-child(1),
.formula-table tbody td:nth-child(1) {
  width: 58px;
  text-align: center;
}

.formula-table thead th:nth-child(2) {
  min-width: 150px;
}

.formula-table thead th:nth-child(3) {
  min-width: 230px;
}

.formula-table thead th:nth-child(4) {
  min-width: 170px;
}

.formula-table thead th:nth-child(5) {
  min-width: 120px;
}

.formula-table thead th:nth-child(6) {
  min-width: 120px;
}

.formula-table thead th:nth-child(7) {
  min-width: 100px;
}

.formula-table thead th:nth-child(8) {
  min-width: 220px;
}

.formula-application-table thead th:nth-child(1),
.formula-application-table tbody td:nth-child(1),
.formula-log-table thead th:nth-child(1),
.formula-log-table tbody td:nth-child(1),
.formula-run-log-table thead th:nth-child(1),
.formula-run-log-table tbody td:nth-child(1) {
  width: 58px;
  text-align: center;
}

.formula-application-table thead th:nth-child(2),
.formula-application-table thead th:nth-child(3),
.formula-application-table thead th:nth-child(4),
.formula-application-table thead th:nth-child(5),
.formula-application-table thead th:nth-child(6),
.formula-application-table thead th:nth-child(7) {
  min-width: 180px;
}

.formula-log-table thead th:nth-child(2) {
  min-width: 220px;
}

.formula-log-table thead th:nth-child(3) {
  min-width: 220px;
}

.formula-log-table thead th:nth-child(4) {
  min-width: 240px;
}

.formula-log-table thead th:nth-child(5) {
  min-width: 170px;
}

.formula-log-table thead th:nth-child(6) {
  min-width: 260px;
}

.formula-run-log-table thead th:nth-child(2),
.formula-run-log-table thead th:nth-child(3),
.formula-run-log-table thead th:nth-child(4),
.formula-run-log-table thead th:nth-child(5),
.formula-run-log-table thead th:nth-child(6),
.formula-run-log-table thead th:nth-child(7),
.formula-run-log-table thead th:nth-child(8) {
  min-width: 170px;
}

.selection-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid #d5dbea;
  color: #a5afc6;
  background: #fff;
  font-size: 12px;
  line-height: 1;
}

.selection-mark--header {
  background: #eef2fb;
}

.selection-mark--selected {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
}

.formula-link {
  color: var(--color-primary-ink);
  text-decoration: underline dotted rgba(85, 118, 255, 0.34);
  text-underline-offset: 4px;
}

.formula-route-digest {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 22px;
}

.formula-route-step {
  width: 20px;
  height: 12px;
  clip-path: polygon(0 0, 72% 0, 100% 50%, 72% 100%, 0 100%, 16% 50%);
}

.formula-route-step--green {
  background: #4fbc7f;
}

.formula-route-step--blue {
  background: #58a6f4;
}

.formula-route-step--yellow {
  background: #f4c84e;
}

.formula-route-step--ghost {
  background: #dfe4ec;
}

.formula-route-count {
  color: var(--color-text-faint);
  font-size: 12px;
}

.formula-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}

.formula-status--active {
  background: rgba(85, 118, 255, 0.92);
  color: #fff;
}

.formula-status--idle {
  background: #9eabb6;
  color: #fff;
}

.drawer__panel--formula {
  width: min(820px, 100%);
}

.formula-drawer-form {
  display: grid;
  gap: 18px;
}

.formula-drawer-form .form-row {
  grid-template-columns: 126px 1fr;
}

.formula-drawer-form textarea {
  min-height: 108px;
}

.formula-chooser {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.formula-chooser__button {
  min-width: 86px;
  padding: 0 14px;
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  background: #fff;
  color: #4d5872;
}

.formula-placeholder {
  color: var(--color-text-faint);
  font-size: 13px;
}

.formula-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #eef2f8;
  color: #4a566f;
  font-size: 13px;
}

.formula-chip__close {
  color: #7a859e;
  font-size: 14px;
  line-height: 1;
}

.formula-modal {
  z-index: 96;
}

.formula-submodal {
  z-index: 106;
}

.formula-submodal--stacked {
  z-index: 116;
}

.formula-detail-modal {
  z-index: 100;
}

.formula-detail-modal__panel {
  width: min(1690px, calc(100vw - 72px));
  margin-top: 56px;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}

.formula-detail-modal__subtitle {
  margin: 6px 0 0;
  color: var(--color-text-subtle);
  font-size: 13px;
}

.formula-detail-modal__body {
  padding: 0 18px 18px;
}

.formula-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(0, 1fr);
  gap: 12px;
}

.formula-card {
  border: 1px solid rgba(221, 226, 238, 0.92);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.formula-card__toolbar {
  justify-content: space-between;
}

.formula-card__toolbar-left,
.formula-card__toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.formula-mini-button {
  color: #5b6781;
  font-size: 14px;
}

.formula-mini-button:hover,
.formula-link-button:hover {
  color: var(--color-primary-ink);
}

.formula-card__table-shell {
  border: 0;
  border-radius: 0;
}

.formula-route-table thead th:nth-child(1),
.formula-route-table tbody td:nth-child(1) {
  width: 150px;
}

.formula-param-view__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 18px 10px;
  border-bottom: 1px solid #eef1f7;
  background: #fff;
}

.formula-param-view__left,
.formula-param-view__right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.formula-checkbox-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #5c6681;
  font-size: 14px;
}

.formula-checkbox-text__box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid #d2d7e4;
  border-radius: 4px;
  background: #fff;
  color: #78839a;
  font-size: 11px;
}

.formula-link-button {
  color: var(--color-primary);
  font-size: 14px;
}

.formula-param-table thead th:nth-child(1) {
  min-width: 160px;
}

.formula-param-table thead th:nth-child(2),
.formula-param-table thead th:nth-child(3),
.formula-param-table thead th:nth-child(4) {
  min-width: 110px;
}

.formula-submodal__panel {
  width: min(900px, calc(100vw - 48px));
  margin-top: 72px;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}

.formula-submodal__panel--wide {
  width: min(980px, calc(100vw - 48px));
}

.formula-submodal__toolbar,
.formula-param-modal__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.formula-param-modal__toolbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.formula-param-modal__tabs {
  margin-bottom: 0;
  border-bottom: 0;
}

.formula-param-modal__tabs .drawer-tabs__item {
  padding-bottom: 8px;
}

.formula-submodal__table-shell {
  min-height: 400px;
}

.formula-selector-table thead th:nth-child(1),
.formula-selector-table tbody td:nth-child(1),
.formula-param-picker-table thead th:nth-child(1),
.formula-param-picker-table tbody td:nth-child(1) {
  width: 58px;
  text-align: center;
}

.formula-param-picker-table thead th:last-child,
.formula-param-picker-table tbody td:last-child,
.formula-param-config-table thead th:last-child,
.formula-param-config-table tbody td:last-child {
  min-width: 120px;
}

.formula-param-config-table input,
.formula-param-picker-table select {
  min-height: 32px;
}

.formula-realtime-chip {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(85, 118, 255, 0.12);
  color: var(--color-primary);
  font-size: 13px;
}

.formula-realtime-chip.is-visible {
  display: inline-flex;
}

.formula-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #475466;
  color: #fff;
  font-size: 11px;
}

@media (max-width: 1220px) {
  .formula-detail-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .formula-shell__head,
  .formula-card__head {
    flex-direction: column;
    align-items: stretch;
  }

  .formula-shell__search,
  .formula-card__search {
    min-width: 0;
  }

  .formula-drawer-form .form-row {
    grid-template-columns: 1fr;
  }

  .formula-chooser {
    grid-template-columns: 1fr;
  }

  .formula-detail-modal__panel,
  .formula-submodal__panel {
    width: calc(100vw - 20px);
    margin-top: 20px;
  }

  .formula-range,
  .formula-range__fields {
    flex-wrap: wrap;
  }
}
