@font-face {
  font-family: "MiSans";
  src: url("../assets/fonts/MiSans-Semibold.woff2?v=5b570ee085696350") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family:
    Inter, "Segoe UI", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  background: #101316;
  color: #eef2f3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1280px;
  min-height: 100vh;
  overflow: hidden;
}

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

button {
  border: 1px solid #3a4650;
  background: #202930;
  color: #eef2f3;
  height: 34px;
  border-radius: 6px;
  padding: 0 12px;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button:hover,
button.active {
  border-color: #66c2a5;
  background: #20362f;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #37424b;
  background: #151b20;
  color: #eef2f3;
  border-radius: 6px;
  min-height: 34px;
  padding: 7px 9px;
}

textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.45;
}

.editor-shell {
  --left-panel-width: 390px;
  --right-panel-width: 300px;
  --right-property-height: 46%;

  display: grid;
  grid-template-columns:
    var(--left-panel-width)
    6px
    minmax(620px, 1fr)
    6px
    var(--right-panel-width);
  height: 100vh;
}

.panel {
  overflow: auto;
  border-color: #27313a;
  background: #151a1f;
}

.panel-resizer {
  position: relative;
  z-index: 4;
  background: #101316;
  cursor: col-resize;
}

.panel-resizer::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 2px;
  width: 2px;
  border-radius: 999px;
  background: #27313a;
  content: "";
  transition: background 120ms ease, width 120ms ease;
}

.panel-resizer:hover::before,
.panel-resizer:focus-visible::before {
  left: 1px;
  width: 4px;
  background: #66c2a5;
}

.resizing-panels {
  cursor: col-resize;
  user-select: none;
}

.resizing-panel-height {
  cursor: row-resize;
  user-select: none;
}

.sidebar {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  border-right: 1px solid #27313a;
  min-height: 0;
  overflow: hidden;
}

.editor-toolrail {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 12px 6px;
  border-right: 1px solid #27313a;
  background: #101316;
  overflow-x: hidden;
  overflow-y: auto;
}

.editor-toolrail button {
  width: 34px;
  min-width: 34px;
  padding: 0;
}

.toolrail-separator {
  height: 1px;
  margin: 4px 3px;
  background: #303b43;
}

.inspector {
  border-left: 1px solid #27313a;
  padding: 14px;
  display: grid;
  grid-template-rows: minmax(220px, var(--right-property-height)) 10px minmax(220px, 1fr);
  gap: 0;
  overflow: hidden;
}

.inspector-section {
  min-width: 0;
  border: 1px solid #27313a;
  border-radius: 8px;
  background: #12171b;
  padding: 12px;
  overflow: hidden;
}

.property-section {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.panel-height-resizer {
  position: relative;
  min-height: 10px;
  cursor: row-resize;
  outline: none;
}

.panel-height-resizer::before {
  position: absolute;
  top: 4px;
  right: 18px;
  left: 18px;
  height: 2px;
  border-radius: 999px;
  background: #27313a;
  content: "";
  transition: background 120ms ease, height 120ms ease;
}

.panel-height-resizer:hover::before,
.panel-height-resizer:focus-visible::before {
  top: 3px;
  height: 4px;
  background: #66c2a5;
}

.toolbar,
.stage-toolbar,
.segmented,
.field-grid,
.checks,
.toolbar-group {
  display: flex;
  gap: 8px;
}

.toolbar button {
  flex: 1;
}

.sidebar-panel {
  border: 1px solid #27313a;
  border-radius: 8px;
  padding: 12px;
  background: #12171b;
}

.sidebar-panel .section-title:first-child {
  margin-top: 0;
}

.asset-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
  min-width: 0;
  min-height: 0;
  margin: 14px;
  padding: 0;
  overflow: hidden;
}

.sidebar-tabs {
  display: flex;
  gap: 0;
  padding: 0 8px;
  border-bottom: 1px solid #303b43;
  background: #151a1f;
}

.sidebar-tabs button {
  position: relative;
  height: 38px;
  min-width: 76px;
  border: 0;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #9ba8b1;
  padding: 0 14px;
}

.sidebar-tabs.compact-tabs button {
  min-width: 42px;
  min-height: 54px;
  height: auto;
  padding: 7px 10px 8px;
  line-height: 1.05;
  writing-mode: vertical-rl;
}

.sidebar-tabs button.active {
  border-bottom-color: #66c2a5;
  background: #12171b;
  color: #eef2f3;
  box-shadow: inset 0 1px 0 #303b43, inset 1px 0 0 #303b43, inset -1px 0 0 #303b43;
}

.sidebar-tabs button.active::after {
  position: absolute;
  right: 1px;
  bottom: -1px;
  left: 1px;
  height: 1px;
  background: #12171b;
  content: "";
}

.asset-tab-panel {
  min-height: 0;
  padding: 12px;
}

.preset-tab-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}

.object-tab-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 8px;
}

.palette-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.palette-search-row input {
  min-width: 0;
}

.palette-result-status {
  min-height: 16px;
  color: #81909a;
  font-size: 12px;
}

.preset-panel-toolbar {
  display: flex;
  gap: 8px;
}

.preset-panel-toolbar button {
  width: 100%;
}

.icon-button {
  width: 34px;
  min-width: 34px;
  padding: 0;
}

.stage-wrap {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  background: #0f1215;
  overflow: hidden;
}

.stage-body {
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  overflow: hidden;
}

.stage-toolbar {
  padding: 7px 12px;
  border-bottom: 1px solid #27313a;
  background: #151a1f;
  min-width: 0;
  display: grid;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
}

.stage-toolbar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  min-width: max-content;
  white-space: nowrap;
}

.stage-toolbar-row > * {
  flex: 0 0 auto;
}

.stage-toolbar-main {
  justify-content: flex-start;
}

.stage-document-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(240px, max-content);
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid #27313a;
  border-radius: 8px;
  background: #11181c;
  white-space: normal;
}

.stage-document-row > * {
  min-width: 0;
}

.document-name-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.document-name-label {
  color: #9ed9c6;
  font-size: 12px;
  font-weight: 700;
}

.document-dirty-indicator {
  margin-left: 6px;
  color: #ffca80;
  font-size: 11px;
  font-weight: 600;
}

.document-dirty-indicator[hidden] {
  display: none;
}

.stage-toolbar-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-menubar {
  display: flex;
  align-items: center;
  height: 34px;
  border-right: 1px solid #303b43;
  padding-right: 8px;
}

.app-menu-trigger {
  width: auto;
  min-width: 58px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-color: transparent;
  background: transparent;
  color: #d9e0e4;
  padding: 0 9px;
}

.app-menu-trigger svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.app-menu-trigger[aria-expanded="true"],
.app-menu-trigger:not(:disabled):hover {
  border-color: #303b43;
  background: #20362f;
  color: #eef2f3;
}

.file-menu {
  position: fixed;
  z-index: 30;
  width: 252px;
  max-width: calc(100vw - 16px);
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid #303b43;
  border-radius: 4px;
  background: rgba(18, 23, 27, 0.98);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.file-menu.hidden {
  display: none;
}

.file-menu-section {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.file-menu-section + .file-menu-section {
  padding-top: 4px;
  border-top: 1px solid #303b43;
}

.file-menu-separator {
  height: 1px;
  margin: 4px 2px;
  background: #303b43;
}

.file-menu-item {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 32px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border-radius: 4px;
  padding: 0 8px;
  border-color: transparent;
  background: transparent;
  color: #d9e0e4;
  text-align: left;
  outline: 0;
  justify-self: stretch;
}

.file-menu-item svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.file-menu-item span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-menu-item > span:first-child {
  grid-column: 1 / 3;
}

.file-menu-item kbd {
  color: #81909a;
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 11px;
  font-weight: 500;
}

.danger-menu-item {
  color: #ffb5b2;
}

.file-menu-item:not(:disabled):hover,
.file-menu-item:focus-visible {
  border-color: #303b43;
  background: #20362f;
  box-shadow: inset 0 0 0 1px rgba(102, 194, 165, 0.18);
}

.share-name-field,
.file-name-field {
  margin: 0;
}

.document-name-input-wrap {
  position: relative;
  display: block;
  min-width: 0;
}

.board-name-input-wrap {
  width: 13ch;
  min-width: 212px;
}

.document-name-input-wrap input {
  padding-right: 52px;
  font-variant-numeric: tabular-nums;
}

.document-name-count {
  position: absolute;
  top: 50%;
  right: 9px;
  transform: translateY(-50%);
  color: #81909a;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.layers-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.layer-count {
  margin-left: auto;
  color: #81909a;
  font-variant-numeric: tabular-nums;
}

.field .field-error {
  min-height: 16px;
  color: #f18b8b;
  font-size: 12px;
}

.stage-toolbar input {
  width: 140px;
}

.stage-document-row input {
  width: 100%;
}

.stage-toolbar select {
  width: 88px;
}

.stage-toolbar .toolbar-select {
  width: 92px;
  flex: 0 0 auto;
}

.stage-toolbar button {
  min-width: 34px;
  width: 34px;
  padding: 0;
}

.stage-toolbar .text-tool {
  width: auto;
  min-width: 84px;
  padding: 0 12px;
}

.stage-toolbar .icon-tool.text-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stage-toolbar-main .toolbar-group:first-child {
  border-left: 0;
}

.stage-toolbar-main .toolbar-group {
  border-right: 0;
}

.toolbar-group {
  align-items: center;
  gap: 4px;
  border-left: 1px solid #303b43;
  border-right: 1px solid #303b43;
  padding: 0 8px;
}

.toolbar-separator {
  align-self: stretch;
  width: 1px;
  margin: 3px 4px;
  background: #303b43;
}

.toolbar-group button {
  min-width: 34px;
  width: 34px;
  padding: 0;
}

.stage-toolbar .app-menu-trigger {
  width: auto;
  min-width: 58px;
  height: 28px;
  display: inline-flex;
  padding: 0 9px;
}

.stage-toolbar .app-menu-trigger svg {
  width: 14px;
  height: 14px;
}

.toolbar-label {
  color: #a8b4bd;
  font-size: 12px;
}

.icon-tool {
  display: grid;
  place-items: center;
}

.icon-tool svg,
.icon-toggle svg {
  pointer-events: none;
}

.icon-tool svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.grid-density-actions,
.grid-opacity-actions,
.zoom-actions {
  gap: 8px;
  border-left: 1px solid #303b43;
  border-right: 0;
}

.status-range,
.zoom-range {
  width: 146px;
  min-height: 0;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #27313a;
  accent-color: #66c2a5;
}

.grid-density-actions .status-range {
  width: 104px;
}

.grid-opacity-actions .status-range {
  width: 92px;
}

.status-label {
  color: #a8b4bd;
  font-size: 12px;
}

#grid-density-value,
#grid-opacity-value {
  min-width: 34px;
  color: #a8b4bd;
  font-size: 12px;
  text-align: right;
}

#zoom-value {
  min-width: 62px;
  color: #a8b4bd;
  font-size: 12px;
  text-align: right;
}

.toolbar-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #a8b4bd;
  font-size: 13px;
}

.toolbar-toggle input {
  width: auto;
  min-height: 0;
}

.icon-toggle {
  position: relative;
  width: 34px;
  height: 34px;
  justify-content: center;
  border: 1px solid #3a4650;
  border-radius: 6px;
  background: #202930;
  cursor: pointer;
}

.icon-toggle:hover,
.icon-toggle:has(input:checked) {
  border-color: #66c2a5;
  background: #20362f;
  color: #eef2f3;
}

.icon-toggle input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.icon-toggle svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

#stage-host {
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 24px;
  min-width: 0;
}

.stage-statusbar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 5px 12px;
  border-top: 1px solid #27313a;
  background: #151a1f;
  overflow-x: auto;
  overflow-y: hidden;
}

.stage-statusbar .zoom-actions {
  margin-left: auto;
}

.stage-statusbar .toolbar-group {
  flex: 0 0 auto;
  padding-right: 0;
}

.stage-statusbar .toolbar-toggle {
  flex: 0 0 auto;
}

.status-toggle {
  width: 32px;
  height: 32px;
}

#stage-host.drag-target {
  background: radial-gradient(circle at center, rgba(102, 194, 165, 0.12), transparent 58%);
}

#stage-host canvas {
  outline: 1px solid #3a4650;
}

#stage-host.can-pan,
#stage-host.can-pan canvas {
  cursor: grab !important;
}

#stage-host.is-panning,
#stage-host.is-panning canvas {
  cursor: grabbing !important;
  user-select: none;
}

.field {
  display: grid;
  gap: 6px;
  margin: 12px 0;
}

.field span,
.section-title {
  color: #a8b4bd;
  font-size: 12px;
}

.section-title {
  margin: 18px 0 10px;
  text-transform: uppercase;
}

.inspector-section > .section-title:first-child {
  margin-top: 0;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}

.segmented button {
  position: relative;
  height: 34px;
  min-width: 0;
  border: 1px solid #303b43;
  border-radius: 6px;
  background: #151a1f;
  color: #9ba8b1;
  padding: 0 8px;
  font-size: 13px;
  white-space: nowrap;
}

.segmented button.active {
  border-color: #66c2a5;
  background: #20362f;
  color: #eef2f3;
  box-shadow: inset 3px 0 0 #66c2a5;
}

.segmented button:not(.active):hover {
  border-color: #4d665e;
  background: #19251f;
}

.palette {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  align-content: start;
}

.palette button {
  height: 48px;
  min-width: 0;
  padding: 5px;
  display: grid;
  place-items: center;
  cursor: grab;
}

.palette-empty {
  grid-column: 1 / -1;
  margin: 8px 0 0;
}

.palette button:active {
  cursor: grabbing;
}

.preset-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  align-content: start;
}

.preset-card {
  min-width: 0;
  display: grid;
  gap: 6px;
  border: 1px solid #303b43;
  border-radius: 6px;
  background: #1b2228;
  padding: 7px;
}

.preset-preview {
  width: 100%;
  height: 82px;
  min-width: 0;
  padding: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 5px;
  background: #151a1f;
  cursor: grab;
}

.preset-preview:active {
  cursor: grabbing;
}

.preset-preview img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.preset-preview-placeholder {
  color: #81909a;
  font-size: 12px;
}

.preset-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.preset-meta strong,
.preset-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preset-meta strong {
  color: #eef2f3;
  font-size: 13px;
}

.preset-meta span {
  color: #81909a;
  font-size: 12px;
}

.preset-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.preset-actions button {
  height: 28px;
  padding: 0 9px;
}

.danger-text-button {
  color: #ffb5b2;
}

.preset-empty {
  margin: 0;
}

.object-preview {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  background-repeat: no-repeat;
  image-rendering: auto;
}

.text-swatch {
  color: #eef2f3;
  font-weight: 700;
}

.shape-swatch svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.shape-swatch .shape-fill {
  fill: rgba(102, 194, 165, 0.24);
  stroke: #66c2a5;
  stroke-width: 2;
}

.shape-swatch .shape-stroke {
  fill: none;
  stroke: #66c2a5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.shape-swatch .shape-dot {
  fill: #eef2f3;
  stroke: #66c2a5;
  stroke-width: 1.4;
}

.shape-swatch .shape-ring {
  fill: none;
  stroke: #66c2a5;
  stroke-width: 5;
}

.shape-swatch .shape-ring-hole {
  fill: #151a1f;
  stroke: rgba(238, 242, 243, 0.72);
  stroke-width: 1.2;
}

.background-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 8px;
}

.background-option {
  height: auto;
  min-height: 74px;
  padding: 6px;
  display: grid;
  grid-template-rows: 48px auto;
  gap: 5px;
  text-align: left;
}

.background-option img {
  width: 100%;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
}

.background-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #dce6ea;
  font-size: 12px;
}

.inspector-form.hidden,
.hidden {
  display: none;
}

.inspector-form .hidden {
  display: none;
}

.type-value-input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  opacity: 0;
  pointer-events: none;
}

.field-grid {
  align-items: center;
}

.inspector-form .field {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  min-width: 0;
  max-width: 100%;
}

.inspector-form,
.inspector-form .field-grid {
  min-width: 0;
  max-width: 100%;
}

.inspector-form .field > span,
.color-value-row span {
  color: #a8b4bd;
  font-size: 12px;
}

.inspector-form .field.hidden,
.inspector-form .hidden {
  display: none;
}

.inspector-primary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.coordinate-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.parameter-field-grid,
.inspector-appearance {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
}

.slider-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
  align-items: center;
}

.slider-control input[type="range"] {
  height: 18px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #27313a;
  accent-color: #66c2a5;
}

.slider-control input[type="number"] {
  min-width: 0;
  text-align: right;
}

.color-control {
  position: relative;
  display: block;
}

.text-field {
  align-items: start;
}

.text-control {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.text-control textarea {
  min-height: 34px;
  max-height: 92px;
  overflow: hidden;
  resize: none;
  line-height: 1.35;
  word-break: break-all;
}

.field-count {
  color: #7f8c95;
  font-size: 11px;
  line-height: 1;
  text-align: right;
}

.color-picker-trigger {
  height: 34px;
  min-width: 0;
  width: 44px;
  padding: 3px;
  border: 1px solid #3a4650;
  border-radius: 6px;
  background:
    linear-gradient(45deg, #263039 25%, transparent 25%),
    linear-gradient(-45deg, #263039 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #263039 75%),
    linear-gradient(-45deg, transparent 75%, #263039 75%);
  background-color: #151b20;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
  background-size: 12px 12px;
  overflow: hidden;
}

.color-preview {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(238, 242, 243, 0.25);
}

.color-value-input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  opacity: 0;
  pointer-events: none;
}

.color-popover {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 30;
  width: 236px;
  max-width: min(236px, calc(100vw - 24px));
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid #303b43;
  border-radius: 8px;
  background: #151a1f;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.44);
}

.color-popover.hidden {
  display: none;
}

.color-saturation {
  position: relative;
  height: 128px;
  border: 1px solid #303b43;
  border-radius: 6px;
  cursor: crosshair;
  background:
    linear-gradient(to top, #000, transparent),
    linear-gradient(to right, #fff, transparent),
    var(--picker-hue-color, #ff8000);
}

.color-saturation span {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1px #111820, 0 2px 6px rgba(0, 0, 0, 0.44);
  pointer-events: none;
}

.color-hue {
  appearance: none;
  height: 18px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
}

.color-hue::-webkit-slider-runnable-track {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    #ff0000,
    #ffff00,
    #00ff00,
    #00ffff,
    #0000ff,
    #ff00ff,
    #ff0000
  );
}

.color-hue::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -2px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #151a1f;
  box-shadow: 0 0 0 1px #111820, 0 2px 6px rgba(0, 0, 0, 0.44);
}

.color-hue::-moz-range-track {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    #ff0000,
    #ffff00,
    #00ff00,
    #00ffff,
    #0000ff,
    #ff00ff,
    #ff0000
  );
}

.color-hue::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #151a1f;
  box-shadow: 0 0 0 1px #111820, 0 2px 6px rgba(0, 0, 0, 0.44);
}

.color-hex-input,
.color-rgb-input {
  font-family: "Cascadia Mono", "Consolas", monospace;
}

.color-hex-input {
  text-transform: uppercase;
}

.color-value-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.color-value-row input {
  min-height: 30px;
}

.color-rgb-control {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.color-rgb-control input {
  min-width: 0;
  padding: 0 6px;
  text-align: right;
}

.layers {
  display: grid;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 4px 28px 0;
  align-content: start;
  scrollbar-color: #3a4650 #151a1f;
}

.layers.root-drop-target {
  background: linear-gradient(to bottom, transparent calc(100% - 28px), rgb(158 217 198 / 12%));
  outline: 1px dashed #9ed9c6;
  outline-offset: -2px;
}

.layer-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
}

.layer-toolbar button {
  width: 34px;
  min-width: 34px;
  padding: 0;
}

.layer-toolbar-group {
  display: flex;
  gap: 4px;
  border-right: 1px solid #303b43;
  padding-right: 8px;
}

.layer-toolbar-group:last-child {
  border-right: 0;
  padding-right: 0;
}

.layers-section {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
}

.layer-row {
  border: 1px solid #303b43;
  background: #1b2228;
  border-radius: 6px;
  padding: 6px 6px 6px calc(6px + var(--layer-depth, 0) * 16px);
  cursor: pointer;
  display: grid;
  grid-template-columns: 28px 28px 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.layer-group-row {
  grid-template-columns: 28px 28px 28px 28px minmax(0, 1fr) auto;
  background: #202832;
}

.layer-group-toggle,
.layer-group-icon {
  width: 28px;
  height: 26px;
  display: grid;
  place-items: center;
}

.layer-group-toggle {
  min-width: 0;
  padding: 0;
}

.layer-group-toggle svg,
.layer-group-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.layer-group-icon {
  color: #9ed9c6;
}

.layer-name-input {
  min-width: 0;
  width: 100%;
  height: 28px;
  padding: 0 8px;
}

.layer-row.dragging {
  opacity: 0.45;
}

.layer-row.drop-before {
  border-top-color: #9ed9c6;
  box-shadow: inset 0 3px 0 #9ed9c6;
}

.layer-row.drop-after {
  border-bottom-color: #9ed9c6;
  box-shadow: inset 0 -3px 0 #9ed9c6;
}

.layer-row.drop-inside {
  border-color: #9ed9c6;
  background: #263c35;
  box-shadow: inset 0 0 0 1px #9ed9c6;
}

.layer-row.active {
  border-color: #66c2a5;
  background: #20362f;
}

.layer-row.primary {
  box-shadow: inset 3px 0 0 #66c2a5;
}

.layer-row.locked {
  border-color: #4e5963;
  background:
    repeating-linear-gradient(
      -45deg,
      rgb(255 255 255 / 4%) 0,
      rgb(255 255 255 / 4%) 6px,
      transparent 6px,
      transparent 12px
    ),
    #171d22;
  color: #87939d;
}

.layer-row.locked.active {
  border-color: #7a8792;
  background:
    repeating-linear-gradient(
      -45deg,
      rgb(255 255 255 / 5%) 0,
      rgb(255 255 255 / 5%) 6px,
      transparent 6px,
      transparent 12px
    ),
    #202832;
}

.layer-row.muted {
  opacity: 0.65;
}

.layer-empty {
  border: 1px dashed #303b43;
  border-radius: 6px;
  color: #81909a;
  font-size: 13px;
  padding: 14px;
  text-align: center;
}

.layer-toggle {
  width: 28px;
  height: 26px;
  min-width: 0;
  padding: 0;
  display: grid;
  place-items: center;
}

.layer-toggle svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.layer-toggle.active[data-action="locked"] {
  color: #f2c879;
  border-color: #7b6333;
  background: #302819;
}

.layer-preview {
  justify-self: center;
}

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

.layer-position {
  color: #81909a;
  font-size: 12px;
}

.empty-state {
  border: 1px dashed #3a4650;
  border-radius: 6px;
  color: #81909a;
  padding: 18px;
  text-align: center;
}

#code-output {
  min-height: 116px;
}

#preview-image {
  width: 100%;
  display: none;
  border: 1px solid #303b43;
  border-radius: 6px;
  margin-top: 10px;
}

.local-board-list {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
}

.local-storage-divider {
  width: 100%;
  height: 1px;
  border: 0;
  margin: 2px 0;
  background: #303b43;
}

.local-storage-summary {
  padding: 10px 12px;
  border: 1px solid #303b43;
  border-radius: 6px;
  background: #101519;
  color: #dbe4e7;
  font-size: 12px;
}

.local-storage-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  align-items: center;
}

.local-storage-preview-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.local-storage-preview-main span,
.local-storage-preview-meta {
  color: #9aa8b2;
}

.local-storage-preview-main strong {
  overflow: hidden;
  color: #eef2f3;
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.local-storage-preview-meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.local-storage-preview-bar {
  grid-column: 1 / -1;
  height: 5px;
  border-radius: 999px;
  background: #26313a;
  overflow: hidden;
}

.local-storage-preview-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #66c2a5;
}

.local-storage-preview button {
  grid-row: 1;
  grid-column: 2;
}

.local-storage-details {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #303b43;
  border-radius: 6px;
  background: #101519;
  color: #dbe4e7;
  font-size: 12px;
}

.local-storage-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.local-storage-metric {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid #27313a;
  border-radius: 6px;
  background: #151a1f;
}

.local-storage-metric span,
.local-storage-note,
.local-storage-usage-row span {
  color: #9aa8b2;
}

.local-storage-metric strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #eef2f3;
  font-size: 13px;
  font-weight: 650;
}

.local-storage-usage-list {
  display: grid;
  gap: 7px;
}

.local-storage-usage-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px 10px;
  align-items: center;
}

.local-storage-usage-row span,
.local-storage-usage-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.local-storage-usage-row strong {
  color: #eef2f3;
  font-size: 12px;
  font-weight: 600;
}

.local-storage-detail-actions {
  display: flex;
  justify-content: flex-end;
}

.local-storage-usage-row button {
  min-width: 64px;
}

.local-storage-usage-bar {
  grid-column: 1 / -1;
  height: 4px;
  border-radius: 999px;
  background: #26313a;
  overflow: hidden;
}

.local-storage-usage-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #66c2a5;
}

.local-storage-note {
  margin: 0;
}

.local-board-bulk-actions {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.local-board-transfer-actions,
.local-board-selection-actions {
  display: flex;
  gap: 8px;
}

.local-board-row {
  display: grid;
  grid-template-columns: 22px 132px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid #303b43;
  border-radius: 6px;
  background: #12171b;
}

.local-board-select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.local-board-select input {
  width: auto;
  min-height: 0;
}

.local-board-preview {
  width: 132px;
  aspect-ratio: 4 / 3;
  height: auto;
  min-width: 0;
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
  background: #0b0f12;
  color: #a8b4bd;
  font-size: 12px;
}

.local-board-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.danger-button,
.danger-tool {
  border-color: rgba(239, 83, 80, 0.5);
  background: rgba(239, 83, 80, 0.14);
  color: #ffb5b2;
}

.danger-button:not(:disabled):hover,
.danger-tool:not(:disabled):hover {
  border-color: rgba(239, 83, 80, 0.78);
  background: rgba(239, 83, 80, 0.22);
  color: #ffd0ce;
}

.local-board-meta {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.local-board-meta strong,
.local-board-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.local-board-meta span {
  color: #a8b4bd;
  font-size: 12px;
}

.local-board-actions {
  display: flex;
  gap: 6px;
}

.local-board-actions button {
  height: 30px;
  padding: 0 9px;
}

.local-board-empty {
  margin: 0;
}

.compact-dialog {
  width: min(420px, calc(100vw - 32px));
}

.editor-dialog {
  width: min(720px, calc(100vw - 32px));
  border: 1px solid #303b43;
  border-radius: 8px;
  padding: 0;
  background: #151a1f;
  color: #eef2f3;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.editor-dialog::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

.dialog-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.dialog-header,
.dialog-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dialog-header {
  justify-content: space-between;
}

.dialog-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}

.dialog-actions {
  justify-content: flex-end;
}

.dialog-actions button {
  min-width: 96px;
}

.editor-dialog textarea {
  min-height: 150px;
}

.status {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  max-width: min(560px, calc(100vw - 32px));
  border: 1px solid #31404a;
  background: rgba(21, 27, 32, 0.96);
  color: #dce6ea;
  border-radius: 6px;
  padding: 9px 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.36);
}

.status.visible {
  opacity: 1;
}

.status.error {
  border-color: #b95d5d;
  color: #ffd9d9;
}

.context-menu {
  position: fixed;
  z-index: 20;
  width: 132px;
  border: 1px solid #303b43;
  border-radius: 8px;
  padding: 5px;
  background: #151a1f;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.44);
}

.context-menu > button {
  min-width: 120px;
  width: 100%;
  height: 30px;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0 10px;
}

.context-menu button:hover {
  background: #20362f;
}

.context-menu-separator {
  height: 1px;
  margin: 5px 4px;
  background: #303b43;
}

.context-icon-grid {
  display: grid;
  grid-template-columns: repeat(3, 34px);
  gap: 4px;
  padding: 2px 0;
}

.context-menu .context-icon {
  width: 34px;
  height: 30px;
  min-width: 0;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  padding: 0;
}

.context-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}
