:root {
  --bg: #1d1f23;
  --panel: #23262b;
  --panel-strong: #2a2e35;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f3f4f6;
  --muted: #9fa6b2;
  --accent: #f1f1f1;
  --accent-deep: #f1f1f1;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  --radius-xl: 6px;
  --radius-lg: 5px;
  --radius-md: 4px;
  --toolbar-height: 42px;
  --preview-width: min(100%, 1220px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  min-height: 100%;
}

body {
  font-family: "Segoe UI Variable Text", "Segoe UI", "Trebuchet MS", sans-serif;
  font-size: 11px;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
}

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

button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

a {
  color: inherit;
}

#app {
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

.builder-shell {
  height: 100vh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  min-height: var(--toolbar-height);
  padding: 6px 9px;
  background: linear-gradient(180deg, #1e2024 0%, #23262b 100%);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

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

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  background: #1a1a1a;
  color: #fff;
  font-family: "Segoe UI", sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  box-shadow: none;
}

.brand-copy h1 {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  font-size: 0.74rem;
  letter-spacing: 0;
  color: #f8fafc;
}

.brand-copy p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.62rem;
  display: none;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.toolbar-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #343434;
}

.toolbar-meta {
  color: var(--muted);
  font-size: 0.64rem;
  display: none;
}

.segmented {
  display: inline-flex;
  padding: 1px;
  gap: 1px;
  border-radius: 5px;
  background: #2d3138;
  border: 1px solid var(--line);
}

.segmented button,
.toolbar-button,
.action-button,
.ghost-button,
.mini-button {
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease;
}

.segmented button {
  padding: 4px 7px;
  border-radius: 4px;
  color: var(--muted);
  font-size: 0.64rem;
}

.segmented button.active {
  background: #f3f4f6;
  color: #111827;
}

.toolbar-button,
.action-button {
  padding: 5px 8px;
  border-radius: 5px;
  background: #f8fafc;
  color: #111827;
  font-size: 0.66rem;
}

.ghost-button,
.mini-button {
  padding: 4px 7px;
  border-radius: 4px;
  background: #2c3036;
  border: 1px solid var(--line);
  font-size: 0.64rem;
}

.mini-button {
  padding: 3px 6px;
  font-size: 0.6rem;
}

.segmented button:hover,
.toolbar-button:hover,
.action-button:hover,
.ghost-button:hover,
.mini-button:hover {
  box-shadow: inset 0 0 0 1px rgba(17, 17, 17, 0.06);
}

.workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr) 248px;
  gap: 7px;
  padding: 7px;
  min-height: 0;
  overflow: hidden;
}

.panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, #252930 0%, #21252a 100%);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.panel-header {
  padding: 7px 7px 5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.panel-header h2,
.canvas-header h2,
.export-header h2 {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  font-size: 0.72rem;
}

.panel-header p,
.canvas-header p,
.helper-text {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.35;
}

.panel-header p,
.canvas-header p {
  display: none;
}

.panel-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 7px;
}

.panel-tabs {
  display: inline-flex;
  gap: 1px;
  margin-top: 4px;
  padding: 1px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #242424;
}

.panel-tab {
  min-width: 38px;
  padding: 4px 7px;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--muted);
}

.panel-tab.active {
  background: #3a4250;
  color: #fff;
}

.panel-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.compact-stack {
  gap: 4px;
}

.stat-card,
.section-card,
.inspector-section {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.03);
  padding: 6px;
}

.compact-panel-section {
  padding: 0;
}

.asset-panel-shell,
.layers-panel-shell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.asset-search {
  display: block;
  margin-top: 6px;
}

.asset-search input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: #252525;
  color: #9a9a9a;
  padding: 6px 8px;
  font-size: 0.62rem;
}

.asset-categories {
  margin-top: 1px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.asset-category {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.asset-category-header h4 {
  margin: 0;
  font-size: 0.54rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #c5cad3;
}

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

.asset-tile-wrap {
  position: relative;
}

.asset-tile {
  width: 100%;
  min-height: 34px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 4px;
  padding: 5px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  color: #f3f3f3;
}

.asset-tile-icon {
  width: 20px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  font-size: 0.42rem;
  font-family: "Cascadia Code", "Consolas", monospace;
  color: #fff;
}

.asset-tile-label {
  font-size: 0.56rem;
  font-weight: 600;
  line-height: 1.2;
  color: #f8fafc;
}

.asset-tile-info {
  position: absolute;
  top: 3px;
  right: 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.asset-tile-wrap:hover .asset-tile-info,
.asset-tile-wrap:focus-within .asset-tile-info {
  opacity: 1;
  pointer-events: auto;
}

.section-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
}

.section-count,
.disclosure-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #242424;
  color: #9a9a9a;
  font-size: 0.56rem;
  font-weight: 700;
}

.compact-disclosure,
.inspector-disclosure {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: #313131;
}

.compact-disclosure summary,
.inspector-disclosure summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
}

.compact-disclosure summary::after,
.inspector-disclosure summary::after {
  content: "+";
  color: #888;
  font-size: 0.8rem;
  font-weight: 700;
}

.compact-disclosure[open] summary::after,
.inspector-disclosure[open] summary::after {
  content: "-";
}

.compact-disclosure summary::-webkit-details-marker,
.inspector-disclosure summary::-webkit-details-marker {
  display: none;
}

.compact-disclosure summary span:first-child,
.inspector-disclosure summary strong {
  font-size: 0.76rem;
  font-weight: 700;
  color: #f1f1f1;
}

.inspector-disclosure summary div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.inspector-disclosure summary span {
  font-size: 0.68rem;
  color: #777;
}

.disclosure-body {
  padding: 0 10px 10px;
}

.wf-section {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: #313131;
  padding: 7px;
}

.wf-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.wf-section-header h4 {
  margin: 0;
  font-size: 0.62rem;
}

.wf-control-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wf-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.wf-box-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wf-box-label {
  font-size: 0.54rem;
  font-weight: 600;
  color: #7e7e7e;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.wf-space-editor {
  position: relative;
  height: 126px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  background: linear-gradient(180deg, #31353d 0%, #262a31 100%);
}

.wf-space-margin,
.wf-space-padding {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.wf-space-margin {
  inset: 18px 22px;
  background: rgba(255, 255, 255, 0.02);
}

.wf-space-padding {
  inset: 18px 20px;
  background: rgba(255, 255, 255, 0.04);
}

.wf-space-tag {
  position: absolute;
  left: 6px;
  padding: 1px 4px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.32);
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.44rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.wf-space-tag-margin {
  top: 5px;
}

.wf-space-tag-padding {
  top: 5px;
}

.wf-space-center {
  position: absolute;
  inset: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  background: rgba(17, 17, 17, 0.2);
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.52rem;
  font-weight: 600;
}

.wf-space-input {
  position: absolute;
  width: 24px;
  height: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  text-align: center;
  font-size: 0.46rem;
}

.wf-space-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.wf-space-input.margin.top {
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
}

.wf-space-input.margin.right {
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
}

.wf-space-input.margin.bottom {
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
}

.wf-space-input.margin.left {
  top: 50%;
  left: 4px;
  transform: translateY(-50%);
}

.wf-space-input.padding.top {
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
}

.wf-space-input.padding.right {
  top: 50%;
  right: 24px;
  transform: translateY(-50%);
}

.wf-space-input.padding.bottom {
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
}

.wf-space-input.padding.left {
  top: 50%;
  left: 24px;
  transform: translateY(-50%);
}

.wf-box-editor {
  position: relative;
  height: 62px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 4px;
  background: linear-gradient(135deg, #383838 0%, #292929 100%);
}

.wf-box-center {
  position: absolute;
  inset: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 3px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.42rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.wf-box-input {
  position: absolute;
  width: 20px;
  height: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  text-align: center;
  font-size: 0.42rem;
}

.wf-box-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.wf-box-input.top {
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
}

.wf-box-input.right {
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
}

.wf-box-input.bottom {
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
}

.wf-box-input.left {
  top: 50%;
  left: 4px;
  transform: translateY(-50%);
}

.wf-fold {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.wf-fold-summary {
  display: flex;
  align-items: center;
  min-height: 26px;
  padding: 6px 7px;
  font-size: 0.6rem;
  font-weight: 700;
  color: #f8fafc;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.wf-fold-body {
  padding: 7px;
}

.inspector-disclosure[open] summary,
.compact-disclosure[open] summary {
  border-bottom: 1px solid rgba(17, 17, 17, 0.06);
  margin-bottom: 10px;
}

.stat-card h3,
.section-card h3,
.inspector-section h3,
.code-pane header h3 {
  margin: 0;
  font-size: 0.72rem;
}

.stat-card p,
.section-card p,
.inspector-section p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.6rem;
}

.stat-grid,
.inspector-grid {
  margin-top: 4px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.stat-item {
  padding: 6px;
  border-radius: var(--radius-md);
  background: #252525;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-item strong {
  display: block;
  font-size: 0.7rem;
}

.stat-item span {
  display: block;
  margin-top: 2px;
  font-size: 0.58rem;
  color: var(--muted);
}

.block-grid,
.layers-root {
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.asset-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.asset-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  gap: 6px;
  align-items: center;
}

.block-card,
.layer-row {
  text-align: left;
  width: 100%;
  padding: 6px 7px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #313131;
}

.compact-block-card {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 6px;
}

.block-icon {
  width: 15px;
  height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  background: #111;
  color: #fff;
  font-size: 0.46rem;
  font-weight: 700;
  flex: 0 0 auto;
}

.block-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.compact-block-card .block-copy span {
  margin-top: 0;
}

.block-info {
  width: 15px;
  height: 15px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #252525;
  color: #9a9a9a;
  font-size: 0.46rem;
  font-weight: 700;
}

.inspector-stack .inspector-grid,
.inspector-stack .wf-two-col {
  margin-top: 0;
}

.block-card strong,
.layer-row strong {
  display: block;
  font-size: 0.64rem;
  line-height: 1.15;
}

.block-copy span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.56rem;
  line-height: 1.2;
}

.block-card[draggable="true"] {
  cursor: grab;
}

.layer-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.layer-row {
  background: rgba(255, 255, 255, 0.03);
  padding-right: 5px;
}

.layer-row.selected {
  background: #35404d;
  border-color: rgba(255, 255, 255, 0.14);
}

.layer-children {
  padding-left: 7px;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  margin-left: 4px;
}

.layer-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.layer-kind {
  width: 18px;
  height: 14px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  background: #1f2329;
  color: #b9b9b9;
  font-size: 0.42rem;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-weight: 700;
}

.layer-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-row.is-drop-target,
.canvas-root.is-drop-target,
.canvas-node.is-drop-target {
  box-shadow: 0 0 0 2px rgba(17, 17, 17, 0.22);
}

.canvas-panel {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.canvas-header {
  padding: 7px 7px 0;
}

.canvas-stage {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 6px 7px 7px;
}

.canvas-stage-inner {
  min-height: 100%;
  border-radius: 6px;
  padding: 6px;
  background:
    linear-gradient(180deg, #17191d, #20242a),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0, rgba(255, 255, 255, 0.03) 1px, transparent 1px, transparent 32px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0, rgba(255, 255, 255, 0.03) 1px, transparent 1px, transparent 32px);
}

.preview-frame-shell {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100%;
}

.preview-frame {
  width: var(--preview-width);
  min-height: 100%;
  position: relative;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.preview-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 7px;
  border-bottom: 1px solid rgba(17, 17, 17, 0.08);
  background: #f5f5f5;
}

.preview-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
}

.preview-dot.red { background: #111; opacity: 0.25; }
.preview-dot.yellow { background: #111; opacity: 0.18; }
.preview-dot.green { background: #111; opacity: 0.12; }

.preview-address {
  margin-left: auto;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.48rem;
  color: var(--muted);
  background: #ececec;
}

.canvas-root {
  min-height: calc(100% - 58px);
  position: relative;
}

.canvas-node {
  position: relative;
  outline: 1px solid transparent;
  outline-offset: -1px;
  transition: outline-color 120ms ease, box-shadow 120ms ease;
}

.canvas-node:hover {
  outline-color: rgba(17, 17, 17, 0.18);
}

.canvas-node.is-selected {
  outline: 2px solid rgba(17, 17, 17, 0.65);
}

.canvas-node.is-inline-editing {
  cursor: text;
  outline: 2px solid rgba(17, 17, 17, 0.72);
  box-shadow: inset 0 0 0 999px rgba(255, 255, 255, 0.02);
}

.canvas-node[contenteditable="true"] {
  user-select: text;
  -webkit-user-modify: read-write-plaintext-only;
}

.canvas-node[contenteditable="true"]:focus {
  outline: 2px solid rgba(17, 17, 17, 0.72);
}

.canvas-node.is-selected::before {
  content: attr(data-node-name);
  position: absolute;
  top: 5px;
  left: 5px;
  z-index: 4;
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(17, 17, 17, 0.94);
  color: #fff;
  font-size: 0.46rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.canvas-node.is-inline-editing::before {
  display: none;
}

.canvas-node img {
  max-width: 100%;
  display: block;
}

.preview-frame [data-wb-node].is-active {
  box-shadow: 0 0 0 2px rgba(17, 17, 17, 0.22) inset;
}

.preview-frame iframe {
  width: 100%;
  border: 0;
}

.canvas-quick-editor {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 12;
  width: min(320px, calc(100% - 24px));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(23, 26, 31, 0.96);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.canvas-quick-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px 7px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.canvas-quick-editor-head strong {
  font-size: 0.68rem;
  color: #f9fafb;
}

.canvas-quick-editor-head span {
  font-size: 0.58rem;
  color: #9ca3af;
}

.canvas-quick-editor-body {
  display: grid;
  gap: 8px;
  padding: 8px 10px 10px;
}

.canvas-quick-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.canvas-quick-field span {
  font-size: 0.58rem;
  font-weight: 600;
  color: #d1d5db;
}

.canvas-quick-field input,
.canvas-quick-field textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  background: #171b21;
  color: #f9fafb;
  padding: 6px 8px;
  font-size: 0.62rem;
}

.canvas-quick-field textarea {
  min-height: 76px;
  resize: vertical;
}

.empty-drop {
  padding: 5px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(17, 17, 17, 0.12);
  background: #252525;
  color: var(--muted);
  text-align: center;
  font-size: 0.56rem;
}

.inspector-intro,
.empty-panel {
  display: grid;
  place-items: center;
  min-height: 120px;
  padding: 8px;
  text-align: center;
  color: var(--muted);
}

.empty-panel h3 {
  margin: 0;
  font-family: "Segoe UI Variable Text", "Segoe UI", sans-serif;
  font-size: 0.66rem;
}

.inspector-summary {
  padding-bottom: 5px;
}

.inspector-title-row,
.inspector-toolbar {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  align-items: center;
}

.inspector-toolbar {
  margin-top: 4px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 4px;
  border-radius: 3px;
  background: #1f2329;
  color: var(--accent-deep);
  font-size: 0.5rem;
  font-weight: 700;
}

.breakpoint-pill {
  background: #3a3a3a;
  color: #f1f1f1;
}

.inspector-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.inspector-field.full {
  grid-column: 1 / -1;
}

.inspector-field span {
  font-size: 0.54rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.inspector-field input,
.inspector-field select,
.inspector-field textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  background: #1d2127;
  padding: 4px 5px;
  resize: vertical;
  font-size: 0.6rem;
}

.inspector-field textarea {
  min-height: 58px;
}

.inspector-field input[readonly] {
  color: #c7ced8;
  background: #171b21;
}

.inspector-color-field {
  gap: 4px;
}

.inspector-color-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 5px;
}

.inspector-color-picker {
  padding: 0;
  min-height: 28px;
  cursor: pointer;
}

.inspector-color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.inspector-swatch {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: var(--swatch);
  box-shadow: inset 0 0 0 1px rgba(17, 17, 17, 0.08);
}

.inspector-swatch.active {
  box-shadow:
    0 0 0 1px #fff,
    inset 0 0 0 1px rgba(17, 17, 17, 0.18);
}

.export-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 17, 17, 0.22);
  backdrop-filter: blur(14px);
}

.export-card {
  width: min(1120px, 100%);
  max-height: min(88vh, 920px);
  overflow: auto;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 6px 16px rgba(17, 17, 17, 0.08);
}

.export-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 8px;
  border-bottom: 1px solid rgba(17, 17, 17, 0.08);
}

.export-layout {
  padding: 7px 8px 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 6px;
}

.code-pane {
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}

.code-pane header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 5px 6px;
  border-bottom: 1px solid rgba(17, 17, 17, 0.08);
  background: #fafafa;
}

.code-pane pre {
  margin: 0;
  padding: 6px;
  min-height: 220px;
  overflow: auto;
  background: #fff;
  color: #111;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 0.54rem;
  line-height: 1.4;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 1240px) {
  .workspace {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .right-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace,
  .export-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .workspace,
  .topbar,
  .canvas-stage,
  .panel-body,
  .panel-header,
  .canvas-header {
    padding-left: 6px;
    padding-right: 6px;
  }

  .panel,
  .preview-frame,
  .export-card {
    border-radius: 4px;
  }

  .inspector-grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }
}
