@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --orange: #ff5a1f;
  --orange-deep: #e9440b;
  --ink: #111111;
  --paper: #ffffff;
  --warm: #f6f3ee;
  --muted: #6d6b67;
  --line: #dedbd5;
  --panel: #191919;
  --panel-soft: #232323;
  --display: "Manrope", Arial, sans-serif;
  --mono: "DM Mono", Consolas, monospace;
  --shell: min(1440px, calc(100vw - 48px));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  padding: 0;
  max-width: none;
  min-width: 320px;
  background: var(--warm);
  color: var(--ink);
  font: 16px/1.55 var(--display);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
[x-cloak] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; z-index: 1000; top: 10px; left: 10px; padding: 10px 16px;
  background: var(--ink); color: white; transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

.sb-topbar {
  height: 82px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.96);
  display: flex;
  align-items: center;
}
.sb-nav {
  width: var(--shell); margin: 0 auto; display: flex; align-items: center; gap: 34px;
}
.sb-brand {
  display: inline-flex; align-items: center; gap: 10px; margin-right: auto;
  font-weight: 800; font-size: 20px; letter-spacing: -.045em;
}
.sb-brand-mark { width: 30px; height: auto; flex: 0 0 auto; object-fit: contain; }
.sb-brand > span > span { color: inherit; }
.sb-product-name {
  padding-left: 17px; border-left: 1px solid var(--line); color: var(--muted);
  font: 11px var(--mono); text-transform: uppercase; letter-spacing: .1em;
}
.sb-nav-links { display: flex; align-items: center; gap: 9px; }
.sb-nav-links a {
  padding: 9px 12px; color: var(--muted); font-size: 12px; font-weight: 700;
  border: 1px solid transparent;
}
.sb-nav-links a:hover { color: var(--ink); }
.sb-nav-links a.active { border-color: var(--ink); color: var(--ink); }
.sb-home-link { font-size: 12px; font-weight: 700; }
.sb-home-link span { color: var(--orange); margin-right: 6px; }

.sb-hero {
  background: var(--ink); color: white; overflow: hidden; position: relative;
  border-bottom: 5px solid var(--orange);
}
.sb-hero::after {
  content: "</>"; position: absolute; right: 4vw; top: 50%; transform: translateY(-55%);
  color: rgba(255,90,31,.14); font: 700 clamp(100px, 18vw, 260px)/1 var(--mono);
  letter-spacing: -.12em; pointer-events: none;
}
.sb-hero-inner {
  width: var(--shell); min-height: 300px; margin: 0 auto; padding: 63px 0 57px;
  position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr .65fr;
  gap: 80px; align-items: end;
}
.sb-kicker {
  margin: 0 0 22px; color: var(--orange); font: 500 11px var(--mono);
  text-transform: uppercase; letter-spacing: .16em;
}
.sb-kicker::before { content: ""; display: inline-block; width: 27px; border-top: 1px solid; margin: 0 12px 4px 0; }
.sb-hero h1 { margin: 0; max-width: 850px; font-size: clamp(45px, 5.8vw, 78px); line-height: .98; letter-spacing: -.065em; font-weight: 650; }
.sb-hero h1 span { color: var(--orange); }
.sb-hero-copy { margin: 0 0 5px; max-width: 470px; color: #aaa; font-size: 15px; }
.sb-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 25px; }
.sb-meta span { border: 1px solid #383838; border-radius: 100px; padding: 5px 10px; color: #bbb; font: 9px var(--mono); text-transform: uppercase; letter-spacing: .08em; }

.sb-main { width: var(--shell); margin: 0 auto; padding: 40px 0 64px; }
.sb-workspace { display: grid; grid-template-columns: minmax(340px, 460px) minmax(0, 1fr); min-height: 750px; border: 1px solid var(--line); background: white; }
.sb-config { padding: 35px 37px 40px; border-right: 1px solid var(--line); }
.sb-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 25px; border-bottom: 1px solid var(--ink); }
.sb-step { color: var(--orange); font: 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.sb-panel-head h2 { margin: 7px 0 0; font-size: 28px; letter-spacing: -.045em; line-height: 1.1; }
.sb-count { min-width: 52px; height: 39px; padding: 0 8px; display: grid; place-items: center; background: var(--orange); color: white; font: 500 11px var(--mono); transition: .2s; }
.sb-count.empty { border: 1px solid #bdb7ae; background: var(--warm); color: var(--muted); }
.sb-fieldset { margin: 0; padding: 28px 0; border: 0; border-bottom: 1px solid var(--line); }
.sb-fieldset legend { width: 100%; padding: 0; margin: 0 0 18px; font: 500 10px var(--mono); color: var(--orange); letter-spacing: .12em; text-transform: uppercase; }
.sb-legend-label, .sb-label-group { display: inline-flex; align-items: center; gap: 6px; }
.sb-info {
  position: relative; z-index: 3; width: 16px; height: 16px; display: inline-grid; place-items: center; flex: 0 0 auto;
  border: 1px solid #aaa39a; border-radius: 50%; background: white; color: var(--ink);
  font: 700 9px/1 Arial, sans-serif; letter-spacing: 0; text-transform: none; cursor: help;
}
.sb-info:hover, .sb-info:focus { border-color: var(--orange); background: var(--orange); color: white; outline: none; }
.sb-info:focus-visible { box-shadow: 0 0 0 2px rgba(255,90,31,.25); }
.sb-tooltip {
  position: absolute; z-index: 20; left: 0; bottom: calc(100% + 9px); width: 220px; padding: 10px 11px;
  border: 1px solid #333; background: var(--ink); color: white; box-shadow: 0 8px 24px rgba(20,18,15,.18);
  font: 400 10px/1.5 var(--display); letter-spacing: 0; text-align: left; text-transform: none;
  opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity .15s, transform .15s, visibility .15s; pointer-events: none;
}
.sb-tooltip::after { content: ""; position: absolute; top: 100%; left: 7px; border: 5px solid transparent; border-top-color: var(--ink); }
.sb-info:hover .sb-tooltip, .sb-info:focus .sb-tooltip, .sb-info:focus-within .sb-tooltip { opacity: 1; visibility: visible; transform: none; }
.sb-field { display: block; margin-top: 16px; }
.sb-field:first-of-type { margin-top: 0; }
.sb-field > span { display: flex; justify-content: space-between; margin-bottom: 7px; font-size: 12px; font-weight: 700; }
.sb-field small { color: var(--muted); font: 9px var(--mono); font-weight: 400; text-transform: uppercase; }
.sb-input, .sb-select {
  display: block; width: 100%; height: 46px; padding: 0 13px; border: 1px solid #cfcac2;
  border-radius: 0; outline: 0; background: white; color: var(--ink); transition: border .2s, box-shadow .2s;
}
.sb-input:focus, .sb-select:focus { border-color: var(--orange); box-shadow: inset 3px 0 var(--orange); }
.sb-input:disabled { background: #efede8; color: #999; cursor: not-allowed; }
.sb-inline-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sb-inline-fields .sb-field { margin-top: 0; }

.sb-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  min-height: 51px; padding: 12px 0; cursor: pointer; font-size: 13px; font-weight: 650;
}
.sb-toggle-featured { margin-bottom: 17px; padding: 14px; border: 1px solid #c8c2b9; background: var(--warm); }
.sb-toggle-copy { display: grid; gap: 3px; }
.sb-toggle-copy strong { font-size: 13px; }
.sb-toggle-copy small { color: var(--muted); font: 9px var(--mono); text-transform: uppercase; letter-spacing: .04em; }
.sb-toggle-action { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.sb-toggle-action b { min-width: 23px; color: var(--orange); font: 500 10px var(--mono); text-transform: uppercase; }
.sb-toggle + .sb-toggle { border-top: 1px solid var(--line); }
.sb-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.sb-switch { width: 40px; height: 22px; padding: 3px; flex: 0 0 auto; border: 1px solid #aaa49b; border-radius: 50px; background: #dedad3; transition: .2s; }
.sb-switch::after { content: ""; display: block; width: 14px; height: 14px; border-radius: 50%; background: white; box-shadow: 0 1px 3px #777; transition: transform .2s; }
.sb-toggle input:checked + .sb-switch { background: var(--orange); border-color: var(--orange); }
.sb-toggle input:checked + .sb-switch::after { transform: translateX(18px); }
.sb-toggle input:focus-visible + .sb-switch { outline: 2px solid var(--ink); outline-offset: 2px; }

.sb-format-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sb-format-hint { margin: -8px 0 12px; color: var(--muted); font: 9px var(--mono); text-transform: uppercase; letter-spacing: .07em; }
.sb-format { cursor: pointer; }
.sb-format input { position: absolute; opacity: 0; }
.sb-format span {
  position: relative; display: grid; place-items: center; height: 46px; border: 1px dashed #aaa39a;
  background: #efebe5; color: #777169; font: 500 10px var(--mono); transition: .2s;
}
.sb-format span::before {
  content: ""; position: absolute; top: 7px; right: 7px; width: 9px; height: 9px;
  border: 1px solid #a19a91; background: white;
}
.sb-format:hover span { border-color: var(--orange); color: var(--ink); }
.sb-format input:checked + span { border-style: solid; border-color: var(--ink); background: var(--ink); color: white; box-shadow: inset 0 -3px var(--orange); }
.sb-format input:checked + span::before { content: "✓"; display: grid; place-items: center; border-color: var(--orange); background: var(--orange); color: white; font: 700 8px/1 Arial, sans-serif; }
.sb-format input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: 2px; }

.sb-primary {
  width: 100%; min-height: 52px; margin-top: 27px; padding: 14px 17px; border: 0;
  display: flex; justify-content: space-between; align-items: center; cursor: pointer;
  background: var(--orange); color: white; font-weight: 750; font-size: 13px; transition: .2s;
}
.sb-primary:hover { background: var(--orange-deep); transform: translateY(-2px); }
.sb-primary span { font-size: 19px; }

.sb-output { min-width: 0; display: flex; flex-direction: column; background: var(--panel); color: white; }
.sb-output-head { min-height: 87px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 24px; border-bottom: 1px solid #353535; }
.sb-output-title { display: flex; align-items: center; gap: 13px; }
.sb-status-dot { width: 8px; height: 8px; border-radius: 50%; background: #696969; box-shadow: 0 0 0 5px rgba(255,255,255,.04); }
.sb-status-dot.ready { background: var(--orange); }
.sb-output-title strong { display: block; font-size: 13px; }
.sb-output-title small { display: block; margin-top: 3px; color: #777; font: 9px var(--mono); text-transform: uppercase; letter-spacing: .09em; }
.sb-output-actions { display: flex; gap: 8px; }
.sb-action {
  min-height: 38px; padding: 8px 12px; border: 1px solid #454545; background: transparent; color: #c9c9c9;
  cursor: pointer; font-size: 10px; font-weight: 700; transition: .2s;
}
.sb-action:hover:not(:disabled) { border-color: var(--orange); color: white; }
.sb-action:disabled { opacity: .35; cursor: not-allowed; }
.sb-code-wrap { flex: 1; min-height: 560px; position: relative; }
.sb-code {
  display: block; width: 100%; height: 100%; min-height: 660px; resize: none; border: 0; outline: 0;
  margin: 0; padding: 27px 29px 45px 62px; border-radius: 0; box-shadow: none; background: linear-gradient(90deg, #141414 0 45px, #303030 46px, #191919 47px);
  color: #e9b7ff; caret-color: var(--orange); font: 12px/1.7 var(--mono); tab-size: 2; white-space: pre;
}
.sb-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; padding: 30px; pointer-events: none; }
.sb-empty-mark { color: var(--orange); font: 500 45px var(--mono); letter-spacing: -.12em; }
.sb-empty strong { margin-top: 15px; font-size: 18px; }
.sb-empty p { max-width: 330px; margin: 7px 0 0; color: #777; font-size: 12px; }
.sb-output-foot { min-height: 42px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #353535; color: #666; font: 9px var(--mono); text-transform: uppercase; letter-spacing: .08em; }

.sb-footer { padding: 28px 0; border-top: 1px solid var(--line); background: white; }
.sb-footer-inner { width: var(--shell); margin: 0 auto; display: flex; justify-content: space-between; gap: 30px; color: var(--muted); font: 9px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.sb-footer a:hover { color: var(--orange); }
.sb-toast {
  position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: 340px; padding: 13px 17px;
  background: white; border-left: 4px solid var(--orange); box-shadow: 0 12px 35px rgba(0,0,0,.18);
  font-size: 12px; font-weight: 700;
}

/* Visual workflow editor */
.node-page { height: 100vh; overflow: hidden; background: #ece9e3; }
.node-page .sb-topbar { height: 72px; }
.node-shell { height: calc(100vh - 72px); display: grid; grid-template-columns: 270px minmax(0, 1fr); }
.node-sidebar { z-index: 2; padding: 25px 20px; background: white; border-right: 1px solid var(--line); overflow-y: auto; }
.node-sidebar .sb-step { display: block; margin-bottom: 8px; }
.node-sidebar h1 { margin: 0; font-size: 24px; letter-spacing: -.045em; }
.node-sidebar > p { margin: 9px 0 25px; color: var(--muted); font-size: 12px; }
.node-section-title { margin: 25px 0 10px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font: 9px var(--mono); text-transform: uppercase; letter-spacing: .12em; }
.node-item { margin-bottom: 8px; padding: 13px 12px; border: 1px solid var(--line); background: var(--warm); cursor: grab; display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 750; transition: .2s; }
.node-item:hover { border-color: var(--orange); transform: translateX(3px); }
.node-item:active { cursor: grabbing; }
.node-icon { width: 26px; height: 26px; display: grid; place-items: center; flex: 0 0 auto; background: var(--ink); color: var(--orange); font: 13px var(--mono); }
.node-stage { min-width: 0; display: grid; grid-template-rows: 1fr auto; position: relative; }
#drawflow { min-height: 0; background-color: #ece9e3; background-image: radial-gradient(#c9c4bc 1px, transparent 1px); background-size: 22px 22px; }
.drawflow .drawflow-node { width: 220px; padding: 0; border: 1px solid #cfcac2; border-radius: 0; background: white; color: var(--ink); box-shadow: 0 8px 24px rgba(35,30,24,.09); }
.drawflow .drawflow-node.selected { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(255,90,31,.18), 0 8px 24px rgba(35,30,24,.12); }
.drawflow .drawflow-node .input, .drawflow .drawflow-node .output { width: 12px; height: 12px; border: 2px solid white; background: var(--orange); box-shadow: 0 0 0 1px var(--orange); }
.drawflow .connection .main-path { stroke: var(--orange); stroke-width: 3px; }
.drawflow-node .title-box { padding: 11px 13px; border-bottom: 1px solid var(--line); background: var(--ink); color: white; font: 500 10px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.drawflow-node .title-box span { color: var(--orange); margin-right: 7px; }
.node-content { padding: 13px; color: var(--muted); font-size: 10px; }
.node-content input, .node-content select { width: 100%; height: 34px; margin-top: 7px; padding: 0 8px; border: 1px solid var(--line); background: var(--warm); color: var(--ink); font-size: 10px; }
.node-content button { width: 100%; padding: 9px; border: 0; background: var(--orange); color: white; cursor: pointer; font-size: 10px; font-weight: 700; }
.node-toolbar { position: absolute; z-index: 4; top: 17px; right: 18px; display: flex; gap: 7px; }
.node-toolbar button { padding: 9px 11px; border: 1px solid var(--line); background: white; cursor: pointer; font: 500 9px var(--mono); text-transform: uppercase; }
.node-toolbar button:hover { border-color: var(--orange); }
.node-output { max-height: 250px; border-top: 4px solid var(--orange); background: var(--panel); color: #ddd; }
.node-output-head { padding: 11px 17px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #333; }
.node-output-head strong { font-size: 11px; }
.node-output-head button { border: 0; background: transparent; color: #999; cursor: pointer; font-size: 11px; }
.node-output pre { max-height: 185px; overflow: auto; margin: 0; padding: 17px; color: #e9b7ff; font: 10px/1.6 var(--mono); white-space: pre-wrap; }

@media (max-width: 900px) {
  :root { --shell: min(100% - 32px, 720px); }
  .sb-product-name, .sb-home-link { display: none; }
  .sb-hero-inner { grid-template-columns: 1fr; gap: 28px; min-height: 0; }
  .sb-hero-copy { max-width: 600px; }
  .sb-workspace { grid-template-columns: 1fr; }
  .sb-config { border-right: 0; border-bottom: 1px solid var(--line); }
  .sb-code { min-height: 600px; }
  .node-shell { grid-template-columns: 220px minmax(600px, 1fr); overflow: auto; }
}

@media (max-width: 600px) {
  :root { --shell: calc(100% - 24px); }
  .sb-topbar { height: 68px; }
  .sb-nav { gap: 12px; }
  .sb-brand { font-size: 18px; }
  .sb-brand-mark { width: 26px; }
  .sb-nav-links a { padding: 7px; font-size: 10px; }
  .sb-nav-links a:first-child { display: none; }
  .sb-hero-inner { padding: 45px 0 39px; }
  .sb-main { padding: 18px 0 35px; }
  .sb-config { padding: 27px 21px 30px; }
  .sb-inline-fields { grid-template-columns: 1fr; }
  .sb-output-head { align-items: flex-start; flex-direction: column; }
  .sb-output-actions { width: 100%; }
  .sb-action { flex: 1; }
  .sb-code { padding-left: 21px; background: #191919; font-size: 10px; }
  .sb-footer-inner { flex-direction: column; gap: 8px; }
}

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