:root {
  --b-plum: #570d38;
  --b-plum-deep: #370723;
  --b-tangerine: #ffb448;
  --b-ink-dark: #0c0a0e;
  --b-term: #0e0b10;
  --b-term-raised: #16121a;
  --b-term-line: rgb(255 255 255 / .07);
  --b-term-text: #e8e3ea;
  --b-term-dim: #8b8193;
  --b-term-faint: #5a5160;
  --b-radius: 14px;
  --b-bg: light-dark(#f4f1f3, #08060a);
}

html, body { height: 100%; }
body.builder {
  margin: 0;
  font-family: Geist, var(--lucid-font-sans);
  background:
    radial-gradient(1200px 520px at 8% -10%, light-dark(rgb(87 13 56 / .12), rgb(87 13 56 / .42)), transparent 70%),
    radial-gradient(900px 420px at 100% 0%, light-dark(rgb(255 180 72 / .1), rgb(255 180 72 / .06)), transparent 70%),
    var(--b-bg);
  color: var(--lucid-ink);
  overflow: hidden;
}
.site-noscript { max-width: 560px; margin: 80px auto; padding: 0 16px; }

.b-app { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100dvh; }

.b-bar { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 14px 0 18px; }
.b-brand { display: inline-flex; align-items: center; gap: 9px; color: var(--lucid-ink); text-decoration: none; border-radius: 8px; }
.b-brand img { border-radius: 7px; box-shadow: 0 6px 16px -8px rgb(87 13 56 / .8); }
.b-brand-word { font: 700 16px/1 Rubik, var(--lucid-font-sans); letter-spacing: -.01em; }
.b-slash { color: var(--lucid-ink-4, var(--lucid-ink-3)); font-weight: 300; font-size: 20px; opacity: .5; }
.b-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14.5px; letter-spacing: -.01em; margin-right: 6px; }
.b-pill {
  padding: 3px 7px; border-radius: 999px; font: 600 10px/1 var(--lucid-font-mono); letter-spacing: .04em; text-transform: uppercase;
  color: #370723; background: var(--b-tangerine); box-shadow: inset 0 1px 0 rgb(255 255 255 / .45), 0 4px 12px -5px rgb(255 180 72 / .7);
}
.b-auto { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--lucid-ink-2); cursor: pointer; padding: 0 6px; user-select: none; -webkit-user-select: none; }
.b-run[data-variant="primary"] {
  background: linear-gradient(180deg, #7a1a50, var(--b-plum-deep));
  color: #fff;
  box-shadow: 0 0 0 1px rgb(55 7 35 / .9), inset 0 1px 0 rgb(255 255 255 / .18), 0 8px 22px -10px rgb(87 13 56 / .9);
}
.b-run[data-variant="primary"]:hover { background: linear-gradient(180deg, #8a2160, #45092c); }
.b-run .lucid-icon { color: var(--b-tangerine); }
.b-run .lucid-kbd { background: rgb(255 255 255 / .12); color: rgb(255 255 255 / .8); box-shadow: none; }

.b-main { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 10px; padding: 0 10px 0; min-height: 0; }
.b-right { display: grid; grid-template-rows: minmax(0, 1fr) minmax(170px, 34%); gap: 10px; min-height: 0; }

.b-panel { display: flex; flex-direction: column; min-height: 0; border-radius: var(--b-radius); overflow: hidden; }
.b-panel-head { display: flex; align-items: center; gap: 8px; flex: none; height: 42px; padding: 0 8px 0 14px; }
.b-meta { font: 11.5px/1 var(--lucid-font-mono); color: var(--b-term-faint); }

.b-editor, .b-console {
  background: linear-gradient(180deg, var(--b-term-raised), var(--b-term) 120px);
  color: var(--b-term-text);
  color-scheme: dark;
  box-shadow: 0 0 0 1px rgb(0 0 0 / .5), inset 0 1px 0 rgb(255 255 255 / .06), 0 24px 60px -30px rgb(20 2 12 / .8);
}
.b-editor .b-panel-head, .b-console .b-panel-head { box-shadow: inset 0 -1px 0 var(--b-term-line); }
.b-ghost { color: var(--b-term-dim); }
.b-ghost:hover { color: var(--b-term-text); }
.b-editor .b-ghost:hover, .b-console .b-ghost:hover { background: rgb(255 255 255 / .07); }

.b-tab { display: inline-flex; align-items: center; gap: 8px; height: 26px; padding: 0 11px; border-radius: 7px; font: 500 12.5px/1 var(--lucid-font-mono); color: #f3eef5; background: rgb(255 255 255 / .06); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .06); }
.b-tab-dot { width: 6px; height: 6px; border-radius: 50%; background: #3dd68c; box-shadow: 0 0 8px #3dd68c; transition: background .3s, box-shadow .3s; }
.b-tab-dot[data-dirty] { background: var(--b-tangerine); box-shadow: 0 0 8px var(--b-tangerine); }

.b-code { position: relative; flex: 1; min-height: 0; overflow: auto; scrollbar-color: rgb(255 255 255 / .14) transparent; }
.b-code-inner { display: grid; min-width: 100%; width: max-content; min-height: 100%; }
.b-code-view, .b-code-input {
  grid-area: 1 / 1; margin: 0; padding: 16px 28px 40px 0; border: 0; box-sizing: border-box;
  font: 13.5px/1.7 "Geist Mono", var(--lucid-font-mono); letter-spacing: 0; tab-size: 2; white-space: pre;
  font-variant-ligatures: none;
}
.b-code-view { pointer-events: none; }
.b-code-view code { display: block; font: inherit; }
.b-code-input {
  padding-left: 52px; resize: none; overflow: hidden; outline: none; background: transparent;
  color: transparent; -webkit-text-fill-color: transparent; caret-color: var(--b-tangerine);
}
.b-code-input::selection { background: rgb(255 180 72 / .24); -webkit-text-fill-color: transparent; }
.b-code .code-line { display: flex; }
.b-code .code-num { flex: none; box-sizing: border-box; width: 52px; padding-right: 18px; text-align: right; color: #43394a; user-select: none; -webkit-user-select: none; }
.b-code .code-text { white-space: pre; }
.b-code .tok-kw { color: #ff8fc8; }
.b-code .tok-str { color: #9de0b4; }
.b-code .tok-num { color: #ffc799; }
.b-code .tok-fn { color: #8fc1ff; }
.b-code .tok-type { color: #ffd88a; }
.b-code .tok-prop { color: #c7bcd0; }
.b-code .tok-punct { color: #7a6d84; }
.b-code:focus-within .code-num { color: #5a4d62; }

.b-editor-foot { display: flex; align-items: center; gap: 14px; flex: none; height: 34px; padding: 0 14px; font-size: 11.5px; color: var(--b-term-faint); box-shadow: inset 0 1px 0 var(--b-term-line); }
.b-editor-foot .lucid-kbd { background: rgb(255 255 255 / .07); color: var(--b-term-dim); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .06); }
.b-editor-foot > span { display: inline-flex; align-items: center; gap: 4px; }

.b-preview {
  background: var(--lucid-surface-raised);
  box-shadow: 0 0 0 1px var(--lucid-line), var(--lucid-shadow-sm, 0 1px 2px rgb(0 0 0 / .06)), 0 24px 60px -34px light-dark(rgb(87 13 56 / .35), rgb(0 0 0 / .8));
}
.b-preview .b-panel-head { box-shadow: inset 0 -1px 0 var(--lucid-line); }
.b-preview .b-ghost { color: var(--lucid-ink-3); }
.b-preview .b-ghost:hover { color: var(--lucid-ink); }
.b-lights { display: inline-flex; gap: 6px; margin-right: 4px; }
.b-lights i { width: 10px; height: 10px; border-radius: 50%; background: var(--lucid-line-strong); }
.b-url { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 7px; font: 11.5px/1 var(--lucid-font-mono); color: var(--lucid-ink-3); background: var(--lucid-hover); }
.b-status { display: inline-flex; align-items: center; gap: 7px; font: 500 11.5px/1 var(--lucid-font-mono); color: var(--lucid-ink-3); padding-right: 4px; }
.b-status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lucid-ink-4, #9a9aa3); transition: background .3s, box-shadow .3s; }
.b-status[data-status="ok"] .b-status-dot { background: #22c55e; box-shadow: 0 0 0 3px rgb(34 197 94 / .18); animation: b-pulse 2.4s ease-in-out infinite; }
.b-status[data-status="running"] .b-status-dot { background: var(--b-tangerine); box-shadow: 0 0 0 3px rgb(255 180 72 / .2); }
.b-status[data-status="error"] { color: #e5484d; }
.b-status[data-status="error"] .b-status-dot { background: #e5484d; box-shadow: 0 0 0 3px rgb(229 72 77 / .2); }
.b-stage { position: relative; flex: 1; min-height: 0; background: var(--lucid-surface); }
.b-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; }

.b-console-title { display: inline-flex; align-items: center; gap: 8px; font: 600 12px/1 var(--lucid-font-mono); letter-spacing: .02em; color: #f3eef5; }
.b-console-title .lucid-icon { color: var(--b-tangerine); }
.b-count { padding: 3px 7px; border-radius: 999px; font: 600 10.5px/1 var(--lucid-font-mono); }
.b-count[data-level="error"] { color: #ff9c9f; background: rgb(229 72 77 / .16); box-shadow: inset 0 0 0 1px rgb(229 72 77 / .3); }
.b-count[data-level="warn"] { color: var(--b-tangerine); background: rgb(255 180 72 / .12); box-shadow: inset 0 0 0 1px rgb(255 180 72 / .28); }
.b-count[hidden] { display: none; }

.b-log { flex: 1; min-height: 0; margin: 0; padding: 6px 0 10px; list-style: none; overflow: auto; font: 12.5px/1.55 "Geist Mono", var(--lucid-font-mono); scrollbar-color: rgb(255 255 255 / .14) transparent; }
.b-log-empty { display: flex; align-items: center; gap: 10px; padding: 8px 16px; color: var(--b-term-faint); }
.b-prompt { color: var(--b-tangerine); font-weight: 600; }
.b-caret { width: 7px; height: 15px; background: var(--b-tangerine); border-radius: 1px; animation: b-blink 1.1s steps(1) infinite; }
.b-log-row {
  display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 10px; align-items: start;
  padding: 6px 14px 6px 16px; position: relative;
  animation: b-in 360ms var(--lucid-ease-out, cubic-bezier(.2, .8, .2, 1)) both;
}
.b-log-row + .b-log-row { box-shadow: inset 0 1px 0 rgb(255 255 255 / .035); }
.b-log-icon { display: grid; place-items: center; height: 19px; color: var(--b-term-faint); }
.b-log-text { color: var(--b-term-text); overflow-wrap: anywhere; white-space: pre-wrap; }
.b-log-time { font-size: 11px; line-height: 19px; color: var(--b-term-faint); font-variant-numeric: tabular-nums; }
.b-log-row[data-level="run"] { margin-top: 6px; }
.b-log-row[data-level="run"] .b-log-icon { color: var(--b-tangerine); }
.b-log-row[data-level="run"] .b-log-text { color: var(--b-term-dim); }
.b-log-row[data-level="ok"] .b-log-icon, .b-log-row[data-level="ok"] .b-log-text { color: #4ade80; }
.b-log-row[data-level="info"] .b-log-icon { color: #8fc1ff; }
.b-log-row[data-level="warn"] { background: linear-gradient(90deg, rgb(255 180 72 / .09), transparent 70%); }
.b-log-row[data-level="warn"]::before, .b-log-row[data-level="error"]::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 2px; border-radius: 2px; background: var(--b-tangerine); }
.b-log-row[data-level="warn"] .b-log-icon { color: var(--b-tangerine); }
.b-log-row[data-level="warn"] .b-log-text { color: #ffe2b8; }
.b-log-row[data-level="error"] { background: linear-gradient(90deg, rgb(229 72 77 / .12), transparent 70%); }
.b-log-row[data-level="error"]::before { background: #e5484d; }
.b-log-row[data-level="error"] .b-log-icon { color: #ff7a7f; }
.b-log-row[data-level="error"] .b-log-text { color: #ffc4c6; }
.b-log-head { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.b-log-code { padding: 1px 7px; border-radius: 5px; font: 600 11px/1.6 var(--lucid-font-mono); color: #370723; background: var(--b-tangerine); }
.b-log-row[data-level="error"] .b-log-code { color: #fff; background: #c9353a; }
.b-log-tag { font-size: 11.5px; color: #8fc1ff; }
.b-log-fix { display: flex; gap: 7px; align-items: baseline; margin-top: 3px; color: var(--b-term-dim); font-family: Geist, var(--lucid-font-sans); font-size: 12.5px; }
.b-log-fix .lucid-icon { flex: none; color: var(--b-tangerine); transform: translateY(1px); }

.b-foot { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 18px; font-size: 12px; color: var(--lucid-ink-3); }
.b-foot a { color: var(--lucid-ink-3); text-decoration: none; }
.b-foot a:hover { color: var(--lucid-ink); }
.b-foot-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; }

.b-steps { display: grid; gap: 18px; margin: 4px 0 0; padding: 0; list-style: none; }
.b-step { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 14px; }
.b-step-num { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font: 600 12px/1 var(--lucid-font-mono); color: #370723; background: var(--b-tangerine); }
.b-step-body b { display: block; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.b-step-body p { margin: 3px 0 10px; font-size: 13px; line-height: 1.5; color: var(--lucid-ink-3); }
.b-copy { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border-radius: 10px; background: var(--lucid-hover); box-shadow: inset 0 0 0 1px var(--lucid-line); }
.b-copy code { flex: 1; min-width: 0; font: 12.5px/1.4 var(--lucid-font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-copy-prompt { align-items: flex-start; }
.b-copy-prompt p { flex: 1; margin: 2px 0; font-size: 12.5px; line-height: 1.55; color: var(--lucid-ink-2); }
.b-soon { display: flex; gap: 12px; margin-top: 22px; padding: 14px; border-radius: 12px; color: #f6e9f0; background: radial-gradient(120% 160% at 0% 0%, #7a1a50, #370723 70%); box-shadow: inset 0 1px 0 rgb(255 255 255 / .12); }
.b-soon-icon { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 9px; color: #370723; background: var(--b-tangerine); }
.b-soon b { font-size: 13.5px; }
.b-soon p { margin: 3px 0 0; font-size: 12.5px; line-height: 1.5; color: rgb(246 233 240 / .75); }
.b-term { margin: 10px 0 0; padding: 12px 14px; border-radius: 10px; font: 12.5px/1.5 "Geist Mono", var(--lucid-font-mono); color: var(--b-term-text); background: var(--b-term); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .06); }
.b-term-dim { color: var(--b-term-faint); }

@keyframes b-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes b-blink { 50% { opacity: 0; } }
@keyframes b-pulse { 50% { box-shadow: 0 0 0 5px rgb(34 197 94 / .06); } }

@media (max-width: 980px) {
  body.builder { overflow: auto; }
  .b-app { height: auto; min-height: 100dvh; }
  .b-main { grid-template-columns: minmax(0, 1fr); }
  .b-editor { height: 56vh; }
  .b-right { grid-template-rows: 60vh 300px; }
  .b-hide-sm { display: none; }
  .b-slash, .b-brand-word { display: none; }
  .b-run .lucid-kbd, .b-theme { display: none; }
}
@media (max-width: 560px) {
  .b-bar { gap: 6px; padding: 0 10px; flex-wrap: wrap; height: auto; min-height: 56px; }
  .b-editor-foot > span:not(.b-meta) { display: none; }
  .b-foot { flex-wrap: wrap; height: auto; padding: 10px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .b-log-row, .b-caret, .b-status-dot { animation: none !important; }
}
