:root {
  --bg: #f3f7fb;
  --bg-deep: #0f172a;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --surface-muted: rgba(247, 250, 252, 0.92);
  --text: #102033;
  --muted: #5d6b7e;
  --line: rgba(15, 23, 42, 0.10);
  --line-strong: rgba(15, 23, 42, 0.16);
  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-soft: rgba(15, 118, 110, 0.10);
  --accent-orange: #dd6b20;
  --danger: #b42318;
  --warning: #b54708;
  --info: #175cd3;
  --shadow-lg: 0 28px 70px rgba(15, 23, 42, 0.12);
  --shadow-md: 0 18px 38px rgba(15, 23, 42, 0.09);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

[x-cloak] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.16), transparent 26%),
    radial-gradient(circle at 100% 0%, rgba(221, 107, 32, 0.16), transparent 22%),
    radial-gradient(circle at 50% 100%, rgba(23, 92, 211, 0.10), transparent 28%),
    linear-gradient(180deg, #f8fbfd 0%, #eff4f9 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(15, 23, 42, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.02) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.6), transparent 92%);
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(2rem, 3.2vw, 3.2rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 6px;
  font-size: 1.12rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h3 {
  margin-bottom: 6px;
  font-size: 1rem;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--accent);
}

.intro,
.section-heading p,
.hero-panel p,
.project-card p,
.history-card p,
.list-row p,
.brand-subtitle,
.identity span,
small,
label small,
.helper-text {
  color: var(--muted);
}

.login-body {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(1080px, 100%);
}

.login-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.8fr);
  gap: 18px;
  align-items: stretch;
}

.spotlight,
.login-card,
.panel,
.hero-panel,
.metric-panel,
.template-card,
.workflow-card,
.template-selector {
  background: var(--surface);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.spotlight,
.login-card,
.panel,
.hero-panel {
  position: relative;
  overflow: hidden;
}

.spotlight::before,
.hero-panel::before,
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.36), transparent 42%);
}

.spotlight {
  padding: 26px;
  background:
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.18), transparent 30%),
    radial-gradient(circle at 0% 100%, rgba(221, 107, 32, 0.16), transparent 28%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.88));
  color: #f8fafc;
}

.spotlight .eyebrow,
.spotlight .intro,
.spotlight p,
.spotlight .helper-text {
  color: rgba(248, 250, 252, 0.78);
}

.spotlight .eyebrow {
  color: #8de0d8;
}

.spotlight h1 {
  color: #ffffff;
}

.login-card {
  padding: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.86));
}

.auth-card {
  display: grid;
  align-content: start;
  gap: 16px;
}

.feature-list,
.workflow-grid,
.metric-strip,
.template-grid,
.template-highlights {
  display: grid;
  gap: 12px;
}

.feature-list {
  margin-top: 18px;
}

.feature-item,
.workflow-card,
.mini-stat,
.template-note {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.06);
}

.feature-item strong,
.workflow-card strong {
  display: block;
  margin-bottom: 6px;
}

.stack {
  display: grid;
  gap: 12px;
}

label,
.field-card {
  display: grid;
  gap: 8px;
}

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

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input::placeholder,
textarea::placeholder {
  color: #8b97a8;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(23, 92, 211, 0.30);
  box-shadow: 0 0 0 4px rgba(23, 92, 211, 0.10);
  background: #ffffff;
}

textarea {
  resize: vertical;
}

.primary-button,
.ghost-button,
.tab-row button,
.template-selector {
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

.primary-button {
  color: white;
  background: linear-gradient(135deg, var(--accent), #0f5d95);
  box-shadow: 0 18px 34px rgba(15, 118, 110, 0.24);
}

.ghost-button,
.tab-row button {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  color: var(--text);
}

.template-selector {
  display: grid;
  padding: 14px;
  text-align: left;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
}

.primary-button:hover,
.ghost-button:hover,
.tab-row button:hover,
.template-selector:hover,
.project-card:hover,
.template-card:hover,
.workflow-card:hover,
.metric-panel:hover {
  transform: translateY(-2px);
}

.page-grid {
  width: min(1260px, calc(100% - 32px));
  margin: 18px auto 40px;
  display: grid;
  gap: 16px;
}

.topbar {
  position: sticky;
  top: 18px;
  z-index: 20;
  width: min(1260px, calc(100% - 32px));
  margin: 14px auto 0;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 999px;
  box-shadow: var(--shadow-md);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #0f5d95);
  color: #ffffff;
  font-weight: 800;
  letter-spacing: -0.04em;
  box-shadow: 0 14px 24px rgba(15, 118, 110, 0.22);
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: 0.95rem;
}

.brand-subtitle {
  margin: 0;
  font-size: 0.78rem;
}

.topbar-actions,
.nav-links,
.hero-actions,
.meta-row,
.history-header,
.toolbar-row,
.check-row,
.template-meta,
.detail-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-links {
  gap: 8px;
}

.nav-links a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  transition: background 160ms ease, color 160ms ease;
}

.nav-links a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.78);
}

.identity {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.hero-panel {
  padding: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 16px;
  align-items: start;
  background:
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.12), transparent 28%),
    radial-gradient(circle at bottom left, rgba(221, 107, 32, 0.10), transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.82));
}

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

.hero-copy p:last-child {
  margin-bottom: 0;
}

.hero-side {
  display: grid;
  gap: 10px;
  justify-items: stretch;
}

.hero-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hero-kpis,
.metric-strip {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mini-stat,
.metric-panel {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
}

.mini-stat strong,
.metric-panel strong {
  display: block;
  font-size: 1.55rem;
  line-height: 1;
  margin-bottom: 6px;
}

.mini-stat span,
.metric-panel span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.builder-grid {
  grid-template-columns: minmax(240px, 0.58fr) minmax(0, 1.42fr);
}

.builder-page {
  width: min(100%, calc(100% - 14px));
  margin-top: 10px;
}

.builder-meta-grid {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 8px;
}

.builder-meta-wide {
  grid-column: span 1;
}

.builder-app {
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.08), transparent 16%),
    linear-gradient(180deg, #09111f 0%, #0f172a 100%);
  color: #e2e8f0;
}

.builder-app .topbar {
  width: min(100%, calc(100% - 14px));
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.74);
  border-color: rgba(148, 163, 184, 0.14);
}

.builder-app .topbar .brand-subtitle,
.builder-app .topbar .identity span,
.builder-app .topbar .nav-links a {
  color: rgba(226, 232, 240, 0.68);
}

.builder-app .topbar .ghost-button {
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.14);
}

.builder-app .panel,
.builder-app .doc-tabs-shell,
.builder-app .studio-meta,
.builder-app .builder-tabs {
  background: rgba(15, 23, 42, 0.68);
  border-color: rgba(148, 163, 184, 0.12);
  box-shadow: none;
}

.builder-app .panel,
.builder-app .section-heading p,
.builder-app .helper-text,
.builder-app label span,
.builder-app .empty-state,
.builder-app .field-card,
.builder-app .connection-card,
.builder-app .doc-tab {
  color: #dbe5f1;
}

.builder-app .field-card,
.builder-app .connection-card,
.builder-app .empty-state {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(148, 163, 184, 0.12);
}

.builder-app input,
.builder-app textarea,
.builder-app select {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(148, 163, 184, 0.14);
  color: #f8fafc;
}

.builder-app input::placeholder,
.builder-app textarea::placeholder {
  color: rgba(226, 232, 240, 0.34);
}

.builder-app .panel::before,
.builder-app .doc-tabs-shell::before {
  display: none;
}

.studio-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
}

.studio-title {
  display: grid;
  gap: 4px;
}

.studio-title strong {
  font-size: 0.96rem;
  line-height: 1;
}

.studio-stats,
.studio-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.studio-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.68rem;
  color: rgba(226, 232, 240, 0.78);
}

.studio-stat strong {
  font-size: 0.74rem;
  color: #f8fafc;
}

.studio-chrome {
  padding: 6px 8px;
}

.studio-meta {
  padding: 8px 10px;
}

.builder-tabs {
  position: sticky;
  top: 60px;
  z-index: 12;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
  width: fit-content;
}

.doc-tabs-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
}

.doc-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.doc-tab-actions {
  min-width: 180px;
}

.doc-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 150px;
  padding: 4px 7px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
}

.doc-tab.active {
  background: rgba(15, 118, 110, 0.10);
  border-color: rgba(15, 118, 110, 0.24);
  color: var(--text);
}

.doc-tab-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.68rem;
  font-weight: 800;
}

.doc-tab-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  font-size: 0.64rem;
  color: var(--muted);
}

.project-grid {
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.88fr);
}

.panel {
  padding: 18px;
}

.section-heading {
  margin-bottom: 12px;
}

.section-heading.tight {
  margin-bottom: 8px;
}

.section-heading p:last-child {
  margin-bottom: 0;
}

.aside-panel {
  position: sticky;
  top: 108px;
}

.flash {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(15, 118, 110, 0.10);
  border: 1px solid rgba(15, 118, 110, 0.18);
}

.flash-error {
  background: rgba(180, 35, 24, 0.10);
  border-color: rgba(180, 35, 24, 0.18);
}

.demo-box,
.empty-state,
.template-note,
.section-card {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--line-strong);
  background: rgba(255, 255, 255, 0.54);
}

.metric-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.workflow-grid,
.template-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.workflow-card,
.template-card {
  padding: 16px;
  box-shadow: none;
}

.workflow-card p:last-child,
.template-card p:last-child {
  margin-bottom: 0;
}

.project-list,
.history-list,
.feedback-list,
.preview-stack,
.list-table,
.field-list {
  display: grid;
  gap: 10px;
}

.project-card,
.history-card,
.list-row,
.field-card,
.output-card,
.feedback-card {
  padding: 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.project-card {
  display: grid;
  gap: 10px;
}

.project-card .meta-row,
.template-card .meta-row {
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.92rem;
}

.template-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.template-card-actions .ghost-button {
  padding: 8px 10px;
  font-size: 0.72rem;
}

.input-grid,
.output-grid {
  display: grid;
  gap: 10px;
}

.input-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.output-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 10px;
}

.field-card,
.output-card {
  background: rgba(255, 255, 255, 0.82);
}

.field-card strong,
.output-card span {
  display: block;
}

.output-card strong {
  margin-top: 4px;
  font-size: 1.55rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.field-error {
  color: var(--danger);
  font-style: normal;
  font-size: 0.9rem;
}

.feedback-card {
  background: rgba(255, 255, 255, 0.84);
}

.feedback-error {
  border-color: rgba(180, 35, 24, 0.22);
  background: rgba(180, 35, 24, 0.08);
}

.feedback-warn {
  border-color: rgba(181, 71, 8, 0.24);
  background: rgba(181, 71, 8, 0.10);
}

.feedback-info {
  border-color: rgba(23, 92, 211, 0.22);
  background: rgba(23, 92, 211, 0.10);
}

.badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
  font-size: 0.74rem;
}

.status-pill.orange {
  background: rgba(221, 107, 32, 0.10);
  color: var(--accent-orange);
}

.status-pill.dark {
  background: rgba(15, 23, 42, 0.08);
  color: var(--bg-deep);
}

.list-row {
  justify-content: space-between;
  gap: 12px;
}

.aligned-right {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.tab-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tab-row button.active {
  background: linear-gradient(135deg, var(--accent), #0f5d95);
  color: white;
  border-color: transparent;
}

.field-list {
  max-height: 760px;
  overflow: auto;
  padding-right: 6px;
}

.dense-list {
  gap: 6px;
}

.compact-panel {
  padding: 12px;
}

.builder-subtoolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.compact-button {
  padding: 5px 8px;
  min-height: 28px;
  font-size: 0.66rem;
}

.compact-card {
  padding: 8px;
  gap: 8px;
}

.collapse-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.collapse-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.collapse-main strong,
.collapse-main .helper-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collapse-icon,
.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(226, 232, 240, 0.72);
  font-size: 0.62rem;
  line-height: 1;
}

.drag-handle {
  cursor: grab;
  letter-spacing: -0.08em;
}

.compact-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.field-editor-grid {
  display: grid;
  gap: 8px;
}

.field-editor-grid .input-grid {
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.collapse-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.compact-check {
  margin: 0;
}

.danger-text {
  color: #fecaca;
}

.toolbar-row {
  flex-wrap: wrap;
  margin-top: 12px;
}

.check-row {
  gap: 10px;
}

.check-row input {
  width: auto;
}

.template-selector.active {
  border-color: rgba(23, 92, 211, 0.28);
  box-shadow: 0 0 0 4px rgba(23, 92, 211, 0.10);
  background:
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.08), transparent 34%),
    rgba(255, 255, 255, 0.95);
}

.template-selector h3,
.template-card h3 {
  margin-bottom: 6px;
}

.template-selector p,
.template-card p {
  margin-bottom: 8px;
}

.template-grid.selector-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-row {
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9rem;
}

.section-card {
  display: grid;
  gap: 16px;
}

.history-header {
  justify-content: space-between;
  align-items: flex-start;
}

.history-header h3,
.history-header p {
  margin-bottom: 0;
}

.compact-feedback {
  margin-top: 10px;
}

.builder-shell {
  display: grid;
  gap: 20px;
}

.builder-studio {
  display: grid;
  gap: 0;
  align-items: start;
  min-height: calc(100vh - 180px);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(8, 14, 24, 0.92);
}

.builder-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}

.studio-pane {
  height: 100%;
  min-height: calc(100vh - 180px);
  padding: 8px;
  background: rgba(15, 23, 42, 0.88);
  overflow: auto;
}

.studio-pane-left {
  border-right: 1px solid rgba(148, 163, 184, 0.08);
}

.studio-pane-right {
  border-left: 1px solid rgba(148, 163, 184, 0.08);
}

.studio-canvas-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: rgba(8, 14, 24, 0.98);
}

.studio-resizer {
  width: 6px;
  cursor: col-resize;
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.04), rgba(148, 163, 184, 0.12), rgba(148, 163, 184, 0.04));
}

.studio-resizer:hover {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.12), rgba(56, 189, 248, 0.32), rgba(56, 189, 248, 0.12));
}

.toolbox-list {
  display: grid;
  gap: 3px;
}

.toolbox-item {
  display: grid;
  justify-items: start;
  gap: 3px;
  width: 100%;
  padding: 4px 5px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  text-align: left;
  cursor: grab;
}

.toolbox-item strong,
.toolbox-item small {
  display: block;
}

.toolbox-item strong {
  font-size: 0.62rem;
  line-height: 1.05;
}

.pane-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.connection-card {
  display: grid;
  gap: 6px;
  padding: 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.compact-stack {
  gap: 8px;
}

.canvas-card {
  padding: 0;
  overflow: hidden;
}

.graph-canvas {
  position: relative;
  height: 100%;
  min-height: 680px;
  border-radius: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.18), transparent 28%),
    linear-gradient(180deg, #0f172a 0%, #172554 100%);
  background-size: 26px 26px, 26px 26px, auto, auto;
  overflow: hidden;
}

.graph-editor-stage {
  min-height: 0;
  height: 100%;
  position: relative;
}

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

.graph-edge-group {
  pointer-events: none;
}

.graph-edge-shadow,
.graph-edge {
  fill: none;
}

.graph-edge-shadow {
  stroke: rgba(8, 15, 28, 0.88);
  stroke-width: 5.5;
  stroke-linecap: round;
  opacity: 0.95;
}

.graph-edge {
  stroke: rgba(125, 211, 252, 0.92);
  stroke-width: 2.2;
  stroke-linecap: round;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.16));
}

.graph-edge-selected {
  stroke: rgba(103, 232, 249, 0.98);
  stroke-width: 2.8;
}

.graph-edge-shadow-temp,
.graph-edge-temp {
  stroke-width: 2.4;
  stroke-dasharray: 4 4;
}

.graph-edge-shadow-temp {
  stroke: rgba(8, 15, 28, 0.88);
}

.graph-edge-temp {
  stroke: rgba(45, 212, 191, 0.96);
}

.graph-edge-socket {
  fill: #7dd3fc;
  stroke: rgba(8, 15, 28, 0.92);
  stroke-width: 1.5;
}

.graph-edge-socket-target {
  fill: #2dd4bf;
}

.graph-node {
  position: absolute;
  width: 104px;
  padding: 5px 6px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #eff6ff;
  background: rgba(15, 23, 42, 0.82);
  box-shadow: 0 18px 34px rgba(2, 6, 23, 0.35);
  cursor: grab;
  user-select: none;
  z-index: 2;
}

.graph-node-selected {
  box-shadow: 0 0 0 2px rgba(125, 211, 252, 0.75), 0 18px 34px rgba(2, 6, 23, 0.35);
  transform: translateY(-1px);
}

.graph-node-header {
  display: grid;
  gap: 2px;
  margin-bottom: 3px;
}

.graph-node strong {
  font-size: 0.61rem;
  line-height: 1.1;
  display: block;
}

.graph-node-type {
  font-size: 0.45rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.50);
}

.graph-port-column,
.graph-params {
  display: grid;
  gap: 2px;
  margin-top: 3px;
}

.graph-param,
.graph-port {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 16px;
}

.graph-param-key,
.graph-port-name {
  font-size: 0.48rem;
  font-weight: 800;
  color: #f8fafc;
}

.graph-param-value {
  font-size: 0.46rem;
  color: rgba(226, 232, 240, 0.84);
  word-break: break-word;
}

.graph-port {
  cursor: crosshair;
  user-select: none;
  width: 100%;
  position: relative;
  z-index: 3;
}

.graph-port.in {
  justify-content: flex-start;
}

.graph-port.out {
  flex-direction: row-reverse;
  justify-content: space-between;
}

.graph-port-handle {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #67e8f9;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
  flex: none;
}

.graph-port.active {
  border-color: rgba(45, 212, 191, 0.82);
  background: rgba(45, 212, 191, 0.16);
}

.graph-port.candidate {
  border-color: rgba(56, 189, 248, 0.82);
  background: rgba(56, 189, 248, 0.18);
}

.graph-port.connectable {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.10);
}

.graph-node-input {
  border-color: rgba(125, 211, 252, 0.36);
}

.graph-node-constant {
  border-color: rgba(250, 204, 21, 0.36);
}

.graph-node-operation,
.graph-node-compare {
  border-color: rgba(45, 212, 191, 0.34);
}

.graph-node-output {
  border-color: rgba(251, 146, 60, 0.36);
}

.graph-node-feedback {
  border-color: rgba(248, 113, 113, 0.36);
}

.graph-toolbar {
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.graph-toolbar-copy,
.graph-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.graph-toolbar-actions .ghost-button.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(125, 211, 252, 0.34);
  color: #f8fafc;
}

.studio-pane-right .stack {
  gap: 6px;
}

.builder-reactflow-host {
  min-height: 0;
  height: 100%;
}

.builder-reactflow-canvas {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.18), transparent 28%),
    linear-gradient(180deg, #0f172a 0%, #172554 100%);
  background-size: 26px 26px, 26px 26px, auto, auto;
}

.builder-reactflow-sync-probe {
  display: none;
}

.studio-pane-right .empty-state {
  padding: 8px;
  font-size: 0.62rem;
}

.studio-pane-right .field-card,
.studio-pane-right .connection-card {
  padding: 5px;
  border-radius: 7px;
}

.studio-pane-right .section-heading {
  margin-bottom: 6px;
}

.studio-pane-right label {
  gap: 3px;
}

.studio-pane-right label span,
.studio-pane-right .helper-text,
.studio-pane-right .detail-row,
.studio-pane-right .status-pill,
.studio-pane-right .badge {
  font-size: 0.58rem;
}

.studio-pane-right .history-header {
  gap: 5px;
}

.studio-pane-right .stack.compact-stack {
  gap: 4px;
}

.studio-pane-right .detail-row {
  gap: 5px;
}

.studio-pane-right input,
.studio-pane-right select {
  padding: 5px 6px;
  border-radius: 7px;
  font-size: 0.64rem;
}

.studio-pane-right .history-header strong,
.studio-pane-right .section-heading h2 {
  font-size: 0.66rem;
}

.inspector-toolbar,
.connection-card-head,
.inspector-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.inspector-toolbar {
  margin: 1px 0 5px;
}

.connection-card-head {
  margin-bottom: 2px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 4px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: #dbe5f1;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(125, 211, 252, 0.24);
}

.icon-button.danger:hover {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(248, 113, 113, 0.28);
  color: #fecaca;
}

.studio-pane-right .connection-card {
  gap: 4px;
}

.studio-pane-right .connection-card label span {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.72;
}

.port-binding-row {
  display: grid;
  gap: 2px;
}

.port-binding-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding-left: 8px;
}

.port-binding-detail .helper-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studio-pane-right .port-binding-row {
  padding: 3px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.studio-pane-right .port-binding-row:last-child {
  border-bottom: 0;
}

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

.helper-card {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
}

.helper-card strong {
  display: block;
  margin-bottom: 8px;
}

@media (max-width: 1180px) {
  .login-grid,
  .hero-panel,
  .project-grid,
  .builder-columns,
  .builder-meta-grid,
  .doc-tabs-shell,
  .metric-strip,
  .workflow-grid,
  .template-grid,
  .template-grid.selector-grid,
  .helper-grid {
    grid-template-columns: 1fr;
  }

  .builder-studio {
    display: block;
    min-height: auto;
  }

  .studio-pane {
    position: static;
    min-height: auto;
  }

  .studio-resizer {
    display: none;
  }

  .doc-tabs-shell {
    align-items: stretch;
  }

  .hero-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 980px) {
  .content-grid,
  .builder-grid,
  .input-grid,
  .output-grid,
  .compact-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .topbar-actions,
  .hero-actions,
  .history-header,
  .list-row,
  .meta-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .identity,
  .aligned-right {
    justify-items: start;
  }

  .aside-panel {
    position: static;
  }

  .builder-tabs {
    width: 100%;
  }

  .builder-page {
    width: min(100%, calc(100% - 24px));
  }
}

@media (max-width: 720px) {
  body,
  .login-body {
    padding: 0;
  }

  .page-grid,
  .topbar {
    width: min(100%, calc(100% - 24px));
  }

  .topbar {
    top: 12px;
    border-radius: 28px;
  }

  .spotlight,
  .login-card,
  .hero-panel,
  .panel {
    padding: 16px;
    border-radius: 24px;
  }

  .graph-canvas {
    min-height: 420px;
  }
}
