:root,
[data-theme="light"] {
  --bg: #f3eee6;
  --bg-2: #e8e0d4;
  --card: #fffaf3;
  --ink: #1a1612;
  --mute: #6f675e;
  --line: rgba(26, 22, 18, 0.1);
  --line-strong: rgba(26, 22, 18, 0.18);
  --accent: #c45c26;
  --accent-2: #1a1612;
  --ok: #2a7a52;
  --danger: #c43c28;
  --preview: #d9d1c5;
  --sheet: #ffffff;
  --shadow: 0 18px 50px rgba(26, 22, 18, 0.12);
  --hud: rgba(255, 250, 243, 0.92);
  --code-bg: #161310;
  --code-ink: #f3eee6;
  --gutter: #8a8176;
  --rail: #fffaf3;
  --rail-ink: #1a1612;
  --sans: "IBM Plex Sans", "Segoe UI", sans-serif;
  --display: "Syne", "Arial Black", sans-serif;
  --btn: "Fredoka", "IBM Plex Sans", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --scroll: #c45c26;
  --scroll-track: rgba(26, 22, 18, 0.08);
}

[data-theme="dark"] {
  --bg: #12100e;
  --bg-2: #1a1714;
  --card: #1e1a16;
  --ink: #f4efe6;
  --mute: #9a9288;
  --line: rgba(244, 239, 230, 0.1);
  --line-strong: rgba(244, 239, 230, 0.16);
  --accent: #e07038;
  --accent-2: #f4efe6;
  --ok: #5dcea0;
  --danger: #ff7a6c;
  --preview: #0d0c0b;
  --sheet: #ffffff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  --hud: rgba(24, 20, 17, 0.92);
  --code-bg: #0c0b0a;
  --code-ink: #ece7de;
  --gutter: #7a736a;
  --rail: #0e0c0b;
  --rail-ink: #f4efe6;
  --scroll: #e07038;
  --scroll-track: rgba(244, 239, 230, 0.08);
}

[hidden] {
  display: none !important;
}

button,
.go,
.ghost,
.nav-link,
.nav-link b,
.seg-btn,
.boot-reload,
.preview-devices button,
.editor-tab,
.dock button {
  font-family: var(--btn);
}

* {
  box-sizing: border-box;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll) var(--scroll-track);
}

*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

*::-webkit-scrollbar-track {
  background: var(--scroll-track);
}

*::-webkit-scrollbar-thumb {
  background: var(--scroll);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--ink);
  border: 2px solid transparent;
  background-clip: padding-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.45;
  cursor: default;
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
}

.bench {
  height: 100%;
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr);
  overflow: hidden;
}

.rail {
  position: relative;
  z-index: 6;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 16px 12px 14px;
  background: var(--rail);
  color: var(--rail-ink);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 4px 8px 18px;
}

.mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: block;
  flex: none;
  object-fit: contain;
}

h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
}

.rail-kicker {
  margin: 0 8px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
}

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--mute);
  font: inherit;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  display: grid;
  gap: 2px;
  min-width: 0;
}

.nav-link:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}

.nav-link[aria-current="page"] {
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 16%, var(--card));
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-link b {
  font-family: var(--btn);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.nav-link span {
  font-size: 11px;
  font-weight: 500;
  color: var(--mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.boot-reload {
  margin-top: auto;
  appearance: none;
  border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--card));
  color: var(--ink);
  font-family: var(--btn);
  font-size: 12px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
}

.stage {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dock {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 0.85fr;
  gap: 6px;
  padding: 10px 12px 0;
  background: var(--bg);
}

.dock button {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-family: var(--btn);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
}

.dock button:hover {
  border-color: var(--accent);
}

.bench[data-view="convert"] .dock [data-view-target="convert"],
.bench[data-view="editor"] .dock [data-view-target="editor"],
.bench[data-view="settings"] .dock [data-view-target="settings"] {
  box-shadow: inset 0 0 0 2px var(--ink);
}

.view {
  display: none !important;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.bench[data-view="convert"] #view-convert,
.bench[data-view="editor"] #view-editor,
.bench[data-view="settings"] #view-settings {
  display: flex !important;
}

.jobbar {
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  display: grid;
  gap: 10px;
}

.job-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.seg {
  display: flex;
  margin: 0;
  padding: 3px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 12px;
}

.seg legend {
  display: none;
}

.seg-btn {
  appearance: none;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--mute);
  font-family: var(--btn);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 12px;
  cursor: pointer;
  display: grid;
  place-items: center;
  border-radius: 9px;
}

.seg-btn:hover {
  color: var(--ink);
}

.seg-btn[aria-selected="true"],
.seg-btn:has(input:checked) {
  background: var(--ink);
  color: var(--bg);
}

[data-mode="local"] #tab-local[aria-selected="true"] {
  background: var(--ok);
  color: #06150d;
}

.seg-btn input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.composer {
  display: flex;
  align-items: end;
  gap: 8px;
}

.url-field,
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.url-field {
  flex: 1;
}

.url-field > span,
.field > span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
}

textarea,
input[type="password"],
input[type="text"],
input[type="number"],
input[type="url"],
input[type="color"],
select {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  padding: 10px 12px;
  border-radius: 10px;
  resize: none;
  outline: none;
}

.url-field textarea {
  height: 42px;
  white-space: nowrap;
  overflow: hidden;
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.ghost,
.go {
  cursor: pointer;
}

.ghost {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  padding: 8px 12px;
  height: 42px;
  border-radius: 10px;
}

.ghost.icon {
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.ghost:hover:not(:disabled) {
  border-color: var(--accent);
}

.ghost:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ghost[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.go {
  height: 42px;
  background: var(--accent);
  color: #fff8f0;
  border: 0;
  padding: 0 18px;
  border-radius: 10px;
  font-family: var(--btn);
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.go:hover {
  filter: brightness(1.08);
}

[data-mode="local"] .go {
  background: var(--ok);
  color: #06150d;
}

.plugin-pill {
  margin: 0 0 0 auto;
  color: var(--mute);
  font-size: 12px;
  padding: 0 0 0 16px;
  position: relative;
}

.model-seg .model-btn {
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 4.6rem;
  padding: 6px 10px;
  line-height: 1.15;
}

.model-seg .model-name {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.model-seg .model-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mute);
  opacity: 0.9;
}

.model-seg .seg-btn:has(input:checked) .model-tag {
  color: inherit;
  opacity: 0.75;
}

.preview-bay .preview-quality {
  margin: 0;
  padding: 0;
  border: 0;
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.preview-bay .preview-quality legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.preview-bay .preview-quality .seg-btn {
  padding: 5px 9px;
  font-size: 12px;
}

.plugin-pill::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mute);
}

.plugin-pill.is-on {
  color: var(--ok);
}

.plugin-pill.is-on::before {
  background: var(--ok);
}

.hint {
  margin: 0;
  color: var(--mute);
  font-size: 13px;
}

.hint a {
  color: var(--accent);
  font-weight: 600;
}

.mast-status {
  margin: 0;
  min-height: 1.1em;
  color: var(--ok);
  font-size: 13px;
}

.mast-status.error {
  color: var(--danger);
}

.work {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
}

.tray {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 14px;
  border-right: 1px solid var(--line);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.facts span {
  padding: 4px 8px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.layers-panel,
.library {
  flex: 1 1 auto;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 14px;
  overflow: hidden;
}

.layers-panel header,
.library header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
}

.layers-panel header p,
.library header p {
  margin: 0;
  color: var(--ink);
}

.layers-tree,
.library-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.layer-row {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  text-align: left;
  padding: 7px 12px;
  cursor: pointer;
}

.layer-row:hover,
.layer-row[aria-selected="true"] {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.layer-type {
  width: 40px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.layer-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-empty {
  margin: 0;
  padding: 12px;
  color: var(--mute);
  font-size: 13px;
}

.library-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.library-item[aria-selected="true"] {
  background: color-mix(in srgb, var(--ok) 12%, transparent);
}

.library-open {
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 2px;
}

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

.library-actions {
  display: flex;
  gap: 4px;
}

.library-actions .ghost {
  height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

.proof {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #161310;
}

.preview-bay {
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #1e1a16, #161310);
  border-bottom: 1px solid rgba(243, 238, 230, 0.08);
  color: #f4efe6;
}

.bay-id {
  margin-right: auto;
  min-width: 0;
}

.bay-kicker {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c45c26;
}

.hud-title {
  margin: 0;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.04em;
  max-width: 32vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-bay .ghost,
.preview-bay .zoom-read {
  background: #221e18;
  color: #f4efe6;
  border-color: rgba(243, 238, 230, 0.14);
}

.preview-bay .onion {
  color: #9a9286;
}

.preview-meta {
  margin: 0;
  padding: 6px 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #9a9286;
  background: #120f0c;
  border-top: 1px solid rgba(243, 238, 230, 0.08);
}

.zoom-cluster,
.onion {
  display: flex;
  align-items: center;
  gap: 6px;
}

.zoom-cluster .ghost {
  height: 34px;
}

.zoom-read {
  appearance: none;
  min-width: 52px;
  height: 34px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  border-radius: 10px;
  cursor: pointer;
}

.onion {
  color: var(--mute);
  font-size: 12px;
}

.onion input[type="range"],
.inspector input[type="range"] {
  width: 88px;
  accent-color: var(--accent);
}

.edit-toggle[aria-pressed="true"] {
  background: var(--ok);
  color: #06150d;
  border-color: var(--ok);
}

.bed {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  cursor: grab;
  background:
    linear-gradient(90deg, rgba(196, 92, 38, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(196, 92, 38, 0.08) 1px, transparent 1px),
    repeating-conic-gradient(#1a1714 0% 25%, #14110e 0% 50%) 0 0 / 28px 28px;
  background-size: 80px 80px, 80px 80px, 28px 28px;
}

.bed.is-panning {
  cursor: grabbing;
}

.bench.is-editing .bed {
  cursor: default;
}

.empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 88px 40px 40px;
  color: var(--mute);
}

.empty-kicker {
  font-family: var(--display);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.05em;
  color: var(--ink);
  margin: 0 0 8px;
}

.empty > p {
  margin: 0 auto;
  max-width: 32em;
}

.viewport {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.slot,
.sheet {
  position: relative;
  overflow: hidden;
}

.sheet {
  background: var(--sheet);
  box-shadow:
    0 0 0 1px rgba(196, 92, 38, 0.35),
    0 28px 70px rgba(0, 0, 0, 0.45);
  border-radius: 2px;
}

.sheet iframe,
.sheet img {
  display: block;
  border: 0;
  background: transparent;
}

.sheet iframe {
  overflow: hidden;
}

.sheet img#truth {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}

.hit {
  position: absolute;
  inset: 0;
  z-index: 4;
}

.bench.is-editing .hit {
  display: none;
}

.inspector {
  position: absolute;
  z-index: 7;
  top: 18px;
  right: 14px;
  width: min(300px, calc(100% - 28px));
  max-height: calc(100% - 88px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--hud);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.proof:has(#convert-code:not([hidden])) .inspector {
  max-height: calc(100% - 286px);
}

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

.inspect-kicker {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
}

.inspector h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.inspect-type {
  margin: 0;
  color: var(--ok);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.fx-stack {
  display: grid;
  gap: 6px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.fx-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.fx-body {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 0 0 6px 22px;
}

.fx-body.is-open {
  display: grid;
}

.fx-body label {
  display: grid;
  gap: 2px;
  font-size: 11px;
  color: var(--mute);
}

.editor-view {
  background: #0e0c0a;
  color: var(--code-ink);
}

.ide-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #161310;
}

.ide-id p {
  margin: 0;
}

.ide-id p:last-child {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.editor-chrome {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #141210;
}

.editor-tabs {
  display: flex;
  gap: 2px;
}

.editor-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: #8d8a85;
  font: inherit;
  font-family: var(--mono);
  font-size: 12px;
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.editor-tab.is-on {
  color: #fff;
  border-bottom-color: var(--accent);
}

.edited-flag {
  color: #e2b56a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.code-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.code-actions .ghost {
  height: 32px;
  background: #1c1c1c;
  color: #eceae6;
  border-color: rgba(255, 255, 255, 0.12);
}

.sandbox {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, var(--ide-split, 1.15fr)) 8px minmax(220px, 0.85fr);
}

.split-handle {
  cursor: col-resize;
  background: #c45c26;
  opacity: 0.35;
}

.split-handle:hover {
  opacity: 1;
}

.sandbox-preview header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8d8a85;
}

.preview-devices {
  display: flex;
  gap: 4px;
}

.preview-devices button {
  appearance: none;
  border: 0;
  background: #221e18;
  color: #9a9286;
  font: inherit;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
}

.preview-devices .is-on {
  background: #c45c26;
  color: #fff8f0;
}

.sandbox-frame-shell {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: start center;
  overflow: auto;
  background:
    repeating-conic-gradient(#1a1714 0% 25%, #12100e 0% 50%) 0 0 / 20px 20px;
}

.sandbox-frame-shell iframe {
  width: min(100%, var(--ed-device, 100%));
  height: 100%;
  border: 0;
  background: #fff;
  justify-self: center;
}

.sandbox-preview iframe {
  flex: 1;
  width: 100%;
  border: 0;
  background: #fff;
}

.find-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #1a1714;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.find-bar input {
  flex: 1;
}

.find-bar .ghost {
  height: 34px;
}

.ide-status {
  margin: 0;
  padding: 6px 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: #9a9286;
  background: #120f0c;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.bench.is-sandbox-full .rail,
.bench.is-sandbox-full .dock {
  display: none;
}

.bench.is-sandbox-full {
  grid-template-columns: 1fr;
}

.sandbox-preview {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #0e0e0e;
}

.convert-code {
  flex: none;
  position: relative;
  z-index: 8;
  height: 198px;
  border-top: 1px solid var(--line);
  background: var(--code-bg);
  color: var(--code-ink);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.convert-code header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.convert-code header p {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8d8a85;
}

.convert-code .code-actions {
  margin-left: auto;
}

.convert-code-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.convert-code article {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.convert-code article:last-child {
  border-right: 0;
}

.convert-code h3 {
  margin: 0;
  padding: 8px 12px 0;
  font-size: 11px;
  font-weight: 600;
  color: #8d8a85;
}

.convert-code pre {
  flex: 1;
  margin: 0;
  padding: 8px 12px 12px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.mix-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(8, 8, 8, 0.55);
}

.mix-card {
  width: min(440px, calc(100vw - 32px));
  padding: 22px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}

.mix-card p {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
}

.mix-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.ide {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.ide[data-layout="html"] #buffer-css,
.ide[data-layout="css"] #buffer-html {
  display: none;
}

.ide[data-layout="html"],
.ide[data-layout="css"] {
  grid-template-columns: 1fr;
}

.buffer {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.buffer:last-child {
  border-right: 0;
}

.buffer-bar {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: #8d8a85;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.buffer-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 48px 1fr;
}

.gutter {
  margin: 0;
  padding: 16px 8px 16px 0;
  overflow: hidden;
  text-align: right;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  color: #5c5a56;
  user-select: none;
  background: #0e0e0e;
}

.buffer textarea {
  height: 100%;
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 16px 18px;
  resize: none;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--code-bg);
  color: var(--code-ink);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  tab-size: 2;
  white-space: pre;
  caret-color: #fff;
}

.buffer textarea:focus {
  box-shadow: none;
}

.settings {
  overflow: auto;
  background:
    radial-gradient(circle at 8% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 28%),
    var(--bg);
}

.settings-page {
  width: min(640px, calc(100% - 48px));
  margin: 36px auto 64px;
  display: grid;
  gap: 16px;
}

.settings-head h2 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.settings-head p,
.eyebrow {
  margin: 0;
  color: var(--mute);
}

.eyebrow {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.settings-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  display: grid;
  gap: 12px;
}

.settings-card h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
}

.theme-seg {
  width: fit-content;
}

.file-chip {
  display: inline-flex;
  width: fit-content;
  padding: 10px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--bg-2);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  text-decoration: none;
}

.file-chip:hover {
  border-color: var(--accent);
}

input[type="file"] {
  font: inherit;
  font-size: 13px;
  color: var(--mute);
}

@media (max-width: 900px) {
  .bench {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }
  .rail {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    padding: 0 8px 0 0;
  }
  .rail-kicker {
    display: none;
  }
  .rail-nav {
    flex: 1;
    flex-direction: row;
    overflow-x: auto;
  }
  .nav-link span {
    display: none;
  }
  .nav-link {
    padding: 8px 10px;
  }
  .boot-reload {
    margin: 0;
    white-space: nowrap;
  }
  .work {
    display: flex;
    flex-direction: column;
  }
  .proof {
    min-height: 52vh;
    order: -1;
  }
  .tray {
    max-height: 220px;
    border-right: 0;
    border-top: 1px solid var(--line);
  }
  .composer {
    flex-wrap: wrap;
  }
  .url-field {
    flex: 1 1 100%;
  }
  .ide {
    grid-template-columns: 1fr;
  }
}

/* Figbit studio shell: one navigation system, clear hierarchy, quiet surfaces. */
:root,
[data-theme="light"] {
  --bg: #f5f1e9;
  --bg-2: #ebe4d9;
  --card: #fffdf8;
  --ink: #201a14;
  --mute: #766d63;
  --line: rgba(32, 26, 20, 0.11);
  --line-strong: rgba(32, 26, 20, 0.2);
  --accent: #d9652b;
  --ok: #3d8a63;
  --rail: #171310;
  --rail-ink: #f8f0e5;
  --rail-muted: #a99d90;
  --shadow: 0 22px 60px rgba(32, 26, 20, 0.14);
}

[data-theme="dark"] {
  --bg: #121110;
  --bg-2: #191715;
  --card: #201c18;
  --ink: #f5eee4;
  --mute: #9d9286;
  --line: rgba(245, 238, 228, 0.1);
  --line-strong: rgba(245, 238, 228, 0.17);
  --accent: #e6783d;
  --ok: #69c596;
  --rail: #0c0b0a;
  --rail-ink: #f8f0e5;
  --rail-muted: #9e9388;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.44);
}

.dock {
  display: none !important;
}

.bench {
  grid-template-columns: 240px minmax(0, 1fr);
  background: var(--bg);
}

.rail {
  padding: 24px 16px 18px;
  background: var(--rail);
  color: var(--rail-ink);
  border-right: 1px solid rgba(248, 240, 229, 0.1);
}

.brand {
  padding: 4px 10px 36px;
}

.mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
}

.brand h1 {
  color: var(--rail-ink);
  font-size: 22px;
}

.rail-kicker {
  margin: 0 10px 10px;
  color: var(--rail-muted);
  font-size: 10px;
}

.rail-nav {
  gap: 7px;
}

.nav-link {
  position: relative;
  padding: 13px 13px;
  color: var(--rail-muted);
  border: 1px solid transparent;
  border-radius: 14px;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-link:hover {
  color: var(--rail-ink);
  background: rgba(248, 240, 229, 0.07);
  transform: translateX(2px);
}

.nav-link[aria-current="page"] {
  color: var(--rail-ink);
  background: rgba(217, 101, 43, 0.18);
  border-color: rgba(217, 101, 43, 0.32);
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-link b {
  font-size: 15px;
}

.nav-link span {
  color: var(--rail-muted);
  font-size: 12px;
}

.boot-reload {
  border-color: rgba(217, 101, 43, 0.55);
  background: rgba(217, 101, 43, 0.12);
  color: var(--rail-ink);
}

.stage {
  background: var(--bg);
}

.jobbar {
  padding: 24px 28px 22px;
  gap: 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.job-row {
  gap: 9px;
}

.seg {
  padding: 4px;
  background: var(--card);
  border-color: var(--line);
  border-radius: 12px;
}

.seg-btn {
  padding: 8px 14px;
  border-radius: 8px;
}

.composer {
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(32, 26, 20, 0.06);
}

.url-field {
  padding: 0 4px;
}

.url-field > span {
  padding-left: 8px;
}

.url-field textarea {
  height: 44px;
  border-color: transparent;
  background: transparent;
}

.url-field textarea:focus {
  border-color: var(--accent);
  background: var(--card);
}

.ghost,
.go {
  border-radius: 11px;
}

.ghost {
  background: var(--card);
}

.go {
  min-width: 112px;
  background: var(--accent);
}

.mast-status {
  min-height: 1.1em;
}

.work {
  grid-template-columns: 258px minmax(0, 1fr);
  border-top: 0;
}

.tray {
  padding: 20px 16px;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
}

.facts {
  gap: 5px;
}

.facts span {
  padding: 6px 9px;
  background: var(--card);
}

.layers-panel,
.library {
  min-height: 150px;
  border-color: var(--line-strong);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(32, 26, 20, 0.04);
}

.layers-panel header,
.library header {
  padding: 13px 14px;
  background: rgba(255, 253, 248, 0.24);
}

.layer-row {
  padding: 9px 14px;
}

.proof {
  background: #1a1816;
}

.preview-bay {
  min-height: 70px;
  padding: 12px 18px;
  background: #211e1a;
  border-bottom-color: rgba(248, 240, 229, 0.1);
}

.bay-kicker {
  color: #e6783d;
}

.hud-title {
  max-width: min(34vw, 480px);
  color: #f8f0e5;
  font-size: 17px;
}

.preview-bay .ghost,
.preview-bay .zoom-read {
  background: #2a2520;
  border-color: rgba(248, 240, 229, 0.15);
}

.preview-bay .ghost:hover:not(:disabled) {
  border-color: #e6783d;
}

.preview-bay .go {
  min-width: 164px;
}

.bed {
  background:
    linear-gradient(rgba(230, 120, 61, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(230, 120, 61, 0.08) 1px, transparent 1px),
    #171513;
  background-size: 64px 64px;
}

.empty {
  padding: 40px;
  color: #a99d90;
}

.empty-kicker {
  margin-bottom: 12px;
  color: #f8f0e5;
  font-size: clamp(30px, 4vw, 50px);
}

.empty > p {
  max-width: 38em;
}

.empty > p + p {
  margin-top: 5px;
  color: #84796d;
  font-size: 12px;
}

.sheet {
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(230, 120, 61, 0.42), 0 32px 80px rgba(0, 0, 0, 0.46);
}

.preview-meta {
  padding: 8px 18px;
  background: #121110;
  color: #897d70;
}

.inspector {
  top: 14px;
  right: 16px;
  padding: 18px;
  background: rgba(32, 28, 24, 0.96);
  border-color: rgba(248, 240, 229, 0.15);
}

.convert-code {
  height: 230px;
}

.editor-view {
  background: #100f0e;
}

.ide-top {
  min-height: 68px;
  padding: 10px 18px;
  gap: 18px;
  background: #1a1714;
  border-bottom-color: rgba(248, 240, 229, 0.1);
}

.ide-id {
  min-width: 124px;
}

.ide-id p:last-child {
  color: #f8f0e5;
  font-size: 16px;
}

.editor-tabs {
  padding: 3px;
  background: #0f0e0d;
  border: 1px solid rgba(248, 240, 229, 0.1);
  border-radius: 11px;
}

.editor-tab {
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  color: #968a7e;
}

.editor-tab.is-on {
  color: #f8f0e5;
  background: #2b251f;
}

.code-actions {
  gap: 6px;
}

.code-actions .ghost {
  height: 34px;
  padding: 0 10px;
  background: #24201c;
  border-color: rgba(248, 240, 229, 0.1);
}

.sandbox {
  grid-template-columns: minmax(0, var(--ide-split, 1.12fr)) 6px minmax(280px, 0.88fr);
}

.split-handle {
  background: #d9652b;
  opacity: 0.24;
}

.buffer {
  background: #100f0e;
  border-right-color: rgba(248, 240, 229, 0.08);
}

.buffer-bar {
  padding: 10px 16px;
  background: #171411;
  color: #a99d90;
  border-bottom-color: rgba(248, 240, 229, 0.08);
}

.buffer-body {
  grid-template-columns: 52px 1fr;
}

.gutter {
  padding: 17px 10px 17px 0;
  background: #0c0b0a;
  color: #655d55;
}

.buffer textarea {
  padding: 17px 18px;
  background: #100f0e;
  font-size: 13px;
  line-height: 1.7;
}

.sandbox-preview {
  background: #171513;
}

.sandbox-preview header {
  padding: 10px 14px;
  background: #1d1916;
}

.sandbox-frame-shell {
  padding: 18px;
  background:
    linear-gradient(rgba(230, 120, 61, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(230, 120, 61, 0.07) 1px, transparent 1px),
    #121110;
  background-size: 32px 32px;
}

.sandbox-frame-shell iframe {
  min-height: 100%;
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(248, 240, 229, 0.12), 0 18px 50px rgba(0, 0, 0, 0.35);
}

.ide-status {
  padding: 8px 18px;
  background: #0c0b0a;
}

.settings-page {
  width: min(760px, calc(100% - 64px));
  margin: 52px auto 72px;
  gap: 18px;
}

.settings-head h2 {
  font-size: 48px;
}

.settings-card {
  padding: 24px;
  border-radius: 18px;
}

@media (max-width: 1100px) {
  .bench {
    grid-template-columns: 208px minmax(0, 1fr);
  }

  .work {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .preview-bay .onion {
    display: none;
  }

  .ide-top {
    flex-wrap: wrap;
  }

  .ide-top .code-actions {
    margin-left: auto;
  }
}

@media (max-width: 900px) {
  .bench {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .rail {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid rgba(248, 240, 229, 0.1);
  }

  .brand {
    padding: 0 4px 0 0;
  }

  .brand h1 {
    font-size: 18px;
  }

  .rail-kicker {
    display: none;
  }

  .rail-nav {
    flex: 1;
    flex-direction: row;
    overflow-x: auto;
  }

  .nav-link {
    flex: 0 0 auto;
    padding: 9px 11px;
  }

  .nav-link span {
    display: none;
  }

  .work {
    display: flex;
    flex-direction: column;
  }

  .tray {
    max-height: 220px;
    border-right: 0;
    border-top: 1px solid var(--line);
  }

  .proof {
    min-height: 52vh;
    order: -1;
  }

  .jobbar {
    padding: 16px;
  }

  .sandbox {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(360px, 1fr) 6px minmax(280px, 0.8fr);
  }

  .split-handle {
    cursor: row-resize;
  }

  .settings-page {
    width: min(100% - 32px, 760px);
    margin-top: 28px;
  }
}
