:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --bg: #1c1c1e;
  --panel: #2c2c2e;
  --panel-soft: #242426;
  --panel-raised: #3a3a3c;
  --line: rgba(255, 255, 255, .10);
  --line-strong: rgba(255, 255, 255, .20);
  --text: rgba(255, 255, 255, .92);
  --muted: rgba(255, 255, 255, .62);
  --primary: #8e8eff;
  --primary-weak: rgba(142, 142, 255, .16);
  --ok: #79d7b8;
  --ok-bg: rgba(121, 215, 184, .13);
  --warn: #e2bd73;
  --warn-bg: rgba(226, 189, 115, .14);
  --danger: #ff8b82;
  --danger-bg: rgba(255, 139, 130, .14);
  --radius: 12px;
  --radius-lg: 12px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font: inherit;
}

button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 12px;
  background: var(--panel);
  color: var(--text);
  font-weight: 650;
  cursor: pointer;
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}

button:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: #f8fafc;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}

button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .2);
  outline-offset: 2px;
}

button:disabled {
  opacity: .48;
  cursor: not-allowed;
}

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

.primary:hover:not(:disabled) {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.secondary {
  background: var(--primary-weak);
  border-color: #bfd3ff;
  color: #1d4ed8;
}

.ghost {
  background: transparent;
}

.danger {
  background: var(--danger-bg);
  border-color: #ffc9c3;
  color: var(--danger);
}

.icon {
  width: 34px;
  min-width: 34px;
  padding: 0;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
}

input, select, textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
}

select[multiple] {
  min-height: 92px;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 56px 1fr;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(14px);
}

.brand {
  min-height: 40px;
  display: grid;
  gap: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.brand-mark {
  font-size: 17px;
  font-weight: 850;
}

.brand-sub {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.nav {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
}

.nav button {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
}

.nav button.active {
  background: #fff;
  color: var(--text);
}

.account-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-name {
  max-width: 220px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-home, .profile-page {
  padding: 32px 24px;
}

.home-hero {
  max-width: 1040px;
  margin: 0 auto 28px;
  padding: 34px 36px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,251,255,.98));
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: center;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .05);
}

.hero-copy {
  max-width: 690px;
}

.eyebrow {
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
}

.home-hero h1 {
  margin: 6px 0 10px;
  font-size: 38px;
  line-height: 1.08;
  letter-spacing: 0;
}

.home-hero p, .project-card p, .drawer-head p, .node-card p, .muted {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.home-actions, .card-actions, .bar-actions, .modal-actions, .inspector-actions, .dataset-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.home-actions {
  justify-content: stretch;
  align-content: center;
  margin-top: 6px;
}

.home-actions button {
  flex: 1 1 132px;
}

.hero-points {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.hero-points span {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.hero-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 20px;
  background: rgba(255,255,255,.78);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 18px 34px rgba(37, 99, 235, .07);
}

.hero-panel-row {
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.hero-panel-row span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
}

.hero-panel-row strong {
  font-size: 13px;
}

.hero-panel-row.active {
  border-color: rgba(37, 99, 235, .32);
  background: #f8fbff;
}

.project-section {
  max-width: 1040px;
  margin: 0 auto;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title h2 {
  margin: 0;
  font-size: 15px;
  color: var(--text);
  font-weight: 850;
}

.section-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
}

.project-card {
  min-height: 210px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  display: grid;
  gap: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
  transition: border-color .18s var(--ease), transform .18s var(--ease), background .18s var(--ease);
}

.project-card-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: start;
}

.project-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.project-status {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.project-status.ready {
  border-color: rgba(22, 163, 74, .24);
  color: #15803d;
  background: #f7fdf9;
}

.project-status.error {
  border-color: rgba(220, 38, 38, .24);
  color: #b91c1c;
  background: #fff8f8;
}

.project-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.project-metrics div {
  display: grid;
  gap: 2px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 14px;
  background: #f8fbff;
}

.project-metrics strong {
  font-size: 19px;
}

.project-metrics span {
  color: var(--muted);
  font-size: 12px;
}

.project-progress {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 14px;
  background: #fff;
}

.project-progress.loading {
  color: var(--muted);
  font-size: 12px;
}

.project-step-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.project-step {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.project-step i {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: transparent;
  font-style: normal;
  font-size: 11px;
  line-height: 1;
}

.project-step b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-step.done {
  color: #166534;
}

.project-step.done i {
  border-color: rgba(22, 163, 74, .28);
  background: #ecfdf3;
  color: #15803d;
}

.project-step.warn {
  color: #b91c1c;
}

.project-step.warn i {
  border-color: rgba(220, 38, 38, .26);
  background: #fff8f8;
  color: #b91c1c;
}

.project-next {
  justify-self: start;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-size: 12px;
  font-weight: 800;
}

.project-next:hover {
  color: var(--primary);
  box-shadow: none;
}

.project-next.primary-link {
  color: var(--primary);
}

.project-card:hover {
  border-color: var(--line-strong);
  background: #fbfdff;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.project-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.activation-panel {
  display: grid;
  grid-template-columns: minmax(220px, .9fr) minmax(320px, 1.6fr);
  gap: 14px;
  max-width: 1040px;
  margin: 16px 0 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
}

.activation-panel h2 {
  margin: 4px 0 6px;
  font-size: 22px;
}

.activation-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.activation-step {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.activation-step i {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, .34);
  color: var(--primary);
  font-style: normal;
}

.activation-step.done {
  border-color: rgba(22, 163, 74, .24);
  background: #f5fff8;
  color: #166534;
}

.plan-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(300px, 1.7fr);
  gap: 14px;
  max-width: 1040px;
  margin: 16px 0 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
}

.plan-panel h2 {
  margin: 4px 0 6px;
  font-size: 22px;
}

.plan-limits {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.plan-limits div, .plan-upgrade {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}

.plan-limits strong {
  font-size: 18px;
}

.plan-limits span, .plan-upgrade p {
  color: var(--muted);
  font-size: 12px;
}

.plan-upgrade {
  grid-column: 1 / -1;
  background: #f8fbff;
}

.trust-panel {
  display: grid;
  grid-template-columns: minmax(220px, .9fr) minmax(320px, 1.6fr);
  gap: 14px;
  max-width: 1040px;
  margin: 0 0 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
}

.trust-panel h2 {
  margin: 4px 0 6px;
  font-size: 22px;
}

.trust-list {
  display: grid;
  gap: 8px;
}

.trust-list div {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}

.trust-list strong {
  color: var(--text);
  font-size: 12px;
}

.trust-list span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.analytics-metrics {
  margin-top: -8px;
}

.admin-metric {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.admin-metric strong {
  font-size: 24px;
}

.admin-metric span {
  color: var(--muted);
  font-size: 12px;
}

.admin-table td:first-child {
  display: grid;
  gap: 3px;
}

.admin-table td:first-child small {
  color: var(--muted);
}

.admin-table select {
  min-width: 108px;
}

.muted-row {
  opacity: .62;
}

.danger-badge {
  background: var(--danger-bg);
  color: var(--danger);
}

.project-facts {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.workspace {
  min-height: calc(100vh - 56px);
  display: grid;
  grid-template-rows: 64px auto 1fr;
}

.project-bar {
  position: sticky;
  top: 56px;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(12px);
}

.bar-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.back {
  min-width: 64px;
}

.project-bar h1 {
  margin: 0 0 4px;
  font-size: 17px;
  line-height: 1.1;
}

.bar-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.status-dot::before, .dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--primary);
}

.ok::before { background: var(--ok); }
.warn::before { background: var(--warn); }
.error::before { background: var(--danger); }
.info::before { background: var(--primary); }

.workspace-grid {
  display: grid;
  grid-template-columns: 232px minmax(660px, 1fr) 332px;
  min-height: calc(100vh - 120px);
}

.workspace-notices {
  display: grid;
  gap: 8px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: #f8fbff;
}

.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.notice strong {
  display: block;
  margin-bottom: 2px;
}

.notice p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.notice.error {
  border-color: #f3b6ae;
  background: #fff6f4;
}

.notice.warning {
  border-color: #ead287;
  background: #fffbea;
}

.notice.info {
  border-color: #bfd3ff;
  background: #f4f8ff;
}

.notice.success {
  border-color: #9ed8cf;
  background: #f0fbf8;
}

.notice-actions {
  display: inline-flex;
  gap: 8px;
  flex: none;
}

.workflow-nav, .inspector {
  position: sticky;
  top: 120px;
  max-height: calc(100vh - 120px);
  overflow: auto;
  background: var(--panel);
}

.workflow-nav {
  padding: 16px 14px;
  border-right: 1px solid var(--line);
}

.workflow-list {
  display: grid;
  gap: 8px;
}

.workflow-row {
  width: 100%;
  min-height: 60px;
  display: grid;
  gap: 5px;
  text-align: left;
  overflow: hidden;
}

.workflow-row.active {
  border-color: var(--primary);
  background: var(--primary-weak);
}

.workflow-row.error-state {
  border-color: rgba(220, 38, 38, .26);
}

.workflow-row.warning-state {
  border-color: #ead287;
}

.workflow-row.ready-state:not(.active) {
  border-color: #b7ded8;
}

.row-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.row-head span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-health-line {
  display: flex;
  gap: 5px;
  min-height: 18px;
  overflow: hidden;
}

.health-pill {
  min-width: 0;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.ok-pill {
  background: var(--ok-bg);
  color: var(--ok);
}

.warn-pill {
  background: var(--warn-bg);
  color: var(--warn);
}

.danger-pill {
  background: var(--danger-bg);
  color: var(--danger);
}

.dot {
  display: inline-grid;
  place-items: center;
  width: 14px;
  min-width: 14px;
}

small, .muted {
  color: var(--muted);
}

.create-box {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

.canvas-wrap {
  min-width: 0;
  padding: 18px 18px 16px;
  background:
    linear-gradient(180deg, #f9fbfe 0%, var(--bg) 100%);
  overflow: auto;
}

.step-banner {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.9);
}

.step-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.step-copy strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step-banner button {
  flex: none;
  min-height: 32px;
}

.canvas-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 16px;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(18px);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  position: sticky;
  top: 0;
  z-index: 8;
}

.canvas-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.canvas-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-meta span {
  color: var(--muted);
  font-size: 12px;
}

.canvas-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.zoom-readout {
  min-width: 44px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-align: center;
}

.icon-btn {
  width: 34px;
  min-width: 34px;
  padding-inline: 0;
}

.canvas {
  position: relative;
  min-width: 1120px;
  min-height: 650px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(#edf2f7 1px, transparent 1px),
    linear-gradient(90deg, #edf2f7 1px, transparent 1px),
    #fff;
  background-size: 24px 24px;
  overflow: auto;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 18px 44px rgba(15, 23, 42, .06);
  scroll-behavior: smooth;
  cursor: crosshair;
  overscroll-behavior: contain;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.canvas.panning {
  cursor: grabbing;
  user-select: none;
  scroll-behavior: auto;
}

.canvas:active {
  cursor: crosshair;
}

.canvas.panning:active {
  cursor: grabbing;
}

.canvas-viewport {
  position: relative;
}

.canvas-content {
  position: absolute;
  inset: 0 auto auto 0;
  transform-origin: 0 0;
}

.empty-canvas {
  min-width: 0;
  display: grid;
  place-items: center;
}

.empty-state {
  padding: 22px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
}

.canvas-empty-card {
  position: absolute;
  left: 40px;
  top: 40px;
  display: grid;
  gap: 10px;
  max-width: 440px;
}

.starter-card-grid {
  display: grid;
  gap: 8px;
}

.starter-card {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 2px 10px;
  align-items: center;
  text-align: left;
  border-radius: 10px;
}

.starter-card span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--primary-weak);
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
}

.starter-card strong,
.starter-card small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.starter-card small {
  color: var(--muted);
  font-weight: 550;
}

.selection-box {
  position: absolute;
  z-index: 4;
  border: 1px solid rgba(37, 99, 235, .7);
  background: rgba(37, 99, 235, .1);
  pointer-events: none;
}

.node-card {
  position: absolute;
  z-index: 2;
  padding: 12px 10px 10px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--primary);
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
  transition: border-color .2s var(--ease), transform .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}

.node-card.kind-data { border-left-color: #2563eb; }
.node-card.kind-primitive { border-left-color: #7c3aed; }
.node-card.kind-variable { border-left-color: #0f766e; }
.node-card.kind-model { border-left-color: #1e40af; }
.node-card.kind-diagnostic { border-left-color: #64748b; }
.node-card.kind-output { border-left-color: #9333ea; }
.node-card.kind-robust { border-left-color: #a16207; }
.node-card.kind-heterogeneity { border-left-color: #15803d; }

.node-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, .07);
}

.node-card p {
  display: -webkit-box;
  min-height: 40px;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.node-note {
  display: block;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px dashed var(--line);
  line-height: 1.4;
}

.node-card.selected {
  border-color: var(--primary);
  background: #fbfdff;
  outline: 2px solid var(--primary);
  outline-offset: 4px;
  box-shadow: 0 0 0 7px rgba(37, 99, 235, .14), 0 14px 30px rgba(15, 23, 42, .12);
}

.node-card.connecting {
  border-color: var(--warn);
  border-left-color: var(--warn);
  background: var(--warn-bg);
}

.node-tools {
  display: flex;
  justify-content: flex-start;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.node-card.flipped .node-tools {
  justify-content: flex-end;
}

.node-flip {
  width: 32px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  line-height: 1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}

.flip-icon {
  display: block;
  width: 15px;
  height: 15px;
  background: currentColor;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg%20xmlns="http://www.w3.org/2000/svg"%20viewBox="0%200%201024%201024"><path%20d="M102.369864%20656.206329h833.291877c43.860046%200%2087.720092%2042.367079%2087.720092%2084.733157s-43.859046%2084.733157-87.719092%2084.733157H409.346188l73.128409%2042.366079c43.859046%2028.244386%2058.450729%2070.610464%2029.225365%20113.019542-29.226364%2042.367079-73.085411%2056.488771-116.945457%2028.244386l-350.877369-197.795699a77.308319%2077.308319%200%200%201-43.859046-70.567465c0-14.079694%200-42.366079%2014.633681-56.488771%2014.590683-14.079694%2058.450729-28.244386%2087.718093-28.244386zM614.053736%20198.325287l-73.12841-42.367079C497.06628%20127.713822%20482.474597%2085.347744%20511.700962%2042.938666%20540.925326%200.572588%20584.784372-13.550105%20628.644418%2014.69428l350.877369%20197.7527c43.860046%2028.244386%2058.451729%2070.610464%2029.226365%20112.977543-14.591683%2028.244386-43.860046%2042.366079-73.085411%2042.366078H87.736182c-43.859046%200-87.718092-42.366079-87.718092-84.733157s43.859046-84.732157%2087.718092-84.732157h526.316554z"/></svg>') center / contain no-repeat;
  mask: url('data:image/svg+xml;utf8,<svg%20xmlns="http://www.w3.org/2000/svg"%20viewBox="0%200%201024%201024"><path%20d="M102.369864%20656.206329h833.291877c43.860046%200%2087.720092%2042.367079%2087.720092%2084.733157s-43.859046%2084.733157-87.719092%2084.733157H409.346188l73.128409%2042.366079c43.859046%2028.244386%2058.450729%2070.610464%2029.225365%20113.019542-29.226364%2042.367079-73.085411%2056.488771-116.945457%2028.244386l-350.877369-197.795699a77.308319%2077.308319%200%200%201-43.859046-70.567465c0-14.079694%200-42.366079%2014.633681-56.488771%2014.590683-14.079694%2058.450729-28.244386%2087.718093-28.244386zM614.053736%20198.325287l-73.12841-42.367079C497.06628%20127.713822%20482.474597%2085.347744%20511.700962%2042.938666%20540.925326%200.572588%20584.784372-13.550105%20628.644418%2014.69428l350.877369%20197.7527c43.860046%2028.244386%2058.451729%2070.610464%2029.226365%20112.977543-14.591683%2028.244386-43.860046%2042.366079-73.085411%2042.366078H87.736182c-43.859046%200-87.718092-42.366079-87.718092-84.733157s43.859046-84.732157%2087.718092-84.732157h526.316554z"/></svg>') center / contain no-repeat;
}

.node-flip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f8fbff;
}

.node-card.flipped .node-flip {
  color: var(--primary);
  border-color: rgba(37, 99, 235, .35);
}

.node-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.node-top strong {
  line-height: 1.25;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.connect-hint {
  display: inline-flex;
  width: fit-content;
  padding: 3px 7px;
  border-radius: 999px;
  background: #fff;
  color: var(--warn);
  font-weight: 800;
}

.node-port-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(96px, .82fr);
  gap: 12px;
  margin-top: 10px;
}

.node-port-column {
  display: grid;
  align-content: start;
  gap: 5px;
}

.node-port-column.output {
  justify-items: end;
}

.node-card.flipped .node-port-column.output {
  justify-items: start;
}

.node-card.flipped .node-port-column.input {
  justify-items: end;
}

.port-title {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.port-pill {
  width: 100%;
  min-height: 24px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  padding: 3px 7px 3px 3px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  border: 1px solid var(--line);
  background: #f8fbff;
  cursor: pointer;
  user-select: none;
}

.port-type {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.port-pill > span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.port-pill.output {
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 3px 3px 3px 7px;
  background: #fff;
  color: var(--primary);
  text-align: right;
  cursor: crosshair;
}

.port-pill.output .port-dot {
  order: 3;
}

.port-pill.output .port-type {
  order: 2;
}

.node-card.flipped .port-pill.output {
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 3px 7px 3px 3px;
  text-align: left;
}

.node-card.flipped .port-pill.output .port-dot {
  order: 0;
}

.node-card.flipped .port-pill.output .port-type {
  order: 3;
}

.node-card.flipped .port-pill.input {
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 3px 3px 3px 7px;
  text-align: right;
}

.node-card.flipped .port-pill.input .port-dot {
  order: 3;
}

.node-card.flipped .port-pill.input .port-type {
  order: 2;
}

.port-pill.input.bound {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  border-color: rgba(15, 118, 110, .35);
  background: var(--ok-bg);
  color: var(--ok);
}

.port-pill.input.drop-target {
  border-color: var(--warn);
  background: var(--warn-bg);
  color: var(--warn);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, .16);
  transform: translateX(-2px);
}

.port-pill.input.reject-target {
  border-color: var(--danger);
  background: #fff1f2;
  color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .16);
  transform: translateX(-2px);
}

.port-pill.input.idle {
  cursor: default;
}

.port-pill.active {
  border-color: var(--warn);
  background: var(--warn-bg);
  color: var(--warn);
}

.port-dot {
  width: 11px;
  height: 11px;
  border: 2px solid currentColor;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(255,255,255,.95);
}

.port-clear {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: rgba(15, 118, 110, .1);
  color: var(--ok);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.port-clear:hover {
  background: var(--danger);
  color: #fff;
}

.param-binding {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  align-items: center;
  padding: 8px 9px;
  border: 1px solid rgba(15, 118, 110, .2);
  border-radius: 10px;
  background: var(--ok-bg);
}

.param-binding span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.param-binding strong {
  overflow: hidden;
  color: var(--ok);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.param-binding button {
  grid-row: 1 / span 2;
  grid-column: 2;
  min-height: 26px;
  padding: 3px 7px;
  font-size: 12px;
}

.inline-upload {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-raised);
}

.inline-upload > label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.inline-upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.edge-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}

.edge-path {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3;
  pointer-events: stroke;
  cursor: pointer;
}

.edge-path.selected {
  stroke: var(--danger);
  stroke-width: 4;
}

.edge-path.preview {
  stroke: var(--warn);
  stroke-dasharray: 8 7;
  pointer-events: none;
}

.edge-path.preview.invalid {
  stroke: var(--danger);
}

.toast-stack {
  position: fixed;
  top: 76px;
  right: 18px;
  z-index: 60;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 36px));
}

.toast {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .14);
  font-size: 13px;
  font-weight: 800;
}

.toast.error {
  border-color: rgba(220, 38, 38, .28);
  background: #fff1f2;
  color: var(--danger);
}

.toast.success {
  border-color: rgba(15, 118, 110, .28);
  background: var(--ok-bg);
  color: var(--ok);
}

.toast.info {
  border-color: #bfd3ff;
  background: var(--primary-weak);
  color: #1d4ed8;
}

.inspector {
  padding: 16px 14px;
  border-left: 1px solid var(--line);
}

.panel {
  display: grid;
  gap: 12px;
  animation: rise .18s var(--ease) both;
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.health-item {
  display: grid;
  gap: 2px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #f7faff);
}

.health-item strong {
  font-size: 18px;
}

.health-item span {
  color: var(--muted);
  font-size: 12px;
}

.io-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.io-summary > div {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #f7faff);
}

.io-summary span {
  color: var(--muted);
  font-size: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field.has-field-message input,
.field.has-field-message select,
.field.has-field-message textarea {
  border-color: #e58f84;
  background: #fffafa;
}

.field.field-focused {
  margin: -6px;
  padding: 6px;
  border: 1px solid #8fb2ff;
  border-radius: 12px;
  background: #f4f8ff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .08);
}

.field.param-nested {
  margin-left: 16px;
  padding-left: 12px;
  border-left: 2px solid var(--line);
}

.field.param-nested > label {
  font-size: 11px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.check input {
  width: auto;
}

.field-checklist {
  display: grid;
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.field-checklist .check {
  min-height: 34px;
  padding: 7px 10px;
  border-bottom: 1px solid #eef2f7;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.field-checklist .check:last-child {
  border-bottom: 0;
}

.field-checklist .all-fields {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-soft);
  color: var(--primary);
  font-weight: 800;
}

.field-checklist .empty-inline {
  margin: 10px;
}

.card-issues {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #f3b6ae;
  border-radius: 8px;
  background: #fff6f4;
}

.card-issues > strong {
  color: var(--danger);
  font-size: 13px;
}

.focus-note {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid #8fb2ff;
  border-radius: 10px;
  background: #f4f8ff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .08);
}

.focus-note strong {
  color: #1d4ed8;
  font-size: 13px;
}

.focus-note p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.message-panel {
  display: grid;
  gap: 8px;
}

.message-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.message-panel-head strong {
  color: var(--text);
  font-size: 13px;
}

.messages {
  display: grid;
  gap: 8px;
}

.messages.compact {
  gap: 6px;
}

.message-item {
  width: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 8px;
  align-items: start;
  padding: 9px 10px;
  text-align: left;
  border: 1px solid var(--line);
  border-left-width: 4px;
  font-weight: 500;
  border-radius: 8px;
  line-height: 1.45;
}

.message-item.actionable {
  cursor: pointer;
}

.message-item.actionable:hover {
  border-color: var(--line-strong);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}

.message-item.error, .message-item.fatal {
  border-left-color: var(--danger);
  background: var(--danger-bg);
}

.message-item.warning {
  border-left-color: var(--warn);
  background: var(--warn-bg);
}

.message-item.info {
  border-left-color: var(--primary);
  background: var(--primary-weak);
}

.message-severity {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.message-copy {
  min-width: 0;
}

.message-action {
  grid-column: 2;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.message-actions {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.message-actions button {
  padding: 6px 10px;
}

.message-item small {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
}

.field-messages {
  display: grid;
  gap: 5px;
}

.field-message {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 12px;
}

.field-message.error, .field-message.fatal {
  background: var(--danger-bg);
  color: var(--danger);
}

.field-message.warning {
  background: var(--warn-bg);
  color: var(--warn);
}

.field-message.info {
  background: var(--primary-weak);
  color: #1d4ed8;
}

.field-message span {
  font-weight: 850;
}

.field-message p {
  margin: 0;
}

.edge-card, .export-status {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #f7faff);
}

.export-status {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
}

.export-status.success {
  border-color: rgba(22, 163, 74, .28);
  background: #f7fdf9;
}

.export-status.failed {
  border-color: rgba(220, 38, 38, .28);
  background: #fff8f8;
}

.export-recovery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.status-orb {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 6px rgba(37, 99, 235, .10);
  animation: pulseSoft 1.8s var(--ease) infinite;
}

.export-status.success .status-orb {
  background: var(--ok);
  box-shadow: 0 0 0 6px rgba(22, 163, 74, .10);
  animation: none;
}

.export-status.failed .status-orb {
  background: var(--danger);
  box-shadow: 0 0 0 6px rgba(220, 38, 38, .10);
  animation: none;
}

.drawer-shade, .modal-shade {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(15, 23, 42, .22);
  animation: fadeIn .18s var(--ease) both;
}

.card-drawer {
  width: min(430px, 94vw);
  height: 100%;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: #fff;
  overflow: auto;
  box-shadow: 18px 0 40px rgba(15, 23, 42, .08);
  animation: drawerIn .22s var(--ease) both;
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.drawer-head h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.picker-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.recommendation-strip {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #bfd3ff;
  border-radius: 14px;
  background: #f8fbff;
}

.recommendation-strip .section-head {
  padding: 0 2px 2px;
}

.recommendation-item {
  width: 100%;
  min-height: 72px;
  display: grid;
  gap: 3px;
  text-align: left;
  background: #fff;
}

.recommendation-item span {
  color: var(--primary);
  font-size: 11px;
  font-weight: 850;
}

.recommendation-item small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picker-list h3 {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.picker-item {
  width: 100%;
  min-height: 70px;
  display: grid;
  gap: 4px;
  text-align: left;
}

.picker-item span {
  color: var(--muted);
  font-weight: 500;
}

.modal-shade {
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal, .dataset-dialog {
  width: min(620px, 94vw);
  max-height: 90vh;
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .14);
  animation: rise .2s var(--ease) both;
}

.export-modal {
  width: min(720px, 94vw);
}

.auth-modal {
  width: min(440px, 94vw);
}

.create-project-modal {
  width: min(760px, 94vw);
  padding: 0;
  overflow: hidden;
}

.create-modal-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 430px;
}

.create-modal-rail {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  background:
    linear-gradient(180deg, #102033, #19334f);
  color: #f8fbff;
}

.create-modal-rail h2 {
  margin: 8px 0 10px;
  font-size: 28px;
  line-height: 1.08;
}

.create-modal-rail p {
  margin: 0;
  color: #dbeafe;
  line-height: 1.55;
}

.rail-kicker {
  color: #93c5fd;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
}

.rail-steps {
  display: grid;
  gap: 8px;
}

.rail-steps span {
  padding: 8px 10px;
  border: 1px solid rgba(219, 234, 254, .22);
  border-radius: 10px;
  background: rgba(255, 255, 255, .08);
  color: #f8fbff;
  font-size: 12px;
  font-weight: 750;
}

.create-modal-form {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 24px;
}

.create-modal-form textarea {
  min-height: 112px;
  resize: vertical;
}

@media (max-width: 720px) {
  .create-modal-grid {
    grid-template-columns: 1fr;
  }

  .create-modal-rail {
    padding: 20px;
  }

  .create-modal-rail h2 {
    font-size: 23px;
  }
}

.auth-form {
  display: grid;
  gap: 12px;
  margin: 14px 0;
}

.context-menu {
  position: fixed;
  z-index: 60;
  width: 210px;
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, .16);
  animation: fadeIn .12s var(--ease) both;
}

.context-menu button {
  width: 100%;
  justify-content: flex-start;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}

.context-menu button:hover:not(:disabled) {
  background: var(--panel-soft);
  box-shadow: none;
}

.export-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 14px;
}

.export-summary-card {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
}

.export-summary-card span,
.export-summary-card small,
.export-row small {
  color: var(--muted);
  font-size: 12px;
}

.export-summary-card strong {
  font-size: 22px;
  letter-spacing: 0;
}

.export-summary-card.ready-card {
  border-color: #9ed8cf;
  background: #f0fbf8;
}

.export-summary-card.danger-card {
  border-color: #f3b6ae;
  background: #fff6f4;
}

.export-summary-card.warning-card {
  border-color: #ead287;
  background: #fffbea;
}

.export-package-preview {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 16px;
  background: #fff;
}

.export-package-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.export-package-grid > div {
  display: grid;
  gap: 3px;
  padding: 10px;
  border-radius: 12px;
  background: #f8fafc;
}

.export-package-grid span,
.export-package-grid small {
  color: var(--muted);
  font-size: 12px;
}

.export-package-grid strong {
  font-size: 15px;
  letter-spacing: 0;
}

.export-file-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.export-file-strip code {
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
}

.export-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.export-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease);
}

.export-row:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, .28);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.export-row.active {
  border-color: rgba(37, 99, 235, .38);
  background: #f8fbff;
}

.export-row.has-error {
  border-color: rgba(220, 38, 38, .30);
  background: #fffafa;
}

.export-row.has-warning {
  border-color: #ead287;
}

.export-row.is-ready b {
  color: var(--ok);
}

.export-row.has-error b {
  color: var(--danger);
}

.export-row input {
  width: auto;
}

.dataset-dialog {
  width: min(1080px, 94vw);
}

.dataset-grid,
.dataset-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: 14px;
}

.dataset-layout {
  align-items: start;
}

.dataset-fields-panel,
.dataset-side-panel,
.role-guide,
.preview-card,
.privacy-note,
.schema-readiness,
.schema-issues {
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.dataset-fields-panel {
  overflow: hidden;
}

.dataset-side-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
  background: linear-gradient(180deg, #fbfdff 0%, #fff 100%);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px;
}

.section-head.compact {
  padding-bottom: 6px;
}

.section-head span {
  color: var(--muted);
  font-size: 12px;
}

.schema-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.schema-stats div {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 14px;
  background: #f8fbff;
}

.schema-stats span {
  color: var(--muted);
  font-size: 12px;
}

.schema-stats strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-wrap {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.dataset-fields-panel .table-wrap,
.preview-card .table-wrap {
  border-width: 1px 0 0;
  border-radius: 0;
}

.schema-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
}

.schema-table th, .schema-table td {
  padding: 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.schema-table input, .schema-table select {
  min-width: 120px;
  padding: 6px;
}

.schema-table .schema-cell-invalid input {
  border-color: #e58f84;
  background: #fffafa;
}

.schema-readiness {
  overflow: hidden;
}

.schema-readiness p {
  margin: 0;
  padding: 0 12px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.schema-readiness.ready {
  border-color: #9ed8cf;
  background: #f9fffd;
}

.schema-readiness.warning {
  border-color: #ead287;
  background: #fffdf3;
}

.schema-readiness.error {
  border-color: #f3b6ae;
  background: #fffafa;
}

.role-chip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 12px 12px;
}

.role-chip {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.role-chip span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-chip strong {
  color: var(--text);
  font-size: 12px;
}

.role-chip.ready {
  border-color: #9ed8cf;
  background: #f0fbf8;
}

.role-chip.missing {
  border-color: #f3b6ae;
  background: #fff0ee;
}

.role-chip.soft {
  background: #f8fbff;
}

.schema-issues {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-color: #f3b6ae;
  background: #fff6f4;
}

.schema-issues strong {
  color: var(--danger);
  font-size: 13px;
}

.schema-issues p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.preview-card {
  display: grid;
  gap: 10px;
  overflow: hidden;
}

.role-guide {
  overflow: hidden;
}

.role-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 10px;
  align-items: start;
  padding: 9px 12px;
  border-top: 1px solid var(--line);
}

.role-row code {
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}

.role-row span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.privacy-note {
  padding: 12px;
  background: #f8fbff;
}

.privacy-note p {
  margin: 4px 0 0;
  color: var(--muted);
}

.sticky-actions {
  position: sticky;
  bottom: -20px;
  margin: 14px -20px -20px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(18px);
}

dialog {
  border: 0;
  padding: 0;
  background: transparent;
}

dialog::backdrop {
  background: rgba(15, 23, 42, .22);
}

.empty-inline {
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes drawerIn {
  from { transform: translateX(-18px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes rise {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes pulseSoft {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(.82); opacity: .72; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 980px) {
  .home-hero, .project-bar {
    display: grid;
  }
  .home-hero {
    grid-template-columns: 1fr;
  }
  .home-actions, .bar-actions {
    justify-content: flex-start;
  }
  .workspace-grid {
    grid-template-columns: 1fr;
  }
  .workflow-nav, .inspector {
    position: static;
    max-height: none;
    border: 0;
    border-bottom: 1px solid var(--line);
  }
  .canvas {
    min-width: 760px;
  }
  .dataset-grid,
  .dataset-layout,
  .export-summary,
  .export-package-grid {
    grid-template-columns: 1fr;
  }
  .project-grid {
    grid-template-columns: 1fr;
  }
  .activation-panel,
  .activation-steps,
  .plan-panel,
  .plan-limits,
  .trust-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .project-home, .profile-page, .canvas-wrap {
    padding: 14px;
  }
  .home-hero {
    padding: 18px;
  }
  .home-hero h1 {
    font-size: 28px;
  }
  .topbar {
    padding: 0 12px;
  }
  .brand-sub {
    display: none;
  }
  .canvas-toolbar {
    align-items: stretch;
    display: grid;
  }
  .canvas-actions {
    justify-content: flex-start;
  }
  .schema-stats {
    grid-template-columns: 1fr;
  }
  .export-row {
    grid-template-columns: auto 1fr;
  }
  .export-row b {
    grid-column: 2;
  }
}

/* macOS Vibrancy theme layer */
body {
  background: var(--bg);
}

button {
  border-color: var(--line);
  border-radius: 8px;
  background: #3a3a3c;
  color: rgba(255, 255, 255, .90);
  box-shadow: none;
  transition: background .2s ease-out, border-color .2s ease-out, color .2s ease-out, opacity .2s ease-out;
}

button:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: #444447;
  box-shadow: none;
}

button:active:not(:disabled) {
  opacity: .80;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 0;
  border-color: rgba(255, 255, 255, .25);
  box-shadow: 0 0 0 2px rgba(100, 100, 255, .30);
}

.primary,
.secondary,
.ghost,
.danger {
  background: #3a3a3c;
  border-color: var(--line);
  color: rgba(255, 255, 255, .90);
}

.primary:hover:not(:disabled),
.secondary:hover:not(:disabled),
.ghost:hover:not(:disabled),
.danger:hover:not(:disabled) {
  background: #48484a;
  border-color: var(--line-strong);
  color: rgba(255, 255, 255, .96);
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #1c1c1e;
  color: rgba(255, 255, 255, .90);
  transition: background .2s ease-out, border-color .2s ease-out, color .2s ease-out;
}

input::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, .30);
}

.topbar,
.project-bar,
.canvas-toolbar,
.sticky-actions {
  border-color: var(--line);
  background: rgba(44, 44, 46, .78);
  -webkit-backdrop-filter: saturate(160%) blur(22px);
  backdrop-filter: saturate(160%) blur(22px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .05);
}

.brand-mark,
.home-hero h1,
.section-title h2,
.project-card h3,
.activation-panel h2,
.plan-panel h2,
.trust-panel h2,
.project-bar h1,
.drawer-head h2,
.create-modal-rail h2 {
  color: rgba(255, 255, 255, .95);
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-weight: 600;
  letter-spacing: 0;
}

.brand-sub,
.home-hero p,
.project-card p,
.drawer-head p,
.node-card p,
.muted,
small,
.section-subtitle,
.project-facts,
.canvas-meta span,
.account-name,
.field label,
.message-panel-head,
.role-row span,
.privacy-note p {
  color: var(--muted);
}

.nav {
  border-color: var(--line);
  border-radius: 12px;
  background: rgba(28, 28, 30, .80);
}

.nav button {
  border-radius: 8px;
  color: var(--muted);
}

.nav button.active {
  background: #3a3a3c;
  color: rgba(255, 255, 255, .92);
}

.project-home,
.profile-page {
  background: transparent;
}

.home-hero,
.project-card,
.activation-panel,
.plan-panel,
.trust-panel,
.admin-metric,
.notice,
.workflow-row,
.step-banner,
.empty-state,
.inline-upload,
.toast,
.health-item,
.io-summary > div,
.edge-card,
.export-status,
.modal,
.dataset-dialog,
.context-menu,
.recommendation-strip,
.recommendation-item,
.picker-item,
.export-summary-card,
.export-package-preview,
.export-package-grid > div,
.export-row,
.dataset-fields-panel,
.dataset-side-panel,
.role-guide,
.preview-card,
.privacy-note,
.schema-readiness,
.schema-issues,
.schema-stats div,
.role-chip,
.field-checklist,
.card-issues,
.focus-note,
.message-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #2c2c2e;
  box-shadow: none;
}

.home-hero {
  grid-template-columns: minmax(0, 1fr) 300px;
  border-color: var(--line);
  background: rgba(44, 44, 46, .86);
  -webkit-backdrop-filter: saturate(150%) blur(24px);
  backdrop-filter: saturate(150%) blur(24px);
}

.eyebrow,
.project-kicker,
.recommendation-item span,
.project-next.primary-link,
.project-next:hover,
.message-action,
.role-row code {
  color: rgba(180, 180, 255, .92);
}

.hero-points span,
.project-status,
.health-pill,
.badge,
.connect-hint,
.zoom-readout,
.rail-steps span,
.export-file-strip code {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #3a3a3c;
  color: var(--muted);
}

.hero-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(28, 28, 30, .72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}

.hero-panel-row {
  border-color: var(--line);
  border-radius: 10px;
  background: #2c2c2e;
}

.hero-panel-row span,
.project-step i,
.activation-step i,
.starter-card span,
.port-dot,
.port-clear,
.status-orb {
  border-radius: 8px;
  background: #3a3a3c;
  color: rgba(255, 255, 255, .78);
  box-shadow: none;
}

.hero-panel-row.active,
.workflow-row.active,
.export-row.active,
.field.field-focused,
.focus-note {
  border-color: rgba(180, 180, 255, .38);
  background: rgba(142, 142, 255, .15);
  box-shadow: 0 0 0 2px rgba(100, 100, 255, .16);
}

.project-card:hover,
.node-card:hover,
.export-row:hover {
  transform: none;
  border-color: var(--line-strong);
  background: #333335;
  box-shadow: none;
}

.project-metrics div,
.project-progress,
.activation-step,
.plan-limits div,
.plan-upgrade,
.trust-list div,
.workspace-notices,
.project-progress.loading,
.canvas-wrap,
.workflow-nav,
.inspector,
.create-box,
.project-step i,
.field-checklist .all-fields {
  border-color: var(--line);
  background: #242426;
}

.workspace-grid {
  background: rgba(28, 28, 30, .72);
}

.workflow-nav,
.inspector {
  -webkit-backdrop-filter: saturate(150%) blur(18px);
  backdrop-filter: saturate(150%) blur(18px);
}

.canvas-wrap {
  background: #1c1c1e;
}

.canvas {
  border-color: var(--line);
  border-radius: 12px;
  background: #1c1c1e;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}

.canvas-empty-card {
  background: transparent;
}

.node-card {
  border: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-radius: 12px;
  background: #2c2c2e;
  box-shadow: none;
}

.node-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: rgba(180, 180, 255, .55);
}

.node-card.kind-data::before { background: rgba(142, 142, 255, .70); }
.node-card.kind-primitive::before { background: rgba(191, 171, 255, .70); }
.node-card.kind-variable::before { background: rgba(121, 215, 184, .70); }
.node-card.kind-model::before { background: rgba(150, 190, 255, .70); }
.node-card.kind-diagnostic::before { background: rgba(180, 180, 190, .70); }
.node-card.kind-output::before { background: rgba(204, 171, 255, .70); }
.node-card.kind-robust::before { background: rgba(226, 189, 115, .70); }
.node-card.kind-heterogeneity::before { background: rgba(137, 213, 145, .70); }

.node-card.selected {
  border-color: rgba(180, 180, 255, .48);
  background: #333335;
  outline: 1px solid rgba(180, 180, 255, .48);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px rgba(100, 100, 255, .16);
}

.node-card.connecting,
.port-pill.active,
.port-pill.input.drop-target {
  border-color: rgba(226, 189, 115, .42);
  background: var(--warn-bg);
}

.node-flip,
.port-pill,
.port-pill.output,
.starter-card,
.param-binding,
.schema-table,
.schema-table th,
.schema-table td {
  border-color: var(--line);
  background: #242426;
  color: var(--text);
  box-shadow: none;
}

.port-pill.input.bound,
.ok-pill,
.project-status.ready,
.project-step.done i,
.project-step.done,
.activation-step.done,
.export-status.success,
.export-status.succeeded,
.notice.success,
.export-summary-card.ready-card,
.schema-readiness.ready,
.role-chip.ready,
.toast.success {
  border-color: rgba(121, 215, 184, .32);
  background: var(--ok-bg);
  color: var(--ok);
}

.warn-pill,
.message-item.warning,
.field-message.warning,
.export-summary-card.warning-card,
.schema-readiness.warning,
.notice.warning,
.export-row.has-warning {
  border-color: rgba(226, 189, 115, .32);
  background: var(--warn-bg);
  color: var(--warn);
}

.danger-pill,
.project-status.error,
.project-step.warn i,
.project-step.warn,
.notice.error,
.toast.error,
.field.has-field-message input,
.field.has-field-message select,
.field.has-field-message textarea,
.card-issues,
.message-item.error,
.message-item.fatal,
.field-message.error,
.field-message.fatal,
.export-status.failed,
.export-summary-card.danger-card,
.export-row.has-error,
.schema-table .schema-cell-invalid input,
.schema-readiness.error,
.role-chip.missing,
.schema-issues {
  border-color: rgba(255, 139, 130, .34);
  background: var(--danger-bg);
  color: var(--danger);
}

.export-status.queued,
.export-status.running {
  border-color: rgba(142, 142, 255, .28);
  background: rgba(142, 142, 255, .14);
  color: rgba(220, 220, 255, .92);
}

.notice.info,
.toast.info,
.message-item.info,
.field-message.info,
.role-chip.soft,
.privacy-note {
  border-color: rgba(142, 142, 255, .28);
  background: var(--primary-weak);
  color: rgba(210, 210, 255, .88);
}

.edge-path {
  stroke: rgba(180, 180, 255, .78);
}

.edge-path.selected,
.edge-path.preview.invalid {
  stroke: var(--danger);
}

.edge-path.preview {
  stroke: var(--warn);
}

.drawer-shade,
.modal-shade,
dialog::backdrop {
  background: rgba(0, 0, 0, .44);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.card-drawer {
  border-right: 1px solid var(--line);
  background: rgba(44, 44, 46, .90);
  -webkit-backdrop-filter: saturate(160%) blur(24px);
  backdrop-filter: saturate(160%) blur(24px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .30);
}

.create-modal-rail {
  background: #242426;
  color: rgba(255, 255, 255, .92);
}

.create-modal-rail p,
.rail-kicker {
  color: var(--muted);
}

.table-wrap {
  border-color: var(--line);
}

.schema-table th,
.schema-table td,
.field-checklist .check,
.role-row,
.node-note,
.node-tools {
  border-color: var(--line);
}

.schema-table th {
  color: var(--muted);
  font-weight: 700;
}

.empty-inline {
  border-color: var(--line);
  color: var(--muted);
  background: #242426;
}

.icon {
  border-radius: 8px;
}

.panel,
.modal,
.dataset-dialog,
.context-menu,
.card-drawer {
  animation: none;
}

.status-orb {
  animation: none;
}

/* Density and overflow hardening after real workflow audit */
.workflow-row,
.row-head,
.row-head span,
.workflow-health-line,
.canvas-meta,
.canvas-actions,
.node-card,
.node-top,
.node-port-grid,
.node-port-column,
.port-pill,
.project-card,
.dataset-dialog,
.table-wrap {
  min-width: 0;
}

.workflow-row {
  overflow: hidden;
  padding-inline: 12px;
}

.row-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.workflow-row small,
.workflow-health-line {
  max-width: 100%;
}

.workflow-health-line {
  flex-wrap: wrap;
}

.node-card {
  padding: 14px 14px 12px 16px;
}

.node-top strong {
  min-width: 0;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.28;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-card p {
  min-height: 34px;
  line-height: 1.45;
}

.node-port-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  padding-top: 2px;
}

.node-port-column {
  gap: 6px;
}

.node-port-column.output,
.node-card.flipped .node-port-column.input,
.node-card.flipped .node-port-column.output {
  justify-items: stretch;
}

.port-title {
  overflow: hidden;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.port-pill,
.port-pill.output,
.node-card.flipped .port-pill.output,
.node-card.flipped .port-pill.input {
  min-height: 28px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 6px;
  padding: 4px 7px;
  text-align: left;
}

.port-pill.output .port-dot,
.node-card.flipped .port-pill.output .port-dot {
  order: 0;
}

.port-pill.output .port-type,
.node-card.flipped .port-pill.output .port-type,
.node-card.flipped .port-pill.input .port-type {
  order: 3;
}

.node-card.flipped .port-pill.input {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.node-card.flipped .port-pill.input.bound {
  grid-template-columns: minmax(0, 1fr) auto auto auto;
}

.node-card.flipped .port-pill.input .port-dot {
  order: 3;
}

.node-card.flipped .port-pill.input.bound .port-dot {
  order: 4;
}

.node-card.flipped .port-pill.input.bound .port-clear {
  order: 3;
}

.port-type {
  max-width: 54px;
  padding: 1px 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, .045);
  line-height: 1.25;
}

.port-pill.input.bound {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.dataset-dialog {
  width: min(1160px, 94vw);
}

.dataset-grid,
.dataset-layout {
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
}

.dataset-fields-panel,
.preview-card {
  min-width: 0;
}

.table-wrap {
  overflow: auto;
  scrollbar-color: rgba(255, 255, 255, .28) rgba(255, 255, 255, .06);
}

.dataset-fields-panel .schema-table {
  min-width: 820px;
}

.preview-card .schema-table {
  min-width: 720px;
}

.schema-table th,
.schema-table td {
  padding: 10px;
}

.schema-table input,
.schema-table select {
  min-width: 0;
  width: 100%;
}

.schema-table td:last-child,
.schema-table th:last-child {
  width: 52px;
  padding-right: 12px;
}

.schema-table td:nth-child(5),
.schema-table th:nth-child(5) {
  min-width: 180px;
}

.canvas,
.workflow-nav,
.inspector,
.table-wrap,
.dataset-dialog,
.card-drawer {
  scrollbar-color: rgba(255, 255, 255, .28) rgba(255, 255, 255, .06);
}

.canvas::-webkit-scrollbar,
.workflow-nav::-webkit-scrollbar,
.inspector::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
.dataset-dialog::-webkit-scrollbar,
.card-drawer::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.canvas::-webkit-scrollbar-thumb,
.workflow-nav::-webkit-scrollbar-thumb,
.inspector::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb,
.dataset-dialog::-webkit-scrollbar-thumb,
.card-drawer::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, .24);
  background-clip: padding-box;
}

.canvas::-webkit-scrollbar-track,
.workflow-nav::-webkit-scrollbar-track,
.inspector::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track,
.dataset-dialog::-webkit-scrollbar-track,
.card-drawer::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, .04);
}
