/*
 * PARAMETRIC FLOW DESIGNER - MASTER STYLESHEET
 *
 * Structure
 * 1. Shared foundation: tokens, reset, reusable controls, utilities, and components
 * 2. Authentication pages
 * 3. Workspace portal
 * 4. Workspace database configuration
 * 5. Workspace IFC configuration
 * 6. Dashboard designer
 * 7. Parametric flow designer
 *
 * Page-specific rules are rooted at html.app-page--* so styles cannot leak between
 * screens. Add reusable UI to section 1; keep screen-only layouts in their page section.
 */

/* ==========================================================================
   1. Shared foundation, design tokens, components, and utilities
   ========================================================================== */

:root {
  --bg: #f2f4f7;
  --surface: #ffffff;
  --panel: #ffffff;
  --card: #ffffff;
  --text: #1d1d1f;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --line-strong: #b8b8bd;
  --accent: #0071e3;
  --accent-dark: #005ec0;
  --accent-soft: #eff6ff;
  --danger: #b42318;
  --danger-border: #f2b8b5;
  --danger-surface: #fff5f5;
  --success: #166534;
  --warning: #9a3412;
  --control-height: 34px;
  --control-radius: 10px;
  --control-padding-x: 12px;
  --panel-radius: 14px;
  --page-gutter: 16px;
  --header-height: 52px;
  --toolbar-height: 44px;
  --focus-ring: 0 0 0 3px rgba(0, 113, 227, 0.18);
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:where(button, input, select, textarea, .toolbar-link) {
  font: inherit;
  color: inherit;
}

:where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), select, textarea) {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  padding: 0 var(--control-padding-x);
  background: #ffffff;
  color: var(--text);
  transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

:where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), select) {
  height: var(--control-height);
  min-height: var(--control-height);
}

select {
  height: var(--control-height) !important;
  min-height: var(--control-height) !important;
  border-radius: var(--control-radius) !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  padding-left: var(--control-padding-x);
  padding-right: calc(var(--control-padding-x) + 14px);
}

:where(textarea) {
  min-height: 88px;
  padding-top: 9px;
  padding-bottom: 9px;
  resize: vertical;
}

:where(input[type="checkbox"], input[type="radio"]) {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
}

:where(input[type="file"]) {
  height: var(--control-height);
  min-height: var(--control-height);
  overflow: hidden;
  padding: 0 var(--control-padding-x) 0 0;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: #ffffff;
  line-height: var(--control-height);
  cursor: pointer;
}

:where(input[type="file"])::file-selector-button {
  height: calc(var(--control-height) - 2px);
  margin: 0 10px 0 0;
  padding: 0 var(--control-padding-x);
  border: 0;
  border-right: 1px solid var(--line);
  background: #f5f5f7;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

:where(input[type="file"]):hover::file-selector-button {
  background: #ffffff;
}

:where(input[type="file"]:disabled),
:where(input[type="file"]:disabled)::file-selector-button {
  cursor: not-allowed;
  opacity: 0.6;
}

:where(input, select, textarea):focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

:where(button, .button, .toolbar-link) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  padding: 0 var(--control-padding-x);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: #f5f5f7;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

button {
  height: var(--control-height) !important;
  min-height: var(--control-height) !important;
  border-radius: var(--control-radius) !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.toolbar-link {
  min-height: var(--control-height);
  text-decoration: none;
}

button:hover,
.button:hover,
.toolbar-link:hover {
  background: #ffffff;
  border-color: var(--line-strong);
}

button:active,
.button:active,
.toolbar-link:active {
  transform: translateY(1px);
}

button:focus-visible,
.button:focus-visible,
.toolbar-link:focus-visible {
  outline: 0;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

button.primary,
.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

button.primary:hover,
.primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button.danger,
.danger {
  border-color: var(--danger-border);
  background: var(--danger-surface);
  color: var(--danger);
}

button.danger:hover,
.danger:hover {
  border-color: #e7a3a0;
  background: #ffeceb;
}

.text-button {
  width: fit-content;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0;
  background: transparent;
  color: var(--accent-dark);
}

.text-button:hover {
  border-color: transparent;
  background: transparent;
  text-decoration: underline;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.app-icon {
  display: block;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  object-fit: contain;
}

.toolbar {
  position: relative;
  z-index: 2000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  height: var(--toolbar-height);
  min-height: var(--toolbar-height);
  max-height: var(--toolbar-height);
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid #e5e5ea;
  color: var(--ink);
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toolbar :is(button, .toolbar-link) {
  white-space: nowrap;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--header-height);
  padding: 9px 18px;
  border-bottom: 1px solid #cfd3d8;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  --icon-button-size: var(--control-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 var(--icon-button-size);
  width: var(--icon-button-size) !important;
  min-width: var(--icon-button-size);
  max-width: var(--icon-button-size);
  height: var(--icon-button-size) !important;
  min-height: var(--icon-button-size) !important;
  max-height: var(--icon-button-size) !important;
  padding: 0 !important;
  border-radius: 999px !important;
  border: 1px solid #d9dde3;
  background: #f8fafc;
  color: #374151;
  cursor: pointer;
  line-height: 1;
  text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.icon-button:hover {
  background: #ffffff;
  border-color: #b8b8bd;
}

.icon-button:active {
  transform: translateY(1px);
}

.icon-button:focus-visible {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.18);
}

.icon-button--small {
  --icon-button-size: 26px;
}

.ui-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-header h1,
.canvas-titlebar h1 {
  flex: 0 0 auto;
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.canvas-titlebar {
  min-height: var(--header-height);
  padding: 9px 18px;
}

.canvas-flow-title,
.entity-title-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.canvas-flow-title {
  flex: 1 1 220px;
  max-width: 520px;
  padding: 0 8px;
}

.entity-title,
.page-context-title {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-context-title {
  flex: 1 1 220px;
  max-width: 520px;
  text-align: center;
}

.entity-title-form {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  max-width: min(620px, calc(100vw - 20px));
}

.entity-title-input {
  width: min(320px, calc(100vw - 120px));
  min-width: 120px;
}

.session-user {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 260px;
  min-height: 28px;
  padding: 4px 8px;
  overflow: hidden;
  border: 1px solid #d9dde3;
  border-radius: var(--control-radius);
  background: #f8fafc;
  color: #4b5563;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layout-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--control-height);
  padding: 0 var(--control-padding-x);
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.layout-toggle:has(input:checked) {
  border-color: #93c5fd;
  background: var(--accent-soft);
  color: #1e40af;
}

.layout-toggle:has(input:disabled) {
  pointer-events: none;
  opacity: 0.55;
}

.lock-bar {
  position: relative;
  z-index: 1999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 36px;
  padding: 5px 18px;
  border-bottom: 1px solid #e5e5ea;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  color: var(--ink);
  font-size: 12px;
}

.lock-bar.is-owner {
  background: rgba(240, 253, 244, 0.94);
}

.lock-bar.is-readonly {
  background: rgba(255, 247, 237, 0.96);
}

.lock-bar__content,
.lock-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.lock-bar__status,
.lock-bar__requests {
  min-width: 0;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lock-bar__requests {
  flex: 0 1 auto;
  color: var(--muted);
  font-size: 11px;
}

.lock-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  height: 24px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.lock-pill.is-owner {
  border-color: #86efac;
  background: #dcfce7;
  color: var(--success);
}

.lock-pill.is-readonly {
  border-color: #fdba74;
  background: #ffedd5;
  color: var(--warning);
}

.lock-pill.is-viewer {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #334155;
}

.lock-pill.is-editable {
  border-color: #93c5fd;
  background: #dbeafe;
  color: #1e40af;
}

.utility-page-main {
  width: 100%;
  max-width: 1160px;
  min-height: 0;
  margin: 0 auto;
  padding: 12px var(--page-gutter) 20px;
  overflow: auto;
}

body.embedded .utility-page-main {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.resource-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  align-content: start;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

.resource-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #dde2e9;
}

.resource-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
}

.resource-header__actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.resource-form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e7eb;
}

.resource-form > label {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.resource-form__row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.resource-form__row :is(input, select) {
  flex: 1 1 auto;
  min-width: 0;
}

.resource-form__row button {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .app-header--entity {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .app-header--entity h1 {
    font-size: 14px;
  }

  .app-header--entity .canvas-flow-title,
  .app-header--entity .page-context-title {
    order: 3;
    flex: 1 0 100%;
    justify-content: flex-start;
    max-width: none;
    padding: 0;
    text-align: left;
  }

  .app-header--entity .topbar-actions {
    margin-left: auto;
  }
}

@media (max-width: 768px) {
  .lock-bar {
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .lock-bar__content {
    width: 100%;
  }

  .lock-bar__status {
    max-width: 100%;
    white-space: normal;
  }

  .resource-form {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .resource-form__row {
    align-items: stretch;
    flex-direction: column;
  }

  .resource-form__row button {
    width: 100%;
  }
}

.content {
  max-width: 980px;
  margin: 20px auto;
  padding: 0 16px 20px;
  display: grid;
  gap: 14px;
}

.card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: var(--card);
  box-shadow: rgba(99, 99, 99, 0.08) 0px 2px 10px 0px;
}

.action-btn,
.add-node-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.add-icon {
  width: 12px;
  height: 12px;
  display: inline-block;
  background: currentColor;
  clip-path: polygon(40% 0%, 60% 0%, 60% 40%, 100% 40%, 100% 60%, 60% 60%, 60% 100%, 40% 100%, 40% 60%, 0% 60%, 0% 40%, 40% 40%);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 24, 40, 0.42);
}

.modal-panel {
  position: relative;
  width: min(680px, calc(100vw - 24px));
  max-height: min(90vh, 860px);
  overflow: auto;
  padding: 14px;
  border-radius: var(--panel-radius);
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.2);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-header :is(h2, h3) {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

/* ==========================================================================
   2. Authentication pages
   ========================================================================== */

:where(html.app-page--auth) body {
  display: grid;
  place-items: center;
}

:where(html.app-page--login) body {
  position: relative;
  isolation: isolate;
  display: block;
  min-height: 100dvh;
  padding: clamp(20px, 3vw, 48px);
  overflow-x: hidden;
  background:
    radial-gradient(circle at 14% 12%, rgba(20, 184, 166, 0.18), transparent 35%),
    radial-gradient(circle at 82% 76%, rgba(59, 130, 246, 0.2), transparent 38%),
    linear-gradient(145deg, #06111f 0%, #0a1730 48%, #101a36 100%);
}

:where(html.app-page--login) .auth-background,
:where(html.app-page--login) body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

:where(html.app-page--login) .auth-background {
  z-index: 0;
  overflow: hidden;
}

:where(html.app-page--login) body::before {
  content: "";
  z-index: 1;
  background:
    linear-gradient(110deg, rgba(2, 6, 23, 0.16), rgba(15, 23, 42, 0.06)),
    radial-gradient(circle at center, transparent 14%, rgba(2, 6, 23, 0.34) 100%);
}

:where(html.app-page--login) #webgl-canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 500ms ease;
}

:where(html.app-page--login.webgl-ready) #webgl-canvas {
  opacity: 0.24;
}

:where(html.app-page--login.webgl-unavailable) .auth-background {
  display: none;
}

:where(html.app-page--auth) .auth-card {
  width: min(460px, calc(100vw - 32px));
  padding: 22px;
  box-shadow: rgba(100, 100, 111, 0.2) 0 7px 29px 0;
}

:where(html.app-page--login) .login-shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 448px);
  align-items: center;
  gap: clamp(44px, 6vw, 96px);
  width: min(1420px, 100%);
  min-height: calc(100dvh - clamp(40px, 6vw, 96px));
  margin: 0 auto;
}

:where(html.app-page--login) .login-intro {
  display: grid;
  align-content: center;
  gap: clamp(22px, 3vh, 34px);
  min-width: 0;
  color: #f8fafc;
}

:where(html.app-page--login) .login-brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  color: #ffffff;
  letter-spacing: 0.08em;
}

:where(html.app-page--login) .login-brand-lockup > span:last-child {
  display: grid;
  gap: 1px;
}

:where(html.app-page--login) .login-brand-lockup strong {
  font-size: 13px;
  line-height: 1;
}

:where(html.app-page--login) .login-brand-lockup small {
  color: #93c5fd;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

:where(html.app-page--login) .login-brand-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(219, 234, 254, 0.86));
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

:where(html.app-page--login) .login-brand-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

:where(html.app-page--login) .login-hero-copy {
  max-width: 760px;
}

:where(html.app-page--login) .login-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

:where(html.app-page--login) .login-eyebrow i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2dd4bf;
  box-shadow: 0 0 0 5px rgba(45, 212, 191, 0.12), 0 0 18px rgba(45, 212, 191, 0.72);
}

:where(html.app-page--login) .login-hero-copy h1 {
  max-width: 720px;
  margin: 0;
  color: #f8fafc;
  font-size: clamp(42px, 5.3vw, 76px);
  font-weight: 740;
  letter-spacing: -0.055em;
  line-height: 0.98;
  text-wrap: balance;
}

:where(html.app-page--login) .login-hero-copy h1 span {
  color: transparent;
  background: linear-gradient(100deg, #5eead4 4%, #60a5fa 52%, #c4b5fd 96%);
  background-clip: text;
  -webkit-background-clip: text;
}

:where(html.app-page--login) .login-hero-copy p {
  max-width: 690px;
  margin: 20px 0 0;
  color: #cbd5e1;
  font-size: clamp(15px, 1.25vw, 18px);
  line-height: 1.65;
}

:where(html.app-page--login) .flow-showcase {
  width: min(760px, 100%);
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 22px;
  background: rgba(8, 19, 40, 0.7);
  box-shadow: 0 28px 70px rgba(2, 6, 23, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
}

:where(html.app-page--login) .flow-showcase-toolbar,
:where(html.app-page--login) .flow-showcase-status {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 650;
}

:where(html.app-page--login) .flow-showcase-toolbar {
  justify-content: space-between;
  border-bottom: 1px solid rgba(148, 163, 184, 0.13);
}

:where(html.app-page--login) .flow-showcase-title,
:where(html.app-page--login) .flow-showcase-live,
:where(html.app-page--login) .flow-showcase-status span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

:where(html.app-page--login) .flow-showcase-title i {
  width: 10px;
  height: 10px;
  border: 2px solid #60a5fa;
  border-radius: 3px;
  box-shadow: 6px 4px 0 -2px #2dd4bf;
}

:where(html.app-page--login) .flow-showcase-live {
  color: #5eead4;
  font-size: 9px;
  letter-spacing: 0.12em;
}

:where(html.app-page--login) .flow-showcase-live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2dd4bf;
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.9);
  animation: login-live-pulse 2s ease-out infinite;
}

:where(html.app-page--login) .flow-showcase-canvas {
  position: relative;
  height: 300px;
  overflow: hidden;
  background:
    linear-gradient(rgba(148, 163, 184, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.055) 1px, transparent 1px),
    radial-gradient(circle at 55% 48%, rgba(59, 130, 246, 0.1), transparent 38%);
  background-size: 28px 28px, 28px 28px, auto;
}

:where(html.app-page--login) .flow-showcase-links {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

:where(html.app-page--login) .flow-link {
  fill: none;
  stroke: rgba(96, 165, 250, 0.55);
  stroke-width: 2;
  stroke-dasharray: 7 9;
  vector-effect: non-scaling-stroke;
  animation: login-flow-dash 7s linear infinite;
}

:where(html.app-page--login) .flow-link--two {
  stroke: rgba(167, 139, 250, 0.55);
  animation-delay: -1.6s;
}

:where(html.app-page--login) .flow-link--three {
  stroke: rgba(45, 212, 191, 0.62);
  animation-delay: -3s;
}

:where(html.app-page--login) .flow-link--four {
  stroke: rgba(34, 211, 238, 0.56);
  animation-delay: -4.4s;
}

:where(html.app-page--login) .flow-signal {
  fill: #ffffff;
  filter: drop-shadow(0 0 5px #60a5fa);
}

:where(html.app-page--login) .flow-demo-node {
  position: absolute;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  width: 19%;
  min-width: 122px;
  height: 58px;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  background: rgba(15, 29, 54, 0.95);
  color: #e2e8f0;
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: login-node-float 5.8s ease-in-out infinite;
}

:where(html.app-page--login) .flow-demo-node--data {
  top: 49px;
  left: 2.5%;
}

:where(html.app-page--login) .flow-demo-node--ifc {
  top: 193px;
  left: 2.5%;
  animation-delay: -2.2s;
}

:where(html.app-page--login) .flow-demo-node--logic {
  top: 121px;
  left: 40%;
  animation-delay: -3.5s;
}

:where(html.app-page--login) .flow-demo-node--geometry {
  top: 73px;
  left: 78%;
  animation-delay: -1.2s;
}

:where(html.app-page--login) .flow-demo-node--output {
  top: 193px;
  left: 78%;
  animation-delay: -4.3s;
}

:where(html.app-page--login) .flow-demo-node > span:last-of-type {
  display: grid;
  min-width: 0;
}

:where(html.app-page--login) .flow-demo-node small {
  color: #64748b;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

:where(html.app-page--login) .flow-demo-node strong {
  overflow: hidden;
  font-size: 10px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:where(html.app-page--login) .flow-demo-node-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

:where(html.app-page--login) .flow-demo-node-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

:where(html.app-page--login) .flow-demo-node-icon--blue { color: #93c5fd; background: rgba(59, 130, 246, 0.14); }
:where(html.app-page--login) .flow-demo-node-icon--violet { color: #c4b5fd; background: rgba(139, 92, 246, 0.14); }
:where(html.app-page--login) .flow-demo-node-icon--amber { color: #fcd34d; background: rgba(245, 158, 11, 0.14); }
:where(html.app-page--login) .flow-demo-node-icon--green { color: #5eead4; background: rgba(20, 184, 166, 0.14); }
:where(html.app-page--login) .flow-demo-node-icon--cyan { color: #67e8f9; background: rgba(6, 182, 212, 0.14); }

:where(html.app-page--login) .flow-port {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  border: 2px solid #0f1d36;
  border-radius: 50%;
  background: #60a5fa;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.28), 0 0 10px rgba(96, 165, 250, 0.6);
  transform: translateY(-50%);
}

:where(html.app-page--login) .flow-port--in { left: -5px; }
:where(html.app-page--login) .flow-port--out { right: -5px; }

:where(html.app-page--login) .flow-showcase-status {
  gap: 20px;
  border-top: 1px solid rgba(148, 163, 184, 0.13);
}

:where(html.app-page--login) .flow-showcase-status strong {
  margin-left: auto;
  color: #cbd5e1;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

:where(html.app-page--login) .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

:where(html.app-page--login) .status-dot--blue { background: #60a5fa; }
:where(html.app-page--login) .status-dot--green { background: #34d399; }

:where(html.app-page--login) .login-benefits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  max-width: 760px;
}

:where(html.app-page--login) .login-benefits > div {
  display: grid;
  gap: 5px;
  padding-left: 14px;
  border-left: 2px solid rgba(96, 165, 250, 0.45);
}

:where(html.app-page--login) .login-benefits > div:nth-child(2) { border-left-color: rgba(167, 139, 250, 0.5); }
:where(html.app-page--login) .login-benefits > div:nth-child(3) { border-left-color: rgba(45, 212, 191, 0.55); }

:where(html.app-page--login) .login-benefits strong {
  color: #f8fafc;
  font-size: 12px;
  letter-spacing: 0.04em;
}

:where(html.app-page--login) .login-benefits span {
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.5;
}

:where(html.app-page--login) .auth-card {
  position: relative;
  width: 100%;
  padding: clamp(26px, 3vw, 38px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.955);
  box-shadow: 0 32px 90px rgba(2, 6, 23, 0.42), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
  backdrop-filter: blur(24px) saturate(125%);
  -webkit-backdrop-filter: blur(24px) saturate(125%);
}

:where(html.app-page--login) .auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 26px;
  right: 26px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #60a5fa, #2dd4bf, transparent);
}

:where(html.app-page--login) .auth-card-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 22px;
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

:where(html.app-page--login) .auth-card-kicker i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

:where(html.app-page--login) .auth-card-heading {
  margin-bottom: 24px;
}

:where(html.app-page--login) .auth-card-heading h2 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(27px, 3vw, 34px);
  font-weight: 740;
  letter-spacing: -0.035em;
}

:where(html.app-page--login) .auth-card-heading p {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
}

:where(html.app-page--login) .auth-card-footnote {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin: 20px 0 0;
  color: #94a3b8;
  font-size: 10px;
}

:where(html.app-page--login) .auth-card-footnote span {
  color: #10b981;
}

:where(html.app-page--auth) h1 {
  margin: 0 0 6px;
  font-size: 20px;
}

:where(html.app-page--auth) .auth-brand {
  margin: 0 0 6px;
}

:where(html.app-page--auth) .auth-brand h1 {
  margin: 0;
}

:where(html.app-page--auth) h2 {
  margin: 0;
  font-size: 18px;
}

:where(html.app-page--auth) p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}

:where(html.app-page--auth) .subtle {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

:where(html.app-page--auth) .auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 14px;
}

:where(html.app-page--auth) .auth-tab.active {
  background: #1f2937;
  color: #f9fafb;
  border-color: #111827;
}

:where(html.app-page--auth) .auth-form {
  display: grid;
  gap: 8px;
}

:where(html.app-page--auth) .auth-form.hidden {
  display: none;
}

:where(html.app-page--auth) label {
  margin-top: 4px;
  font-size: 13px;
}

:where(html.app-page--auth) .register-profile-field {
  display: grid;
  gap: 8px;
}

:where(html.app-page--auth) .register-profile-field.hidden,
:where(html.app-page--auth) .register-profile-field[hidden] {
  display: none !important;
}

:where(html.app-page--auth) button {
  margin-top: 10px;
  width: 100%;
}

:where(html.app-page--auth) .error {
  margin-top: 12px;
  color: #b91c1c;
  min-height: 20px;
  font-size: 13px;
}

:where(html.app-page--auth) .info {
  margin-top: 12px;
  color: #0f766e;
  min-height: 20px;
  font-size: 13px;
}

:where(html.app-page--auth) .field-feedback {
  min-height: 18px;
  font-size: 12px;
  color: var(--muted);
}

:where(html.app-page--auth) .field-feedback.error {
  color: #b91c1c;
}

:where(html.app-page--auth) .field-feedback.ok {
  color: #166534;
}

:where(html.app-page--auth) .password-rules {
  margin: 2px 0 6px;
  padding-left: 0;
  font-size: 12px;
  color: var(--muted);
  list-style: none;
}

:where(html.app-page--auth) .password-rules li {
  margin: 2px 0;
  position: relative;
  padding-left: 16px;
}

:where(html.app-page--auth) .password-rules li::before {
  content: "*";
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 700;
}

:where(html.app-page--auth) .password-rules li.valid {
  color: #166534;
}

:where(html.app-page--auth) .password-rules li.valid::before {
  content: "+";
  color: #166534;
}

:where(html.app-page--auth) .password-rules li.invalid {
  color: #b91c1c;
}

:where(html.app-page--auth) .password-rules li.invalid::before {
  color: #b91c1c;
}

:where(html.app-page--login) .auth-tabs {
  gap: 4px;
  margin-bottom: 22px;
  padding: 4px;
  border: 1px solid #e2e8f0;
  border-radius: 13px;
  background: #f1f5f9;
}

:where(html.app-page--login) .auth-tab {
  height: 36px;
  margin: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #64748b;
  box-shadow: none;
}

:where(html.app-page--login) .auth-tab:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.65);
  color: #334155;
}

:where(html.app-page--login) .auth-tab.active {
  border-color: transparent;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
}

:where(html.app-page--login) .auth-form {
  gap: 9px;
  animation: login-form-in 220ms ease-out both;
}

:where(html.app-page--login) .auth-form label {
  margin-top: 5px;
  color: #334155;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.025em;
}

:where(html.app-page--login) .auth-form input,
:where(html.app-page--login) .auth-form select {
  height: 44px;
  min-height: 44px;
  border-color: #dbe3ed;
  border-radius: 11px;
  background: rgba(248, 250, 252, 0.92);
  color: #0f172a;
  font-size: 13px;
}

:where(html.app-page--login) .auth-form input::placeholder {
  color: #94a3b8;
}

:where(html.app-page--login) .auth-form input:hover {
  border-color: #cbd5e1;
  background: #ffffff;
}

:where(html.app-page--login) .auth-form input:focus,
:where(html.app-page--login) .auth-form select:focus {
  border-color: #3b82f6;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.11);
}

:where(html.app-page--login) .auth-form button {
  min-height: 42px;
  margin-top: 11px;
  border-radius: 11px;
}

:where(html.app-page--login) .auth-form button.primary {
  border-color: #172554;
  background: linear-gradient(120deg, #172554, #1d4ed8 62%, #0f766e 130%);
  color: #ffffff;
  box-shadow: 0 9px 20px rgba(30, 64, 175, 0.2);
}

:where(html.app-page--login) .auth-form button.primary:hover:not(:disabled) {
  border-color: #1e3a8a;
  background: linear-gradient(120deg, #1e3a8a, #2563eb 62%, #0f766e 130%);
  box-shadow: 0 11px 24px rgba(30, 64, 175, 0.25);
  transform: translateY(-1px);
}

:where(html.app-page--login) .auth-form button.primary span {
  font-size: 16px;
  line-height: 1;
  transition: transform 150ms ease;
}

:where(html.app-page--login) .auth-form button.primary:hover span {
  transform: translateX(2px);
}

:where(html.app-page--login) .auth-form .text-button {
  min-height: 28px;
  margin-top: 2px;
  border: 0;
  background: transparent;
  color: #2563eb;
  font-size: 11px;
  box-shadow: none;
}

:where(html.app-page--login) .auth-form .text-button:hover:not(:disabled) {
  background: #eff6ff;
}

:where(html.app-page--login) .password-rules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 10px;
  margin: 2px 0 3px;
  padding: 9px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  font-size: 9px;
}

:where(html.app-page--login) .password-rules li {
  margin: 0;
  padding-left: 13px;
}

:where(html.app-page--login) .field-feedback {
  min-height: 14px;
  font-size: 10px;
}

:where(html.app-page--login) :is(.info, .error) {
  min-height: 0;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.45;
}

:where(html.app-page--login) .info {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}

:where(html.app-page--login) .error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

:where(html.app-page--login) :is(.info, .error):empty {
  display: none;
}

@keyframes login-flow-dash {
  to { stroke-dashoffset: -64; }
}

@keyframes login-node-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes login-live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.45), 0 0 12px rgba(45, 212, 191, 0.9); }
  70%, 100% { box-shadow: 0 0 0 7px rgba(45, 212, 191, 0), 0 0 12px rgba(45, 212, 191, 0.7); }
}

@keyframes login-form-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1180px) {
  :where(html.app-page--login) .login-shell {
    grid-template-columns: minmax(0, 1fr);
    justify-content: center;
    gap: 44px;
    width: min(820px, 100%);
  }

  :where(html.app-page--login) .login-intro {
    padding-top: 18px;
  }

  :where(html.app-page--login) .auth-card {
    justify-self: center;
    width: min(448px, 100%);
    margin-bottom: 24px;
  }
}

@media (max-width: 720px) {
  :where(html.app-page--login) .login-shell {
    gap: 32px;
  }

  :where(html.app-page--login) .login-intro {
    gap: 20px;
    padding-top: 4px;
  }

  :where(html.app-page--login) .login-hero-copy h1 {
    max-width: 560px;
    font-size: clamp(39px, 12vw, 62px);
  }

  :where(html.app-page--login) .login-hero-copy p {
    font-size: 15px;
  }

  :where(html.app-page--login) .flow-showcase {
    display: none;
  }

  :where(html.app-page--login) .login-benefits {
    gap: 12px;
  }

  :where(html.app-page--login) .login-benefits > div {
    padding-left: 10px;
  }
}

@media (max-width: 560px) {
  :where(html.app-page--login) body {
    padding: 16px;
  }

  :where(html.app-page--login) .login-eyebrow {
    margin-bottom: 12px;
    font-size: 9px;
  }

  :where(html.app-page--login) .login-benefits {
    grid-template-columns: 1fr;
  }

  :where(html.app-page--login) .login-benefits span {
    max-width: 360px;
  }

  :where(html.app-page--login) .auth-card {
    width: 100%;
    padding: 25px 20px;
    border-radius: 21px;
    backdrop-filter: blur(14px) saturate(115%);
    -webkit-backdrop-filter: blur(14px) saturate(115%);
  }

  :where(html.app-page--login) .auth-card-heading h2 {
    font-size: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :where(html.app-page--login) #webgl-canvas {
    transition: none;
  }

  :where(html.app-page--login) :is(.flow-link, .flow-demo-node, .flow-showcase-live i, .auth-form) {
    animation: none;
  }

  :where(html.app-page--login) .flow-signal {
    display: none;
  }
}

/* ==========================================================================
   3. Workspace portal
   ========================================================================== */

html:where(.app-page--workspace) {
  scrollbar-gutter: stable;
}

:where(html.app-page--workspace) .workspace-layout {
  max-width: 1160px;
  margin: 12px auto 18px;
  padding: 0 16px 20px;
}

:where(html.app-page--workspace) .workspace-tabs {
  display: grid;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}

:where(html.app-page--workspace) .workspace-commandbar {
  border-bottom: 1px solid #d9dde3;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

:where(html.app-page--workspace) .workspace-commandbar-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 8px 16px;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(260px, 420px) auto;
  align-items: center;
  gap: 10px;
}

:where(html.app-page--workspace) body:not([data-active-tab="database"]) #portal-db-lock-bar {
  display: none !important;
}

:where(html.app-page--workspace) #team-modal,
:where(html.app-page--workspace) #run-modal {
  z-index: 6000;
}

:where(html.app-page--workspace) .ifc-parent-modal {
  position: fixed;
  inset: 0;
  z-index: 7000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.48);
}

:where(html.app-page--workspace) .ifc-parent-modal.hidden {
  display: none !important;
}

:where(html.app-page--workspace) .ifc-parent-modal-panel {
  display: grid;
  justify-items: center;
  gap: 14px;
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid #d8dee8;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  text-align: center;
}

:where(html.app-page--workspace) .ifc-parent-modal-panel h2 {
  margin: 0;
  color: #111827;
  font-size: 18px;
  line-height: 1.2;
}

:where(html.app-page--workspace) .ifc-parent-modal-panel p {
  min-height: 36px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

:where(html.app-page--workspace) .ifc-parent-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #d1d5db;
  border-top-color: #2563eb;
  border-radius: 999px;
  animation: ifc-parent-spin 700ms linear infinite;
}

:where(html.app-page--workspace) .ifc-parent-progress {
  position: relative;
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

:where(html.app-page--workspace) .ifc-parent-progress span {
  position: absolute;
  inset-block: 0;
  width: 40%;
  border-radius: inherit;
  background: #2563eb;
  animation: ifc-parent-progress 1100ms ease-in-out infinite;
}

:where(html.app-page--workspace) body.ifc-parent-modal-open {
  overflow: hidden;
}

@keyframes ifc-parent-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes ifc-parent-progress {
  0% {
    left: -40%;
  }

  100% {
    left: 100%;
  }
}

:where(html.app-page--workspace) .workspace-select-group {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

:where(html.app-page--workspace) .workspace-select-group label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

:where(html.app-page--workspace) .workspace-select-group select,
:where(html.app-page--workspace) .workspace-create-form input {
  width: 100%;
  min-width: 0;
}

:where(html.app-page--workspace) .workspace-create-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

:where(html.app-page--workspace) .workspace-command-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
}

:where(html.app-page--workspace) .team-toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--control-height) !important;
  min-width: var(--control-height);
  padding: 0 !important;
}

:where(html.app-page--workspace) .tabs-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-width: 0;
  gap: 8px;
  padding: 0 8px;
}

:where(html.app-page--workspace) .tab-btn {
  flex: 0 1 auto;
  min-width: 0;
  border-radius: 999px !important;
  padding: 0 14px !important;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
}

:where(html.app-page--workspace) .tab-btn.icon-button {
  flex: 0 0 var(--control-height);
  min-width: var(--control-height);
  padding: 0 !important;
}

:where(html.app-page--workspace) .tab-btn.active,
:where(html.app-page--workspace) .tab-btn[aria-selected="true"] {
  color: #ffffff;
  border-color: var(--accent);
  background: var(--accent);
}

:where(html.app-page--workspace) .tab-btn.active:hover,
:where(html.app-page--workspace) .tab-btn[aria-selected="true"]:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

:where(html.app-page--workspace) .tab-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
  animation: tab-fade 180ms ease;
}

:where(html.app-page--workspace) .tab-panel[hidden] {
  display: none;
}

:where(html.app-page--workspace) .database-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: min(78vh, 840px);
  min-height: 0;
  max-height: min(78vh, 840px);
  overflow: hidden;
  justify-self: stretch;
}

:where(html.app-page--workspace) #panel-database,
:where(html.app-page--workspace) #panel-ifc {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: clip;
}

:where(html.app-page--workspace) #panel-ifc {
  align-content: start;
  align-items: start;
}

:where(html.app-page--workspace) #panel-ifc .database-panel,
:where(html.app-page--workspace) #panel-ifc .workspace-db-frame {
  align-self: start;
}

:where(html.app-page--workspace) .database-panel.is-size-locked {
  width: var(--db-panel-width, 100%) !important;
  max-width: var(--db-panel-width, 100%) !important;
}

:where(html.app-page--workspace) .workspace-db-frame {
  display: block;
  position: static;
  inset: auto;
  z-index: auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
}

:where(html.app-page--workspace) body:not(.db-modal-open) .workspace-db-frame {
  position: static !important;
  inset: auto !important;
  z-index: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
}

:where(html.app-page--workspace) .workspace-db-frame.is-modal-open {
  position: fixed;
  inset: 0;
  z-index: 5000;
  width: 100%;
  height: 100%;
  background: transparent;
}

:where(html.app-page--workspace) body.db-modal-open {
  overflow-x: hidden;
  overflow-y: scroll;
}

@keyframes tab-fade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

:where(html.app-page--workspace) .card h2 {
  margin: 0 0 10px;
  font-size: 16px;
}

:where(html.app-page--workspace) .context-grid {
  display: grid;
  gap: 8px;
}

:where(html.app-page--workspace) .context-grid label {
  font-size: 13px;
  color: var(--muted);
}

:where(html.app-page--workspace) .context-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

:where(html.app-page--workspace) .context-actions {
  display: inline-flex;
  gap: 8px;
}

:where(html.app-page--workspace) .context-card .context-row,
:where(html.app-page--workspace) .context-card .create-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 168px;
  gap: 8px;
  align-items: center;
}

:where(html.app-page--workspace) .context-card .context-row select,
:where(html.app-page--workspace) .context-card .create-row input {
  width: 100%;
  min-width: 0;
}

:where(html.app-page--workspace) .context-card .context-actions {
  justify-content: stretch;
}

:where(html.app-page--workspace) .context-card .context-actions > button,
:where(html.app-page--workspace) .context-card #create-workspace-btn {
  width: 100%;
  justify-self: stretch;
}

:where(html.app-page--workspace) .create-form label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--muted);
}

:where(html.app-page--workspace) .create-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

:where(html.app-page--workspace) .create-row input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}

:where(html.app-page--workspace) .create-row button {
  flex: 0 0 auto;
  white-space: nowrap;
  padding-inline: 14px;
}

:where(html.app-page--workspace) .flows-panel,
:where(html.app-page--workspace) .dashboards-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
}

:where(html.app-page--workspace) .flows-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #dde2e9;
}

:where(html.app-page--workspace) .flows-header h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

:where(html.app-page--workspace) .flows-header-actions {
  display: inline-flex;
  gap: 8px;
}

:where(html.app-page--workspace) #import-flow-btn {
  min-width: 118px;
  white-space: nowrap;
}

:where(html.app-page--workspace) .flows-panel > .create-form,
:where(html.app-page--workspace) .dashboards-panel > .create-form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e7eb;
}

:where(html.app-page--workspace) .flows-panel > .create-form label,
:where(html.app-page--workspace) .dashboards-panel > .create-form label {
  margin-bottom: 0;
  font-weight: 600;
  white-space: nowrap;
}

:where(html.app-page--workspace) .flows-panel > .create-form .create-row,
:where(html.app-page--workspace) .dashboards-panel > .create-form .create-row {
  min-width: 0;
}

:where(html.app-page--workspace) .status {
  min-height: 20px;
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}

:where(html.app-page--workspace) .status.error {
  color: #b91c1c;
}

:where(html.app-page--workspace) .flows-list,
:where(html.app-page--workspace) .dashboards-list {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

:where(html.app-page--workspace) .flow-row,
:where(html.app-page--workspace) .dashboard-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  height: 76px;
  overflow: hidden;
  border: 1px solid #dcdce1;
  border-radius: 10px;
  background: #fcfcfd;
}

:where(html.app-page--workspace) .flow-meta {
  min-width: 0;
}

:where(html.app-page--workspace) .flow-title-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

:where(html.app-page--workspace) .flow-title {
  display: block;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

:where(html.app-page--workspace) .flow-meta span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

:where(html.app-page--workspace) .flow-actions {
  display: flex;
  gap: 8px;
}

:where(html.app-page--workspace) .workspace-team-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

:where(html.app-page--workspace) .workspace-team-grid > .card {
  height: 100%;
  min-height: 0;
}

:where(html.app-page--workspace) .team-card,
:where(html.app-page--workspace) .flows-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

:where(html.app-page--workspace) .team-card {
  max-height: min(52vh, 560px);
}

:where(html.app-page--workspace) .flows-card {
  max-height: min(72vh, 760px);
}

:where(html.app-page--workspace) .flows-panel,
:where(html.app-page--workspace) .dashboards-panel {
  max-height: min(76vh, 780px);
}

:where(html.app-page--workspace) .workspace-team-grid > .card + .card {
  margin-top: 0;
}

:where(html.app-page--workspace) .flows-list,
:where(html.app-page--workspace) .dashboards-list,
:where(html.app-page--workspace) .members-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
  align-content: start;
  grid-auto-rows: max-content;
}

:where(html.app-page--workspace) .empty {
  padding: 12px;
  border: 1px dashed #d2d2d7;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  background: #fafafb;
}

:where(html.app-page--workspace) .members-list {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

:where(html.app-page--workspace) .member-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  height: 76px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fcfdff;
}

:where(html.app-page--workspace) .member-row > div:first-child {
  min-width: 0;
}

:where(html.app-page--workspace) .member-row strong {
  display: block;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

:where(html.app-page--workspace) .member-row span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

:where(html.app-page--workspace) .member-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

:where(html.app-page--workspace) .member-role-select {
  min-width: 110px;
}

:where(html.app-page--workspace) .team-modal-panel {
  width: min(760px, calc(100vw - 24px));
  display: grid;
  gap: 12px;
}

:where(html.app-page--workspace) .team-modal-panel .modal-header h3 {
  margin: 0;
  font-size: 16px;
}

:where(html.app-page--workspace) .team-member-form {
  padding-top: 2px;
}

:where(html.app-page--workspace) .team-member-form .create-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px auto;
  gap: 8px;
}

:where(html.app-page--workspace) .team-modal-panel .members-list {
  max-height: min(52vh, 460px);
  overflow: auto;
}

:where(html.app-page--workspace) .user-info-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

:where(html.app-page--workspace) .user-info-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: start;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fcfdff;
}

:where(html.app-page--workspace) .user-info-row dt {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

:where(html.app-page--workspace) .user-info-row dd {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  word-break: break-word;
}

:where(html.app-page--workspace) .email-change-panel,
:where(html.app-page--workspace) .openai-key-panel {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

:where(html.app-page--workspace) .email-change-panel h3,
:where(html.app-page--workspace) .openai-key-panel h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

:where(html.app-page--workspace) .email-change-form,
:where(html.app-page--workspace) .openai-key-form {
  display: grid;
  gap: 8px;
}

:where(html.app-page--workspace) .email-change-form + .email-change-form {
  margin-top: 10px;
}

:where(html.app-page--workspace) .email-change-form.hidden {
  display: none;
}

:where(html.app-page--workspace) .email-change-form label,
:where(html.app-page--workspace) .openai-key-form label {
  font-size: 13px;
  color: var(--muted);
}

:where(html.app-page--workspace) .openai-key-current {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
}

:where(html.app-page--workspace) .openai-key-current span {
  color: var(--muted);
}

:where(html.app-page--workspace) .openai-key-current strong {
  min-width: 0;
  color: var(--ink);
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  word-break: break-word;
}

:where(html.app-page--workspace) .run-slider-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

:where(html.app-page--workspace) .run-slider-row input[type="range"] {
  min-width: 0;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
}

:where(html.app-page--workspace) .run-slider-output {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid #d2d2d7;
  border-radius: 999px;
  background: #ffffff;
  color: #1d1d1f;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

:where(html.app-page--workspace) .email-change-row,
:where(html.app-page--workspace) .openai-key-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 8px;
  align-items: center;
}

:where(html.app-page--workspace) .openai-key-row {
  grid-template-columns: minmax(0, 1fr) 112px 92px;
}

:where(html.app-page--workspace) .email-change-verify-row {
  grid-template-columns: minmax(120px, 1fr) 144px 92px;
}

:where(html.app-page--workspace) .email-change-row input,
:where(html.app-page--workspace) .openai-key-row input {
  width: 100%;
  min-width: 0;
}

:where(html.app-page--workspace) .admin-registration-options-panel,
:where(html.app-page--workspace) .admin-users-panel {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

:where(html.app-page--workspace) .admin-registration-options-panel h3,
:where(html.app-page--workspace) .admin-users-panel h3 {
  margin: 0;
  font-size: 14px;
}

:where(html.app-page--workspace) .admin-registration-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

:where(html.app-page--workspace) .admin-registration-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #0071e3;
}

:where(html.app-page--workspace) .admin-users-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

:where(html.app-page--workspace) .admin-user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fcfdff;
}

:where(html.app-page--workspace) .admin-user-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

:where(html.app-page--workspace) .admin-role-select {
  min-width: 132px;
}

:where(html.app-page--workspace) .admin-subscription-select {
  min-width: 118px;
}

:where(html.app-page--workspace) .admin-user-meta strong {
  display: block;
  font-size: 13px;
}

:where(html.app-page--workspace) .admin-user-meta span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

:where(html.app-page--workspace) .admin-user-meta .admin-user-counts,
:where(html.app-page--workspace) .admin-user-meta .admin-user-storage {
  color: #334155;
  font-weight: 600;
}

:where(html.app-page--workspace) .modal-subtitle {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

:where(html.app-page--workspace) #run-modal .modal-panel {
  width: min(720px, calc(100vw - 24px));
  display: grid;
  gap: 10px;
}

:where(html.app-page--workspace) #run-modal .modal-subtitle {
  margin: 0;
}

:where(html.app-page--workspace) .run-form {
  display: grid;
  gap: 10px;
}

:where(html.app-page--workspace) .run-inputs {
  display: grid;
  gap: 10px;
}

:where(html.app-page--workspace) .run-input {
  display: grid;
  gap: 6px;
}

:where(html.app-page--workspace) .run-input label {
  font-size: 13px;
  color: var(--muted);
}

:where(html.app-page--workspace) .run-section {
  display: grid;
  gap: 8px;
}

:where(html.app-page--workspace) .run-section-title {
  margin: 0;
  font-size: 13px;
  color: #1f2937;
}

:where(html.app-page--workspace) .run-input textarea {
  width: 100%;
  min-height: 70px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

:where(html.app-page--workspace) .run-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

:where(html.app-page--workspace) .run-actions {
  display: flex;
  justify-content: flex-end;
}

:where(html.app-page--workspace) .run-result {
  margin: 12px 0 0;
  padding: 10px;
  min-height: 140px;
  max-height: min(32vh, 260px);
  overflow: auto;
  border-radius: 10px;
  border: 1px solid #dde2e9;
  background: #f8fafc;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

:where(html.app-page--workspace) #run-modal.is-running .run-result {
  border-color: #bfdbfe;
  background: #eff6ff;
}

@media (max-width: 980px) {
  :where(html.app-page--workspace) .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  :where(html.app-page--workspace) .tabs-nav {
    order: 3;
    flex: 1 0 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    padding: 0;
  }

  :where(html.app-page--workspace) .topbar-actions {
    margin-left: auto;
  }

  :where(html.app-page--workspace) .workspace-commandbar-inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  :where(html.app-page--workspace) .workspace-select-group {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-column: 1 / -1;
  }

  :where(html.app-page--workspace) .workspace-create-form {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  :where(html.app-page--workspace) .workspace-command-actions {
    justify-self: end;
  }

  :where(html.app-page--workspace) .create-row {
    flex-direction: column;
  }

  :where(html.app-page--workspace) .context-card .context-row,
:where(html.app-page--workspace) .context-card .create-row {
    grid-template-columns: 1fr;
  }

  :where(html.app-page--workspace) .context-card .context-actions > button,
:where(html.app-page--workspace) .context-card #create-workspace-btn {
    width: 100%;
  }

  :where(html.app-page--workspace) .workspace-team-grid {
    grid-template-columns: 1fr;
  }

  :where(html.app-page--workspace) .team-card,
:where(html.app-page--workspace) .flows-card {
    max-height: none;
  }

  :where(html.app-page--workspace) .flows-panel,
:where(html.app-page--workspace) .dashboards-panel {
    max-height: none;
  }

  :where(html.app-page--workspace) .flows-panel > .create-form,
:where(html.app-page--workspace) .dashboards-panel > .create-form {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  :where(html.app-page--workspace) .flows-panel > .create-form .create-row button,
:where(html.app-page--workspace) .dashboards-panel > .create-form .create-row button,
:where(html.app-page--workspace) .workspace-create-form button,
:where(html.app-page--workspace) .workspace-command-actions button:not(.team-toolbar-btn) {
    width: 100%;
  }

  :where(html.app-page--workspace) .flows-list,
:where(html.app-page--workspace) .dashboards-list,
:where(html.app-page--workspace) .members-list {
    overflow: visible;
  }

  :where(html.app-page--workspace) .context-actions {
    flex-wrap: wrap;
  }

  :where(html.app-page--workspace) .flow-row,
:where(html.app-page--workspace) .dashboard-row {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  :where(html.app-page--workspace) .flow-actions {
    justify-content: flex-end;
  }

  :where(html.app-page--workspace) .user-info-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  :where(html.app-page--workspace) .email-change-row,
:where(html.app-page--workspace) .email-change-verify-row,
:where(html.app-page--workspace) .openai-key-row {
    grid-template-columns: 1fr;
  }

  :where(html.app-page--workspace) .email-change-row button,
:where(html.app-page--workspace) .openai-key-row button {
    width: 100%;
  }

  :where(html.app-page--workspace) .openai-key-current {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  :where(html.app-page--workspace) .admin-user-row {
    grid-template-columns: 1fr;
  }

  :where(html.app-page--workspace) .admin-user-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  :where(html.app-page--workspace) .workspace-commandbar-inner {
    grid-template-columns: 1fr;
  }

  :where(html.app-page--workspace) .workspace-select-group,
:where(html.app-page--workspace) .workspace-create-form {
    grid-template-columns: 1fr;
  }

  :where(html.app-page--workspace) .workspace-command-actions {
    justify-self: stretch;
  }

  :where(html.app-page--workspace) .workspace-command-actions button:not(.team-toolbar-btn) {
    flex: 1 1 auto;
  }

  :where(html.app-page--workspace) .team-toolbar-btn {
    flex: 0 0 var(--control-height);
  }

  :where(html.app-page--workspace) .flows-header {
    align-items: stretch;
    flex-direction: column;
  }

  :where(html.app-page--workspace) .flows-header-actions {
    justify-content: flex-start;
  }

  :where(html.app-page--workspace) .team-member-form .create-row {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   4. Workspace database configuration
   ========================================================================== */

:where(html.app-page--database) body {
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

:where(html.app-page--database) body.embedded {
  grid-template-rows: minmax(0, 1fr);
  background: transparent;
  overflow: hidden;
}

:where(html.app-page--database) body.embedded #auth-topbar {
  display: none;
}

:where(html.app-page--database) body.embedded #db-lock-bar {
  display: none;
}

:where(html.app-page--database) .utility-page-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}

:where(html.app-page--database) body.embedded.embedded-modal-open main {
  visibility: hidden;
}

:where(html.app-page--database) body.embedded.embedded-modal-open .modal {
  visibility: visible;
}

:where(html.app-page--database) .tables-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  justify-self: stretch;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  align-content: start;
  grid-auto-rows: max-content;
  padding-right: 2px;
  box-sizing: border-box;
}

:where(html.app-page--database) .table-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 76px;
  padding: 10px 12px;
  overflow: hidden;
  box-sizing: border-box;
  border: 1px solid #dcdce1;
  border-radius: 10px;
  background: #fcfcfd;
}

:where(html.app-page--database) .table-row-meta {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

:where(html.app-page--database) .table-row-name {
  display: block;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

:where(html.app-page--database) .table-row-sub {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

:where(html.app-page--database) .table-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

:where(html.app-page--database) .edit-table,
:where(html.app-page--database) .delete-table {
  white-space: nowrap;
}

:where(html.app-page--database) .edit-table {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

:where(html.app-page--database) .rows-grid input:focus {
  outline: 0;
  border-color: #0071e3;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.18);
}

:where(html.app-page--database) .columns {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}

:where(html.app-page--database) .column-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr auto auto auto auto 1fr auto;
  gap: 5px;
  align-items: center;
  padding: 6px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fcfcfd;
}

:where(html.app-page--database) .column-row label {
  display: flex;
  align-items: center;
  gap: 4px;
  width: auto;
  font-weight: 500;
  font-size: 12px;
  color: #515154;
}

:where(html.app-page--database) .column-row input,
:where(html.app-page--database) .column-row select,
:where(html.app-page--database) .column-row button {
  margin-top: 0;
  height: 30px;
}

:where(html.app-page--database) .column-row .col-type {
  font-size: 12px;
  line-height: 1.1;
  padding: 2px 6px;
}

:where(html.app-page--database) .column-row label input {
  margin: 0;
  width: 14px;
  height: 14px;
}

:where(html.app-page--database) #status {
  margin: 8px 0 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: hidden;
  min-height: 20px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: 0;
  padding: 0;
  font-size: 13px;
}

:where(html.app-page--database) .data-manager {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

:where(html.app-page--database) .data-manager h3 {
  margin: 0;
  font-size: 14px;
}

:where(html.app-page--database) .data-manager-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

:where(html.app-page--database) .data-manager-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

:where(html.app-page--database) .data-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

:where(html.app-page--database) .data-controls label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 600;
}

:where(html.app-page--database) .data-controls select {
  margin-top: 0;
  min-width: 220px;
  height: 32px;
  padding: 4px 8px;
}

:where(html.app-page--database) .data-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 12px;
}

:where(html.app-page--database) .rows-grid {
  max-height: min(36vh, 360px);
  overflow: auto;
}

:where(html.app-page--database) .rows-grid table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

:where(html.app-page--database) .rows-grid th,
:where(html.app-page--database) .rows-grid td {
  border: 1px solid var(--line);
  padding: 4px 6px;
  text-align: left;
  vertical-align: middle;
  line-height: 1.2;
}

:where(html.app-page--database) .rows-grid th.actions-col,
:where(html.app-page--database) .rows-grid td.actions-col {
  width: 32px;
  min-width: 32px;
  max-width: 32px;
  padding: 2px;
  text-align: center;
}

:where(html.app-page--database) .rows-grid th:first-child,
:where(html.app-page--database) .rows-grid td:first-child {
  width: 5vw;
  min-width: 56px;
  max-width: 120px;
}

:where(html.app-page--database) .rows-grid th {
  background: #f5f5f7;
  font-size: 12px;
  color: #515154;
}

:where(html.app-page--database) .rows-grid input {
  width: 100%;
  border-radius: 999px;
  padding: 4px 6px;
  height: 28px;
  margin: 0;
}

:where(html.app-page--database) .rows-grid td.boolean-cell {
  text-align: center;
}

:where(html.app-page--database) .rows-grid input.row-bool {
  width: 16px;
  height: 16px;
  padding: 0;
  margin: 0;
}

:where(html.app-page--database) .rows-grid .row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
}

:where(html.app-page--database) .rows-grid .row-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

:where(html.app-page--database) .rows-grid .row-actions .delete-row-btn {
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  font-size: 15px;
  line-height: 1;
}

:where(html.app-page--database) .rows-grid button[data-action="save"] {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

:where(html.app-page--database) .rows-grid button[data-action="save"]:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

:where(html.app-page--database) .rows-grid .empty-note {
  background: #f5f5f7;
  color: #1d1d1f;
  border: 1px solid #d2d2d7;
  border-radius: 12px;
  padding: 10px;
}

:where(html.app-page--database) .empty {
  padding: 12px;
  border: 1px dashed #d2d2d7;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  background: #fafafb;
}

:where(html.app-page--database) .tables-list .empty {
  align-self: start;
}

:where(html.app-page--database) .modal {
  z-index: 3000;
}

:where(html.app-page--database) .modal-panel {
  width: min(520px, calc(100vw - 20px));
  max-height: none;
}

:where(html.app-page--database) .table-edit-panel {
  width: min(1040px, calc(100vw - 20px));
  max-height: min(92vh, 900px);
  display: grid;
  gap: 12px;
}

:where(html.app-page--database) #table-edit-modal.is-new .data-manager {
  display: none;
}

:where(html.app-page--database) .table-edit-form {
  gap: 12px;
}

:where(html.app-page--database) .table-edit-section {
  display: grid;
  gap: 10px;
}

:where(html.app-page--database) .table-edit-columns-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

:where(html.app-page--database) .table-edit-columns-header h3 {
  margin: 0;
  font-size: 14px;
}

:where(html.app-page--database) .table-edit-columns-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

:where(html.app-page--database) .table-edit-columns {
  display: grid;
  gap: 8px;
  max-height: min(30vh, 320px);
  overflow: auto;
  padding-right: 2px;
}

:where(html.app-page--database) .modal-form {
  display: grid;
  gap: 9px;
}

:where(html.app-page--database) .modal-form label {
  font-weight: 600;
  color: #111827;
}

@media (max-width: 1000px) {
  :where(html.app-page--database) .data-manager-header {
    flex-direction: column;
    align-items: flex-start;
  }

  :where(html.app-page--database) .data-manager-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  :where(html.app-page--database) .column-row {
    grid-template-columns: 1fr;
  }

  :where(html.app-page--database) .table-row {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  :where(html.app-page--database) .table-row-actions {
    justify-content: flex-end;
  }
}

/* ==========================================================================
   5. Workspace IFC configuration
   ========================================================================== */

:where(html.app-page--ifc) body {
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

:where(html.app-page--ifc) body.embedded {
  grid-template-rows: minmax(0, 1fr);
  align-items: start;
  background: transparent;
  overflow: hidden;
}

:where(html.app-page--ifc) body.embedded #auth-topbar {
  display: none;
}

:where(html.app-page--ifc) .ifc-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #d1d5db;
  border-top-color: #2563eb;
  border-radius: 999px;
  animation: ifc-spin 700ms linear infinite;
}

@keyframes ifc-spin {
  to {
    transform: rotate(360deg);
  }
}

:where(html.app-page--ifc) .ifc-modal-open {
  overflow: hidden;
}

:where(html.app-page--ifc) .ifc-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
}

:where(html.app-page--ifc) .ifc-modal-panel {
  display: grid;
  justify-items: center;
  gap: 14px;
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid #d8dee8;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  text-align: center;
}

:where(html.app-page--ifc) .ifc-modal-panel h2 {
  margin: 0;
  color: #111827;
  font-size: 18px;
  line-height: 1.2;
}

:where(html.app-page--ifc) .ifc-modal-panel p {
  min-height: 36px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

:where(html.app-page--ifc) .ifc-spinner-large {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

:where(html.app-page--ifc) .ifc-progress {
  position: relative;
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

:where(html.app-page--ifc) .ifc-progress span {
  position: absolute;
  inset-block: 0;
  width: 40%;
  border-radius: inherit;
  background: #2563eb;
  animation: ifc-progress 1100ms ease-in-out infinite;
}

@keyframes ifc-progress {
  0% {
    left: -40%;
  }

  100% {
    left: 100%;
  }
}

:where(html.app-page--ifc) .status {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 20px;
  margin: 0;
  padding: 0;
  overflow-wrap: anywhere;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  white-space: pre-wrap;
}

:where(html.app-page--ifc) .status.error {
  color: #991b1b;
}

:where(html.app-page--ifc) .ifc-model-list {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  align-content: start;
}

:where(html.app-page--ifc) .ifc-model-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.75fr) minmax(0, 2fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 76px;
  padding: 10px 12px;
  overflow: hidden;
  box-sizing: border-box;
  border: 1px solid #dcdce1;
  border-radius: 10px;
  background: #fcfcfd;
}

:where(html.app-page--ifc) .ifc-model-meta {
  min-width: 0;
  overflow: hidden;
}

:where(html.app-page--ifc) .ifc-model-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #111827;
  font-size: 14px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:where(html.app-page--ifc) .ifc-model-sub {
  display: block;
  min-width: 0;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:where(html.app-page--ifc) .ifc-properties-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(62px, 1fr));
  align-items: center;
  gap: 6px;
  min-width: 0;
}

:where(html.app-page--ifc) .ifc-property {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 5px 6px;
  border-left: 1px solid #e5e7eb;
}

:where(html.app-page--ifc) .ifc-property strong,
:where(html.app-page--ifc) .ifc-property span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:where(html.app-page--ifc) .ifc-property strong {
  color: #111827;
  font-size: 15px;
  line-height: 1.1;
}

:where(html.app-page--ifc) .ifc-property span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

:where(html.app-page--ifc) .ifc-model-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

:where(html.app-page--ifc) .empty {
  padding: 12px;
  border: 1px dashed #d2d2d7;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  background: #fafafb;
}

@media (max-width: 1000px) {

  :where(html.app-page--ifc) .ifc-model-row {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  :where(html.app-page--ifc) .ifc-properties-row {
    grid-template-columns: repeat(7, minmax(56px, 1fr));
    overflow-x: auto;
  }

  :where(html.app-page--ifc) .ifc-model-actions {
    justify-content: flex-end;
  }
}

/* ==========================================================================
   6. Dashboard designer
   ========================================================================== */

:where(html.app-page--dashboard) body {
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

:where(html.app-page--dashboard) body.dashboard-readonly .entity-title-edit,
:where(html.app-page--dashboard) body.dashboard-readonly #save-dashboard,
:where(html.app-page--dashboard) body.dashboard-readonly #save-close-dashboard,
:where(html.app-page--dashboard) body.dashboard-readonly .add-chart-btn,
:where(html.app-page--dashboard) body.dashboard-readonly .layout-toggle,
:where(html.app-page--dashboard) body.dashboard-readonly .dashboard-card-delete,
:where(html.app-page--dashboard) body.dashboard-readonly .dashboard-card-duplicate,
:where(html.app-page--dashboard) body.dashboard-readonly .dashboard-link-handle,
:where(html.app-page--dashboard) body.dashboard-readonly .dashboard-edge-hit,
:where(html.app-page--dashboard) body.dashboard-readonly .resize-handle {
  display: none !important;
}

:where(html.app-page--dashboard) .dashboard-toolbar {
  position: relative;
  z-index: 2000;
}

:where(html.app-page--dashboard) .chart-toolbar {
  overflow-x: auto;
  scrollbar-width: thin;
}

:where(html.app-page--dashboard) .add-chart-btn {
  cursor: pointer;
}

:where(html.app-page--dashboard) .add-chart-btn:active {
  cursor: pointer;
}

:where(html.app-page--dashboard) #dashboard-canvas-wrapper {
  position: relative;
  margin: 10px 14px 14px;
  border: 1px solid #d2d2d7;
  border-style: dashed;
  border-radius: 18px;
  min-height: 0;
  align-self: stretch;
  overflow: hidden;
  background: #f2f4f7;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.08);
}

:where(html.app-page--dashboard) #dashboard-canvas-wrapper.dashboard-grid-enabled::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(0, 113, 227, 0.18) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 113, 227, 0.18) 1px, transparent 1px);
  background-size:
    var(--dashboard-grid-size, 24px) var(--dashboard-grid-size, 24px),
    var(--dashboard-grid-size, 24px) var(--dashboard-grid-size, 24px);
  background-position:
    var(--dashboard-grid-offset-x, 0px) var(--dashboard-grid-offset-y, 0px),
    var(--dashboard-grid-offset-x, 0px) var(--dashboard-grid-offset-y, 0px);
}

:where(html.app-page--dashboard) #dashboard-canvas-wrapper.can-pan {
  cursor: grab;
}

:where(html.app-page--dashboard) #dashboard-canvas-wrapper.is-panning {
  cursor: grabbing;
  user-select: none;
}

:where(html.app-page--dashboard) .lane-guides {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

:where(html.app-page--dashboard) .lane {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

:where(html.app-page--dashboard) .lane-canvas {
  background: #e9ecef;
  width: 100%;
  height: 100%;
}

:where(html.app-page--dashboard) .lane span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  font-size: clamp(26px, 4vw, 56px);
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #ced4da;
  user-select: none;
}

:where(html.app-page--dashboard) #dashboard-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 72vh;
  z-index: 10;
  transform-origin: 0 0;
}

:where(html.app-page--dashboard) #dashboard-edge-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: visible;
  pointer-events: none;
}

:where(html.app-page--dashboard) .dashboard-edge {
  fill: none;
  stroke: #4b5563;
  stroke-width: 3;
  stroke-linecap: round;
  pointer-events: none;
}

:where(html.app-page--dashboard) .dashboard-edge-pending {
  stroke: #6c757d;
  stroke-dasharray: 8 6;
}

:where(html.app-page--dashboard) .dashboard-edge-hit {
  fill: none;
  stroke: rgba(0, 0, 0, 0);
  stroke-width: 14;
  stroke-linecap: round;
  cursor: pointer;
  pointer-events: stroke;
}

:where(html.app-page--dashboard) .dashboard-edge-group:hover .dashboard-edge {
  stroke: #dc2626;
  stroke-width: 4;
}

:where(html.app-page--dashboard) .dashboard-run-timer {
  position: absolute;
  right: 12px;
  bottom: 160px;
  z-index: 21;
  min-width: 158px;
  padding: 6px 10px;
  border: 1px solid #c7c7cc;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: rgba(99, 99, 99, 0.14) 0px 2px 8px 0px;
  color: #515154;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  backdrop-filter: blur(3px);
}

:where(html.app-page--dashboard) .dashboard-run-timer.is-running {
  color: #0f5132;
  border-color: #9fd8b4;
  background: rgba(236, 253, 245, 0.96);
}

:where(html.app-page--dashboard) #dashboard-minimap {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 220px;
  height: 140px;
  z-index: 20;
  border: 1px solid #c7c7cc;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(3px);
  overflow: hidden;
  box-shadow: rgba(99, 99, 99, 0.18) 0px 2px 8px 0px;
}

:where(html.app-page--dashboard) #dashboard-minimap-layer {
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
}

:where(html.app-page--dashboard) #dashboard-minimap-viewport {
  position: absolute;
  border: 2px solid #0071e3;
  background: rgba(0, 113, 227, 0.12);
  pointer-events: none;
  border-radius: 4px;
}

:where(html.app-page--dashboard) .dashboard-card {
  position: absolute;
  width: 420px;
  min-width: 300px;
  min-height: 260px;
  border-radius: 16px;
  border: 1px solid #d2d2d7;
  background: #ffffff;
  color: #1d1d1f;
  box-shadow: rgba(0, 0, 0, 0.19) 0px 10px 20px, rgba(0, 0, 0, 0.23) 0px 6px 6px;
  overflow: visible;
}

:where(html.app-page--dashboard) .dashboard-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: #ffffff;
}

:where(html.app-page--dashboard) .dashboard-link-handle {
  position: absolute;
  top: 50%;
  z-index: 8;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55);
  cursor: crosshair;
}

:where(html.app-page--dashboard) .dashboard-link-handle:hover,
:where(html.app-page--dashboard) .dashboard-link-handle.is-linked {
  color: var(--dashboard-link-handle-on);
  box-shadow: 0 0 0 1px currentColor, 0 0 8px currentColor;
}

:where(html.app-page--dashboard) .dashboard-link-in {
  left: 0;
  --dashboard-link-handle-on: #22e6b2;
  color: #129b7f;
  transform: translate(-50%, -50%);
}

:where(html.app-page--dashboard) .dashboard-link-out {
  right: 0;
  --dashboard-link-handle-on: #ff5563;
  color: #c93644;
  transform: translate(50%, -50%);
}

:where(html.app-page--dashboard) .dashboard-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 10px 12px;
  border-radius: 16px 16px 0 0;
  border-bottom: 1px solid #e5e5ea;
  color: #1d1d1f;
  font-weight: 600;
  background: #ffffff;
}

:where(html.app-page--dashboard) .dashboard-card-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: move;
  user-select: none;
}

:where(html.app-page--dashboard) .dashboard-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

:where(html.app-page--dashboard) .dashboard-card-actions button {
  width: 24px !important;
  min-width: 24px !important;
  height: 24px !important;
  min-height: 24px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  font-size: 11px;
  line-height: 1;
}

:where(html.app-page--dashboard) .dashboard-action-icon {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:where(html.app-page--dashboard) .dashboard-card-duplicate {
  font-size: 15px !important;
}

:where(html.app-page--dashboard) .dashboard-card-body {
  height: calc(100% - 44px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  padding: 10px 12px 12px;
  border-radius: 0 0 16px 16px;
  background: #ffffff;
  overflow: hidden;
}

:where(html.app-page--dashboard) .dashboard-card-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

:where(html.app-page--dashboard) .dashboard-card-controls select {
  width: 100%;
  min-width: 0;
}

:where(html.app-page--dashboard) .dashboard-card-state {
  min-width: 76px;
  max-width: 116px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #6e6e73;
  font-size: 12px;
  font-weight: 600;
  text-align: right;
}

:where(html.app-page--dashboard) .chart-surface {
  min-width: 0;
  min-height: 0;
  border: 1px solid #e5e5ea;
  border-radius: 10px;
  background: #fbfcfd;
  overflow: hidden;
}

:where(html.app-page--dashboard) .dashboard-card-geometry,
:where(html.app-page--dashboard) .dashboard-card-geometry::before,
:where(html.app-page--dashboard) .dashboard-card-geometry .dashboard-card-header,
:where(html.app-page--dashboard) .dashboard-card-geometry .dashboard-card-body {
  border-color: #285f9f;
  background: #173b67;
  color: #f7fbff;
}

:where(html.app-page--dashboard) .dashboard-card-geometry .dashboard-card-header {
  border-bottom-color: #3977bb;
}

:where(html.app-page--dashboard) .dashboard-card-geometry .dashboard-card-state {
  color: #dcecff;
}

:where(html.app-page--dashboard) .dashboard-card-geometry .chart-surface {
  border-color: #a9c7eb;
  background: #e1eaed;
}

:where(html.app-page--workspace) .studio-launch-link {
  border-color: #b9cce2;
  background: #edf5ff;
  color: #174f87;
}

:where(html.app-page--workspace) .studio-launch-link:hover {
  border-color: #8fb2d7;
  background: #ffffff;
}

/* ==========================================================================
   8. Scenario Studio (end-user sequence composer)
   ========================================================================== */

:where(html.app-page--studio) {
  --studio-navy: #17253b;
  --studio-navy-soft: #253653;
  --studio-canvas: #eef2f6;
  --studio-green: #168568;
  --studio-green-soft: #e6f5f0;
  --studio-amber: #b26a12;
  --studio-amber-soft: #fff4df;
  --studio-violet: #7554c6;
  --studio-violet-soft: #f1edff;
}

:where(html.app-page--studio) body {
  height: 100vh;
  min-height: 680px;
  overflow: hidden;
  background: var(--studio-canvas);
}

:where(html.app-page--studio.studio-modal-open) body {
  overflow: hidden !important;
}

:where(html.app-page--studio) .studio-topbar {
  position: relative;
  z-index: 20;
  height: 62px;
  min-height: 62px;
  padding-inline: 16px;
  border-bottom-color: #d8e0e8;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 12px rgba(23, 37, 59, 0.06);
}

:where(html.app-page--studio) .studio-brand {
  color: inherit;
  text-decoration: none;
}

:where(html.app-page--studio) .studio-brand > span {
  display: grid;
  gap: 1px;
}

:where(html.app-page--studio) .studio-brand strong {
  font-size: 13px;
  letter-spacing: 0.055em;
}

:where(html.app-page--studio) .studio-brand small {
  color: #64748b;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

:where(html.app-page--studio) .studio-mode-switch {
  position: absolute;
  left: 50%;
  display: inline-grid;
  grid-template-columns: repeat(2, auto);
  gap: 3px;
  padding: 3px;
  border: 1px solid #d9e0e7;
  border-radius: 12px;
  background: #f2f5f8;
  transform: translateX(-50%);
}

:where(html.app-page--studio) .studio-mode-switch :is(a, span) {
  min-width: 62px;
  padding: 6px 12px;
  border-radius: 8px;
  color: #5f6d7e;
  font-size: 12px;
  font-weight: 750;
  text-align: center;
  text-decoration: none;
}

:where(html.app-page--studio) .studio-mode-switch .active {
  background: #ffffff;
  color: var(--studio-navy);
  box-shadow: 0 1px 5px rgba(23, 37, 59, 0.12);
}

:where(html.app-page--studio) .studio-workspace-picker {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #64748b;
  font-size: 11px;
  font-weight: 650;
}

:where(html.app-page--studio) .studio-workspace-picker select {
  width: 170px;
  background: #f8fafc;
  font-size: 12px;
}

:where(html.app-page--studio) .studio-shell {
  --studio-library-width: 264px;
  display: grid;
  grid-template-columns: var(--studio-library-width) minmax(0, 1fr);
  height: calc(100vh - 62px);
  min-height: 0;
  overflow: hidden;
  transition: grid-template-columns 180ms ease;
}

:where(html.app-page--studio) .studio-shell.is-library-collapsed {
  --studio-library-width: 68px;
}

:where(html.app-page--studio) :is(.studio-sidebar, .studio-inspector) {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #ffffff;
}

:where(html.app-page--studio) .studio-inspector[hidden] {
  display: none !important;
}

:where(html.app-page--studio) .studio-sidebar {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 16px 14px;
  border-right: 1px solid #dce3ea;
}

:where(html.app-page--studio) .studio-sidebar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

:where(html.app-page--studio) .studio-library-toggle .ui-icon {
  transition: transform 180ms ease;
}

:where(html.app-page--studio) .studio-shell:not(.is-library-collapsed) .studio-library-toggle .ui-icon {
  transform: rotate(180deg);
}

:where(html.app-page--studio) .studio-library-content {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
  min-width: 0;
  min-height: 0;
}

:where(html.app-page--studio) .studio-library-rail-label {
  display: none;
}

:where(html.app-page--studio) .studio-shell.is-library-collapsed .studio-sidebar {
  gap: 10px;
  padding: 12px 8px;
}

:where(html.app-page--studio) .studio-shell.is-library-collapsed .studio-sidebar .studio-pane-header {
  justify-content: center;
}

:where(html.app-page--studio) .studio-shell.is-library-collapsed .studio-sidebar .studio-pane-header > div:first-child,
:where(html.app-page--studio) .studio-shell.is-library-collapsed .studio-library-content {
  display: none;
}

:where(html.app-page--studio) .studio-shell.is-library-collapsed .studio-sidebar-actions {
  flex-direction: column;
}

:where(html.app-page--studio) .studio-shell.is-library-collapsed .studio-library-rail-label {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  color: #738197;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

:where(html.app-page--studio) .studio-inspector {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-left: 1px solid #dce3ea;
}

:where(html.app-page--studio) .studio-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

:where(html.app-page--studio) .studio-pane-header h2 {
  margin: 2px 0 0;
  color: var(--studio-navy);
  font-size: 17px;
  line-height: 1.2;
}

:where(html.app-page--studio) .studio-eyebrow {
  display: block;
  color: #7b899b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.095em;
  line-height: 1.2;
  text-transform: uppercase;
}

:where(html.app-page--studio) .studio-new-sequence {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid #cbdcf0;
  border-radius: 12px;
  background: #f5f9ff;
}

:where(html.app-page--studio) .studio-new-sequence label {
  color: #526174;
  font-size: 11px;
  font-weight: 700;
}

:where(html.app-page--studio) .studio-new-sequence > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

:where(html.app-page--studio) .studio-search {
  position: relative;
  display: flex;
  align-items: center;
}

:where(html.app-page--studio) .studio-search .ui-icon {
  position: absolute;
  left: 10px;
  z-index: 1;
  width: 14px;
  height: 14px;
  color: #7c8b9e;
  pointer-events: none;
}

:where(html.app-page--studio) .studio-search input {
  padding-left: 32px;
  background: #f7f9fb;
  font-size: 12px;
}

:where(html.app-page--studio) .studio-sequence-list {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

:where(html.app-page--studio) .studio-sequence-item {
  position: relative;
  display: grid;
  gap: 5px;
  width: 100%;
  height: auto !important;
  min-height: 66px !important;
  padding: 10px 11px !important;
  border: 1px solid transparent;
  border-radius: 11px !important;
  background: transparent;
  color: #344256;
  text-align: left;
}

:where(html.app-page--studio) .studio-sequence-item:hover {
  border-color: #dce4ec;
  background: #f7f9fb;
}

:where(html.app-page--studio) .studio-sequence-item.active {
  border-color: #a9c8ec;
  background: #edf5ff;
  color: #173f70;
  box-shadow: inset 3px 0 0 var(--accent);
}

:where(html.app-page--studio) .studio-sequence-item strong {
  width: 100%;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:where(html.app-page--studio) .studio-sequence-item span {
  color: #7a8797;
  font-size: 10px;
  font-weight: 550;
}

:where(html.app-page--studio) .studio-sidebar-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  padding: 10px;
  border: 1px solid #dfe6ed;
  border-radius: 11px;
  background: #f8fafc;
}

:where(html.app-page--studio) .studio-note-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #e1ebf7;
  color: #365477;
  font-size: 11px;
  font-weight: 800;
}

:where(html.app-page--studio) .studio-sidebar-note strong {
  display: block;
  color: #3c4b5e;
  font-size: 11px;
}

:where(html.app-page--studio) .studio-sidebar-note p {
  margin: 3px 0 0;
  color: #748193;
  font-size: 10px;
  line-height: 1.45;
}

:where(html.app-page--studio) .studio-main {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  min-height: 0;
  padding: 16px;
  overflow: hidden;
}

:where(html.app-page--studio) .studio-composer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

:where(html.app-page--studio) .studio-composer-copy {
  flex: 1 1 auto;
  min-width: 0;
}

:where(html.app-page--studio) .studio-title-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 2px;
}

:where(html.app-page--studio) .studio-title-input {
  width: min(520px, 100%);
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 !important;
  border-color: transparent !important;
  border-radius: 5px !important;
  background: transparent !important;
  color: var(--studio-navy) !important;
  font-size: 21px !important;
  font-weight: 780 !important;
  box-shadow: none !important;
}

:where(html.app-page--studio) .studio-title-input:not(:disabled):hover,
:where(html.app-page--studio) .studio-title-input:not(:disabled):focus {
  padding-inline: 7px !important;
  border-color: #b9cce2 !important;
  background: rgba(255, 255, 255, 0.72) !important;
}

:where(html.app-page--studio) .studio-description-input {
  width: min(680px, 100%);
  height: 27px !important;
  min-height: 27px !important;
  margin-top: 1px;
  padding: 0 !important;
  border-color: transparent !important;
  border-radius: 5px !important;
  background: transparent !important;
  color: #68778a !important;
  font-size: 12px !important;
  box-shadow: none !important;
}

:where(html.app-page--studio) .studio-description-input:not(:disabled):hover,
:where(html.app-page--studio) .studio-description-input:not(:disabled):focus {
  padding-inline: 7px !important;
  border-color: #c7d5e4 !important;
  background: rgba(255, 255, 255, 0.72) !important;
}

:where(html.app-page--studio) .studio-state-pill,
:where(html.app-page--studio) .studio-inspector-badge,
:where(html.app-page--studio) .studio-contract-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid #d8e0e8;
  border-radius: 999px;
  background: #f7f9fb;
  color: #607086;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

:where(html.app-page--studio) .studio-state-pill.is-dirty {
  border-color: #f0c77f;
  background: var(--studio-amber-soft);
  color: #8d550f;
}

:where(html.app-page--studio) .studio-state-pill.is-ready,
:where(html.app-page--studio) .studio-contract-pill.is-ready {
  border-color: #a7dacb;
  background: var(--studio-green-soft);
  color: #116c55;
}

:where(html.app-page--studio) .studio-composer-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}

:where(html.app-page--studio) .studio-status {
  min-height: 18px;
  color: #68778a;
  font-size: 11px;
  font-weight: 600;
}

:where(html.app-page--studio) .studio-status.error {
  color: #a82b25;
}

:where(html.app-page--studio) .studio-status.success {
  color: #147259;
}

:where(html.app-page--studio) .studio-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

:where(html.app-page--studio) .studio-summary article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #dce3ea;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.76);
}

:where(html.app-page--studio) .studio-summary span {
  overflow: hidden;
  color: #778598;
  font-size: 10px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:where(html.app-page--studio) .studio-summary strong {
  color: #25364d;
  font-size: 13px;
}

:where(html.app-page--studio) .studio-board-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #d5dee7;
  border-radius: 16px;
  background: #f8fafc;
  box-shadow: 0 8px 30px rgba(32, 50, 72, 0.06);
}

:where(html.app-page--studio) .studio-board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 14px;
  border-bottom: 1px solid #dfe6ed;
  background: rgba(255, 255, 255, 0.88);
}

:where(html.app-page--studio) .studio-board-header h2 {
  margin: 0;
  color: #26384f;
  font-size: 13px;
}

:where(html.app-page--studio) .studio-board-header p {
  margin: 2px 0 0;
  color: #8290a1;
  font-size: 10px;
}

:where(html.app-page--studio) .studio-board-legend {
  display: flex;
  gap: 10px;
  color: #738195;
  font-size: 9px;
  font-weight: 650;
}

:where(html.app-page--studio) .studio-board-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

:where(html.app-page--studio) .studio-board-legend i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #94a3b8;
}

:where(html.app-page--studio) .studio-board-legend .is-ready {
  background: var(--studio-green);
}

:where(html.app-page--studio) .studio-board-legend .is-review {
  background: #d88920;
}

:where(html.app-page--studio) .studio-board-legend .is-running {
  background: var(--accent);
}

:where(html.app-page--studio) .studio-stage-board {
  display: flex;
  align-items: flex-start;
  min-width: 0;
  min-height: 0;
  padding: 22px 20px 28px;
  overflow: auto;
  background-color: #f5f8fb;
  background-image: radial-gradient(circle at 1px 1px, rgba(99, 119, 142, 0.16) 1px, transparent 0);
  background-size: 20px 20px;
  scroll-behavior: smooth;
}

:where(html.app-page--studio) .studio-empty-board {
  display: grid;
  place-items: center;
  gap: 5px;
  width: 100%;
  min-height: 200px;
  color: #758397;
  text-align: center;
}

:where(html.app-page--studio) .studio-empty-board strong {
  color: #45566b;
  font-size: 14px;
}

:where(html.app-page--studio) .studio-empty-board span {
  font-size: 11px;
}

:where(html.app-page--studio) .studio-stage-column {
  display: grid;
  align-content: start;
  flex: 0 0 332px;
  gap: 8px;
  min-width: 0;
}

:where(html.app-page--studio) .studio-stage-group {
  display: grid;
  gap: 8px;
  padding: 9px;
  border: 1px dashed #c7d2df;
  border-radius: 15px;
  background: rgba(236, 242, 248, 0.78);
}

:where(html.app-page--studio) .studio-stage-group.is-parallel {
  border-color: #a8bdd3;
  background: rgba(230, 238, 247, 0.86);
}

:where(html.app-page--studio) .studio-stage-group.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

:where(html.app-page--studio) .studio-stage-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 0 2px;
}

:where(html.app-page--studio) .studio-stage-heading > div {
  min-width: 0;
}

:where(html.app-page--studio) .studio-stage-heading span {
  display: block;
  color: #8290a1;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

:where(html.app-page--studio) .studio-stage-heading input {
  width: 100%;
  height: 24px !important;
  min-height: 24px !important;
  padding: 0 3px !important;
  border-color: transparent !important;
  background: transparent !important;
  color: #45576d;
  font-size: 10px;
  font-weight: 750;
  box-shadow: none !important;
}

:where(html.app-page--studio) .studio-stage-heading input:hover,
:where(html.app-page--studio) .studio-stage-heading input:focus {
  border-color: #bccada !important;
  background: #ffffff !important;
}

:where(html.app-page--studio) .studio-stage-heading-actions {
  display: flex;
  gap: 3px;
}

:where(html.app-page--studio) .studio-stage-heading-actions button {
  width: 32px !important;
  min-width: 32px !important;
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.8);
  color: #637388;
}

:where(html.app-page--studio) .studio-stage-heading-actions .studio-stage-configure {
  width: auto !important;
  min-width: 38px !important;
  padding-inline: 7px !important;
  border-radius: 999px !important;
  color: #1769b3;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

:where(html.app-page--studio) .studio-service-card,
:where(html.app-page--studio) .studio-terminal-card {
  position: relative;
  display: grid;
  gap: 8px;
  width: 100%;
  min-height: 164px;
  padding: 13px 13px 12px;
  overflow: hidden;
  border: 1px solid #d3dce5;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 5px 16px rgba(30, 48, 69, 0.08);
  color: #2d3c51;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

:where(html.app-page--studio) .studio-service-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #5f83b2;
  content: "";
}

:where(html.app-page--studio) .studio-service-card.category--carbon::before {
  background: #26966f;
}

:where(html.app-page--studio) .studio-service-card.category--cost::before {
  background: #d68a26;
}

:where(html.app-page--studio) .studio-service-card.category--presentation::before {
  background: var(--studio-violet);
}

:where(html.app-page--studio) .studio-service-card:hover,
:where(html.app-page--studio) .studio-terminal-card:hover {
  border-color: #9fb8d4;
  box-shadow: 0 8px 22px rgba(30, 48, 69, 0.13);
  transform: translateY(-1px);
}

:where(html.app-page--studio) :is(.studio-service-card, .studio-terminal-card).selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12), 0 8px 22px rgba(30, 48, 69, 0.11);
}

:where(html.app-page--studio) .studio-service-card.is-running {
  border-color: #7eb8f4;
  animation: studio-running-pulse 1.4s ease-in-out infinite;
}

:where(html.app-page--studio) .studio-service-card.is-failed {
  border-color: #e3a4a0;
}

@keyframes studio-running-pulse {
  50% {
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1), 0 8px 22px rgba(30, 48, 69, 0.11);
  }
}

:where(html.app-page--studio) .studio-service-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

:where(html.app-page--studio) .studio-service-card-header > div {
  min-width: 0;
}

:where(html.app-page--studio) .studio-service-card-header strong {
  display: block;
  overflow: hidden;
  color: #24364d;
  font-size: 12px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:where(html.app-page--studio) .studio-service-card-header small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: #5f6f83;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:where(html.app-page--studio) .studio-card-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 25px !important;
  min-width: 25px !important;
  height: 25px !important;
  min-height: 25px !important;
  padding: 0 !important;
  border-color: transparent;
  background: transparent;
  color: #748399;
  font-size: 17px;
  line-height: 1;
}

:where(html.app-page--studio) .studio-execution-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid #d7e0e9;
  border-radius: 999px;
  background: #f5f7fa;
  color: #5b6c81;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

:where(html.app-page--studio) .studio-node-port-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
  align-items: stretch;
  gap: 5px;
  min-width: 0;
  padding: 9px 0;
  border-block: 1px solid #edf1f5;
}

:where(html.app-page--studio) .studio-node-port-column {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
}

:where(html.app-page--studio) .studio-node-port-heading {
  padding-inline: 4px;
  color: #8290a1;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

:where(html.app-page--studio) .studio-node-port-column.is-output .studio-node-port-heading {
  text-align: right;
}

:where(html.app-page--studio) .studio-node-port {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  min-width: 0;
  min-height: 34px;
  padding: 4px 5px 4px 3px;
  border: 1px solid #e5eaf0;
  border-radius: 8px;
  background: #fafbfd;
}

:where(html.app-page--studio) .studio-node-port.is-output {
  grid-template-columns: auto minmax(0, 1fr) 8px;
  padding: 4px 3px 4px 5px;
  text-align: right;
}

:where(html.app-page--studio) .studio-node-port.is-connected,
:where(html.app-page--studio) .studio-node-port.has-preview {
  border-color: #bfd4e9;
  background: #f3f8fd;
}

:where(html.app-page--studio) .studio-node-port.needs-connection {
  border-color: #edbd69;
  background: #fff8ec;
}

:where(html.app-page--studio) .studio-node-port.is-published {
  border-color: #cfc5ec;
  background: #f8f5ff;
}

:where(html.app-page--studio) .studio-node-port-pin {
  display: block;
  width: 8px;
  height: 8px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #91a0b2;
  box-shadow: 0 0 0 1px #9cacbd;
}

:where(html.app-page--studio) .studio-node-port.is-input.is-connected .studio-node-port-pin,
:where(html.app-page--studio) .studio-port-inspector-section.is-input .studio-node-port-pin {
  background: #3283c9;
  box-shadow: 0 0 0 1px #3283c9;
}

:where(html.app-page--studio) .studio-node-port.needs-connection .studio-node-port-pin {
  background: #d88920;
  box-shadow: 0 0 0 1px #d88920;
}

:where(html.app-page--studio) .studio-node-port.is-output.has-preview .studio-node-port-pin {
  background: var(--studio-green);
  box-shadow: 0 0 0 1px var(--studio-green);
}

:where(html.app-page--studio) .studio-node-port.is-output.is-published .studio-node-port-pin,
:where(html.app-page--studio) .studio-port-inspector-section.is-output .studio-node-port-pin,
:where(html.app-page--studio) .studio-output-port-definition .studio-node-port-pin {
  background: var(--studio-violet);
  box-shadow: 0 0 0 1px var(--studio-violet);
}

:where(html.app-page--studio) .studio-node-port-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

:where(html.app-page--studio) .studio-node-port-name,
:where(html.app-page--studio) .studio-node-port-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:where(html.app-page--studio) .studio-node-port-name {
  color: #34485f;
  font-size: 10px;
  font-weight: 800;
}

:where(html.app-page--studio) .studio-node-port-copy small {
  color: #596b80;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
}

:where(html.app-page--studio) .studio-node-port-type {
  max-width: 42px;
  overflow: hidden;
  color: #64758a;
  font-size: 8px;
  font-weight: 750;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

:where(html.app-page--studio) .studio-node-flow {
  align-self: center;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid #d8e0e9;
  border-radius: 999px;
  background: #ffffff;
  color: #718399;
  font-size: 10px;
}

:where(html.app-page--studio) .studio-node-port-empty,
:where(html.app-page--studio) .studio-node-port-more {
  min-height: 24px;
  padding: 6px 5px;
  color: #8290a1;
  font-size: 8px;
}

:where(html.app-page--studio) .studio-node-port-column.is-output :is(.studio-node-port-empty, .studio-node-port-more) {
  text-align: right;
}

:where(html.app-page--studio) .studio-card-contract {
  display: grid;
  gap: 5px;
  padding: 7px 0;
  border-block: 1px solid #eef1f4;
}

:where(html.app-page--studio) .studio-contract-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 6px;
  font-size: 11px;
  line-height: 1.35;
}

:where(html.app-page--studio) .studio-contract-row > span:first-child {
  color: #5f6f83;
  font-weight: 750;
}

:where(html.app-page--studio) .studio-contract-row > span:last-child {
  overflow: hidden;
  color: #526176;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:where(html.app-page--studio) .studio-service-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

:where(html.app-page--studio) .studio-service-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #647388;
  font-size: 11px;
  font-weight: 750;
}

:where(html.app-page--studio) .studio-service-status::before {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #94a3b8;
  content: "";
}

:where(html.app-page--studio) .studio-service-status.is-ready::before,
:where(html.app-page--studio) .studio-service-status.is-completed::before {
  background: var(--studio-green);
}

:where(html.app-page--studio) .studio-service-status.is-review::before {
  background: #d88920;
}

:where(html.app-page--studio) .studio-service-status.is-running::before {
  background: var(--accent);
}

:where(html.app-page--studio) .studio-service-status.is-failed::before {
  background: #c43831;
}

:where(html.app-page--studio) .studio-card-configure {
  width: auto !important;
  height: 32px !important;
  min-height: 32px !important;
  padding-inline: 10px !important;
  border: 0;
  background: transparent;
  color: #1769b3;
  font-size: 11px;
}

:where(html.app-page--studio) .studio-terminal-card {
  align-content: center;
  min-height: 126px;
  text-align: center;
}

:where(html.app-page--studio) .studio-terminal-card.input-terminal {
  border-color: #a9c7e8;
  background: #edf5ff;
}

:where(html.app-page--studio) .studio-terminal-card.result-terminal {
  border-color: #b9addf;
  background: var(--studio-violet-soft);
}

:where(html.app-page--studio) .studio-terminal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: 0 auto;
  border-radius: 11px;
  background: #ffffff;
  color: #336da8;
  box-shadow: 0 2px 8px rgba(33, 63, 97, 0.1);
}

:where(html.app-page--studio) .result-terminal .studio-terminal-icon {
  color: var(--studio-violet);
}

:where(html.app-page--studio) .studio-terminal-card strong {
  color: #29415e;
  font-size: 12px;
}

:where(html.app-page--studio) .studio-terminal-card span {
  color: #718198;
  font-size: 9px;
}

:where(html.app-page--studio) .studio-board-connector {
  position: relative;
  flex: 0 0 54px;
  height: 2px;
  margin-inline: 4px;
  background: #aebdcd;
}

:where(html.app-page--studio) .studio-board-connector::after {
  position: absolute;
  top: 50%;
  right: -1px;
  width: 8px;
  height: 8px;
  border-top: 2px solid #8fa1b5;
  border-right: 2px solid #8fa1b5;
  content: "";
  transform: translateY(-50%) rotate(45deg);
}

:where(html.app-page--studio) .studio-board-connector button {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px !important;
  min-width: 32px !important;
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  background: #ffffff;
  color: #56708d;
  font-size: 15px;
  transform: translate(-50%, -50%);
}

:where(html.app-page--studio) .studio-add-stage {
  flex: 0 0 158px;
  height: 92px !important;
  min-height: 92px !important;
  padding: 12px !important;
  border: 1px dashed #aebdcd;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.6);
  color: #52677f;
  font-size: 10px;
}

:where(html.app-page--studio) .studio-inspector .studio-pane-header {
  min-height: 74px;
  padding: 15px 16px;
  border-bottom: 1px solid #e0e6ed;
}

:where(html.app-page--studio) .studio-inspector-content {
  min-height: 0;
  overflow: auto;
  padding: 15px 16px 24px;
}

:where(html.app-page--studio) .studio-inspector-empty {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 240px;
  color: #8190a2;
  text-align: center;
}

:where(html.app-page--studio) .studio-inspector-empty .ui-icon {
  width: 26px;
  height: 26px;
}

:where(html.app-page--studio) .studio-inspector-empty strong {
  color: #526176;
  font-size: 12px;
}

:where(html.app-page--studio) .studio-inspector-empty p {
  max-width: 240px;
  margin: 0;
  font-size: 10px;
  line-height: 1.5;
}

:where(html.app-page--studio) .studio-inspector-section {
  display: grid;
  gap: 9px;
  padding: 0 0 15px;
}

:where(html.app-page--studio) .studio-inspector-section + .studio-inspector-section {
  padding-top: 15px;
  border-top: 1px solid #e6ebf0;
}

:where(html.app-page--studio) .studio-inspector-section h3 {
  margin: 0;
  color: #33465d;
  font-size: 11px;
}

:where(html.app-page--studio) .studio-inspector-section > p {
  margin: -3px 0 0;
  color: #7d8b9d;
  font-size: 10px;
  line-height: 1.45;
}

:where(html.app-page--studio) .studio-section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

:where(html.app-page--studio) .studio-section-title-row button {
  width: auto !important;
  height: 28px !important;
  min-height: 28px !important;
  padding-inline: 9px !important;
  font-size: 9px;
}

:where(html.app-page--studio) .studio-service-overview .studio-section-title-row > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

:where(html.app-page--studio) .studio-service-overview .studio-section-title-row p,
:where(html.app-page--studio) .studio-port-inspector-heading p {
  margin: 0;
  color: #77869a;
  font-size: 9px;
  line-height: 1.4;
}

:where(html.app-page--studio) .studio-execution-panel {
  display: grid;
  gap: 10px;
  padding: 11px;
  border: 1px solid #dce4ec;
  border-radius: 12px;
  background: #f8fafc;
}

:where(html.app-page--studio) .studio-execution-panel.is-auto {
  border-color: #b9d8ce;
  background: #f6fbf9;
}

:where(html.app-page--studio) .studio-execution-summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

:where(html.app-page--studio) .studio-execution-summary > span:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

:where(html.app-page--studio) .studio-execution-summary strong {
  color: #34485f;
  font-size: 11px;
}

:where(html.app-page--studio) .studio-execution-summary small {
  color: #6e7e92;
  font-size: 9px;
  line-height: 1.4;
}

:where(html.app-page--studio) .studio-execution-icon {
  display: grid;
  flex: 0 0 30px;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid #bfd4e9;
  border-radius: 9px;
  background: #edf5ff;
  color: #1769b3;
  font-size: 15px;
  font-weight: 850;
}

:where(html.app-page--studio) .studio-execution-panel.is-auto .studio-execution-icon {
  border-color: #a7dacb;
  background: var(--studio-green-soft);
  color: #116c55;
}

:where(html.app-page--studio) .studio-value-extraction {
  min-width: 0;
  padding-top: 9px;
  border-top: 1px solid #d9e7e2;
}

:where(html.app-page--studio) .studio-value-extraction > summary {
  padding: 1px 2px;
  color: #3f665b;
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.4;
}

:where(html.app-page--studio) .studio-value-extraction > summary:hover {
  color: #176c55;
}

:where(html.app-page--studio) .studio-value-extraction > summary:focus-visible {
  border-radius: 5px;
  outline: 3px solid rgba(22, 133, 104, 0.18);
  outline-offset: 2px;
}

:where(html.app-page--studio) .studio-value-extraction[open] > summary {
  margin-bottom: 8px;
}

:where(html.app-page--studio) .studio-record-field-mapping {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  min-width: 0;
  padding: 9px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.72);
}

:where(html.app-page--studio) .studio-record-field-mapping .studio-field {
  gap: 4px;
  min-width: 0;
}

:where(html.app-page--studio) .studio-record-field-mapping .studio-loop-item-picker,
:where(html.app-page--studio) .studio-record-field-mapping .studio-loop-item-picker.is-projected {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

:where(html.app-page--studio) .studio-record-field-mapping :is(select, input) {
  min-width: 0;
  font-size: 10px;
}

:where(html.app-page--studio) .studio-record-field-mapping :is(select, input):hover:not(:disabled) {
  border-color: #8fb9ab;
}

:where(html.app-page--studio) .studio-record-field-mapping :is(select, input):focus-visible {
  outline: 3px solid rgba(22, 133, 104, 0.18);
  outline-offset: 1px;
}

:where(html.app-page--studio) .studio-record-field-mapping small {
  color: #6d7f77;
  font-size: 9px;
  line-height: 1.4;
}

:where(html.app-page--studio) .studio-json-pointer {
  border: 1px solid #e1dced;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.72);
}

:where(html.app-page--studio) .studio-json-pointer > summary {
  padding: 8px 9px;
  color: #5d6e84;
  cursor: pointer;
  font-size: 9px;
  font-weight: 750;
}

:where(html.app-page--studio) .studio-json-pointer > .studio-field {
  padding: 0 9px 9px;
}

:where(html.app-page--studio) .studio-port-inspector-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

:where(html.app-page--studio) .studio-port-inspector-heading > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

:where(html.app-page--studio) .studio-port-inspector-section.is-input .studio-mapping-row {
  border-left: 3px solid #3283c9;
  background: #f8fbfe;
}

:where(html.app-page--studio) .studio-output-port-definition {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e0e5eb;
  border-right: 3px solid #9a87cf;
  border-radius: 11px;
  background: #fbfaff;
}

:where(html.app-page--studio) .studio-output-port-definition.is-published {
  border-color: #cfc5ec;
  border-right-color: var(--studio-violet);
  background: #f8f5ff;
}

:where(html.app-page--studio) .studio-output-port-definition header,
:where(html.app-page--studio) .studio-output-port-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

:where(html.app-page--studio) .studio-output-port-definition header {
  justify-content: space-between;
}

:where(html.app-page--studio) .studio-output-port-definition strong {
  overflow: hidden;
  color: #3c4f66;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:where(html.app-page--studio) .studio-output-port-definition > small {
  color: #718095;
  font-size: 9px;
  line-height: 1.4;
}

:where(html.app-page--studio) .studio-output-port-preview {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 7px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
}

:where(html.app-page--studio) .studio-output-port-preview > span {
  color: #8290a1;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

:where(html.app-page--studio) .studio-output-port-preview > strong,
:where(html.app-page--studio) .studio-output-port-preview > em {
  overflow: hidden;
  color: #53647a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:where(html.app-page--studio) .studio-output-port-definition > button {
  width: 100% !important;
  min-height: 32px !important;
  color: #65519e;
}

:where(html.app-page--studio) .studio-output-port-definition.is-published > button {
  border-color: #b9addf;
  background: var(--studio-violet-soft);
  font-weight: 800;
}

:where(html.app-page--studio) .studio-service-details {
  margin: 0 0 15px;
  border: 1px solid #e2e7ed;
  border-radius: 10px;
  background: #fafbfd;
}

:where(html.app-page--studio) .studio-service-details > summary {
  padding: 10px;
  color: #596b80;
  cursor: pointer;
  font-size: 10px;
  font-weight: 750;
}

:where(html.app-page--studio) .studio-service-details-body {
  display: grid;
  gap: 10px;
  padding: 0 10px 10px;
}

:where(html.app-page--studio) .studio-field {
  display: grid;
  gap: 5px;
}

:where(html.app-page--studio) .studio-field > label,
:where(html.app-page--studio) .studio-field > span:first-child {
  color: #67778b;
  font-size: 10px;
  font-weight: 700;
}

:where(html.app-page--studio) .studio-field small {
  color: #617186;
  font-size: 11px;
  line-height: 1.4;
}

:where(html.app-page--studio) .studio-input-definition,
:where(html.app-page--studio) .studio-mapping-row,
:where(html.app-page--studio) .studio-run-output-card,
:where(html.app-page--studio) .studio-result-definition {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid #dfe5eb;
  border-radius: 11px;
  background: #fafbfd;
}

:where(html.app-page--studio) .studio-input-definition header,
:where(html.app-page--studio) .studio-mapping-row header,
:where(html.app-page--studio) .studio-run-output-card header,
:where(html.app-page--studio) .studio-result-definition header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

:where(html.app-page--studio) .studio-input-definition strong,
:where(html.app-page--studio) .studio-mapping-row strong,
:where(html.app-page--studio) .studio-run-output-card strong,
:where(html.app-page--studio) .studio-result-definition strong {
  overflow: hidden;
  color: #3c4f66;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:where(html.app-page--studio) .studio-preview-callout,
:where(html.app-page--studio) .studio-preview-status {
  display: grid;
  gap: 4px;
  padding: 9px;
  border: 1px solid #edbd69;
  border-radius: 9px;
  background: #fff7e8;
  color: #765019;
  font-size: 10px;
  line-height: 1.4;
}

:where(html.app-page--studio) .studio-preview-callout.is-error,
:where(html.app-page--studio) .studio-preview-status.is-failed {
  border-color: #e3a4a0;
  background: #fff0ef;
  color: #9d2f2a;
}

:where(html.app-page--studio) .studio-preview-status.is-completed {
  border-color: #9ed6bd;
  background: var(--studio-green-soft);
  color: #176c4f;
}

:where(html.app-page--studio) .studio-preview-status.is-running,
:where(html.app-page--studio) .studio-preview-status.is-queued {
  border-color: #a9c7e8;
  background: #edf5ff;
  color: #275f98;
}

:where(html.app-page--studio) .studio-preview-output {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  border: 1px solid #dfe5eb;
  border-radius: 9px;
  background: #ffffff;
}

:where(html.app-page--studio) .studio-preview-output > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

:where(html.app-page--studio) .studio-preview-output strong,
:where(html.app-page--studio) .studio-preview-output small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:where(html.app-page--studio) .studio-preview-output strong {
  color: #3c4f66;
  font-size: 10px;
}

:where(html.app-page--studio) .studio-preview-output small {
  color: #68788c;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
}

:where(html.app-page--studio) .studio-preview-output button {
  width: auto !important;
  min-width: max-content !important;
  height: 28px !important;
  min-height: 28px !important;
  padding-inline: 8px !important;
  font-size: 9px;
}

:where(html.app-page--studio) .studio-result-definition-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

:where(html.app-page--studio) .studio-result-definition-footer small {
  overflow: hidden;
  color: #758397;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:where(html.app-page--studio) .studio-result-definition-footer button {
  width: auto !important;
  height: 28px !important;
  min-height: 28px !important;
  padding-inline: 8px !important;
  font-size: 9px;
}

:where(html.app-page--studio) .studio-raw-results {
  margin-bottom: 15px;
  border: 1px solid #e1e7ed;
  border-radius: 9px;
  background: #fafbfd;
}

:where(html.app-page--studio) .studio-raw-results > summary {
  padding: 9px 10px;
  color: #52647a;
  cursor: pointer;
  font-size: 10px;
  font-weight: 750;
}

:where(html.app-page--studio) .studio-raw-results > .studio-inspector-section {
  padding: 0 10px 10px;
}

:where(html.app-page--studio) .studio-input-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(90px, 0.7fr);
  gap: 7px;
}

:where(html.app-page--studio) .studio-input-definition textarea {
  min-height: 66px;
  resize: vertical;
}

:where(html.app-page--studio) .studio-input-schema {
  border: 1px solid #e1e7ed;
  border-radius: 8px;
  background: #ffffff;
}

:where(html.app-page--studio) .studio-input-schema summary {
  padding: 7px 9px;
  color: #52647a;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

:where(html.app-page--studio) .studio-input-schema .studio-field {
  padding: 0 9px 9px;
}

:where(html.app-page--studio) .studio-stale-run {
  display: grid;
  gap: 3px;
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid #edbd69;
  border-radius: 10px;
  background: #fff7e8;
  color: #765019;
  font-size: 11px;
  line-height: 1.4;
}

:where(html.app-page--studio) .studio-type-chip {
  display: inline-flex;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e9eef4;
  color: #64758a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 8px;
  font-weight: 700;
}

:where(html.app-page--studio) .studio-mapping-controls {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  gap: 6px;
}

:where(html.app-page--studio) .studio-mapping-controls :is(select, input) {
  min-width: 0;
  font-size: 10px;
}

:where(html.app-page--studio) .studio-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

:where(html.app-page--studio) .studio-inline-actions button {
  height: 29px !important;
  min-height: 29px !important;
  font-size: 10px;
}

:where(html.app-page--studio) .studio-validation-list,
:where(html.app-page--studio) .studio-run-timeline {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

:where(html.app-page--studio) .studio-validation-item,
:where(html.app-page--studio) .studio-run-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  color: #637389;
  font-size: 10px;
  line-height: 1.4;
}

:where(html.app-page--studio) .studio-validation-item::before,
:where(html.app-page--studio) .studio-run-step::before {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #edf1f5;
  color: #68788c;
  content: "i";
  font-size: 9px;
  font-weight: 800;
}

:where(html.app-page--studio) .studio-validation-item.error::before,
:where(html.app-page--studio) .studio-run-step.is-failed::before {
  background: #fdeceb;
  color: #b8322c;
  content: "!";
}

:where(html.app-page--studio) .studio-validation-item.success::before,
:where(html.app-page--studio) .studio-run-step.is-completed::before {
  background: var(--studio-green-soft);
  color: var(--studio-green);
  content: "✓";
}

:where(html.app-page--studio) .studio-run-step.is-skipped::before {
  content: "–";
}

:where(html.app-page--studio) .studio-run-result {
  max-height: 190px;
  margin: 0;
  overflow: auto;
  color: #42536a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

:where(html.app-page--studio) .studio-run-output-card > header > div {
  min-width: 0;
}

:where(html.app-page--studio) .studio-run-output-card > header small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: #637389;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:where(html.app-page--studio) .studio-output-values {
  display: grid;
  gap: 7px;
}

:where(html.app-page--studio) .studio-output-value {
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid #e1e7ed;
  border-radius: 8px;
  background: #ffffff;
}

:where(html.app-page--studio) .studio-output-label {
  color: #5c6d82;
  font-size: 10px;
  font-weight: 700;
}

:where(html.app-page--studio) .studio-output-value > div {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
}

:where(html.app-page--studio) .studio-output-value > div > strong {
  color: #223a54;
  font-size: 18px;
  line-height: 1.2;
}

:where(html.app-page--studio) .studio-output-value > div > span,
:where(html.app-page--studio) .studio-output-value > small {
  color: #637389;
  font-size: 10px;
}

:where(html.app-page--studio) .studio-output-details {
  width: 100%;
}

:where(html.app-page--studio) .studio-output-details summary {
  color: #1769b3;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

:where(html.app-page--studio) .studio-output-details .studio-run-result {
  margin-top: 7px;
  padding: 7px;
  border-radius: 6px;
  background: #f4f7fa;
}

:where(html.app-page--studio) .studio-service-library {
  width: min(900px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 44px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
}

:where(html.app-page--studio) .studio-service-library .modal-header h3 {
  margin: 2px 0 0;
  font-size: 17px;
}

:where(html.app-page--studio) .studio-service-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow: auto;
}

:where(html.app-page--studio) .studio-library-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid #dce3ea;
  border-radius: 12px;
  background: #fbfcfd;
}

:where(html.app-page--studio) .studio-library-card > div {
  min-width: 0;
}

:where(html.app-page--studio) .studio-library-card strong {
  display: block;
  overflow: hidden;
  color: #30435b;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:where(html.app-page--studio) .studio-library-card p {
  margin: 4px 0 0;
  overflow: hidden;
  color: #5f6f83;
  font-size: 11px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:where(html.app-page--studio) .studio-library-card button {
  white-space: nowrap;
}

:where(html.app-page--studio) .studio-empty-list {
  grid-column: 1 / -1;
  padding: 24px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  color: #748296;
  font-size: 11px;
  text-align: center;
}

:where(html.app-page--studio) .studio-service-config-modal {
  z-index: 60;
}

:where(html.app-page--studio) .studio-service-config-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: calc(100vw - 32px);
  height: calc(100dvh - 32px);
  max-height: none;
  padding: 0;
  overflow: hidden;
  border-radius: 18px;
}

:where(html.app-page--studio) .studio-service-config-modal.is-generic .studio-service-config-panel {
  width: min(1040px, calc(100vw - 32px));
  height: min(900px, calc(100dvh - 32px));
}

:where(html.app-page--studio) .studio-service-config-status {
  min-width: 0;
  max-height: 84px;
  margin: 8px 16px 0;
  padding: 8px 10px;
  overflow: auto;
  overflow-wrap: anywhere;
  border: 1px solid #d9e3ec;
  border-radius: 8px;
  background: #f5f8fb;
  color: #52677f;
  font-size: 10px;
}

:where(html.app-page--studio) .studio-service-config-status.error {
  border-color: #e9b8b5;
  background: #fff3f2;
  color: #9a3f39;
}

:where(html.app-page--studio) .studio-service-config-status.success {
  border-color: #b9dfcd;
  background: #f0faf5;
  color: #297451;
}

:where(html.app-page--studio) .studio-service-config-header {
  min-width: 0;
  padding: 16px 18px;
  border-bottom: 1px solid #dce3ea;
  background: #ffffff;
}

:where(html.app-page--studio) .studio-service-config-header > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

:where(html.app-page--studio) .studio-service-config-header h2 {
  overflow: hidden;
  color: #24364d;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:where(html.app-page--studio) .studio-service-config-header p {
  margin: 0;
  color: #6c7c90;
  font-size: 10px;
  line-height: 1.4;
}

:where(html.app-page--studio) .studio-service-config-header > button {
  width: auto !important;
  min-width: 72px;
}

:where(html.app-page--studio) .studio-service-config-content {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

:where(html.app-page--studio) .studio-service-config-content.is-generic {
  overflow: auto;
  overscroll-behavior: contain;
  background: #f5f8fb;
}

:where(html.app-page--studio) .studio-service-config-content.is-generic .studio-inspector-content {
  width: min(920px, 100%);
  min-height: 100%;
  margin: 0 auto;
  padding: 24px;
  overflow: visible;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(220, 227, 234, 0.72);
}

:where(html.app-page--studio) .studio-service-config-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.18fr) minmax(260px, 0.82fr) minmax(280px, 1fr);
  height: 100%;
  min-width: 0;
  min-height: 0;
}

:where(html.app-page--studio) .studio-service-config-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  background: #fbfcfe;
}

:where(html.app-page--studio) .studio-service-config-column.is-input {
  background: #f4f8fc;
}

:where(html.app-page--studio) .studio-service-config-column.is-configuration {
  border-inline: 1px solid #dce3ea;
  background: #f7f9fb;
  box-shadow: 0 0 18px rgba(37, 67, 100, 0.035);
}

:where(html.app-page--studio) .studio-service-config-column.is-output {
  background: #faf9fd;
}

:where(html.app-page--studio) .studio-service-config-column-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 13px 16px;
  border-bottom: 1px solid #e1e7ed;
  background: rgba(255, 255, 255, 0.94);
}

:where(html.app-page--studio) .studio-service-config-column-header > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

:where(html.app-page--studio) .studio-service-config-column-header h3 {
  margin: 0;
  color: #30445c;
  font-size: 13px;
}

:where(html.app-page--studio) .studio-service-config-column-header p {
  margin: 0;
  color: #758499;
  font-size: 9px;
  line-height: 1.4;
}

:where(html.app-page--studio) .studio-service-config-column.is-input > .studio-service-config-column-header .studio-node-port-pin {
  background: #3283c9;
  box-shadow: 0 0 0 1px #3283c9;
}

:where(html.app-page--studio) .studio-service-config-column.is-output > .studio-service-config-column-header .studio-node-port-pin {
  background: var(--studio-violet);
  box-shadow: 0 0 0 1px var(--studio-violet);
}

:where(html.app-page--studio) .studio-service-config-column.is-configuration > .studio-service-config-column-header .studio-execution-icon {
  border-color: #cbd6e1;
  background: #f1f4f7;
  color: #64778b;
  box-shadow: none;
}

:where(html.app-page--studio) .studio-service-config-column-body {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  padding: 14px 16px 22px;
  overflow: auto;
  overscroll-behavior: contain;
}

:where(html.app-page--studio) .studio-card-input-options {
  display: grid;
  align-content: start;
  gap: 9px;
  min-width: 0;
}

:where(html.app-page--studio) .studio-card-input-options .studio-mapping-row {
  gap: 8px;
  padding: 10px;
  border-color: #d7e1ea;
  border-left: 3px solid #79a8d0;
  background: #ffffff;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

:where(html.app-page--studio) .studio-card-input-options .studio-mapping-row:hover {
  border-color: #b9cddd;
  border-left-color: #5f99c9;
  background: #fcfdff;
}

:where(html.app-page--studio) .studio-card-input-options .studio-mapping-row:focus-within {
  border-color: #72a6d2;
  border-left-color: #3283c9;
  box-shadow: 0 0 0 3px rgba(50, 131, 201, 0.12);
}

:where(html.app-page--studio) .studio-card-input-options .studio-mapping-row > header {
  min-width: 0;
}

:where(html.app-page--studio) .studio-card-input-options .studio-mapping-row > header strong {
  color: #344a62;
  font-size: 10px;
}

:where(html.app-page--studio) .studio-card-input-options .studio-field {
  gap: 4px;
}

:where(html.app-page--studio) .studio-card-input-options .studio-field > label {
  font-size: 9px;
}

:where(html.app-page--studio) .studio-card-input-options select[data-binding-input] {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border-color: #cbd7e2;
  background-color: #ffffff;
  color: #344a62;
  font-size: 10px;
}

:where(html.app-page--studio) .studio-card-input-options select[data-binding-input]:hover:not(:disabled) {
  border-color: #8fb4d4;
}

:where(html.app-page--studio) .studio-card-input-options select[data-binding-input]:focus-visible {
  outline: 3px solid rgba(50, 131, 201, 0.2);
  outline-offset: 1px;
}

:where(html.app-page--studio) .studio-card-input-options .studio-field small {
  color: #6f8094;
  font-size: 9px;
}

:where(html.app-page--studio) .studio-card-input-options textarea {
  min-height: 58px;
  resize: vertical;
}

:where(html.app-page--studio) .studio-result-handling {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #d8e1e9;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 67, 100, 0.035);
}

:where(html.app-page--studio) .studio-result-mode-intro {
  display: grid;
  gap: 3px;
  min-width: 0;
}

:where(html.app-page--studio) .studio-result-mode-intro strong {
  color: #34495f;
  font-size: 11px;
}

:where(html.app-page--studio) .studio-result-mode-intro p {
  margin: 0;
  color: #718196;
  font-size: 9px;
  line-height: 1.45;
}

:where(html.app-page--studio) .studio-result-mode-control {
  gap: 6px;
  padding: 0;
}

:where(html.app-page--studio) .studio-result-mode-control select[data-service-result-mode] {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border-color: #c8d5e0;
  background-color: #ffffff;
  color: #34495f;
  font-size: 10px;
  font-weight: 700;
}

:where(html.app-page--studio) .studio-result-mode-control select[data-service-result-mode]:hover:not(:disabled) {
  border-color: #91acc4;
}

:where(html.app-page--studio) .studio-result-mode-control select[data-service-result-mode]:focus-visible {
  outline: 3px solid rgba(77, 113, 146, 0.18);
  outline-offset: 1px;
}

:where(html.app-page--studio) .studio-result-mode-help {
  display: block;
  margin: -5px 2px 0;
  color: #6d7f92;
  font-size: 9px;
  line-height: 1.45;
}

:where(html.app-page--studio) .studio-execution-panel.is-compact {
  gap: 8px;
  margin-top: 1px;
  padding: 9px 10px;
  border-color: #cbded8;
  border-radius: 10px;
  background: #f7fbfa;
}

:where(html.app-page--studio) .studio-execution-panel.is-compact .studio-execution-summary {
  gap: 8px;
}

:where(html.app-page--studio) .studio-execution-panel.is-compact .studio-execution-icon {
  flex-basis: 26px;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  font-size: 12px;
}

:where(html.app-page--studio) .studio-execution-panel.is-compact .studio-execution-summary > span:last-child {
  gap: 1px;
}

:where(html.app-page--studio) .studio-execution-panel.is-compact .studio-execution-summary strong {
  font-size: 10px;
}

:where(html.app-page--studio) .studio-execution-panel.is-compact .studio-execution-summary small {
  font-size: 8px;
}

:where(html.app-page--studio) .studio-execution-panel.is-compact .studio-record-field-mapping {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: start;
}

:where(html.app-page--studio) .studio-result-handling > .studio-execution-panel.is-compact {
  margin-top: 0;
  padding: 10px 0 0;
  border: 0;
  border-top: 1px solid #e1e7ed;
  border-radius: 0;
  background: transparent;
}

@media (max-width: 1160px) {
  :where(html.app-page--studio) .studio-service-config-panel {
    width: calc(100vw - 18px);
    height: calc(100dvh - 18px);
  }

  :where(html.app-page--studio) .studio-service-config-content {
    overflow: auto;
    overscroll-behavior: contain;
  }

  :where(html.app-page--studio) .studio-service-config-grid {
    display: block;
    height: auto;
  }

  :where(html.app-page--studio) .studio-service-config-column {
    display: block;
  }

  :where(html.app-page--studio) .studio-service-config-column.is-configuration {
    border-inline: 0;
    border-block: 1px solid #dce3ea;
  }

  :where(html.app-page--studio) .studio-service-config-column-body {
    overflow: visible;
  }

  :where(html.app-page--studio) .studio-card-input-options {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

}

@media (max-width: 560px) {
  :where(html.app-page--studio) .studio-service-config-panel {
    width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  :where(html.app-page--studio) .studio-service-config-modal.is-generic .studio-service-config-panel {
    width: 100vw;
    height: 100dvh;
  }

  :where(html.app-page--studio) .studio-service-config-header {
    padding: 12px;
  }

  :where(html.app-page--studio) .studio-service-config-header h2 {
    font-size: 15px;
  }

  :where(html.app-page--studio) .studio-service-config-header p {
    display: none;
  }

  :where(html.app-page--studio) .studio-service-config-content.is-generic .studio-inspector-content {
    width: 100%;
    padding: 16px 12px calc(24px + env(safe-area-inset-bottom));
    box-shadow: none;
  }

  :where(html.app-page--studio) .studio-service-config-column-header,
  :where(html.app-page--studio) .studio-service-config-column-body {
    padding-inline: 12px;
  }

  :where(html.app-page--studio) .studio-card-input-options {
    grid-template-columns: minmax(0, 1fr);
  }

  :where(html.app-page--studio) .studio-record-field-mapping {
    grid-template-columns: minmax(0, 1fr);
  }
}

:where(html.app-page--studio) .studio-mobile-actions {
  display: none;
}

@media (max-width: 1320px) {
  :where(html.app-page--studio) .studio-shell {
    --studio-library-width: 236px;
  }

  :where(html.app-page--studio) .studio-topbar-actions .session-user {
    display: none;
  }

  :where(html.app-page--studio) .studio-workspace-picker span {
    display: none;
  }
}

@media (max-width: 1080px) {
  :where(html.app-page--studio) .studio-mode-switch {
    position: static;
    transform: none;
  }
}

@media (max-width: 760px) {
  :where(html.app-page--studio) body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  :where(html.app-page--studio) .studio-topbar {
    height: auto;
    min-height: 62px;
    flex-wrap: wrap;
  }

  :where(html.app-page--studio) .studio-mode-switch {
    order: 3;
    width: 100%;
  }

  :where(html.app-page--studio) .studio-mode-switch :is(a, span) {
    width: 100%;
  }

  :where(html.app-page--studio) .studio-topbar-actions .toolbar-link {
    display: none;
  }

  :where(html.app-page--studio) .studio-workspace-picker {
    display: flex;
  }

  :where(html.app-page--studio) .studio-workspace-picker select {
    width: min(142px, 34vw);
  }

  :where(html.app-page--studio) .studio-shell {
    display: block;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  :where(html.app-page--studio) .studio-sidebar {
    min-height: 0;
    max-height: min(70dvh, 520px);
    border-right: 0;
    border-bottom: 1px solid #dce3ea;
  }

  :where(html.app-page--studio) .studio-shell.is-library-collapsed .studio-sidebar {
    grid-template-rows: auto;
    min-height: 60px;
    max-height: 60px;
    padding: 10px 12px;
  }

  :where(html.app-page--studio) .studio-shell.is-library-collapsed .studio-sidebar .studio-pane-header {
    justify-content: space-between;
  }

  :where(html.app-page--studio) .studio-shell.is-library-collapsed .studio-sidebar .studio-pane-header > div:first-child {
    display: block;
  }

  :where(html.app-page--studio) .studio-shell.is-library-collapsed .studio-sidebar-actions {
    flex-direction: row;
  }

  :where(html.app-page--studio) .studio-shell.is-library-collapsed .studio-library-rail-label {
    display: none;
  }

  :where(html.app-page--studio) .studio-sidebar-note {
    display: none;
  }

  :where(html.app-page--studio) .studio-main {
    min-height: 760px;
    padding: 12px 12px calc(84px + env(safe-area-inset-bottom));
    overflow: visible;
  }

  :where(html.app-page--studio) .studio-composer-header {
    display: block;
  }

  :where(html.app-page--studio) .studio-composer-actions {
    display: none;
  }

  :where(html.app-page--studio) .studio-title-input {
    font-size: 18px !important;
  }

  :where(html.app-page--studio) .studio-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  :where(html.app-page--studio) .studio-board-panel {
    min-height: 500px;
    overflow: visible;
  }

  :where(html.app-page--studio) .studio-board-header {
    align-items: flex-start;
  }

  :where(html.app-page--studio) .studio-board-legend {
    display: none;
  }

  :where(html.app-page--studio) .studio-stage-board {
    align-items: stretch;
    flex-direction: column;
    gap: 0;
    padding: 16px;
    overflow: visible;
  }

  :where(html.app-page--studio) .studio-stage-column,
  :where(html.app-page--studio) .studio-add-stage {
    width: 100%;
    flex-basis: auto;
  }

  :where(html.app-page--studio) .studio-board-connector {
    flex: 0 0 42px;
    width: 2px;
    height: 42px;
    margin: 0 auto;
  }

  :where(html.app-page--studio) .studio-board-connector::after {
    top: auto;
    right: 50%;
    bottom: 0;
    transform: translateX(50%) rotate(135deg);
  }

  :where(html.app-page--studio) .studio-service-list {
    grid-template-columns: 1fr;
  }

  :where(html.app-page--studio) .studio-mobile-actions {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 25;
    display: grid;
    grid-template-columns: 1fr 1fr 1.35fr;
    gap: 8px;
    padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
    border-top: 1px solid #d7dee6;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
  }

  :where(html.app-page--studio) :is(.studio-stage-heading-actions button, .studio-board-connector button, .studio-card-configure) {
    min-width: 44px !important;
    min-height: 44px !important;
  }

  :where(html.app-page--studio) .studio-inspector-content :is(button, select, input:not([type="checkbox"])),
  :where(html.app-page--studio) .studio-service-config-header button,
  :where(html.app-page--studio) .studio-service-config-content :is(button, select, input:not([type="checkbox"]), textarea, summary, .toolbar-link),
  :where(html.app-page--studio) .studio-mobile-actions button {
    min-height: 44px !important;
  }
}

@media (max-width: 420px) {
  :where(html.app-page--studio) .studio-node-port-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  :where(html.app-page--studio) .studio-node-flow {
    justify-self: center;
    transform: rotate(90deg);
  }

  :where(html.app-page--studio) .studio-node-port-type {
    max-width: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :where(html.app-page--studio) .studio-shell,
  :where(html.app-page--studio) .studio-library-toggle .ui-icon,
  :where(html.app-page--studio) .studio-card-input-options .studio-mapping-row {
    transition: none;
  }

  :where(html.app-page--studio) .studio-stage-board {
    scroll-behavior: auto;
  }

  :where(html.app-page--studio) .studio-service-card {
    animation: none !important;
    transition: none;
  }
}

:where(html.app-page--dashboard) .dashboard-card-geometry .resize-handle {
  border-right-color: #9fc5ef;
  border-bottom-color: #9fc5ef;
}

:where(html.app-page--dashboard) .dashboard-geometry-viewer {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(205, 221, 228, 0.32)),
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.98), rgba(218, 231, 236, 0.96) 72%),
    #e1eaed;
}

:where(html.app-page--dashboard) .dashboard-geometry-canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 160px;
  cursor: grab;
  touch-action: none;
}

:where(html.app-page--dashboard) .dashboard-geometry-canvas:active {
  cursor: grabbing;
}

:where(html.app-page--dashboard) .dashboard-geometry-canvas.is-hovering:not(:active) {
  cursor: crosshair;
}

:where(html.app-page--dashboard) .dashboard-geometry-toolbar {
  position: absolute;
  right: 8px;
  bottom: 8px;
  left: 8px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 7px 6px 10px;
  border: 1px solid rgba(104, 144, 190, 0.4);
  border-radius: 9px;
  background: rgba(247, 251, 255, 0.9);
  box-shadow: 0 3px 12px rgba(30, 65, 103, 0.12);
  color: #48627f;
  backdrop-filter: blur(8px);
}

:where(html.app-page--dashboard) .dashboard-geometry-status {
  min-width: 0;
  overflow: hidden;
  color: #48627f;
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:where(html.app-page--dashboard) .dashboard-geometry-status.is-error {
  color: #fecaca;
  white-space: normal;
}

:where(html.app-page--dashboard) .dashboard-geometry-fit {
  flex: 0 0 auto;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid rgba(84, 121, 163, 0.46);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.76);
  color: #173b67;
  font-size: 10px;
}

:where(html.app-page--dashboard) .dashboard-geometry-fit:hover {
  border-color: #3977bb;
  background: #ffffff;
  color: #102a4a;
}

:where(html.app-page--dashboard) .dashboard-geometry-snap {
  position: absolute;
  z-index: 6;
  width: 12px;
  height: 12px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #ff8a24;
  box-shadow: 0 0 0 2px rgba(185, 82, 0, 0.68), 0 2px 8px rgba(23, 59, 103, 0.35);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

:where(html.app-page--dashboard) .dashboard-geometry-info {
  position: absolute;
  z-index: 7;
  width: min(280px, calc(100% - 16px));
  padding: 10px 11px;
  border: 1px solid rgba(147, 197, 253, 0.72);
  border-radius: 10px;
  background: rgba(248, 251, 255, 0.98);
  box-shadow: 0 14px 34px rgba(2, 6, 23, 0.3);
  color: #17324f;
  font-size: 11px;
  line-height: 1.35;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

:where(html.app-page--dashboard) .dashboard-geometry-info strong {
  display: block;
  margin-bottom: 5px;
  overflow-wrap: anywhere;
  color: #102a4a;
}

:where(html.app-page--dashboard) .dashboard-geometry-info div {
  display: grid;
  grid-template-columns: minmax(74px, auto) minmax(0, 1fr);
  gap: 5px;
  margin-top: 2px;
}

:where(html.app-page--dashboard) .dashboard-geometry-info span {
  color: #67809c;
}

:where(html.app-page--dashboard) .dashboard-geometry-info b {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
  white-space: pre-wrap;
}

:where(html.app-page--dashboard) .chart-empty,
:where(html.app-page--dashboard) .chart-error,
:where(html.app-page--dashboard) .chart-loading {
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  color: #6e6e73;
  font-size: 13px;
  text-align: center;
}

:where(html.app-page--dashboard) .chart-error {
  color: #b91c1c;
  background: #fff5f5;
}

:where(html.app-page--dashboard) .chart-loading {
  color: #1e40af;
  background: #eff6ff;
}

:where(html.app-page--dashboard) .dashboard-chart {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
}

:where(html.app-page--dashboard) .chart-axis {
  stroke: #9ca3af;
  stroke-width: 1;
}

:where(html.app-page--dashboard) .chart-grid {
  stroke: #e5e7eb;
  stroke-width: 1;
}

:where(html.app-page--dashboard) .chart-label {
  fill: #6b7280;
  font-size: 11px;
}

:where(html.app-page--dashboard) .chart-legend {
  fill: #4b5563;
  font-size: 11px;
}

:where(html.app-page--dashboard) .chart-tooltip-target {
  cursor: default;
}

:where(html.app-page--dashboard) .chart-bar,
:where(html.app-page--dashboard) .chart-point,
:where(html.app-page--dashboard) .chart-slice,
:where(html.app-page--dashboard) .chart-series-line-stroke,
:where(html.app-page--dashboard) .chart-series-area-fill {
  transition: opacity 55ms ease, stroke-width 55ms ease, filter 55ms ease;
}

:where(html.app-page--dashboard) .chart-bar.is-active,
:where(html.app-page--dashboard) .chart-point.is-active,
:where(html.app-page--dashboard) .chart-slice.is-active {
  filter: drop-shadow(0 2px 4px rgba(15, 23, 42, 0.26));
}

:where(html.app-page--dashboard) .chart-point.is-active {
  stroke: #111827;
  stroke-width: 2;
}

:where(html.app-page--dashboard) .chart-series-line-hit {
  fill: none;
  stroke: rgba(0, 0, 0, 0);
  stroke-width: 16;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: stroke;
}

:where(html.app-page--dashboard) .chart-series-area-hit {
  fill: rgba(0, 0, 0, 0);
  stroke: none;
  pointer-events: fill;
}

:where(html.app-page--dashboard) .chart-series.is-active .chart-series-line-stroke {
  stroke-width: 4.2;
}

:where(html.app-page--dashboard) .chart-series.is-active .chart-series-area-fill {
  opacity: 0.28;
}

:where(html.app-page--dashboard) .parallel-line {
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.42;
  pointer-events: none;
  transition: opacity 55ms ease, stroke-width 55ms ease;
}

:where(html.app-page--dashboard) .parallel-hit-line {
  fill: none;
  stroke: rgba(0, 0, 0, 0);
  stroke-width: 16;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: stroke;
}

:where(html.app-page--dashboard) .parallel-series:hover .parallel-line,
:where(html.app-page--dashboard) .parallel-series.is-active .parallel-line {
  opacity: 1;
  stroke-width: 4.2;
}

:where(html.app-page--dashboard) .parallel-series.is-filtered-out .parallel-line {
  stroke: #cbd5e1;
  opacity: 0.32;
}

:where(html.app-page--dashboard) .parallel-series.is-filtered-out,
:where(html.app-page--dashboard) .parallel-series.is-filtered-out .parallel-hit-line {
  pointer-events: none;
}

:where(html.app-page--dashboard) .parallel-chart-tooltip {
  position: fixed;
  z-index: 3000;
  max-width: min(320px, calc(100vw - 16px));
  padding: 9px 10px;
  border: 1px solid rgba(31, 41, 55, 0.2);
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.94);
  color: #ffffff;
  box-shadow: rgba(15, 23, 42, 0.22) 0 10px 28px;
  font-size: 12px;
  line-height: 1.35;
  pointer-events: none;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 45ms ease, transform 45ms ease;
}

:where(html.app-page--dashboard) .parallel-chart-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

:where(html.app-page--dashboard) .parallel-chart-tooltip-title {
  margin-bottom: 5px;
  font-weight: 700;
}

:where(html.app-page--dashboard) .parallel-chart-tooltip-row {
  color: rgba(255, 255, 255, 0.86);
  overflow-wrap: anywhere;
}

:where(html.app-page--dashboard) .parallel-filter-track {
  stroke: rgba(107, 114, 128, 0.28);
  stroke-width: 9;
  stroke-linecap: round;
  pointer-events: none;
}

:where(html.app-page--dashboard) .parallel-filter-window {
  stroke: rgba(0, 113, 227, 0.24);
  stroke-width: 9;
  stroke-linecap: round;
  pointer-events: none;
}

:where(html.app-page--dashboard) .parallel-filter-window.is-active {
  stroke: rgba(0, 113, 227, 0.48);
}

:where(html.app-page--dashboard) .parallel-filter-reset-hit {
  fill: none;
  stroke: rgba(0, 0, 0, 0);
  stroke-width: 22;
  stroke-linecap: round;
  pointer-events: stroke;
  cursor: ns-resize;
}

:where(html.app-page--dashboard) .parallel-filter-handle {
  cursor: ns-resize;
  pointer-events: all;
}

:where(html.app-page--dashboard) .parallel-filter-handle-hit {
  fill: rgba(255, 255, 255, 0);
}

:where(html.app-page--dashboard) .parallel-filter-handle-shape {
  fill: #ffffff;
  stroke: #4b5563;
  stroke-width: 1.4;
  filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.24));
}

:where(html.app-page--dashboard) .parallel-filter-handle:hover .parallel-filter-handle-shape,
:where(html.app-page--dashboard) .parallel-filter-handle.is-active .parallel-filter-handle-shape,
:where(html.app-page--dashboard) body.parallel-filter-dragging .parallel-filter-handle-shape {
  fill: #0071e3;
  stroke: #005bb5;
}

:where(html.app-page--dashboard) .parallel-filter-value {
  fill: #005bb5;
  font-size: 10px;
  font-weight: 700;
  paint-order: stroke;
  stroke: #ffffff;
  stroke-width: 3px;
  pointer-events: none;
}

:where(html.app-page--dashboard) .parallel-filter-empty-label {
  fill: #6b7280;
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
}

:where(html.app-page--dashboard) body.parallel-filter-dragging,
:where(html.app-page--dashboard) body.parallel-filter-dragging * {
  cursor: ns-resize !important;
  user-select: none;
}

:where(html.app-page--dashboard) .dashboard-table-wrap {
  height: 100%;
  min-height: 0;
  overflow: auto;
  background: #ffffff;
}

:where(html.app-page--dashboard) .dashboard-table {
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

:where(html.app-page--dashboard) .dashboard-table th,
:where(html.app-page--dashboard) .dashboard-table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:where(html.app-page--dashboard) .dashboard-table th {
  position: sticky;
  top: 0;
  background: #ffffff;
  color: #374151;
  font-weight: 700;
  z-index: 1;
  overflow: visible;
}

:where(html.app-page--dashboard) .dashboard-table-sort {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  min-width: 0;
  min-height: 24px;
  padding: 0 4px;
  border: 0 !important;
  border-radius: 0 !important;
  background: #ffffff !important;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: none !important;
}

:where(html.app-page--dashboard) .dashboard-table-sort:hover,
:where(html.app-page--dashboard) .dashboard-table-sort:focus,
:where(html.app-page--dashboard) .dashboard-table-sort:active {
  border-radius: 0 !important;
  background: #f3f4f6 !important;
  box-shadow: none !important;
  outline: none;
}

:where(html.app-page--dashboard) .dashboard-table-sort span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

:where(html.app-page--dashboard) .dashboard-table-sort-marker {
  flex: 0 0 auto;
  min-width: 24px;
  color: #4b5563;
  font-size: 10px;
  font-weight: 800;
  text-align: right;
}

:where(html.app-page--dashboard) .dashboard-table-sort.is-active {
  color: #1e40af;
}

:where(html.app-page--dashboard) .dashboard-table-column-resize {
  position: absolute;
  top: 0;
  right: -7px;
  z-index: 3;
  width: 14px;
  height: 100%;
  cursor: col-resize;
  background: transparent;
}

:where(html.app-page--dashboard) .dashboard-table-column-resize::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 50%;
  width: 1px;
  background: #d1d5db;
  transform: translateX(-50%);
}

:where(html.app-page--dashboard) .dashboard-table-column-resize:hover,
:where(html.app-page--dashboard) body.dashboard-table-column-resizing .dashboard-table-column-resize {
  background: rgba(0, 113, 227, 0.16);
}

:where(html.app-page--dashboard) body.dashboard-table-column-resizing,
:where(html.app-page--dashboard) body.dashboard-table-column-resizing * {
  cursor: col-resize !important;
  user-select: none;
}

:where(html.app-page--dashboard) .dashboard-table tbody tr:hover td {
  background: #f3f4f6;
}

:where(html.app-page--dashboard) .metric-card-value {
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 18px;
  background: #ffffff;
}

:where(html.app-page--dashboard) .metric-card-value strong {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: #111827;
  font-size: clamp(28px, 6vw, 64px);
  line-height: 1;
  text-align: center;
}

:where(html.app-page--dashboard) .metric-card-value span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #6b7280;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

:where(html.app-page--dashboard) .resize-handle {
  display: block;
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
  border-right: 2px solid #8e8e93;
  border-bottom: 2px solid #8e8e93;
  border-bottom-right-radius: 2px;
}

:where(html.app-page--dashboard) .chart-config-panel {
  width: min(620px, calc(100vw - 24px));
}

:where(html.app-page--dashboard) #chart-config-modal {
  z-index: 6000;
}

:where(html.app-page--dashboard) .chart-config-form {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

:where(html.app-page--dashboard) .chart-config-form label,
:where(html.app-page--dashboard) .chart-config-check span {
  font-size: 13px;
  color: #4b5563;
  font-weight: 600;
}

:where(html.app-page--dashboard) .chart-config-form input:not([type="checkbox"]),
:where(html.app-page--dashboard) .chart-config-form select {
  width: 100%;
  min-width: 0;
}

:where(html.app-page--dashboard) .chart-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

:where(html.app-page--dashboard) .chart-config-grid > div {
  display: grid;
  gap: 8px;
  min-width: 0;
}

:where(html.app-page--dashboard) .chart-config-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

:where(html.app-page--dashboard) .chart-config-parallel-fields {
  display: grid;
  gap: 8px;
}

:where(html.app-page--dashboard) .parallel-field-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 180px;
  overflow: auto;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

:where(html.app-page--dashboard) .parallel-field-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  color: #374151;
}

:where(html.app-page--dashboard) .parallel-field-option input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

:where(html.app-page--dashboard) .parallel-field-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:where(html.app-page--dashboard) .parallel-field-empty {
  color: #6b7280;
  font-size: 12px;
}

:where(html.app-page--dashboard) .chart-config-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
}

:where(html.app-page--dashboard) .chart-config-check input {
  width: 16px;
  height: 16px;
}

@media (max-width: 768px) {
  :where(html.app-page--dashboard) .dashboard-toolbar {
    flex-direction: column;
    gap: 8px;
    height: auto;
    max-height: none;
    align-items: stretch;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  :where(html.app-page--dashboard) .toolbar-group {
    flex-wrap: wrap;
  }

  :where(html.app-page--dashboard) .dashboard-card {
    width: 320px;
  }

  :where(html.app-page--dashboard) .dashboard-card-controls {
    grid-template-columns: 1fr;
  }

  :where(html.app-page--dashboard) .dashboard-card-state {
    max-width: 100%;
    text-align: left;
  }

  :where(html.app-page--dashboard) .chart-config-grid {
    grid-template-columns: 1fr;
  }

  :where(html.app-page--dashboard) .parallel-field-list {
    grid-template-columns: 1fr;
  }

  :where(html.app-page--dashboard) .lane span {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 0.12em;
    font-size: clamp(18px, 5vw, 28px);
  }
}

/* ==========================================================================
   7. Parametric flow designer
   ========================================================================== */

:where(html.app-page--flow) body {
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
}

:where(html.app-page--flow) body.python-fullscreen-active {
  overflow: hidden;
}

:where(html.app-page--flow) .canvas-toolbar #ai-generate-flow {
  border-color: #0071e3;
  color: #005bb5;
  font-weight: 700;
}

:where(html.app-page--flow) .canvas-toolbar #ai-generate-flow:not(:disabled):hover {
  border-color: #005bb5;
  background: #f0f7ff;
}

:where(html.app-page--flow) .canvas-toolbar #ai-generate-flow.ai-ready {
  background: #eaf4ff;
}

:where(html.app-page--flow) body.terminal-resizing {
  cursor: ns-resize;
  user-select: none;
}

:where(html.app-page--flow) #python-fullscreen-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  bottom: var(--terminal-panel-space, 0px);
  background: rgba(15, 23, 42, 0.45);
  z-index: 9990;
  display: none;
}

:where(html.app-page--flow) body.python-fullscreen-active #python-fullscreen-backdrop {
  display: block;
}

:where(html.app-page--flow) .toolbar-dropdown {
  position: relative;
}

:where(html.app-page--flow) .canvas-toolbar .add-node-btn {
  gap: 8px;
}

:where(html.app-page--flow) .canvas-toolbar .dropdown-menu {
  border-radius: var(--control-radius);
}

:where(html.app-page--flow) .canvas-toolbar .dropdown-menu button {
  justify-content: flex-start;
  height: 30px !important;
  min-height: 30px !important;
  border-radius: calc(var(--control-radius) - 2px) !important;
  padding-inline: 12px !important;
}

:where(html.app-page--flow) .dropdown-caret {
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

:where(html.app-page--flow) .dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 148px;
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  border: 1px solid #d2d2d7;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
  z-index: 2100;
}

:where(html.app-page--flow) .toolbar-dropdown.open .dropdown-menu {
  display: flex;
}

:where(html.app-page--flow) .dropdown-menu button {
  width: 100%;
  text-align: left;
}

:where(html.app-page--flow) #canvas-wrapper {
  position: relative;
  margin: 10px 14px;
  border: 1px solid #d2d2d7;
  border-style: dashed;
  border-radius: 18px;
  min-height: 0;
  align-self: stretch;
  overflow: hidden;
  background: #f2f4f7;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.08);
}

:where(html.app-page--flow) #canvas-wrapper.flow-grid-enabled::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(0, 113, 227, 0.18) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 113, 227, 0.18) 1px, transparent 1px);
  background-size:
    var(--flow-grid-size, 24px) var(--flow-grid-size, 24px),
    var(--flow-grid-size, 24px) var(--flow-grid-size, 24px);
  background-position:
    var(--flow-grid-offset-x, 0px) var(--flow-grid-offset-y, 0px),
    var(--flow-grid-offset-x, 0px) var(--flow-grid-offset-y, 0px);
}

:where(html.app-page--flow) #canvas-wrapper::after {
  content: "Ctrl + mouse wheel  \2014  Zoom\A Ctrl + middle-button drag  \2014  Pan";
  position: absolute;
  left: 18px;
  bottom: 16px;
  z-index: 1;
  color: rgba(81, 81, 84, 0.42);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.65;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: pre;
  pointer-events: none;
  user-select: none;
}

:where(html.app-page--flow) #canvas-wrapper.can-pan {
  cursor: grab;
}

:where(html.app-page--flow) #canvas-wrapper.is-panning {
  cursor: grabbing;
  user-select: none;
}

:where(html.app-page--flow) .lane-guides {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

:where(html.app-page--flow) .lane {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

:where(html.app-page--flow) .lane-canvas {
  background: #e9ecef;
  width: 100%;
  height: 100%;
}

:where(html.app-page--flow) .lane span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  font-size: clamp(26px, 4vw, 56px);
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #ced4da;
  user-select: none;
}

:where(html.app-page--flow) .lane-canvas span {
  color: #ced4da;
}

:where(html.app-page--flow) #canvas {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 62vh;
  z-index: 10;
}

:where(html.app-page--flow) #edge-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: auto;
  overflow: visible;
}

:where(html.app-page--flow) .run-timer {
  position: absolute;
  right: 12px;
  bottom: 160px;
  z-index: 21;
  min-width: 158px;
  padding: 6px 10px;
  border: 1px solid #c7c7cc;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: rgba(99, 99, 99, 0.14) 0px 2px 8px 0px;
  color: #515154;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  backdrop-filter: blur(3px);
}

:where(html.app-page--flow) .run-timer.is-running {
  color: #0f5132;
  border-color: #9fd8b4;
  background: rgba(236, 253, 245, 0.96);
}

:where(html.app-page--flow) #minimap {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 220px;
  height: 140px;
  z-index: 20;
  border: 1px solid #c7c7cc;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(3px);
  overflow: hidden;
  box-shadow: rgba(99, 99, 99, 0.18) 0px 2px 8px 0px;
}

:where(html.app-page--flow) #minimap-layer {
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
}

:where(html.app-page--flow) #minimap-viewport {
  position: absolute;
  border: 2px solid #0071e3;
  background: rgba(0, 113, 227, 0.12);
  pointer-events: none;
  border-radius: 4px;
}

:where(html.app-page--flow) .edge {
  fill: none;
  stroke: #6c757d;
  stroke-width: 3;
  pointer-events: none;
  cursor: pointer;
  transition: stroke 120ms ease, stroke-width 120ms ease;
}

:where(html.app-page--flow) .edge:hover {
  stroke: #dc2626;
  stroke-width: 4;
}

:where(html.app-page--flow) .edge-hover {
  stroke: #dc2626;
  stroke-width: 4;
}

:where(html.app-page--flow) .edge.pending {
  stroke-dasharray: 8 5;
  stroke: #6c757d;
  pointer-events: none;
  cursor: default;
}

:where(html.app-page--flow) .edge-hit {
  fill: none;
  stroke: rgba(0, 0, 0, 0);
  pointer-events: stroke;
  cursor: pointer;
}

:where(html.app-page--flow) .node {
  position: absolute;
  width: 260px;
  border-radius: 16px;
  border: 1px solid #d2d2d7;
  background: var(--card);
  box-shadow: rgba(0, 0, 0, 0.19) 0px 10px 20px, rgba(0, 0, 0, 0.23) 0px 6px 6px;
}

:where(html.app-page--flow) .node-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 44px;
  padding: 10px 12px;
  border-bottom: 1px solid #e5e5ea;
  color: #1d1d1f;
  font-weight: 600;
  cursor: default;
}

:where(html.app-page--flow) .node-title {
  cursor: move;
  user-select: none;
}

:where(html.app-page--flow) .python-node-id {
  margin-left: 8px;
  font-size: 11px;
  font-weight: 500;
  color: #6b7280;
  letter-spacing: 0.01em;
  user-select: text;
}

:where(html.app-page--flow) .node-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

:where(html.app-page--flow) .node-delete {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  font-size: 11px;
  line-height: 1;
}

:where(html.app-page--flow) .node .node-duplicate {
  min-width: 0;
  width: auto;
  height: 18px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #6e6e73;
  font-size: 15px;
  line-height: 1;
}

:where(html.app-page--flow) .node .node-duplicate:hover {
  background: transparent;
  border: 0;
  color: #1f2937;
}

:where(html.app-page--flow) .node-body {
  padding: 10px 12px 12px;
}

:where(html.app-page--flow) .node .node-body label {
  color: #515154;
}

:where(html.app-page--flow) .node textarea,
:where(html.app-page--flow) .node input,
:where(html.app-page--flow) .node select {
  width: 100%;
  border: 1px solid #d2d2d7;
  border-radius: 5px !important;
  padding: 8px;
  background: #ffffff;
  color: #1d1d1f;
  font-family: "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
}

:where(html.app-page--flow) .node input,
:where(html.app-page--flow) .node select {
  border-radius: 5px !important;
}

:where(html.app-page--flow) .node textarea:focus,
:where(html.app-page--flow) .node input:focus,
:where(html.app-page--flow) .node select:focus {
  outline: 0;
  border-color: #0071e3;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.18);
}

:where(html.app-page--flow) .node button {
  background: #f5f5f7;
  color: #1d1d1f;
  border: 1px solid #d2d2d7;
}

:where(html.app-page--flow) .node textarea {
  min-height: 140px;
  resize: vertical;
}

:where(html.app-page--flow) .node-contract-details {
  flex: 0 0 auto;
  border: 1px solid rgba(110, 110, 115, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  overflow: hidden;
}

:where(html.app-page--flow) .node-contract-details summary {
  padding: 7px 9px;
  color: #515154;
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.01em;
  list-style-position: inside;
  user-select: none;
}

:where(html.app-page--flow) .node-contract-details[open] summary {
  border-bottom: 1px solid rgba(110, 110, 115, 0.18);
}

:where(html.app-page--flow) .node-contract-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(72px, 0.52fr);
  gap: 8px;
  padding: 9px;
}

:where(html.app-page--flow) .node-contract-fields label {
  display: grid;
  gap: 4px;
  min-width: 0;
  font-size: 10px;
}

:where(html.app-page--flow) .node-contract-fields .node-contract-description-field {
  grid-column: 1 / -1;
}

:where(html.app-page--flow) .node-contract-fields textarea {
  min-height: 54px;
  resize: vertical;
}

:where(html.app-page--flow) .node-contract-fields textarea[aria-invalid="true"] {
  border-color: #c43831;
  box-shadow: 0 0 0 3px rgba(196, 56, 49, 0.12);
}

:where(html.app-page--flow) .node-contract-required {
  display: flex !important;
  grid-column: 1 / -1;
  grid-template-columns: none !important;
  flex-direction: row;
  align-items: center;
  gap: 7px !important;
}

:where(html.app-page--flow) .node-contract-required input {
  width: 15px;
  height: 15px;
  margin: 0;
}

:where(html.app-page--flow) .node.node-input.input-json-mode .node-body {
  height: calc(100% - 44px);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

:where(html.app-page--flow) .node.node-input.input-json-mode .input-value-json {
  flex: 1 1 auto;
  min-height: 72px;
  resize: none;
  overflow: auto;
}

:where(html.app-page--flow) .python-editor {
  width: 100%;
  height: 180px;
  border: 1px solid #1f2937;
  border-radius: 5px;
  overflow: hidden;
  margin-top: 6px;
}

:where(html.app-page--flow) .python-subtitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

:where(html.app-page--flow) .node.node-python .python-subtitle label {
  margin: 0;
}

:where(html.app-page--flow) .python-runtime-value {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: #9da3ad;
  white-space: nowrap;
}

:where(html.app-page--flow) .node.node-python {
  min-width: 300px;
  min-height: 220px;
  background: #1e1e1e;
  border: 1px solid #2d2d30;
  border-radius: 16px;
  color: #d4d4d4;
  box-shadow: rgba(0, 0, 0, 0.19) 0px 10px 20px, rgba(0, 0, 0, 0.23) 0px 6px 6px;
}

:where(html.app-page--flow) .node.node-python .node-header {
  background: #252526;
  border-bottom: 1px solid #2d2d30;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  color: #d4d4d4;
}

:where(html.app-page--flow) .node.node-python .node-duplicate {
  color: #c7ccd3;
}

:where(html.app-page--flow) .node.node-python .node-duplicate:hover {
  color: #ffffff;
}

:where(html.app-page--flow) .node.node-python .node-toggle-fullscreen {
  background: #3c3c3c;
  color: #f3f3f3;
  border: 1px solid #4d4d50;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
}

:where(html.app-page--flow) .node.node-python .node-toggle-fullscreen:hover {
  background: #4b4b4e;
  border-color: #5f6064;
}

:where(html.app-page--flow) .node.node-python .node-body label {
  color: #9da3ad;
}

:where(html.app-page--flow) .node.node-python .node-body {
  height: calc(100% - 44px);
  display: flex;
  flex-direction: column;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

:where(html.app-page--flow) .node.node-python .python-editor {
  flex: 1;
  min-height: 0;
  border: 1px solid #3a3d41;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px #141414;
}

:where(html.app-page--flow) .node.node-python.node-fullscreen {
  position: fixed !important;
  left: 0 !important;
  top: 0 !important;
  width: 100vw !important;
  height: calc(100vh - var(--terminal-panel-space, 0px)) !important;
  border-radius: 0 !important;
  z-index: 10000 !important;
  margin: 0 !important;
  transform: none !important;
}

:where(html.app-page--flow) .node.node-python.node-fullscreen .handle-in,
:where(html.app-page--flow) .node.node-python.node-fullscreen .handle-out,
:where(html.app-page--flow) .node.node-python.node-fullscreen .resize-handle {
  display: none;
}

:where(html.app-page--flow) .node.node-python.node-fullscreen .node-header {
  position: relative;
  height: 52px;
  padding: 12px 16px;
  padding-right: 110px;
}

:where(html.app-page--flow) .node.node-python.node-fullscreen .node-toggle-fullscreen {
  position: absolute;
  top: 10px;
  right: 12px;
}

:where(html.app-page--flow) .node.node-python.node-fullscreen .node-body {
  height: calc(100% - 52px);
  padding: 12px 16px 16px;
}

:where(html.app-page--flow) .node.node-python.node-fullscreen .python-editor {
  height: 100%;
}

:where(html.app-page--flow) .node.node-dbtable {
  width: 320px;
}
:where(html.app-page--flow) .node.node-dbrow {
  width: 320px;
}
:where(html.app-page--flow) .node.node-dbcolumn {
  width: 320px;
}
:where(html.app-page--flow) .node.node-dbvalue {
  width: 320px;
}

:where(html.app-page--flow) .node.node-ifcproject,
:where(html.app-page--flow) .node.node-ifcsite,
:where(html.app-page--flow) .node.node-ifcbuilding,
:where(html.app-page--flow) .node.node-ifcstorey,
:where(html.app-page--flow) .node.node-ifcspace,
:where(html.app-page--flow) .node.node-ifcelement,
:where(html.app-page--flow) .node.node-ifcentity {
  width: 340px;
  background: #a7f3d0;
  border-color: #5eead4;
}

:where(html.app-page--flow) .node.node-dbtable,
:where(html.app-page--flow) .node.node-dbrow,
:where(html.app-page--flow) .node.node-dbcolumn,
:where(html.app-page--flow) .node.node-dbvalue {
  background: #95d5b2;
  border-color: #74c69d;
}

:where(html.app-page--flow) .node.node-dbtable .node-header,
:where(html.app-page--flow) .node.node-dbrow .node-header,
:where(html.app-page--flow) .node.node-dbcolumn .node-header,
:where(html.app-page--flow) .node.node-dbvalue .node-header {
  background: #95d5b2;
  border-bottom-color: #74c69d;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}

:where(html.app-page--flow) .node.node-dbtable .node-body,
:where(html.app-page--flow) .node.node-dbrow .node-body,
:where(html.app-page--flow) .node.node-dbcolumn .node-body,
:where(html.app-page--flow) .node.node-dbvalue .node-body {
  background: #95d5b2;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

:where(html.app-page--flow) .node.node-ifcproject .node-header,
:where(html.app-page--flow) .node.node-ifcsite .node-header,
:where(html.app-page--flow) .node.node-ifcbuilding .node-header,
:where(html.app-page--flow) .node.node-ifcstorey .node-header,
:where(html.app-page--flow) .node.node-ifcspace .node-header,
:where(html.app-page--flow) .node.node-ifcelement .node-header,
:where(html.app-page--flow) .node.node-ifcentity .node-header {
  background: #a7f3d0;
  border-bottom-color: #5eead4;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}

:where(html.app-page--flow) .node.node-ifcproject .node-body,
:where(html.app-page--flow) .node.node-ifcsite .node-body,
:where(html.app-page--flow) .node.node-ifcbuilding .node-body,
:where(html.app-page--flow) .node.node-ifcstorey .node-body,
:where(html.app-page--flow) .node.node-ifcspace .node-body,
:where(html.app-page--flow) .node.node-ifcelement .node-body,
:where(html.app-page--flow) .node.node-ifcentity .node-body {
  background: #a7f3d0;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

:where(html.app-page--flow) .node.node-input,
:where(html.app-page--flow) .node.node-flowinput {
  background: #fae588;
  border-color: #d9c96b;
}

:where(html.app-page--flow) .node.node-input .node-header,
:where(html.app-page--flow) .node.node-flowinput .node-header {
  background: #fae588;
  border-bottom-color: #d9c96b;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}

:where(html.app-page--flow) .node.node-input .node-body,
:where(html.app-page--flow) .node.node-flowinput .node-body {
  background: #fae588;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

:where(html.app-page--flow) .node.node-map {
  width: 380px;
  min-width: 320px;
  min-height: 340px;
  border-color: #72b5a3;
  background: #dff4ec;
}

:where(html.app-page--flow) .node.node-map .node-header {
  background: #dff4ec;
  border-bottom-color: #9dcfbe;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}

:where(html.app-page--flow) .node.node-map .map-info-toggle {
  display: inline-grid;
  flex: 0 0 18px !important;
  place-items: center;
  box-sizing: border-box;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  padding: 0 !important;
  border: 1.5px solid rgba(49, 95, 82, 0.78);
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.46);
  color: #315f52;
  font-size: 0;
  line-height: 0;
  appearance: none;
}

:where(html.app-page--flow) .node.node-map .map-info-toggle svg {
  display: block;
  width: 9px;
  height: 11px;
  overflow: visible;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

:where(html.app-page--flow) .node.node-map .map-info-toggle:hover,
:where(html.app-page--flow) .node.node-map .map-info-toggle.is-active {
  border-color: #1f4d40;
  background: rgba(255, 255, 255, 0.9);
  color: #1f4d40;
}

:where(html.app-page--flow) .node.node-map .node-body {
  position: relative;
  display: flex;
  height: calc(100% - 44px);
  min-height: 0;
  flex-direction: column;
  gap: 8px;
  background: #dff4ec;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

:where(html.app-page--flow) .map-polygon-toggle {
  display: inline-flex !important;
  flex: 0 0 auto;
  align-items: center;
  align-self: flex-start;
  gap: 6px;
  min-width: 0;
  color: #315f52 !important;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

:where(html.app-page--flow) .map-polygon-toggle input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #315f52;
}

:where(html.app-page--flow) .map-polygon-toggle:has(input:disabled) {
  cursor: default;
  opacity: 0.65;
}

:where(html.app-page--flow) .map-node-canvas {
  position: relative;
  z-index: 0;
  flex: 1 1 auto;
  width: 100%;
  min-height: 190px;
  overflow: hidden;
  border: 1px solid #72b5a3;
  border-radius: 10px;
  background: #d8e8e2;
}

:where(html.app-page--flow) .map-node-canvas-unavailable {
  display: grid;
  place-items: center;
  padding: 18px;
  color: #315f52;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

:where(html.app-page--flow) .map-node-hint {
  flex: 0 0 auto;
  color: #315f52;
  font-size: 11px;
  line-height: 1.3;
}

:where(html.app-page--flow) .map-pin-popup strong {
  display: block;
  color: #1f4d40;
  font-size: 11px;
}

:where(html.app-page--flow) .map-pin-popup > span {
  display: block;
  margin-top: 5px;
  color: #46776a;
  font-size: 10px;
}

:where(html.app-page--flow) .leaflet-tooltip.map-polygon-metrics-tooltip {
  padding: 7px 8px;
  border: 1px solid rgba(49, 95, 82, 0.58);
  border-radius: 8px;
  background: rgba(248, 255, 252, 0.98);
  box-shadow: 0 5px 16px rgba(35, 83, 69, 0.22);
  color: #294f45;
}

:where(html.app-page--flow) .map-polygon-metrics {
  display: grid;
  gap: 2px;
  font-size: 10px;
  line-height: 1.35;
}

:where(html.app-page--flow) .map-polygon-metrics strong {
  margin-bottom: 2px;
  color: #1f4d40;
  font-size: 11px;
}

:where(html.app-page--flow) .map-polygon-metrics span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

:where(html.app-page--flow) .map-pin-marker-icon {
  border: 0;
  background: transparent;
}

:where(html.app-page--flow) .map-pin-marker {
  display: block;
  width: 30px;
  height: 42px;
  overflow: visible;
  filter: drop-shadow(0 2px 2px rgba(24, 52, 44, 0.35));
}

:where(html.app-page--flow) .map-pin-marker path {
  fill: var(--map-pin-color);
  stroke: #ffffff;
  stroke-width: 1.5;
}

:where(html.app-page--flow) .map-pin-marker circle {
  fill: #ffffff;
  stroke: rgba(31, 77, 64, 0.28);
  stroke-width: 1;
}

:where(html.app-page--flow) .map-pin-marker-green,
:where(html.app-page--flow) .map-info-color-green {
  --map-pin-color: #2f9e44;
}

:where(html.app-page--flow) .map-pin-marker-blue,
:where(html.app-page--flow) .map-info-color-blue {
  --map-pin-color: #3478f6;
}

:where(html.app-page--flow) .map-pin-marker-red,
:where(html.app-page--flow) .map-info-color-red {
  --map-pin-color: #e03131;
}

:where(html.app-page--flow) .map-pin-marker-yellow,
:where(html.app-page--flow) .map-info-color-yellow {
  --map-pin-color: #f2c94c;
}

:where(html.app-page--flow) .map-pin-marker-orange,
:where(html.app-page--flow) .map-info-color-orange {
  --map-pin-color: #f08c00;
}

:where(html.app-page--flow) .map-pin-marker-pink,
:where(html.app-page--flow) .map-info-color-pink {
  --map-pin-color: #d63384;
}

:where(html.app-page--flow) .map-pin-marker-purple,
:where(html.app-page--flow) .map-info-color-purple {
  --map-pin-color: #7950f2;
}

:where(html.app-page--flow) .map-info-panel {
  position: absolute;
  inset: 8px 10px 10px;
  z-index: 1001;
  display: flex;
  min-height: 0;
  padding: 10px;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid #72b5a3;
  border-radius: 10px;
  background: rgba(248, 255, 252, 0.98);
  box-shadow: 0 10px 28px rgba(35, 83, 69, 0.24);
  color: #294f45;
  font-size: 10px;
  line-height: 1.4;
}

:where(html.app-page--flow) .map-info-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  color: #1f4d40;
  font-size: 13px;
}

:where(html.app-page--flow) .node.node-map .map-info-close {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  border-color: #9dcfbe;
  border-radius: 999px;
  background: #ffffff;
  color: #315f52;
  font-size: 17px;
  line-height: 20px;
}

:where(html.app-page--flow) .map-info-content {
  display: flex;
  min-height: 0;
  overflow: auto;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 9px;
}

:where(html.app-page--flow) .map-info-pin-list {
  display: grid;
  gap: 7px;
}

:where(html.app-page--flow) .map-info-pin {
  padding: 7px 8px;
  border: 1px solid rgba(114, 181, 163, 0.58);
  border-radius: 8px;
  background: #ffffff;
}

:where(html.app-page--flow) .map-info-pin-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

:where(html.app-page--flow) .map-info-color {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border: 1px solid rgba(31, 77, 64, 0.28);
  border-radius: 50%;
  background: var(--map-pin-color);
}

:where(html.app-page--flow) .map-info-pin-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 3px;
  color: #46776a;
  font-size: 9px;
}

:where(html.app-page--flow) .map-info-pin p {
  margin: 5px 0 0;
  white-space: pre-wrap;
}

:where(html.app-page--flow) .map-info-pin pre {
  margin: 5px 0 0;
  padding: 5px;
  overflow: auto;
  border-radius: 5px;
  background: #edf8f4;
  color: #315f52;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
  line-height: 1.3;
  white-space: pre-wrap;
  word-break: break-word;
}

:where(html.app-page--flow) .map-info-empty {
  margin: 0;
  color: #46776a;
}

:where(html.app-page--flow) .map-info-schema {
  display: grid;
  gap: 4px;
  padding: 7px 8px;
  border-radius: 8px;
  background: #e7f5ef;
  color: #315f52;
}

:where(html.app-page--flow) .map-info-schema code {
  overflow-wrap: anywhere;
  color: #1f4d40;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
}

:where(html.app-page--flow) .node.node-map .leaflet-control-attribution {
  font-size: 9px;
}

:where(html.app-page--flow) .node.node-map .handle,
:where(html.app-page--flow) .node.node-map .resize-handle {
  z-index: 2;
}

:where(html.app-page--flow) .flow-input-runtime-grid {
  margin-top: 6px;
  display: grid;
  gap: 8px;
}

:where(html.app-page--flow) .flow-input-runtime-row {
  display: grid;
  gap: 4px;
}

:where(html.app-page--flow) .flow-input-runtime-row span {
  font-size: 12px;
  color: #5d4f1a;
}

:where(html.app-page--flow) .flow-input-runtime-row span em {
  font-style: normal;
  opacity: 0.8;
  margin-left: 4px;
}

:where(html.app-page--flow) .flow-input-runtime-field {
  width: 100%;
}

:where(html.app-page--flow) .flow-input-runtime-field-json {
  min-height: 70px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

:where(html.app-page--flow) .flow-input-example-code {
  margin: 0;
  max-height: 160px;
  overflow: auto;
  border: 1px solid #d4c26d;
  border-radius: 6px;
  background: #fffbe6;
  color: #3f3510;
  padding: 8px;
  font-size: 12px;
  line-height: 1.4;
  white-space: pre;
}

:where(html.app-page--flow) .flow-input-refresh {
  margin-top: 8px;
}

:where(html.app-page--flow) .input-slider-config {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

:where(html.app-page--flow) .input-slider-config label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

:where(html.app-page--flow) .input-slider-config span {
  color: #515154;
  font-size: 12px;
  font-weight: 600;
}

:where(html.app-page--flow) .node .input-slider-config input,
:where(html.app-page--flow) .node .input-slider-config select {
  min-width: 0;
  height: 30px !important;
  min-height: 30px !important;
  padding-top: 0;
  padding-bottom: 0;
}

:where(html.app-page--flow) .input-slider-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

:where(html.app-page--flow) .node input.input-slider-range {
  height: 24px !important;
  min-height: 24px !important;
  padding: 0;
  border: 0;
  border-radius: 0 !important;
  background: transparent;
  box-shadow: none;
}

:where(html.app-page--flow) .input-slider-output {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid #d2d2d7;
  border-radius: 999px;
  background: #ffffff;
  color: #1d1d1f;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

:where(html.app-page--flow) .node.node-operator {
  width: 280px;
}

:where(html.app-page--flow) .node.node-operator .node-header {
  background: #ecbcfd;
  border-bottom-color: #d9a2ec;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}

:where(html.app-page--flow) .node.node-operator {
  background: #ecbcfd;
}

:where(html.app-page--flow) .node.node-operator .node-body {
  background: #ecbcfd;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

:where(html.app-page--flow) .node.node-if {
  width: 320px;
  background: #ecbcfd;
  border-color: #d9a2ec;
}

:where(html.app-page--flow) .node.node-if .node-header {
  background: #ecbcfd;
  border-bottom-color: #d9a2ec;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}

:where(html.app-page--flow) .node.node-if .node-body {
  background: #ecbcfd;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

:where(html.app-page--flow) .node.node-postit {
  width: 240px;
  min-width: 200px;
  min-height: 170px;
  background: #fff59d;
  border: 1px solid #e6d86d;
  border-radius: 0;
}

:where(html.app-page--flow) .node.node-postit .node-header {
  position: relative;
  z-index: 2;
  height: 24px;
  padding: 0 4px 0 8px;
  border: 0;
  border-bottom: 1px dashed #d8ca66;
  background: rgba(255, 249, 196, 0.55);
}

:where(html.app-page--flow) .node.node-postit .node-title {
  display: inline-block;
  font-size: 12px;
  color: #7a651d;
  opacity: 0.9;
}

:where(html.app-page--flow) .node.node-postit .node-delete {
  width: 18px;
  height: 18px;
  min-width: 18px;
  padding: 0;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
}

:where(html.app-page--flow) .node.node-postit .node-duplicate {
  color: #6b5a1a;
}

:where(html.app-page--flow) .node.node-postit .node-body {
  height: 100%;
  padding: 8px 10px 10px;
  border-radius: 0;
}

:where(html.app-page--flow) .node.node-postit .postit-text {
  width: 100%;
  height: 100%;
  min-height: 120px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #5a4a1b;
  font-size: 18px;
  line-height: 1.35;
  resize: none;
  box-shadow: none;
  padding-right: 14px;
  padding-top: 2px;
  scrollbar-width: thin;
  scrollbar-color: #cdbf63 transparent;
  font-family: "Segoe Print", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", cursive;
}

:where(html.app-page--flow) .node.node-postit .postit-text:focus {
  outline: none;
  border: 0;
  box-shadow: none;
}

:where(html.app-page--flow) .node.node-postit .postit-text::-webkit-scrollbar {
  width: 6px;
}

:where(html.app-page--flow) .node.node-postit .postit-text::-webkit-scrollbar-thumb {
  background: #cdbf63;
  border-radius: 999px;
}

:where(html.app-page--flow) .node.node-postit .postit-text::-webkit-scrollbar-track {
  background: transparent;
}

:where(html.app-page--flow) .operator-formula {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px dashed #b8b8bd;
  border-radius: 10px;
  background: #f8f9fb;
  color: #2b2f33;
  font-weight: 600;
  text-align: center;
}

:where(html.app-page--flow) .operator-symbol {
  display: inline-block;
  min-width: 1ch;
  font-weight: 800;
}

:where(html.app-page--flow) .if-formula {
  margin-top: 8px;
  padding: 10px;
  border: 1px dashed #b8b8bd;
  border-radius: 10px;
  background: #f8f9fb;
  color: #2b2f33;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}

:where(html.app-page--flow) .if-condition-grid {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

:where(html.app-page--flow) .if-condition-grid .if-operator-select {
  min-width: 0;
}

:where(html.app-page--flow) .if-condition-grid .if-condition-value {
  min-width: 0;
}

:where(html.app-page--flow) .if-run-result {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid #d2d2d7;
  border-radius: 10px;
  background: #f5f5f7;
  color: #515154;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

:where(html.app-page--flow) .if-run-result-value {
  font-weight: 700;
}

:where(html.app-page--flow) .if-run-result.is-true {
  border-color: #22b389;
  background: #e7f9f2;
  color: #146f57;
}

:where(html.app-page--flow) .if-run-result.is-false {
  border-color: #d45454;
  background: #fdeeee;
  color: #8b2e2e;
}

:where(html.app-page--flow) .node.node-geometry {
  min-width: 360px;
  min-height: 320px;
  border-color: #285f9f;
  background: #173b67;
  color: #f7fbff;
}

:where(html.app-page--flow) .node.node-geometry .node-header {
  color: #f7fbff;
  background: #173b67;
  border-bottom-color: #3977bb;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}

:where(html.app-page--flow) .node.node-geometry .node-duplicate {
  color: #dcecff;
}

:where(html.app-page--flow) .node.node-geometry .node-duplicate:hover {
  color: #ffffff;
}

:where(html.app-page--flow) .node.node-geometry .geometry-help-toggle {
  display: inline-grid;
  flex: 0 0 18px !important;
  place-items: center;
  box-sizing: border-box;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  aspect-ratio: 1;
  padding: 0 !important;
  border: 1.5px solid rgba(239, 247, 255, 0.95);
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.1);
  color: #f7fbff;
  font-size: 0;
  line-height: 0;
  appearance: none;
}

:where(html.app-page--flow) .node.node-geometry .geometry-help-toggle svg {
  display: block;
  width: 9px;
  height: 11px;
  overflow: visible;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

:where(html.app-page--flow) .node.node-geometry .geometry-help-toggle:hover,
:where(html.app-page--flow) .node.node-geometry .geometry-help-toggle.is-active {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

:where(html.app-page--flow) .node.node-geometry .node-body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: calc(100% - 44px);
  min-height: 0;
  overflow: hidden;
  background: #173b67;
  color: #f7fbff;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

:where(html.app-page--flow) .node.node-geometry .node-body label {
  color: #dcecff;
}

:where(html.app-page--flow) .geometry-preview-shell {
  position: relative;
  flex: 1 1 190px;
  min-height: 170px;
  overflow: hidden;
  border: 1px solid #a9c7eb;
  border-radius: 11px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(205, 221, 228, 0.32)),
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.98), rgba(218, 231, 236, 0.96) 72%),
    #e1eaed;
}

:where(html.app-page--flow) .geometry-preview-canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 170px;
  cursor: grab;
  touch-action: none;
}

:where(html.app-page--flow) .geometry-preview-canvas:active {
  cursor: grabbing;
}

:where(html.app-page--flow) .geometry-preview-canvas.is-hovering:not(:active) {
  cursor: crosshair;
}

:where(html.app-page--flow) .geometry-snap-marker {
  position: absolute;
  z-index: 4;
  width: 12px;
  height: 12px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: #ff8a24;
  box-shadow: 0 0 0 2px rgba(185, 82, 0, 0.68), 0 2px 8px rgba(23, 59, 103, 0.35);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

:where(html.app-page--flow) .geometry-info-card {
  position: absolute;
  z-index: 5;
  width: 240px;
  max-width: calc(100vw - 24px);
  max-height: none;
  padding: 7px 8px;
  overflow: visible;
  border: 1px solid rgba(84, 121, 163, 0.42);
  border-radius: 9px;
  background: rgba(252, 254, 255, 0.9);
  box-shadow: 0 6px 18px rgba(23, 59, 103, 0.18);
  color: #173b67;
  font-size: 10px;
  line-height: 1.35;
  pointer-events: none;
  backdrop-filter: blur(7px);
}

:where(html.app-page--flow) .geometry-info-card strong {
  display: block;
  margin-bottom: 5px;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:where(html.app-page--flow) .geometry-info-card div {
  display: grid;
  grid-template-columns: 66px 1fr;
  gap: 5px;
  margin-top: 2px;
}

:where(html.app-page--flow) .geometry-info-card span {
  color: #67809c;
}

:where(html.app-page--flow) .geometry-info-card b {
  overflow-wrap: anywhere;
  font-weight: 600;
  white-space: pre-wrap;
}

:where(html.app-page--flow) .geometry-preview-toolbar {
  position: absolute;
  right: 8px;
  bottom: 8px;
  left: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 6px 5px 9px;
  border: 1px solid rgba(104, 144, 190, 0.4);
  border-radius: 9px;
  background: rgba(247, 251, 255, 0.9);
  box-shadow: 0 3px 12px rgba(30, 65, 103, 0.12);
  color: #48627f;
  font-size: 10px;
  pointer-events: none;
  z-index: 3;
}

:where(html.app-page--flow) .node.node-geometry .geometry-reset-view {
  padding: 4px 7px;
  border-color: rgba(220, 236, 255, 0.72);
  background: rgba(255, 255, 255, 0.12);
  color: #f7fbff;
  font-size: 10px;
  pointer-events: auto;
}

:where(html.app-page--flow) .node.node-geometry .geometry-reset-view:hover {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

:where(html.app-page--flow) .geometry-preview-status {
  flex: 0 0 auto;
  min-height: 18px;
  color: #dcecff;
  font-size: 11px;
  line-height: 1.35;
}

:where(html.app-page--flow) .geometry-preview-status.is-error {
  color: #fecaca;
}

:where(html.app-page--flow) .geometry-help-panel {
  position: absolute;
  inset: 8px 10px 10px;
  z-index: 8;
  padding: 10px;
  overflow: auto;
  border: 1px solid #8eafd5;
  border-radius: 10px;
  background: rgba(248, 252, 255, 0.98);
  box-shadow: 0 10px 28px rgba(23, 59, 103, 0.24);
  color: #294b70;
  font-size: 11px;
  line-height: 1.45;
}

:where(html.app-page--flow) .geometry-help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  color: #173b67;
  font-size: 13px;
}

:where(html.app-page--flow) .node.node-geometry .geometry-help-close {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  border-color: #aac3df;
  border-radius: 999px;
  background: #ffffff;
  color: #285f9f;
  font-size: 17px;
  line-height: 20px;
}

:where(html.app-page--flow) .geometry-help-panel p {
  margin: 7px 0;
}

:where(html.app-page--flow) .geometry-help-shapes {
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border-radius: 7px;
  background: #eaf3fd;
}

:where(html.app-page--flow) .geometry-help-panel code {
  color: #173b67;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:where(html.app-page--flow) .geometry-help-json {
  margin: 8px 0 0;
  padding: 8px;
  overflow: auto;
  border: 1px solid #bdd1e8;
  border-radius: 7px;
  background: #ffffff;
  color: #173b67;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  line-height: 1.35;
  white-space: pre;
}

:where(html.app-page--flow) .node .result {
  margin-top: 8px;
  background: #f5f5f7;
  border: 1px solid #d2d2d7;
  border-radius: 10px;
  padding: 8px;
  color: #515154;
  font-size: 12px;
  min-height: 44px;
  max-height: 220px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
}

:where(html.app-page--flow) .node.node-output .node-body {
  background: #90e0ef;
  height: calc(100% - 44px);
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

:where(html.app-page--flow) .node.node-output {
  background: #90e0ef;
  border-color: #67c7d9;
  border-radius: 16px;
}

:where(html.app-page--flow) .node.node-output .node-header {
  background: #90e0ef;
  border-bottom-color: #67c7d9;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}

:where(html.app-page--flow) .node.node-output .result {
  margin-top: 0;
  flex: 1;
  min-height: 0;
  max-height: none;
  background: #ffffff;
  border-color: #67c7d9;
  color: #0f3d45;
  border-radius: 10px;
}

:where(html.app-page--flow) .handle {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  transform: translateY(-50%);
  border: 2px solid #6c757d;
  background: var(--panel);
  cursor: crosshair;
  overflow: visible;
}

:where(html.app-page--flow) .handle.handle-connected {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}

:where(html.app-page--flow) .handle.handle-connected::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  background: var(--handle-glow, rgba(16, 185, 129, 0.45));
  opacity: 0.45;
  filter: blur(3px);
  z-index: -1;
  pointer-events: none;
}

:where(html.app-page--flow) .handle.handle-connected-in {
  --handle-glow: rgba(6, 214, 160, 0.42);
  background: #22e6b2;
  border-color: #22e6b2;
  box-shadow: 0 0 0 1px rgba(34, 230, 178, 0.6), 0 0 8px rgba(34, 230, 178, 0.75);
}

:where(html.app-page--flow) .handle.handle-connected-out {
  --handle-glow: rgba(230, 57, 70, 0.42);
  background: #ff5563;
  border-color: #ff5563;
  box-shadow: 0 0 0 1px rgba(255, 85, 99, 0.6), 0 0 8px rgba(255, 85, 99, 0.75);
}

:where(html.app-page--flow) .handle.handle-connected-out-if-true {
  --handle-glow: rgba(230, 57, 70, 0.42);
  background: #ff5563;
  border-color: #ff5563;
  box-shadow: 0 0 0 1px rgba(255, 85, 99, 0.6), 0 0 8px rgba(255, 85, 99, 0.75);
}

:where(html.app-page--flow) .handle.handle-connected-out-if-false {
  --handle-glow: rgba(230, 57, 70, 0.42);
  background: #ff5563;
  border-color: #ff5563;
  box-shadow: 0 0 0 1px rgba(255, 85, 99, 0.6), 0 0 8px rgba(255, 85, 99, 0.75);
}

:where(html.app-page--flow) .handle-in {
  left: -8px;
  background: #0a9874;
  border-color: #0a9874;
}

:where(html.app-page--flow) .handle-in-a {
  top: 36%;
}

:where(html.app-page--flow) .handle-in-b {
  top: 64%;
}

:where(html.app-page--flow) .handle[data-port]::after {
  content: attr(data-port);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 8px;
  font-weight: 400;
  line-height: 1;
  color: #000000;
  background: transparent;
  border: 0;
  padding: 0;
  pointer-events: none;
}

:where(html.app-page--flow) .handle-out[data-port]::after {
  color: #ffffff;
}

:where(html.app-page--flow) .handle-out {
  right: -8px;
  background: #b43644;
  border-color: #b43644;
}

:where(html.app-page--flow) .handle-out-1 {
  top: 36%;
}

:where(html.app-page--flow) .handle-out-2 {
  top: 64%;
}

:where(html.app-page--flow) .node.node-if .handle-out-1 {
  background: #b43644;
  border-color: #b43644;
}

:where(html.app-page--flow) .node.node-if .handle-out-2 {
  background: #b43644;
  border-color: #b43644;
}

:where(html.app-page--flow) .node.node-if .handle-in {
  background: #0a9874;
  border-color: #0a9874;
}

:where(html.app-page--flow) .node.node-if .handle-in.handle-connected-in {
  background: #22e6b2;
  border-color: #22e6b2;
}

:where(html.app-page--flow) .node.node-if .handle-out-1.handle-connected-out-if-true,
:where(html.app-page--flow) .node.node-if .handle-out-2.handle-connected-out-if-false {
  --handle-glow: rgba(230, 57, 70, 0.42);
  background: #ff5563;
  border-color: #ff5563;
  box-shadow: 0 0 0 1px rgba(255, 85, 99, 0.6), 0 0 8px rgba(255, 85, 99, 0.75);
}

:where(html.app-page--flow) .node.node-if .handle-out[data-port]::after {
  color: #000000;
  font-weight: 700;
}

:where(html.app-page--flow) .resize-handle {
  display: block;
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
  border-right: 2px solid #8e8e93;
  border-bottom: 2px solid #8e8e93;
  border-bottom-right-radius: 2px;
}

:where(html.app-page--flow) #result-panel {
  position: relative;
  margin: 0 14px 14px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #343a40;
  color: #f8f9fa;
  border: 1px solid #4f565d;
}

:where(html.app-page--flow) #terminal-resizer {
  position: absolute;
  top: -7px;
  left: 0;
  right: 0;
  height: 14px;
  cursor: ns-resize;
  user-select: none;
}

:where(html.app-page--flow) #terminal-resizer::before {
  content: "\2195";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  color: #96a0aa;
  opacity: 0;
  transition: opacity 120ms ease, color 120ms ease;
  pointer-events: none;
}

:where(html.app-page--flow) #result-panel:hover #terminal-resizer::before,
:where(html.app-page--flow) #terminal-resizer:hover::before,
:where(html.app-page--flow) body.terminal-resizing #terminal-resizer::before {
  opacity: 1;
}

:where(html.app-page--flow) body.terminal-resizing #terminal-resizer::before {
  color: #dce3ea;
}

:where(html.app-page--flow) .result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

:where(html.app-page--flow) #result-panel h2 {
  margin: 0;
  font-size: 16px;
}

:where(html.app-page--flow) #toggle-result {
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid #616971;
  background: #4b5259;
  color: #f8f9fa;
  font-size: 12px;
  line-height: 1;
  min-width: 22px;
  transition: transform 120ms ease;
}

:where(html.app-page--flow) #result-panel.collapsed {
  padding: 8px 14px;
}

:where(html.app-page--flow) #result-panel.collapsed .result-header {
  margin-bottom: 0;
}

:where(html.app-page--flow) #result-panel.collapsed #result-output {
  display: none;
}

:where(html.app-page--flow) #result-panel.collapsed #toggle-result {
  transform: rotate(-90deg);
}

:where(html.app-page--flow) #result-output {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  height: var(--terminal-height, calc(5 * 1.35em));
  max-height: none;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

:where(html.app-page--flow) body.python-fullscreen-active #result-panel {
  margin: 0;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  border-top: 1px solid #2d2d30;
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 10px 16px 12px;
}

:where(html.app-page--flow) body.python-fullscreen-active #result-panel .result-header {
  color: #d4d4d4;
}

:where(html.app-page--flow) body.python-fullscreen-active #result-panel h2 {
  color: #d4d4d4;
}

:where(html.app-page--flow) body.python-fullscreen-active #result-panel #toggle-result {
  background: #3c3c3c;
  color: #f3f3f3;
  border-color: #4d4d50;
}

:where(html.app-page--flow) body.python-fullscreen-active #result-panel #toggle-result:hover {
  background: #4b4b4e;
  border-color: #5f6064;
}

:where(html.app-page--flow) body.python-fullscreen-active #result-panel #result-output {
  background: #1e1e1e;
  border: 1px solid #3a3d41;
  border-radius: 6px;
  color: #d4d4d4;
  padding: 8px 10px;
  font-size: 12px;
  font-family: Consolas, "Courier New", monospace;
}

:where(html.app-page--flow) body.python-fullscreen-active #result-panel #terminal-resizer::before {
  color: #9da3ad;
}

:where(html.app-page--flow) .ai-flow-modal-open {
  overflow: hidden;
}

:where(html.app-page--flow) #ai-flow-modal {
  z-index: 6000;
}

:where(html.app-page--flow) .ai-flow-panel {
  width: min(900px, calc(100vw - 24px));
}

:where(html.app-page--flow) .ai-flow-panel h3 {
  margin: 0;
  font-size: 16px;
}

:where(html.app-page--flow) .ai-flow-form {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

:where(html.app-page--flow) .ai-flow-form label,
:where(html.app-page--flow) .ai-flow-preview-label {
  color: #4b5563;
  font-size: 12px;
  font-weight: 700;
}

:where(html.app-page--flow) .ai-flow-prompt {
  min-height: 120px;
  resize: vertical;
}

:where(html.app-page--flow) .ai-flow-preview {
  width: 100%;
  min-height: 260px;
  margin-top: 8px;
  resize: vertical;
  border: 1px solid #3a3d41;
  border-radius: 8px;
  background: #111827;
  color: #d1d5db;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
}

:where(html.app-page--flow) .ai-flow-panel .status {
  min-height: 20px;
  margin-top: 8px;
  color: #4b5563;
  font-size: 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

:where(html.app-page--flow) .ai-flow-panel .status.error {
  color: #b91c1c;
}

:where(html.app-page--flow) .ai-flow-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

@media (max-width: 1180px) {

  :where(html.app-page--flow) .canvas-toolbar {
    flex-direction: column;
    gap: 8px;
    height: auto;
    max-height: none;
    align-items: stretch;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  :where(html.app-page--flow) .toolbar-group {
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  :where(html.app-page--flow) .toolbar {
    flex-direction: column;
    gap: 8px;
  }

  :where(html.app-page--flow) .node {
    width: 220px;
  }

  :where(html.app-page--flow) .lane span {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 0.12em;
    font-size: clamp(18px, 5vw, 28px);
  }
}
