* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  height: 100%;
  overflow: hidden;
}
body {
  background: #F1F0EF;
  color: #000000;
  font:
    14px/1.4 "Roboto Condensed",
    "Roboto",
    ui-sans-serif,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
.app {
  display: flex;
  height: 100vh;
}
.canvas-area {
  flex: 1;
  position: relative;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}
.builder-version-marker {
  position: absolute;
  left: 0.85rem;
  bottom: 0.7rem;
  z-index: 4;
  color: rgba(0, 0, 0, 0.28);
  font-size: 0.78rem;
  line-height: 1;
  pointer-events: none;
}
.board-controls {
  position: absolute;
  left: 0.75rem;
  bottom: 2.1rem;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem;
  border-radius: 0.55rem;
  background: rgba(241, 240, 239, 0.86);
  box-shadow:
    -2px -2px 5px rgba(255, 255, 255, 0.86),
    2px 3px 7px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(6px);
}
.board-control-btn {
  width: 1.65rem;
  height: 1.65rem;
  border: 0;
  border-radius: 0.42rem;
  background: #F1F0EF;
  color: rgba(0, 0, 0, 0.72);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  box-shadow:
    -1.5px -1.5px 4px rgba(255, 255, 255, 0.8),
    1.5px 2px 5px rgba(0, 0, 0, 0.12);
}
.board-control-btn:hover {
  box-shadow:
    -2px -2px 5px rgba(255, 255, 255, 0.9),
    2px 3px 7px rgba(0, 0, 0, 0.16);
}
.board-zoom-label {
  min-width: 2.55rem;
  text-align: center;
  color: rgba(0, 0, 0, 0.48);
  font-size: 0.78rem;
  line-height: 1;
}
.builder-minimap {
  position: absolute;
  left: 0.8rem;
  right: auto;
  bottom: 4.45rem;
  z-index: 5;
  width: 9.5rem;
  height: 6rem;
  border-radius: 0.55rem;
  background: rgba(241, 240, 239, 0.82);
  box-shadow:
    inset 2px 2px 5px rgba(0, 0, 0, 0.1),
    inset -2px -2px 5px rgba(255, 255, 255, 0.72);
  overflow: hidden;
  opacity: 0.78;
}
.builder-minimap:hover {
  opacity: 1;
}
.builder-minimap svg {
  display: block;
  width: 100%;
  height: 100%;
}
#mainSvg {
  display: block;
  width: 100%;
  height: 100%;
  -webkit-user-select: none;
  user-select: none;
}
#mainSvg text,
#mainSvg tspan {
  -webkit-user-select: none;
  user-select: none;
  pointer-events: none;
}
.board-hints {
  opacity: 0.9;
}
.add-slot {
  --add-slot-surface: #F1F0EF;
  --add-slot-hover-surface: rgb(237, 235, 231);
  --add-slot-plus-light: rgba(255, 255, 255, 0.92);
  --add-slot-plus-shadow: rgba(0, 0, 0, 0.2);
  cursor: default;
}
.add-slot.is-droppable {
  cursor: copy;
}
.add-slot__rect {
  fill: var(--add-slot-surface);
  filter: url(#addInset);
  pointer-events: all;
}
.add-slot.is-hover .add-slot__rect {
  fill: var(--add-slot-hover-surface);
}
.add-slot.is-required .add-slot__rect {
  stroke: #ff3b30;
  stroke-width: 1.7;
}
.add-slot.is-required.is-hover .add-slot__rect {
  stroke-width: 2.2;
}
.add-slot__plus {
  stroke-width: 3.1;
  stroke-linecap: round;
  fill: none;
  pointer-events: none;
}
.add-slot__plus--shadow {
  stroke: var(--add-slot-plus-shadow);
  transform: translate(1.35px, 1.35px);
}
.add-slot__plus--light {
  stroke: var(--add-slot-plus-light);
  transform: translate(-1.25px, -1.25px);
}
.add-slot__plus--core {
  stroke: var(--add-slot-surface);
}
.add-slot.is-hover {
  --add-slot-plus-shadow: rgba(0, 0, 0, 0.24);
}
.edge-path-hit {
  cursor: default;
  pointer-events: stroke;
}
.edge-delete-handle {
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}
.edge-delete-handle.is-hot {
  opacity: 1;
  pointer-events: all;
}
.connection-port {
  cursor: grab;
}
.connection-port:active {
  cursor: grabbing;
}

.panel {
  width: 260px;
  flex-shrink: 0;
  border-left: 1px solid rgba(151, 151, 151, 0.2);
  display: flex;
  flex-direction: column;
  padding: 2rem 2rem;
  gap: 0.5em;
  background: #F1F0EF;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}
.panel > * {
  flex-shrink: 0;
}
.alerts-sidebar-toggle {
  position: fixed;
  top: 0.85rem;
  left: 0.85rem;
  z-index: 18;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  box-shadow: none;
  opacity: 0.78;
  padding: 0;
  transition:
    left 0.14s ease,
    box-shadow 0.1s ease,
    opacity 0.1s ease;
}
.alerts-sidebar-toggle:hover {
  opacity: 1;
  box-shadow:
    -2px -2px 5px rgba(255, 255, 255, 0.85),
    2px 2px 5px rgba(0, 0, 0, 0.14);
}
.alerts-sidebar-toggle.is-open {
  left: 18.1rem;
}
.alerts-sidebar-toggle img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.alerts-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 17;
  width: 17rem;
  display: flex;
  flex-direction: column;
  gap: 0.75em;
  padding: 4rem 1rem 1rem;
  background: #F1F0EF;
  border-right: 1px solid rgba(151, 151, 151, 0.2);
  transform: translateX(-100%);
  transition: transform 0.14s ease;
  box-shadow:
    10px 0 24px rgba(0, 0, 0, 0.08);
}
.alerts-sidebar.is-open {
  transform: translateX(0);
}
.alerts-sidebar-title {
  font-size: 0.78em;
  color: rgba(0, 0, 0, 0.42);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.alerts-sidebar-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35em;
}
.alerts-sidebar-new {
  height: 2.15em;
  border: 0.5px solid #30b0c7;
  border-radius: 0.3em;
  background: #F1F0EF;
  color: #081d21;
  font: inherit;
  font-size: 0.9em;
  font-weight: 300;
  cursor: pointer;
  box-shadow:
    -2px -2px 6px rgba(255, 255, 255, 0.85),
    2px 2px 4px rgba(0, 0, 0, 0.15);
}
.alerts-sidebar-new:hover {
  background: rgba(255, 255, 255, 0.25);
  box-shadow:
    -3px -3px 6px rgba(255, 255, 255, 0.85),
    3px 3px 6px rgba(0, 0, 0, 0.15);
}
.alerts-sidebar-new.is-hidden {
  display: none;
}
.alerts-sidebar-tab {
  height: 2em;
  border: 0;
  border-radius: 0.3em;
  background: transparent;
  color: rgba(0, 0, 0, 0.48);
  font: inherit;
  font-size: 0.86em;
  cursor: pointer;
}
.alerts-sidebar-tab:hover,
.alerts-sidebar-tab.is-active {
  color: #1a1a1a;
  background: #F1F0EF;
  box-shadow:
    -1px -1px 4px rgba(255, 255, 255, 0.85),
    1px 1px 4px rgba(0, 0, 0, 0.12);
}
.alerts-sidebar-list {
  display: grid;
  gap: 0.45em;
  overflow-y: auto;
  min-height: 0;
  padding-right: 0.15em;
}
.alerts-sidebar-list.is-hidden {
  display: none;
}
.alerts-sidebar-state {
  margin-top: 0.25em;
  color: rgba(0, 0, 0, 0.4);
  font-size: 0.82em;
  line-height: 1.35;
}
.alert-row {
  display: grid;
  grid-template-columns: 1.25em minmax(0, 1fr) 2.15em 2.35em 1.75em 1.75em;
  align-items: center;
  gap: 0.35em;
  min-height: 2.05em;
  padding: 0.25em 0.35em;
  border-radius: 0.35em;
  background: #F1F0EF;
  box-shadow:
    -1px -1px 4px rgba(255, 255, 255, 0.85),
    1px 1px 4px rgba(0, 0, 0, 0.15);
}
.alert-row input[type="checkbox"] {
  width: 1em;
  height: 1em;
  accent-color: #30B0C7;
}
.alert-row-name {
  min-width: 0;
  border: 0;
  background: transparent;
  color: #1a1a1a;
  font: inherit;
  font-size: 0.9em;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.alert-row-name:hover {
  color: #30B0C7;
}
.alert-row-icon {
  width: 1.75em;
  height: 1.75em;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0.28em;
  background: transparent;
  cursor: pointer;
  padding: 0;
}
.alert-row-icon:hover {
  background: rgba(0, 0, 0, 0.06);
}
.alert-row-icon.is-danger:hover {
  background: #fff0ee;
}
.alert-row-icon.is-danger:hover img {
  filter: sepia(1) saturate(8) hue-rotate(320deg);
}
.alert-row-icon img {
  width: 1em;
  height: 1em;
  object-fit: contain;
}
.alert-row-fork {
  width: 2.35em;
  font-size: 0.72em;
  color: rgba(0, 0, 0, 0.58);
}
.alert-row-fork:hover {
  color: #30B0C7;
}
.alert-row.is-pending {
  opacity: 0.55;
  pointer-events: none;
}
.alert-history-wrap {
  display: grid;
  gap: 0.35em;
}
.alert-history-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.35em;
}
.alert-history-refresh,
.alert-history-clear {
  min-width: 2.2em;
  height: 2em;
  border-radius: 0.3em;
  border: 0.5px solid rgba(0, 0, 0, 0.12);
  background: #F1F0EF;
  color: #1a1a1a;
  font: inherit;
  font-size: 0.84em;
  font-weight: 300;
  cursor: pointer;
  box-shadow:
    -1px -1px 4px rgba(255, 255, 255, 0.85),
    1px 1px 4px rgba(0, 0, 0, 0.12);
}
.alert-history-refresh:hover {
  border-color: #30B0C7;
}
.alert-history-clear:hover {
  border-color: #ff3b30;
  color: #ff3b30;
}
.alert-history-refresh:disabled,
.alert-history-clear:disabled {
  cursor: default;
  opacity: 0.35;
  border-color: rgba(0, 0, 0, 0.1);
  color: rgba(0, 0, 0, 0.45);
}
.alert-history-table {
  display: grid;
  gap: 0.16em;
  min-width: 0;
}
.alert-history-row {
  display: grid;
  grid-template-columns: 2.7em minmax(0, 1fr) 2.2em 4.2em;
  align-items: center;
  gap: 0.35em;
  min-height: 2.2em;
  padding: 0.25em 0.35em;
  border-radius: 0.28em;
  color: #1a1a1a;
  font-size: 0.78em;
}
.alert-history-row.is-head {
  color: rgba(0, 0, 0, 0.44);
  font-size: 0.72em;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.alert-history-row:not(.is-head) {
  background: #F1F0EF;
  box-shadow:
    -1px -1px 3px rgba(255, 255, 255, 0.75),
    1px 1px 3px rgba(0, 0, 0, 0.1);
}
.alert-history-cell {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.alert-history-price {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.missing-filter-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35em;
  margin-bottom: 0.35em;
}
.missing-filter-select,
.missing-filter-refresh,
.missing-review-select,
.missing-review-save {
  min-width: 0;
  height: 2em;
  border-radius: 0.3em;
  border: 0.5px solid rgba(0, 0, 0, 0.12);
  background: #F1F0EF;
  color: #1a1a1a;
  font: inherit;
  font-size: 0.84em;
  font-weight: 300;
}
.missing-filter-refresh,
.missing-review-save {
  padding: 0 0.7em;
  cursor: pointer;
  box-shadow:
    -1px -1px 4px rgba(255, 255, 255, 0.85),
    1px 1px 4px rgba(0, 0, 0, 0.12);
}
.missing-filter-refresh:hover,
.missing-review-save:hover {
  border-color: #30B0C7;
}
.missing-node-row {
  display: grid;
  gap: 0.28em;
  min-height: 3.15em;
  padding: 0.45em 0.5em;
  border: 0;
  border-radius: 0.35em;
  background: #F1F0EF;
  color: #1a1a1a;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow:
    -1px -1px 4px rgba(255, 255, 255, 0.85),
    1px 1px 4px rgba(0, 0, 0, 0.15);
}
.missing-node-row:hover,
.missing-node-row.is-selected {
  box-shadow:
    -2px -2px 6px rgba(255, 255, 255, 0.9),
    2px 2px 7px rgba(48, 176, 199, 0.28);
}
.missing-node-row.is-pending {
  opacity: 0.55;
  pointer-events: none;
}
.missing-node-top {
  display: flex;
  align-items: center;
  gap: 0.4em;
  min-width: 0;
}
.missing-node-title {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9em;
}
.missing-node-status,
.missing-node-count {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 0.08em 0.48em;
  background: rgba(48, 176, 199, 0.13);
  color: rgba(0, 0, 0, 0.55);
  font-size: 0.68em;
  text-transform: uppercase;
}
.missing-node-status.is-new {
  background: rgba(255, 204, 0, 0.22);
}
.missing-node-status.is-accepted,
.missing-node-status.is-implemented {
  background: rgba(52, 199, 89, 0.18);
}
.missing-node-status.is-rejected {
  background: rgba(255, 59, 48, 0.15);
}
.missing-node-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(0, 0, 0, 0.38);
  font-size: 0.76em;
}
.template-row {
  display: grid;
  gap: 0.32em;
  min-height: 4.2em;
  padding: 0.55em 0.55em;
  border: 0;
  border-radius: 0.35em;
  background: #F1F0EF;
  color: #1a1a1a;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow:
    -1px -1px 4px rgba(255, 255, 255, 0.85),
    1px 1px 4px rgba(0, 0, 0, 0.15);
}
.template-row:hover {
  box-shadow:
    -2px -2px 6px rgba(255, 255, 255, 0.9),
    2px 2px 7px rgba(48, 176, 199, 0.28);
}
.template-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35em;
  margin-bottom: 0.35em;
}
.template-sort,
.template-refresh,
.template-action {
  min-width: 0;
  height: 2em;
  border-radius: 0.3em;
  border: 0.5px solid rgba(0, 0, 0, 0.12);
  background: #F1F0EF;
  color: #1a1a1a;
  font: inherit;
  font-size: 0.78em;
  font-weight: 300;
}
.template-refresh,
.template-action {
  padding: 0 0.65em;
  cursor: pointer;
  box-shadow:
    -1px -1px 4px rgba(255, 255, 255, 0.85),
    1px 1px 4px rgba(0, 0, 0, 0.12);
}
.template-action:hover,
.template-refresh:hover {
  border-color: #30B0C7;
}
.template-row-top {
  display: flex;
  align-items: center;
  gap: 0.4em;
  min-width: 0;
}
.template-row-title {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9em;
}
.template-row-tag {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 0.08em 0.48em;
  background: rgba(48, 176, 199, 0.13);
  color: rgba(0, 0, 0, 0.55);
  font-size: 0.68em;
  text-transform: uppercase;
}
.template-row-desc {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: rgba(0, 0, 0, 0.42);
  font-size: 0.76em;
  line-height: 1.28;
}
.template-row-nodes {
  color: rgba(0, 0, 0, 0.32);
  font-size: 0.72em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.template-row-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35em;
  color: rgba(0, 0, 0, 0.34);
  font-size: 0.7em;
}
.template-row-actions {
  display: flex;
  gap: 0.35em;
  justify-content: flex-end;
}
.template-action.is-danger:hover {
  border-color: #ff3b30;
  color: #ff3b30;
}
.missing-review-dialog {
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 28;
  width: min(42rem, calc(100vw - 2rem));
  max-height: min(42rem, calc(100vh - 2rem));
  display: none;
  grid-template-rows: auto 1fr auto;
  transform: translate(-50%, -50%);
  border-radius: 0.45em;
  background: #F1F0EF;
  color: #1a1a1a;
  box-shadow:
    -6px -6px 18px rgba(255, 255, 255, 0.88),
    8px 8px 24px rgba(0, 0, 0, 0.18);
}
.missing-review-dialog.is-open {
  display: grid;
}
.missing-review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.missing-review-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.05em;
}
.missing-review-close {
  width: 2em;
  height: 2em;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0.3em;
  background: transparent;
  cursor: pointer;
  padding: 0;
}
.missing-review-close:hover {
  box-shadow:
    -1px -1px 4px rgba(255, 255, 255, 0.85),
    1px 1px 4px rgba(0, 0, 0, 0.14);
}
.missing-review-close img {
  width: 1.05em;
  height: 1.05em;
  object-fit: contain;
}
.missing-review-body {
  min-height: 0;
  overflow-y: auto;
  padding: 1rem;
  display: grid;
  gap: 0.8em;
}
.missing-review-section {
  display: grid;
  gap: 0.25em;
}
.missing-review-label {
  color: rgba(0, 0, 0, 0.42);
  font-size: 0.68em;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.missing-review-text,
.missing-review-pre {
  color: rgba(0, 0, 0, 0.72);
  font-size: 0.88em;
  line-height: 1.38;
  white-space: pre-wrap;
  word-break: break-word;
}
.missing-review-pre {
  max-height: 10rem;
  overflow: auto;
  padding: 0.65em;
  border-radius: 0.35em;
  background: rgba(255, 255, 255, 0.34);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.76em;
}
.missing-review-notes {
  width: 100%;
  min-height: 5.5em;
  resize: vertical;
  border: 0.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 0.35em;
  background: #F1F0EF;
  color: #1a1a1a;
  font: inherit;
  padding: 0.55em 0.65em;
  outline: none;
}
.missing-review-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5em;
  padding: 0.8rem 1rem 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.missing-review-save {
  height: 2.25em;
  border-color: #30B0C7;
}
.market-ai-toggle {
  position: fixed;
  right: calc(260px + 1rem);
  bottom: 1rem;
  z-index: 19;
  min-width: 2.4rem;
  height: 2.1rem;
  display: grid;
  place-items: center;
  border: solid 0.5px rgba(255, 255, 255, 0.45);
  border-radius: 0.35rem;
  background: #F1F0EF;
  color: rgba(0, 0, 0, 0.72);
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
  box-shadow:
    -2px -2px 4px rgba(255, 255, 255, 0.85),
    2px 2px 4px rgba(0, 0, 0, 0.15);
}
.market-ai-toggle:hover,
.market-ai-toggle.is-open {
  color: #000000;
  background: rgba(255, 255, 255, 0.25);
  box-shadow:
    -3px -3px 6px rgba(255, 255, 255, 0.85),
    3px 3px 6px rgba(0, 0, 0, 0.15);
    border: solid 1px rgba(255, 255, 255, 0.45);
}
.market-ai-dialog {
  position: fixed;
  right: calc(260px + 1rem);
  bottom: 3.65rem;
  z-index: 29;
  width: min(27rem, calc(100vw - 300px));
  max-height: min(42rem, calc(100vh - 5rem));
  display: none;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0.45rem;
  background: #F1F0EF;
}
.market-ai-dialog.is-open {
  display: flex;
}
.market-ai-head {
  min-height: 2rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0.55rem 0.8rem 0.2rem;
}
.market-ai-close {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: rgba(0, 0, 0, 0.5);
  padding: 0;
  cursor: pointer;
  opacity: 0.78;
  box-shadow: none;
}
.market-ai-close:hover {
  background: transparent;
  color: #1a1a1a;
  opacity: 1;
}
.market-ai-close img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 1;
}
.market-ai-setup {
  display: grid;
  gap: 0.45rem;
  padding: 0.7rem 0.8rem;
}
.market-ai-setup-row {
  display: grid;
  grid-template-columns: minmax(6.8rem, 7.2rem) minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.45rem;
}
.market-ai-input,
.market-ai-textarea {
  width: 100%;
  border: 0;
  border-radius: 0.35rem;
  background: #F1F0EF;
  color: #1a1a1a;
  font: inherit;
  outline: none;
  box-shadow:
    inset -4px -4px 8px rgba(255, 255, 255, 0.85),
    inset 4px 4px 8px rgba(0, 0, 0, 0.15);
}
.market-ai-input {
  height: 2rem;
  padding: 0 0.55rem;
}
select.market-ai-input {
  appearance: auto;
  cursor: pointer;
}
.market-ai-textarea {
  min-height: 3.2rem;
  max-height: 8rem;
  resize: vertical;
  padding: 0.55rem 0.65rem;
}
.market-ai-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.market-ai-setup.is-hidden {
  display: none;
}
.market-ai-btn {
  min-height: 1.85rem;
  border: 0;
  border-radius: 0.32rem;
  background: #F1F0EF;
  color: rgba(0, 0, 0, 0.68);
  font: inherit;
  font-size: 0.82rem;
  padding: 0 0.62rem;
  cursor: pointer;
  box-shadow:
    -1px -1px 4px rgba(255, 255, 255, 0.8),
    1px 1px 4px rgba(0, 0, 0, 0.1);
}
.market-ai-btn:hover:not(:disabled) {
  color: #1a1a1a;
  box-shadow:
    -2px -2px 6px rgba(255, 255, 255, 0.85),
    2px 2px 6px rgba(0, 0, 0, 0.14);
}
.market-ai-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.market-ai-status {
  min-height: 1.2rem;
  color: rgba(0, 0, 0, 0.42);
  font-size: 0.78rem;
}
.market-ai-status.is-error {
  color: #ff3b30;
}
.market-ai-messages {
  flex: 1;
  min-height: 12rem;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 0.55rem;
  padding: 0.8rem;
}
.market-ai-message {
  max-width: 92%;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 0.45rem;
  padding: 0.55rem 0.65rem;
  font-size: 0.88rem;
  line-height: 1.35;
}
.market-ai-message.is-user {
  justify-self: end;
  background: #ffffff;
  color: #12343b;
}
.market-ai-message.is-assistant {
  justify-self: start;
  background: #F1F0EF;
  color: rgba(0, 0, 0, 0.78);
  box-shadow:
    -2px -2px 4px rgba(255, 255, 255, 0.85),
    2px 2px 4px rgba(0, 0, 0, 0.15);
}
.market-ai-form {
  display: grid;
  gap: 0.5rem;
  padding: 0.75rem 0.8rem 0.8rem;
}
.market-ai-form .market-ai-actions {
  justify-content: space-between;
  flex-wrap: nowrap;
}
.market-ai-provider-select {
  min-width: 0;
}
.market-ai-menu-wrap {
  position: relative;
}
.market-ai-menu-btn {
  width: 1rem;
  min-width: 1rem;
  height: 1rem;
  min-height: 1rem;
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}
.market-ai-menu-btn:hover:not(:disabled),
.market-ai-menu-btn:active:not(:disabled) {
  background: transparent;
  box-shadow: none;
}
.market-ai-menu-btn img {
  width: .8rem;
  height: auto;
  max-width: 100%;
  max-height: none;
  transform: rotate(90deg);
  opacity: 0.85;
  pointer-events: none;
}
.market-ai-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.45rem);
  z-index: 35;
  width: min(18rem, calc(100vw - 2rem));
  display: none;
  gap: 0.55rem;
  padding: 0.65rem;
  border-radius: 0.42rem;
  background: #F1F0EF;
  box-shadow:
    -4px -4px 12px rgba(255, 255, 255, 0.82),
    6px 6px 16px rgba(0, 0, 0, 0.16);
}
.market-ai-menu.is-open {
  display: grid;
}
.market-ai-menu-label {
  color: rgba(0, 0, 0, 0.46);
  font-size: 0.74rem;
}
.market-ai-menu-row {
  display: grid;
  gap: 0.3rem;
}
.market-ai-menu-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}
.market-ai-disable-btn {
  color: #ff3b30;
}
.market-ai-send-btn {
  min-width: 6.5rem;
  height: 2.2em;
  min-height: 2.2em;
  border-radius: 0.3em;
  border: 0.5px solid #ffffff;
  background: #F1F0EF;
  color: #000000;
  font-family: inherit;
  font-size: 1em;
  font-weight: 300;
  box-shadow:
    -2px -2px 6px rgba(255, 255, 255, 0.85),
    2px 2px 4px rgba(0, 0, 0, 0.15);
}
.market-ai-send-btn:hover:not(:disabled) {
  background: #F6F5F4;
}
.market-ai-send-btn:active:not(:disabled) {
  box-shadow:
    inset 1px 1px 3px rgba(0, 0, 0, 0.15),
    inset -1px -1px 3px rgba(255, 255, 255, 0.85);
}
.market-ai-send-btn:disabled {
  border-color: rgba(255, 255, 255, 0.85);
  color: rgba(0, 0, 0, 0.15);
  box-shadow: none;
}
@media (max-width: 760px) {
  .market-ai-toggle {
    right: 1rem;
  }
  .market-ai-dialog {
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
    bottom: 3.65rem;
  }
  .market-ai-setup-row {
    grid-template-columns: 1fr;
  }
}
.chip {
  height: 1.85em;
  border-radius: 4px;
  border: 0.5px solid rgba(255, 255, 255, 1);
  display: flex;
  align-items: center;
  padding: 0 0.85em;
  font-size: 1em;
  cursor: grab;
  white-space: nowrap;
  box-shadow:
    1px 1px 4px rgba(0, 0, 0, 0.15),
    -1px -1px 2px rgba(255, 255, 255, 0.85);
  transition: box-shadow 0.1s;
}
.chip:hover {
  box-shadow:
    -2px -2px 6px rgba(255, 255, 255, 0.85),
    2px 2px 4px rgba(0, 0, 0, 0.15);
}
.chip:active {
  cursor: grabbing;
  opacity: 0.75;
}
.chip.is-disabled {
  cursor: not-allowed;
  opacity: 0.38;
  filter: grayscale(0.35);
}
.chip.is-disabled:hover {
  box-shadow:
    1px 1px 4px rgba(0, 0, 0, 0.15),
    -1px -1px 2px rgba(255, 255, 255, 0.85);
}
.chip.is-disabled:active {
  cursor: not-allowed;
  opacity: 0.38;
}
.node-tooltip {
  position: fixed;
  z-index: 20;
  max-width: 18rem;
  padding: 0.6em 0.75em;
  border-radius: 0.35em;
  background: #F1F0EF;
  color: rgba(0, 0, 0, 0.72);
  font-size: 0.78em;
  line-height: 1.35;
  pointer-events: none;
  opacity: 0;
  transform: translateY(0.2em);
  transition:
    opacity 0.08s ease,
    transform 0.08s ease;
  box-shadow:
    -2px -2px 6px rgba(255, 255, 255, 0.85),
    2px 2px 8px rgba(0, 0, 0, 0.18);
}
.node-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.c-tz {
  background: #ffcc00;
}
.c-ticker {
  background: #8e8e93;
}
.c-le {
  background: #ff2d55;
}
.c-pa {
  background: #92dbce;
}
.c-state {
  background: #3ce155;
}
.c-logic {
  background: #f1f0ef;
  border: 1px solid rgba(0, 0, 0, 0.68);
}
.c-ai {
  background: #f1f0ef;
  border: 1px solid rgba(0, 0, 0, 0.68);
}
.c-tg {
  background: #32ade6;
}
.sep {
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
  margin: 0.5em 0;
}
.palette-section-label {
  margin-top: 0.15em;
  font-size: 0.68em;
  color: rgba(0, 0, 0, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.palette-scroll {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.15em;
}
.panel-actions {
  flex-shrink: 0;
  display: grid;
  gap: 0.5em;
  padding-top: 0.8em;
  margin-top: 0.2em;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.hint {
  font-size: 0.7em;
  color: rgba(0, 0, 0, 0.35);
  text-align: center;
}
.save-btn {
  height: 2.2em;
  border-radius: 0.3em;
  border: 0.5px solid #30b0c7;
  background: #F1F0EF;
  color: #081d21;
  font-family: inherit;
  font-size: 1em;
  font-weight: 300;
  cursor: pointer;
  box-shadow:
    -2px -2px 6px rgba(255, 255, 255, 0.85),
    2px 2px 4px rgba(0, 0, 0, 0.15);
}
.save-btn:hover {
  border: 1px solid #30b0c7;
  background: rgba(255, 255, 255, 0.25);
  box-shadow:
    -3px -3px 6px rgba(255, 255, 255, 0.85),
    3px 3px 6px rgba(0, 0, 0, 0.15);
}
.save-btn:active {
  box-shadow:
    inset 1px 1px 3px rgba(0, 0, 0, 0.1),
    inset -1px -1px 3px rgba(255, 255, 255, 0.5);
}
.save-btn.is-clean,
.save-btn:disabled {
  border-color: rgba(0, 0, 0, 0.12);
  color: rgba(8, 29, 33, 0.25);
  cursor: default;
  box-shadow: none;
}
.save-btn.is-clean:hover,
.save-btn:disabled:hover {
  background: #F1F0EF;
}
.inspector-actions {
  margin-top: auto;
  display: grid;
  gap: 0.5em;
}
.move-row,
.done-delete-row {
  display: grid;
  gap: 0.5em;
}
.move-row {
  grid-template-columns: 1fr 1fr;
}
.done-delete-row {
  grid-template-columns: 1fr 2.2em;
}
.node-action-btn,
.delete-icon-btn {
  height: 2.2em;
  border-radius: 0.3em;
  border: 0.5px solid rgba(0, 0, 0, 0.13);
  background: #F1F0EF;
  color: #1a1a1a;
  font-family: inherit;
  font-size: 1em;
  font-weight: 300;
  cursor: pointer;
  box-shadow:
    -2px -2px 6px rgba(255, 255, 255, 0.85),
    2px 2px 4px rgba(0, 0, 0, 0.15);
}
.node-action-btn:hover {
  border-color: #30b0c7;
  background: #eaf8fa;
}
.node-action-btn:active,
.delete-icon-btn:active {
  box-shadow:
    inset 1px 1px 3px rgba(0, 0, 0, 0.1),
    inset -1px -1px 3px rgba(255, 255, 255, 0.5);
}
.node-action-btn:disabled {
  color: rgba(8, 29, 33, 0.25);
  cursor: default;
  box-shadow: none;
}
.node-action-btn:disabled:hover {
  border-color: rgba(0, 0, 0, 0.13);
  background: #F1F0EF;
}
.delete-icon-btn {
  display: grid;
  place-items: center;
  border-color: rgba(255, 59, 48, 0.62);
  padding: 0;
}
.delete-icon-btn:hover {
  border-color: #ff3b30;
  background: #fff0ee;
}
.delete-icon-btn:disabled {
  border-color: rgba(0, 0, 0, 0.13);
  cursor: default;
  box-shadow: none;
}
.delete-icon-btn:disabled:hover {
  background: #F1F0EF;
}
.delete-icon-btn:disabled img {
  opacity: 0.25;
}
.delete-icon-btn img {
  width: 1.05em;
  height: 1.05em;
  object-fit: contain;
}
.builder-json-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45em;
  margin-top: 0.25em;
}
.json-btn {
  height: 2em;
  border-radius: 0.3em;
  border: 0.5px solid rgba(0, 0, 0, 0.13);
  background: transparent;
  color: #1a1a1a;
  font-family: inherit;
  font-size: 0.86em;
  font-weight: 300;
  cursor: pointer;
}
.json-btn:hover {
  border-color: #30b0c7;
  background: #eaf8fa;
}
.json-btn:disabled {
  opacity: 0.45;
  cursor: default;
  border-color: rgba(0, 0, 0, 0.13);
  background: transparent;
}
.json-btn.is-wide {
  grid-column: 1 / -1;
}
.json-file-input {
  display: none;
}
.chart-pick-btn {
  width: 100%;
  height: 1.9em;
  border-radius: 0.3em;
  border: 0;
  background: transparent;
  color: #1a1a1a;
  font-family: inherit;
  font-size: 0.86em;
  font-weight: 300;
  cursor: pointer;
}
.chart-pick-btn:hover {
  background: #F1F0EF;
  box-shadow:
    -2px -2px 6px rgba(255, 255, 255, 0.85),
    2px 2px 4px rgba(0, 0, 0, 0.15);
}
.chart-pick-btn:active {
  box-shadow:
    inset 1px 1px 3px rgba(0, 0, 0, 0.1),
    inset -1px -1px 3px rgba(255, 255, 255, 0.5);
}
.chart-pick-row {
  display: grid;
  grid-template-columns: 1fr 2em;
  gap: 0.45em;
  margin-bottom: 0.6em;
}
.clear-price-btn {
  width: 2em;
  height: 1.9em;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0.3em;
  background: transparent;
  cursor: pointer;
  padding: 0;
}
.clear-price-btn:hover {
  background: #F1F0EF;
  box-shadow:
    -2px -2px 6px rgba(255, 255, 255, 0.85),
    2px 2px 4px rgba(0, 0, 0, 0.15);
}
.clear-price-btn:active {
  box-shadow:
    inset 1px 1px 3px rgba(0, 0, 0, 0.1),
    inset -1px -1px 3px rgba(255, 255, 255, 0.5);
}
.clear-price-btn img {
  width: 1em;
  height: 1em;
  object-fit: contain;
}
.standalone-chart-picker {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  background: #F1F0EF;
}
.standalone-chart-picker.is-open {
  display: block;
}
.standalone-chart-picker__bar {
  position: absolute;
  top: 1em;
  left: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.75em;
  transform: translateX(-50%);
  padding: 0.5em 0.75em;
  border-radius: 0.35em;
  background: #F1F0EF;
  color: rgba(0, 0, 0, 0.72);
  font-size: 0.86em;
  box-shadow:
    -2px -2px 6px rgba(255, 255, 255, 0.85),
    2px 2px 8px rgba(0, 0, 0, 0.18);
}
.standalone-chart-picker__close {
  width: 1.65em;
  height: 1.65em;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(0, 0, 0, 0.62);
  font: inherit;
  font-size: 1.25em;
  line-height: 1;
  cursor: pointer;
}
.standalone-chart-picker__close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #1a1a1a;
}
.standalone-chart-picker__frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
/* Inspector */
.insp-header {
  display: flex;
  align-items: center;
  gap: 0.4em;
  margin-bottom: 0.9em;
}
.insp-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  flex-shrink: 0;
}
.insp-title {
  font-size: 0.92em;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.insp-field {
  display: flex;
  flex-direction: column;
  gap: 0.2em;
  margin-bottom: 0.6em;
}
.insp-field.is-group-gap {
  margin-top: 0.3em;
}
.insp-field.is-required-missing .insp-label,
.insp-field.is-required-missing .variable-ref-label {
  color: #ff3b30;
}
.insp-field.is-required-missing .insp-input,
.insp-field.is-required-missing .insp-select {
  border-color: #ff3b30;
  box-shadow:
    inset 1px 1px 3px rgba(255, 59, 48, 0.08),
    inset -1px -1px 2px rgb(255, 255, 255);
}
.insp-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-size: 0.62em;
  color: rgba(0, 0, 0, 0.38);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field-help {
  width: 1.15em;
  height: 1.15em;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.48);
  font-size: 0.92em;
  line-height: 1;
  text-transform: none;
  letter-spacing: 0;
  cursor: help;
}
.field-help:hover {
  background: rgba(48, 176, 199, 0.16);
  color: #1a1a1a;
}
.insp-input,
.insp-select {
  width: 100%;
  height: 1.75em;
  border: 0.5px solid rgba(0, 0, 0, 0.13);
  border-radius: 0.25em;
  background: #F1F0EF;
  font: inherit;
  font-size: 0.85em;
  padding: 0 0.45em;
  color: #1a1a1a;
  box-shadow:
    inset 1px 1px 3px rgba(0, 0, 0, 0.06),
    inset -1px -1px 2px rgb(255, 255, 255);
  outline: none;
}
.insp-input:focus,
.insp-select:focus {
  border-color: #30b0c7;
}
.insp-select {
  appearance: auto;
  cursor: pointer;
}
.insp-input.is-variable-bound,
.insp-select.is-variable-bound {
  opacity: 0.48;
}
.variable-ref-select {
  height: 1.55em;
  font-size: 0.76em;
  color: rgba(0, 0, 0, 0.58);
}
.variable-ref-label {
  margin-top: 0.12em;
  font-size: 0.58em;
}
.insp-check-label {
  min-height: 1.75em;
  display: flex;
  align-items: center;
  gap: 0.5em;
  color: rgba(0, 0, 0, 0.72);
  font-size: 0.84em;
  cursor: pointer;
}
.insp-check {
  width: 1.05em;
  height: 1.05em;
  accent-color: #30b0c7;
}

.rule-name-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.3em;
  margin-bottom: 0.6em;
}
.rule-name-label {
  font-size: 0.72em;
  color: rgba(0, 0, 0, 0.4);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.rule-name-input {
  width: 100%;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 1em;
  color: #1a1a1a;
  outline: none;
  padding: 0.1em 0;
}
.rule-name-input::placeholder {
  color: rgba(0, 0, 0, 0.25);
}
.rule-name-input:focus {
  border-bottom-color: #30b0c7;
}

/* Candle editor (PA block) */
.pa-candle-layout {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin: 0.45em 0 0.55em -0.85em;
}
.pa-svg {
  display: block;
  flex: 0 0 auto;
  margin: 0;
  overflow: visible;
}
.pa-ratios {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  display: grid;
  gap: 0.42em;
}
.pa-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.18em;
}
.pa-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5em;
  min-width: 0;
}
.pa-lbl {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-size: 0.67em;
  color: rgba(0, 0, 0, 0.44);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pa-row-controls {
  display: block;
  min-width: 0;
}
.pa-pct {
  font-size: 0.7em;
  color: rgba(0, 0, 0, 0.6);
  flex: 0 0 auto;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.pa-op {
  height: 1.45em;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  border: 0.5px solid rgba(0, 0, 0, 0.13);
  border-radius: 0.22em;
  background: #F1F0EF;
  font: inherit;
  font-size: 0.68em;
  color: #1a1a1a;
  padding: 0 0.15em;
  text-align: center;
  box-shadow:
    inset 1px 1px 2px rgba(0, 0, 0, 0.05),
    inset -1px -1px 1px rgba(255, 255, 255, 0.858);
  outline: none;
  cursor: pointer;
  appearance: auto;
}
/* Telegram status */
.tg-status {
  font-size: 0.8em;
  line-height: 1.5;
  padding: 0.15em 0;
}
.tg-status.ok {
  color: #34c759;
}
.tg-status.pending {
  color: #ff9500;
}
.tg-status.none {
  color: rgba(0, 0, 0, 0.38);
}
.tg-connect-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 1.9em;
  border-radius: 0.3em;
  margin-top: 0.55em;
  border: 0.5px solid #32ade6;
  background: #F1F0EF;
  color: #32ade6;
  font: inherit;
  font-size: 0.85em;
  text-decoration: none;
  cursor: pointer;
  box-shadow:
    -1px -1px 4px rgba(255, 255, 255, 0.7),
    1px 1px 4px rgba(0, 0, 0, 0.1);
}
.tg-connect-btn:hover {
  background: #edf8fd;
}
