:root {
  color-scheme: light;
  --fx-bg: #eef1f4;
  --fx-panel-bg: #ffffff;
  --fx-panel-border: rgba(15, 23, 42, 0.08);
  --fx-text: #101828;
  --fx-muted: #5f6c86;
  --fx-accent: #c62432;
  --fx-danger: #d92c3a;
  --fx-radius: 18px;
  --fx-plot-dark: #0b0d17;
  --fx-plot-dark2: #1a1d29;
  --fx-plot-card: #f9fafb;
  --fx-plot-shadow: 0 20px 55px rgba(0, 0, 0, 0.25);
  --fx-panel-glow: radial-gradient(circle at 20% 20%, rgba(198, 36, 50, 0.08), transparent 45%),
    radial-gradient(circle at 80% 0%, rgba(244, 160, 49, 0.08), transparent 42%);
  --fx-sidebar-bg: #f7f8fa;
  --fx-sidebar-border: #d9dce3;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

html,
body,
#root {
  height: 100%;
  margin: 0;
  background: #f5f6f8;
  overflow: hidden;
}

body {
  min-height: 100vh;
  background: #f5f6f8;
  color: var(--fx-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.designer-app {
  --workspace-floating-edge: 24px;
}

.designer-app .workspace-return {
  bottom: 24px;
  right: 24px;
  z-index: 220;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
}

.fx-app-shell {
  display: flex;
  flex-direction: column;
  width: calc(100vw - 16px);
  height: calc(100vh - 16px);
  margin: 8px;
  padding: 0;
  gap: 0;
  box-sizing: border-box;
  background: #f7f8fa;
  border: none;
  border-radius: 10px;
  box-shadow: none;
  overflow: hidden;
}

.fx-app-header {
  display: none;
}

.fx-app-header h1 {
  margin: 0;
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
}

.fx-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.fx-actions--workspace {
  width: 100%;
}

.fx-actions--workspace .fx-button {
  flex: 1 1 170px;
  justify-content: center;
}

.fx-button {
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  cursor: pointer;
  background: rgba(198, 36, 50, 0.08);
  color: var(--fx-accent);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.08);
}

.fx-button--sm {
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
}

.fx-button.primary {
  background: var(--fx-accent);
  color: #fff;
  box-shadow: 0 12px 28px rgba(198, 36, 50, 0.25);
}

.fx-button.danger {
  background: rgba(217, 44, 58, 0.12);
  color: var(--fx-danger);
}

.fx-button:hover {
  transform: translateY(-1px);
  background: rgba(198, 36, 50, 0.15);
  box-shadow: 0 18px 32px rgba(16, 24, 40, 0.15);
}

.fx-button.busy {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.fx-button.busy::after {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-top-color: rgba(255, 255, 255, 0.2);
  animation: fx-spin 0.8s linear infinite;
}

@keyframes fx-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}


.fx-layout {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.fx-main-panels {
  min-width: 0;
  min-height: 0;
  flex: 1;
}

.fx-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  font-size: 14px;
  background: #ffffff !important;
  padding: 20px 32px 28px;
  border: none;
  border-radius: 10px;
  box-shadow: none;
  overflow: hidden;
  position: relative;
  z-index: 1;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}



.fx-page,
.fx-page-content {
  background: #ffffff !important;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.fx-tab-container {
  display: flex;
  width: 100%;
  height: 100%;
  gap: 0;
  border: 1px solid rgba(15, 23, 42, 0.05);
  background: #ffffff;
  border-radius: 10px;
  overflow: visible;
  box-shadow: none;
}

.fx-tabbar-shell {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: stretch;
  background: var(--fx-sidebar-bg);
  position: sticky;
  top: 0;
  height: 100%;
  max-height: 100%;
  overflow: visible;
}

.fx-sidebar {
  width: 236px;
  min-width: 236px;
  max-width: 236px;
  flex: 0 0 236px;
  background: var(--fx-sidebar-bg);
  border-right: none;
  padding: 12px 10px;
  box-sizing: border-box;
  position: relative;
  z-index: 5;
}

.fx-sidebar,
.fx-sidebar * {
  box-sizing: border-box;
  min-width: 0;
}

.fx-sidebar-orgbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 0 0 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: transparent;
}

.fx-org-btn {
  border: 1px solid #cfd3da;
  border-radius: 10px;
  min-width: 0;
  flex: 1;
  height: 32px;
  padding: 0 10px;
  background: #fdfdfd;
  color: #111827;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}

.fx-org-btn > span:not(.fx-org-caret) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fx-org-btn svg {
  width: 0.95rem;
  height: 0.95rem;
}

.fx-org-caret {
  color: #4b5563;
  font-size: 0.85rem;
}

.fx-org-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  color: #4b5563;
}

.fx-org-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.24);
  color: rgba(15, 23, 42, 0.72);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 0;
  appearance: none;
  cursor: pointer;
}

.fx-org-action-btn svg {
  width: 1rem;
  height: 1rem;
}

.fx-org-action-btn:hover {
  transform: translateY(-1px);
  background: #fff5f6;
  color: var(--fx-accent);
  box-shadow: 0 8px 16px rgba(198, 36, 50, 0.14);
}

.fx-org-menu {
  position: absolute;
  left: 0.75rem;
  top: calc(100% + 0.35rem);
  min-width: 225px;
  display: grid;
  gap: 0.1rem;
  padding: 0.35rem;
  background: #fff;
  border: 1px solid #d3d7de;
  border-radius: 10px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
  z-index: 120;
}

.fx-org-menu-item {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #111827;
  font-size: 1rem;
  padding: 0.48rem 0.52rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-align: left;
  cursor: pointer;
}

.fx-org-menu-item-icon {
  width: 1rem;
  height: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4b5563;
}

.fx-org-menu-item-icon svg {
  width: 1rem;
  height: 1rem;
}

.fx-org-menu-item:hover {
  background: #eceef2;
}

.fx-tabbar-toggle {
  display: none;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid var(--fx-panel-border);
  border-radius: 10px;
  padding: 0.55rem 0.85rem;
  margin: 0 0.75rem;
  background: rgba(255, 255, 255, 0.9);
  font-weight: 700;
  cursor: pointer;
  color: var(--fx-text);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
}

.fx-tabbar-toggle:focus-visible {
  outline-offset: 3px;
}

.fx-tabbar-toggle-bars {
  width: 1.1rem;
  height: 2px;
  background: currentColor;
  border-radius: 4px;
  box-shadow: 0 0.35rem 0 0 currentColor, 0 -0.35rem 0 0 currentColor;
}

.fx-tabbar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  flex: 1 1 auto;
  overflow-y: visible;
}

.fx-tabbar-shell.fx-tabbar-collapsible .fx-tabbar-toggle {
  display: inline-flex;
}

.fx-tabbar-shell.fx-tabbar-collapsible .fx-tabbar {
  display: none;
  width: 100%;
  max-height: 0;
  overflow: hidden;
  border-radius: 16px;
}

.fx-tabbar-shell.fx-tabbar-collapsible.fx-tabbar-open .fx-tabbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  max-height: 999px;
}

.fx-tabbar-shell.fx-tabbar-collapsible .fx-tab {
  width: 100%;
  justify-content: flex-start;
}

.fx-tab {
  border: none;
  border-radius: 10px;
  min-height: 40px;
  padding: 0 12px;
  background: transparent;
  color: #1f2937;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.25;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  text-align: left;
}

.fx-tab-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fx-tab-parent {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fx-tab-parent.active {
  color: #111827;
  background: #e4e7ec;
  box-shadow: inset 0 0 0 1px #d5dae3;
}

.fx-tab-caret {
  font-size: 0.72rem;
  transition: transform 0.2s ease;
  opacity: 0.75;
}

.fx-tab-parent[aria-expanded="true"] .fx-tab-caret {
  transform: rotate(180deg);
}

.fx-tab-children {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fx-tab-child {
  margin-left: 14px;
  padding: 0 10px;
  min-height: 36px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0.92;
}

.fx-tab:hover {
  color: #111827;
  background: #eceef2;
}

.fx-tab[aria-selected="true"] {
  color: #111827;
  background: #e4e7ec;
  box-shadow: inset 0 0 0 1px #d5dae3;
}

.fx-sidebar-icons {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: auto 0 0;
  padding: 12px 0 0;
  position: relative;
}

.fx-help-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.55rem);
  display: grid;
  gap: 0.15rem;
  min-width: 190px;
  padding: 0.4rem;
  border: 1px solid #d3d7de;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.14);
  z-index: 30;
}

.fx-help-menu-item {
  border: 0;
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 500;
  color: #111827;
  background: transparent;
  cursor: pointer;
}

.fx-help-menu-item:hover {
  background: #eceef2;
}

.fx-sidebar-icon {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.24);
  color: rgba(15, 23, 42, 0.72);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 0;
  appearance: none;
}

.fx-sidebar-icon svg {
  width: 1.1rem;
  height: 1.1rem;
}

.fx-sidebar-icon {
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.fx-sidebar-icon:hover,
.fx-sidebar-icon.active,
.fx-sidebar-icon[aria-pressed="true"] {
  transform: translateY(-1px);
  background: #fff5f6;
  color: var(--fx-accent);
  box-shadow: 0 8px 16px rgba(198, 36, 50, 0.14);
}

.fx-tab-panels,
.fx-tab-panels-inner,
.fx-page,
.fx-page-content {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}


.fx-page-header {
  display: grid;
  gap: 0.35rem;
  margin: 0;
}

.fx-page-header h2 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.fx-page-header .fx-section-note {
  margin: 0;
}

.fx-preview-card {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 12px;
  padding: 20px;
  box-shadow: none;
}

.fx-tab-panels {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  background: transparent;
  border: none;
  border-radius: 12px;
  box-shadow: none;
  overflow-x: hidden;
  padding: 0;
}

.fx-tab-panels-inner {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.5rem);
  padding-bottom: 1.25rem;
}

.fx-tab-panel {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  align-items: start;
  width: 100%;
}

.fx-tab-panel .fx-panel {
  scroll-margin-top: 110px;
}

.fx-chip-panel {
  gap: 1.25rem;
}


.fx-chip-stage {
  position: relative;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: linear-gradient(145deg, rgba(248, 202, 212, 0.35), rgba(255, 255, 255, 0.9));
  overflow: hidden;
  aspect-ratio: 16 / 9;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
}

.fx-chip-stage svg {
  width: 100%;
  height: 100%;
  display: block;
}

.fx-chip-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(248, 202, 212, 0.4));
  color: var(--fx-muted);
  font-weight: 600;
}

.fx-chip-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--fx-muted);
}

.fx-chip-summary {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fx-text);
}

.fx-chip-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.85rem;
  color: var(--fx-muted);
}


.fx-chip-swatch {
  display: inline-flex;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 4px;
  margin-right: 0.4rem;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
}

.fx-chip-swatch.region {
  background: rgba(198, 36, 50, 0.25);
}

.fx-chip-swatch.buffer {
  background: rgba(244, 160, 49, 0.35);
}

.fx-chip-swatch.borehole {
  background: rgba(236, 72, 153, 0.45);
}

.fx-chip-swatch.connector {
  background: rgba(100, 116, 139, 0.4);
}


.fx-chip-board {
  fill: rgba(250, 250, 255, 0.75);
  stroke: rgba(15, 23, 42, 0.05);
  stroke-width: 0.25;
}

.fx-chip-grid line {
  stroke: rgba(100, 116, 139, 0.18);
  stroke-width: 0.18;
}

.fx-chip-outline {
  fill: rgba(226, 232, 240, 0.3);
  stroke: rgba(100, 116, 139, 0.75);
  stroke-width: 0.45;
  filter: drop-shadow(0 0.6mm 0.8mm rgba(15, 23, 42, 0.15));
}

.fx-chip-region {
  fill: rgba(198, 36, 50, 0.16);
  stroke: rgba(198, 36, 50, 0.65);
  stroke-dasharray: 2.4 1.4;
}

.fx-chip-buffer {
  fill: rgba(244, 160, 49, 0.25);
  stroke: rgba(244, 160, 49, 0.65);
}

.fx-chip-region-label {
  fill: rgba(15, 23, 42, 0.75);
  font-weight: 600;
  dominant-baseline: hanging;
  letter-spacing: 0.03em;
}

.fx-chip-borehole {
  fill: rgba(236, 72, 153, 0.35);
  stroke: rgba(236, 72, 153, 0.85);
}

.fx-chip-borehole-label {
  fill: rgba(15, 23, 42, 0.75);
  font-weight: 600;
  dominant-baseline: middle;
}

.fx-chip-connector {
  fill: none;
  stroke: rgba(15, 23, 42, 0.65);
  stroke-linecap: round;
}

.fx-chip-connector.invalid {
  stroke: rgba(217, 44, 58, 0.9);
  stroke-dasharray: 1.6 1.6;
}

.fx-panel {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 12px;
  padding: clamp(0.95rem, 1.8vw, 1.35rem);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  display: grid;
  gap: 0.9rem;
  position: relative;
  overflow: hidden;
}

.fx-panel.fx-wide {
  grid-column: 1 / -1;
}

.fx-panel h2 {
  margin: 0;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
}

.fx-panel h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--fx-muted);
}

.fx-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.fx-report-grid {
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.fx-path-summary {
  display: grid;
  gap: 0.75rem;
}

.fx-path-row {
  position: relative;
  display: grid;
  gap: 0.4rem;
  padding: 0.85rem 1rem 0.85rem 2.75rem;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.fx-path-row::before {
  content: "";
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  font-weight: 700;
  background: rgba(95, 108, 134, 0.18);
  color: var(--fx-accent);
}

.fx-path-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--fx-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fx-path-value {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  color: var(--fx-text);
  font-size: 0.95rem;
}

.fx-path-status {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.85);
}

.fx-path-detail {
  font-weight: 600;
}

.fx-path-row.ready::before {
  content: "✓";
  background: rgba(198, 36, 50, 0.16);
  color: var(--fx-accent);
}

.fx-path-row.ready .fx-path-status {
  color: var(--fx-accent);
}

.fx-path-row.ready .fx-path-detail {
  opacity: 0.95;
}

.fx-path-row.missing {
  border-color: rgba(217, 44, 58, 0.3);
  background: rgba(217, 44, 58, 0.08);
}

.fx-path-row.missing::before {
  content: "!";
  background: rgba(217, 44, 58, 0.2);
  color: var(--fx-danger);
}

.fx-path-row.missing .fx-path-label,
.fx-path-row.missing .fx-path-status,
.fx-path-row.missing .fx-path-detail {
  color: var(--fx-danger);
}

#reporter-run-summary {
  transition: color 0.2s ease;
}

#reporter-run-summary.ok {
  color: rgba(74, 222, 128, 0.85);
}

#reporter-run-summary.error {
  color: var(--fx-danger);
}

#reporter-run-select-wrapper select {
  min-width: 0;
}

.fx-lock-banner {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: rgba(217, 44, 58, 0.08);
  color: var(--fx-danger);
  display: grid;
  gap: 0.25rem;
  font-size: 0.9rem;
  border: 1px solid rgba(217, 44, 58, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.fx-lock-banner strong {
  font-size: 0.95rem;
}

.fx-field {
  display: grid;
  gap: 0.35rem;
}

.fx-field label {
  font-weight: 700;
  color: var(--fx-text);
}


.fx-field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.fx-info-icon-btn {
  width: 1.2rem;
  height: 1.2rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--fx-muted);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.fx-info-icon-btn svg {
  width: 1.1rem;
  height: 1.1rem;
}

.fx-info-icon-btn:hover,
.fx-info-icon-btn:focus-visible {
  color: var(--fx-accent);
}

.fx-runlist {
  display: grid;
  gap: 0.6rem;
  font-size: 0.95rem;
}

.fx-runlist h3 {
  margin: 0;
  font-size: 1.05rem;
}

.fx-runlist ul {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.25rem;
}

.fx-field small {
  color: var(--fx-muted);
}

.fx-field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.fx-field select,
.fx-field textarea,
.fx-table input,
.fx-table select {
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  padding: 0.6rem 0.75rem;
  color: var(--fx-text);
  font-size: 0.95rem;
  width: 100%;
  box-sizing: border-box;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.fx-field input[type="number"],
.fx-table input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.fx-field input[type="number"]::-webkit-outer-spin-button,
.fx-field input[type="number"]::-webkit-inner-spin-button,
.fx-table input[type="number"]::-webkit-outer-spin-button,
.fx-table input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.fx-field select,
.fx-table select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, rgba(16, 24, 40, 0.45) 50%),
    linear-gradient(135deg, rgba(16, 24, 40, 0.45) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 2px), calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.5rem;
}

.fx-field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus-visible,
.fx-field select:focus-visible,
.fx-field textarea:focus-visible,
.fx-table input:focus-visible,
.fx-table select:focus-visible {
  border-color: rgba(198, 36, 50, 0.55);
  box-shadow: 0 0 0 3px rgba(198, 36, 50, 0.18);
}

.fx-field textarea {
  min-height: 220px;
  font-family: "JetBrains Mono", "SFMono-Regular", ui-monospace, monospace;
  font-size: 0.9rem;
  line-height: 1.4;
}

.fx-toggles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.6rem;
}

.fx-toggle {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.fx-toggle input {
  width: 20px;
  height: 20px;
}

.fx-toggle span {
  flex: 1;
}

.fx-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.fx-table thead {
  background: rgba(198, 36, 50, 0.08);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--fx-accent);
}

.fx-table th,
.fx-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.fx-table tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.015);
}

.fx-table tbody tr:hover {
  background: rgba(198, 36, 50, 0.06);
}

.fx-table .fx-row-limit td {
  color: var(--fx-danger);
  font-weight: 600;
}

.fx-table .fx-col-id {
  text-align: center;
  width: 64px;
}

.fx-table .fx-col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.fx-table-wrapper {
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.fx-table input,
.fx-table select {
  width: 100%;
  box-sizing: border-box;
}

.fx-table button {
  border: none;
  background: rgba(217, 44, 58, 0.12);
  color: var(--fx-danger);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
  font-weight: 600;
}

.fx-table button:hover {
  background: rgba(217, 44, 58, 0.2);
}

.fx-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.fx-section-title button {
  background: rgba(198, 36, 50, 0.08);
  color: var(--fx-accent);
  border-radius: 999px;
  border: none;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  font-weight: 600;
}

.fx-section-title button:hover {
  background: rgba(198, 36, 50, 0.15);
}

.fx-hint {
  color: var(--fx-muted);
  font-size: 0.85rem;
}

.fx-section-note {
  margin: 0.25rem 0 0;
  color: var(--fx-muted);
  font-size: 0.9rem;
  max-width: 60ch;
}

.fx-apply-hint {
  margin: 0.6rem 0 0;
  padding: 0.7rem 0.9rem;
  border-radius: 0.9rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(243, 246, 255, 0.92));
  color: var(--fx-muted-strong);
  border: 1px solid rgba(240, 243, 255, 0.9);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.04);
}


.fx-workflow-explainer {
  margin-top: 0.7rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.75);
}

.fx-workflow-explainer > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.65rem 0.8rem;
  font-weight: 700;
  color: var(--fx-text);
}

.fx-workflow-explainer > summary::-webkit-details-marker {
  display: none;
}

.fx-workflow-explainer-body {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding: 0.75rem 0.8rem 0.85rem;
  display: grid;
  gap: 0.45rem;
}

.fx-workflow-explainer-body h4 {
  margin: 0.2rem 0 0;
  font-size: 0.95rem;
}

.fx-workflow-explainer-body p {
  margin: 0;
  color: var(--fx-muted);
}

.fx-workflow-formula code {
  font-size: 0.88rem;
}

.fx-workflow-why-box {
  margin-top: 0.35rem;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(15, 23, 42, 0.04);
  padding: 0.55rem 0.7rem;
}

.fx-workflow-why-box ul {
  margin: 0.45rem 0 0;
  padding-left: 1.15rem;
}


.fx-workflow-diagnostics {
  margin-top: 0.65rem;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(15, 23, 42, 0.04);
  color: var(--fx-muted-strong);
  font-size: 0.88rem;
}

.fx-workflow-diagnostics strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--fx-text);
}

.fx-workflow-diagnostics ul {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.2rem;
}

.fx-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.fx-panel-header .fx-inline-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.fx-inline-actions--reporter {
  align-items: flex-end;
  justify-content: flex-end;
  gap: 0.75rem;
}

.fx-canvas-menu {
  grid-column: 1 / -1;
  width: 100%;
  margin: 0 0 2rem;
  padding: 0.38rem clamp(0.95rem, 1.8vw, 1.35rem);
  border-bottom: 1px solid rgba(122, 14, 25, 0.9);
  background: #ffffff;
  box-sizing: border-box;
}

.fx-canvas-menu-inner {
  display: flex;
  justify-content: flex-end;
}

.fx-canvas-menu-inner--reporter {
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}


.fx-canvas-menu--label .fx-canvas-menu-inner {
  justify-content: flex-start;
}

.fx-canvas-menu-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--fx-text);
}

.fx-tab-panel .fx-canvas-menu:not(.fx-canvas-menu--label),
.fx-tab-panel .fx-reporter-mode-select {
  display: none !important;
}

.fx-tab-panel .fx-reporter-mode-select--inline {
  display: grid !important;
  min-width: 190px;
}

#reporter-mode-dock .fx-reporter-mode-select {
  margin-left: auto;
}

#reporter-mode-dock .fx-reporter-controls:not(#micp-dock-controls) {
  display: none !important;
}

#layout-mode-dock,
#reporter-mode-dock,
#run-mode-dock {
  position: relative;
  left: -32px;
  width: calc(100% + 64px + 16px);
}

#reporter-mode-dock {
  margin: -12px 0 2.2rem;
}

#run-mode-dock {
  margin: 0 0 2.2rem;
}

.fx-reporter-mode-select {
  display: grid;
  gap: 0.35rem;
  min-width: 190px;
}

.fx-reporter-mode-select select {
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff;
  color: var(--fx-text);
  padding: 0.45rem 0.6rem;
  font-size: 0.95rem;
  min-width: 0;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.fx-run-select {
  display: grid;
  gap: 0.35rem;
  min-width: min(320px, 50vw);
}

.fx-run-select label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--fx-muted);
}

.fx-run-select select {
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff;
  color: var(--fx-text);
  padding: 0.45rem 0.6rem;
  font-size: 0.95rem;
  min-width: 0;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.fx-panel-header button {
  border-radius: 999px;
  border: 1px solid rgba(198, 36, 50, 0.35);
  background: rgba(198, 36, 50, 0.08);
  color: var(--fx-accent);
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  font-weight: 600;
}

.fx-panel-header button:hover {
  background: rgba(198, 36, 50, 0.15);
}

.fx-subsection {
  display: grid;
  gap: 0.75rem;
}

.fx-subsection h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--fx-muted);
}

.fx-subsection--nested {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding-top: 1rem;
  margin-top: 0.2rem;
}

.fx-subsection--nested .fx-panel-header {
  margin-bottom: 0.75rem;
}

.fx-collapse {
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  padding: 0.6rem 0.75rem;
}

.fx-collapse[open] {
  background: rgba(198, 36, 50, 0.05);
}

.fx-collapse > summary {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  color: var(--fx-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0;
}

.fx-collapse > summary::-webkit-details-marker {
  display: none;
}

.fx-collapse > summary::after {
  content: "";
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  margin-left: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.fx-collapse[open] > summary::after {
  transform: rotate(-135deg);
}

.fx-collapse-body {
  padding-top: 0.75rem;
}

.fx-toggle-field {
  align-self: end;
}

.fx-span-all {
  grid-column: 1 / -1;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: 2px solid rgba(198, 36, 50, 0.5);
  outline-offset: 2px;
}

@media (max-width: 820px) {
  .fx-layout,
  .fx-tab-container {
    display: block;
  }

  .fx-app-shell {
    width: 100%;
    height: 100vh;
    margin: 0;
    border-radius: 0;
    border: 0;
  }

  .fx-tab-container {
    height: 100%;
    border-radius: 0;
  }

  .fx-main {
    padding: 12px 14px 16px;
  }

  #layout-mode-dock,
  #reporter-mode-dock,
  #run-mode-dock {
    left: -14px;
    width: calc(100% + 28px + 12px);
  }

  #reporter-mode-dock {
    margin: -12px 0 1.35rem;
  }

  #run-mode-dock {
    margin: 0 0 1.35rem;
  }

  .fx-canvas-menu-inner {
    justify-content: flex-start;
  }

  .fx-reporter-mode-select {
    min-width: 0;
    width: 100%;
  }

  .fx-tab-panels {
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .fx-tab-panels-inner {
    max-width: none;
  }

  .fx-tabbar-shell {
    position: static;
    border-right: 0;
    border-bottom: 0;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .fx-sidebar {
    width: 100%;
    min-width: 0;
    max-width: none;
    border-right: 0;
    padding: 8px 8px;
  }

  .fx-sidebar-orgbar {
    padding: 0.42rem 0.62rem;
  }

  .fx-org-menu {
    left: 0.62rem;
  }

  .fx-tabbar-shell::before,
  .fx-tabbar-shell::after {
    display: none;
  }

  .fx-tab-panel {
    grid-template-columns: 1fr;
  }

  .fx-sidebar-icons {
    margin: 0;
    padding: 0.7rem 0.75rem 0.85rem;
  }

  .fx-help-menu {
    left: 0.75rem;
    bottom: calc(100% + 0.4rem);
  }
}

.fx-span-2 {
  grid-column: span 2;
}

.fx-bin-grid {
  display: grid;
  gap: 1rem;
}

.fx-bin-card {
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  padding: 1rem;
  display: grid;
  gap: 0.75rem;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.fx-bin-card.fx-bin-card--limit {
  border-color: rgba(217, 44, 58, 0.35);
  box-shadow: 0 12px 30px rgba(217, 44, 58, 0.12);
}

.fx-bin-card.fx-bin-card--limit .fx-bin-header h3 {
  color: var(--fx-danger);
}

.fx-bin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.fx-bin-header h3 {
  margin: 0;
  font-size: 1rem;
}

.fx-bin-body {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.fx-bin-body .fx-field {
  margin: 0;
}

.fx-bin-footer {
  display: grid;
  gap: 0.5rem;
}

.fx-bin-limit-note {
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  background: rgba(217, 44, 58, 0.08);
  color: #831d27;
  font-size: 0.9rem;
  line-height: 1.4;
}

.fx-reporter-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.fx-reporter-controls--dock {
  margin-bottom: 0;
}

#micp-dock-controls[hidden] {
  display: none;
}

.fx-reporter-status {
  font-size: 0.9rem;
  color: var(--fx-muted);
}

.fx-reporter-status.error {
  color: var(--fx-danger);
}

.fx-reporter-settings {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-top: 0.75rem;
  align-items: start;
}

.fx-setting-card-header {
  display: grid;
  gap: 0.35rem;
}

.fx-setting-card-header--actions {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 0.75rem;
}

.fx-setting-card .fx-setting-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: start;
}

.fx-setting-card--binning .fx-setting-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
}

.fx-setting-card--binning,
.fx-setting-card--bins {
  grid-column: 1 / -1;
}

.fx-setting-card-table {
  margin-top: 0;
}

.fx-setting-card-actions {
  justify-content: flex-end;
  align-items: flex-start;
  margin-top: 0;
}

.plot-container {
  overflow: visible !important;
}

.fx-upload-icon-btn,
.fx-plot-launch-btn {
  width: 48px;
  min-width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid rgba(198, 36, 50, 0.24);
  background: rgba(198, 36, 50, 0.04);
  color: var(--fx-accent);
  box-shadow: none;
}

.fx-upload-icon-btn svg,
.fx-plot-launch-btn svg {
  width: 21px;
  height: 21px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fx-upload-icon-btn:hover,
.fx-plot-launch-btn:hover {
  transform: translateY(-1px);
  background: rgba(198, 36, 50, 0.10);
  box-shadow: 0 10px 20px rgba(198, 36, 50, 0.12);
}

.fx-upload-icon-btn:focus-visible,
.fx-plot-launch-btn:focus-visible {
  outline: 3px solid rgba(198, 36, 50, 0.18);
  outline-offset: 3px;
}

#section-reporter .fx-field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
#section-reporter .fx-field select {
  min-height: 42px;
}

.fx-setting-card,
.fx-form-card {
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
  padding: 1rem;
  display: grid;
  gap: 0.75rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.fx-setting-card-header h4 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--fx-text);
}

.fx-setting-card-header p {
  margin: 0.25rem 0 0;
}

.fx-form-card h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--fx-text);
}

.fx-form-card .fx-hint {
  margin: 0;
}

.fx-setting-grid {
  gap: 0.75rem;
}

.fx-reporter-settings .fx-field {
  margin: 0;
}

.fx-reporter-summary {
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  padding: 1rem;
  display: grid;
  gap: 0.5rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.fx-reporter-summary dl {
  margin: 0;
  display: grid;
  gap: 0.35rem 1rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.fx-reporter-summary dt {
  font-weight: 600;
  color: var(--fx-text);
}

.fx-reporter-summary dd {
  margin: 0;
  color: var(--fx-muted);
}

.fx-chip {
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(198, 36, 50, 0.08);
  color: var(--fx-accent);
}

.fx-chip.fx-chip--limit {
  background: rgba(217, 44, 58, 0.12);
  color: var(--fx-danger);
  border: 1px solid rgba(217, 44, 58, 0.35);
}

.fx-bin-remove {
  margin-left: auto;
}

.fx-run-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.fx-report-run .fx-run-controls {
  margin-bottom: 0.75rem;
}

#section-manufacturing .fx-run-controls {
  justify-content: flex-start;
}

.fx-manufacturing-grid {
  grid-template-columns: minmax(0, 100%);
}

@media (min-width: 640px) {
  .fx-manufacturing-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

#manufacturing-pack-status {
  min-height: 1.25rem;
}

.fx-inline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--fx-text);
  padding: 0.2rem 0.4rem;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.fx-inline-toggle input {
  width: 18px;
  height: 18px;
}

.fx-inline-toggle:hover {
  border-color: rgba(198, 36, 50, 0.35);
  background: rgba(198, 36, 50, 0.08);
}

.fx-report-run .fx-log-output {
  min-height: 140px;
}

#run-status {
  min-height: 1.25rem;
  margin: 0;
}

#section-run {
  display: block;
  min-height: 0;
  padding: 0;
  border-color: rgba(15, 23, 42, 0.05);
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

#section-run .fx-run-shell {
  width: 100%;
  display: grid;
  gap: 0.85rem;
  box-sizing: border-box;
  padding: clamp(0.95rem, 1.8vw, 1.35rem);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 250, 251, 0.96));
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

#section-run .fx-run-toolbar {
  display: grid;
  gap: 0.65rem;
  align-items: start;
}

#section-run .fx-run-controls {
  justify-content: flex-start;
}

#section-run .fx-run-controls--primary {
  width: 100%;
}

#section-run #run-log {
  width: 100%;
  box-sizing: border-box;
  min-height: clamp(280px, 42vh, 460px);
  max-height: min(58vh, 620px);
  border-radius: 12px;
}

@media (min-width: 720px) {
  #section-run .fx-run-toolbar {
    grid-template-columns: minmax(0, auto) minmax(0, 1fr);
    column-gap: 1rem;
    row-gap: 0.5rem;
    align-items: center;
  }

  #section-run #run-status {
    justify-self: end;
    text-align: right;
  }
}

.fx-log-output {
  margin: 0;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  padding: 0.75rem;
  font-family: "JetBrains Mono", "SFMono-Regular", ui-monospace, monospace;
  font-size: 0.85rem;
  line-height: 1.45;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  width: 100%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 10px 20px rgba(15, 23, 42, 0.06);
}

.fx-log-output--compact {
  max-height: none;
  min-height: 0;
  font-size: 0.78rem;
  padding: 0.5rem 0.75rem;
}

@media (max-width: 900px) {
  .fx-span-2 {
    grid-column: span 1;
  }
}

.fx-hint.error {
  color: var(--fx-danger);
}

.fx-hint.success {
  color: var(--fx-accent);
}

#validation-messages {
  white-space: pre-line;
}


.fx-mode-target-input {
  width: 100%;
  min-height: 42px;
  box-sizing: border-box;
}


.fx-icon-button {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}

.fx-icon-button svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fx-plot-launch-btn:disabled,
.fx-upload-icon-btn:disabled {
  opacity: 0.45;
  box-shadow: none;
  cursor: not-allowed;
}

.fx-run-toggle-btn {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(122, 14, 25, 0.2);
  background: #fff;
  color: var(--fx-accent);
  box-shadow: none;
}

.fx-run-toggle-btn:hover {
  transform: none;
  background: rgba(198, 36, 50, 0.08);
  box-shadow: none;
}

.fx-run-toggle-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.fx-run-toggle-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

#add-bin svg,
.fx-bin-remove svg {
  width: 18px;
  height: 18px;
}
