/* css/editors.css â€” Project tree, dialog canvas, BWCC, palettes */

/* â€”â€”â€” App status bar â€”â€”â€” */
#statusbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 28px;
  height: 20px;
  background: var(--face);
  border-top: 1px solid var(--highlight);
  display: flex;
  align-items: center;
  font: 11px "MS Sans Serif", Tahoma, sans-serif;
  z-index: 997;
  padding: 0 4px;
  gap: 8px;
}
#statusbar .sb-ready {
  min-width: 64px;
  padding-right: 8px;
  border-right: 1px solid var(--shadow);
}
#statusbar .sb-detail {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #000;
}

/* desktop slightly lower for status */
#desktop {
  bottom: 48px !important;
}

/* â€”â€”â€” Project window â€”â€”â€” */
.project-window {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--face);
  font: 11px "MS Sans Serif", Tahoma, sans-serif;
}
.project-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 4px 6px;
  border-bottom: 1px solid var(--shadow);
  align-items: center;
}
.proj-filter {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}
.project-toolbar .sort-mode {
  margin-left: auto;
  font: inherit;
}
.project-split {
  flex: 1;
  display: flex;
  min-height: 0;
}
.project-tree {
  width: 48%;
  overflow: auto;
  background: #fff;
  border: 2px solid;
  border-color: var(--shadow) var(--highlight) var(--highlight) var(--shadow);
  margin: 4px;
}
.project-preview {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin: 4px 4px 4px 0;
  background: var(--face);
  border: 2px solid;
  border-color: var(--shadow) var(--highlight) var(--highlight) var(--shadow);
  min-width: 0;
}
.preview-label {
  padding: 2px 6px;
  background: var(--face);
  border-bottom: 1px solid var(--shadow);
  font-weight: bold;
}
.preview-body {
  flex: 1;
  overflow: auto;
  padding: 8px;
  background: #808080;
}
.tree-type-head {
  font-weight: bold;
  padding: 2px 4px;
  cursor: default;
  user-select: none;
}
.tree-type.collapsed > .tree-children {
  display: none;
}
.tree-children {
  padding-left: 12px;
}
.tree-item {
  padding: 1px 4px;
  cursor: default;
  white-space: nowrap;
}
.tree-item:hover {
  background: #e0e0e0;
}
.tree-item.selected {
  background: var(--active-caption);
  color: var(--caption-text);
}
.tree-empty {
  padding: 12px;
  color: var(--shadow);
}
.project-window.drop-target,
.drop-target {
  outline: 2px dashed var(--active-caption);
}
.preview-meta {
  background: #fff;
  padding: 6px;
  font: 11px "Courier New", monospace;
}

/* â€”â€”â€” Dialog editor â€”â€”â€” */
.dialog-editor {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--face);
  outline: none;
}
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px 4px;
  border-bottom: 1px solid var(--shadow);
  background: var(--face);
}
.editor-toolbar .tool-btn {
  min-width: 48px;
  min-height: 22px;
  padding: 1px 6px;
}
.editor-toolbar .tool-btn.active {
  border-color: var(--dkshadow) var(--highlight) var(--highlight) var(--dkshadow);
  background: #b0b0b0;
}
.editor-canvas-wrap {
  flex: 1;
  overflow: auto;
  background: #808080;
  padding: 16px;
  position: relative;
}
.editor-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 6px;
  border-top: 1px solid var(--highlight);
  background: var(--face);
  font: 11px "MS Sans Serif", Tahoma, sans-serif;
  min-height: 20px;
}
.editor-status .unit-toggle {
  min-width: 56px;
  min-height: 18px;
  padding: 0 4px;
}
.editor-status .status-info {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Dialog frame chrome */
.dialog-render-host {
  display: inline-block;
}
.dialog-frame {
  background: var(--face);
  border-top: 2px solid var(--highlight);
  border-left: 2px solid var(--highlight);
  border-right: 2px solid var(--dkshadow);
  border-bottom: 2px solid var(--dkshadow);
  box-shadow: 1px 1px 0 var(--shadow);
  display: flex;
  flex-direction: column;
  position: relative;
}
.dialog-caption {
  height: 18px;
  background: var(--active-caption);
  color: var(--caption-text);
  font: bold 11px "MS Sans Serif", Tahoma, sans-serif;
  padding: 1px 4px;
  display: flex;
  align-items: center;
  user-select: none;
  cursor: default;
}
.dialog-canvas {
  position: relative;
  background: var(--face);
  overflow: hidden;
}
.dialog-canvas.bwcc-canvas {
  /* chiseled steel fine grid */
  background-color: #c0c0c0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.35) 1px, transparent 1px);
  background-size: 2px 2px;
}

.dialog-control {
  position: absolute;
  box-sizing: border-box;
  font: 11px "MS Sans Serif", Tahoma, sans-serif;
  overflow: hidden;
  user-select: none;
}
.dialog-control.selected {
  outline: 1px dotted #000;
  z-index: 10;
}
.dialog-control.ctl-disabled {
  color: var(--shadow);
}

/* Standard controls */
.ctl-button,
.ctl-defbutton {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--face);
  border-top: 1px solid var(--highlight);
  border-left: 1px solid var(--highlight);
  border-right: 1px solid var(--dkshadow);
  border-bottom: 1px solid var(--dkshadow);
  box-shadow: inset -1px -1px 0 var(--shadow);
  text-align: center;
  padding: 0 4px;
}
.ctl-defbutton {
  border: 2px solid #000;
  box-shadow: inset 1px 1px 0 var(--highlight), inset -1px -1px 0 var(--shadow);
}

/* Button pressed state (test dialog) */
.test-dialog-host .ctl-button.btn-pressed {
  border-color: var(--dkshadow) var(--highlight) var(--highlight) var(--dkshadow);
  box-shadow: inset 1px 1px 0 var(--shadow);
  padding: 1px 0 0 1px;
}
.test-dialog-host .ctl-defbutton.btn-pressed {
  border-color: var(--dkshadow) var(--highlight) var(--highlight) var(--dkshadow);
  box-shadow: inset 2px 2px 0 var(--shadow);
  padding: 2px 0 0 2px;
}
.ctl-edit {
  background: #fff;
  border: 2px solid;
  border-color: var(--shadow) var(--highlight) var(--highlight) var(--shadow);
  padding: 1px 3px;
  overflow: hidden;
  white-space: nowrap;
}
.ctl-static {
  background: transparent;
  padding: 1px 2px;
  white-space: pre-wrap;
}
.ctl-groupbox {
  border: 1px solid var(--shadow);
  box-shadow: 1px 1px 0 var(--highlight);
  background: transparent;
  padding-top: 8px;
}
.ctl-groupbox .groupbox-caption {
  position: absolute;
  top: -1px;
  left: 8px;
  padding: 0 4px;
  background: var(--face);
  font-size: 11px;
}
.bwcc-canvas .ctl-groupbox .groupbox-caption {
  background: transparent;
  background-color: #c0c0c0;
}
.ctl-check,
.ctl-radio {
  display: flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  padding: 1px;
}
.check-box {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 var(--shadow);
}
.radio-dot {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 var(--shadow);
}
.ctl-check.checked .check-box {
  background: #404040;
  box-shadow: inset -1px -1px 0 #fff, inset 1px 1px 0 #808080;
}
.ctl-radio.checked .radio-dot {
  background: #000;
  box-shadow: inset 0 0 0 3px #fff;
}
.bor-check.checked .bor-check-box::after {
  color: #000;
  opacity: 1;
}
.bor-radio.checked .bor-radio-dot {
  background: #000;
  box-shadow: inset 0 0 0 3px #fff;
}
.ctl-listbox {
  background: #fff;
  border: 2px solid;
  border-color: var(--shadow) var(--highlight) var(--highlight) var(--shadow);
  overflow: auto;
}
.list-item {
  padding: 0 2px;
}
.list-item:first-child {
  background: var(--active-caption);
  color: #fff;
}
.ctl-combobox {
  display: flex;
  background: #fff;
  border: 2px solid;
  border-color: var(--shadow) var(--highlight) var(--highlight) var(--shadow);
  align-items: stretch;
}
.combo-text {
  flex: 1;
  padding: 1px 3px;
  overflow: hidden;
}
.combo-arrow {
  width: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--face);
  border-left: 1px solid var(--shadow);
  font-size: 8px;
}
/* Browse control (TWBrowse / TXBrowse / TSBrowse) */
.ctl-browse {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 2px solid;
  border-color: var(--shadow) var(--highlight) var(--highlight) var(--shadow);
  overflow: hidden;
  font-size: 11px;
  font-family: "MS Sans Serif", Tahoma, sans-serif;
}
.browse-header {
  display: flex;
  background: var(--face);
  border-bottom: 1px solid var(--shadow);
  font-weight: bold;
  flex: 0 0 auto;
}
.browse-col {
  flex: 1;
  padding: 2px 4px;
  border-right: 1px solid var(--shadow);
  white-space: nowrap;
  overflow: hidden;
}
.browse-col:last-child {
  border-right: none;
}
.browse-body {
  flex: 1;
  overflow: auto;
}
.browse-row {
  display: flex;
  border-bottom: 1px solid #e0e0e0;
}
.browse-row:nth-child(even) {
  background: #f8f8f8;
}
.browse-cell {
  flex: 1;
  padding: 1px 4px;
  border-right: 1px solid #e0e0e0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.browse-cell:last-child {
  border-right: none;
}
.ctl-static-frame {
  border: 1px solid var(--shadow);
  box-shadow: 1px 1px 0 var(--highlight);
  background: transparent;
}
.ctl-static-rect {
  background: #808080;
}
.ctl-static-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  border: 1px solid var(--shadow);
}

/* BWCC */
.bor-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--face);
  border-top: 2px solid var(--highlight);
  border-left: 2px solid var(--highlight);
  border-right: 2px solid var(--dkshadow);
  border-bottom: 2px solid var(--dkshadow);
  box-shadow: inset -1px -1px 0 var(--shadow);
}
.bor-btn-glyph {
  font-size: 14px;
  font-weight: bold;
  line-height: 1;
  font-family: "Segoe UI Symbol", "Arial Unicode MS", sans-serif;
}
.bor-check,
.bor-radio {
  display: flex;
  align-items: center;
  gap: 4px;
  background: transparent;
}
.bor-check-box {
  width: 13px;
  height: 13px;
  border: 1px solid #000;
  background: #fff;
  box-shadow: inset 1px 1px #808080;
  position: relative;
}
.bor-check-box::after {
  content: "âœ“";
  position: absolute;
  left: 0;
  top: -2px;
  font-size: 12px;
  color: #000;
}
.bor-radio-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid #000;
  background: #fff;
  box-shadow: inset 1px 1px #808080;
}
.bor-shade {
  border: 2px solid;
  border-color: var(--shadow) var(--highlight) var(--highlight) var(--shadow);
  background: transparent;
}
.bor-static {
  padding: 1px 2px;
  background: transparent;
}

/* Resize handles */
.resize-handle {
  position: absolute;
  width: 5px;
  height: 5px;
  background: #000;
  z-index: 20;
}
.handle-nw { left: -2px; top: -2px; cursor: nwse-resize; }
.handle-n  { left: 50%; top: -2px; margin-left: -2px; cursor: ns-resize; }
.handle-ne { right: -2px; top: -2px; cursor: nesw-resize; }
.handle-e  { right: -2px; top: 50%; margin-top: -2px; cursor: ew-resize; }
.handle-se { right: -2px; bottom: -2px; cursor: nwse-resize; }
.handle-s  { left: 50%; bottom: -2px; margin-left: -2px; cursor: ns-resize; }
.handle-sw { left: -2px; bottom: -2px; cursor: nesw-resize; }
.handle-w  { left: -2px; top: 50%; margin-top: -2px; cursor: ew-resize; }

.rubber-band {
  position: absolute;
  border: 1px dotted #000;
  background: rgba(0,0,180,0.08);
  pointer-events: none;
  z-index: 100;
}

.ctl-tab-badge,
.ctl-id-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: #ffff80;
  border: 1px solid #000;
  font-size: 9px;
  padding: 0 2px;
  z-index: 15;
}

/* Palettes */
.control-palette,
.align-palette {
  padding: 4px;
  background: var(--face);
  height: 100%;
  overflow: auto;
}
.palette-section-title {
  font-weight: bold;
  margin: 6px 0 4px;
  border-bottom: 1px solid var(--shadow);
}
.palette-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.palette-btn {
  min-height: 22px;
  width: 100%;
  text-align: left;
  min-width: 0 !important;
}
.palette-btn.active {
  border-color: var(--dkshadow) var(--highlight) var(--highlight) var(--dkshadow);
  background: #b0b0b0;
}
.align-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  padding: 4px;
}
.align-grid button {
  min-width: 28px !important;
  min-height: 24px;
  padding: 0;
  font-size: 12px;
}

/* Identifiers window */
.identifiers-window {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 0;
  background: var(--face);
  font: 11px "MS Sans Serif", Tahoma, sans-serif;
}
.identifiers-window .id-list,
.identifiers-window .id-list-wrap {
  flex: 1;
  overflow: auto;
  background: #fff;
  border: 2px solid;
  border-color: var(--shadow) var(--highlight) var(--highlight) var(--shadow);
  min-height: 0;
}
.identifiers-window .id-row {
  padding: 2px 4px;
  cursor: default;
}
.identifiers-window .id-row.selected {
  background: var(--active-caption);
  color: #fff;
}
.identifiers-window .id-fields,
.identifiers-window .id-detail {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 4px;
  align-items: center;
  padding: 6px;
}
.identifiers-window .id-detail {
  display: block;
}
.identifiers-window .id-detail .style-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.identifiers-window .id-detail .style-row label {
  width: 50px;
  flex: 0 0 auto;
}
.identifiers-window input,
.identifiers-window .usage-box {
  font: inherit;
  border: 2px solid;
  border-color: var(--shadow) var(--highlight) var(--highlight) var(--shadow);
  padding: 2px 4px;
  background: #fff;
}
.identifiers-window .id-detail input {
  flex: 1;
  width: 100%;
}
.id-table {
  width: 100%;
  border-collapse: collapse;
  font: inherit;
}
.id-table th {
  text-align: left;
  background: var(--face);
  border-bottom: 1px solid var(--shadow);
  padding: 2px 4px;
  position: sticky;
  top: 0;
}
.id-table td {
  padding: 1px 4px;
  border-bottom: 1px solid #e0e0e0;
}
.id-table tr.selected {
  background: var(--active-caption);
  color: var(--caption-text);
}
.id-table tr:hover:not(.selected) {
  background: #e8e8ff;
}
.id-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.usage-box {
  min-height: 36px;
  color: #000;
}

/* Style dialog modal */
.style-dialog {
  padding: 8px;
}
.style-row {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
  gap: 6px;
}
.style-row label {
  width: 70px;
  flex: 0 0 auto;
}
.style-row input[type="text"],
.style-row input[type="number"] {
  flex: 1;
  font: inherit;
  border: 1px solid var(--shadow);
  padding: 2px 4px;
  background: var(--window);
}
.style-flags {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--shadow);
  background: var(--window);
  padding: 4px;
  margin: 6px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.flag-check {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.style-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Test dialog */
.test-dialog-host {
  /* no background/padding — dialog floats freely */
}
.test-focusable:focus {
  outline: 1px dotted #000;
}

/* SpeedBar modes */
.speedbar-vertical {
  flex-direction: column !important;
  width: 32px !important;
  height: auto !important;
  padding: 2px !important;
}
.speedbar-vertical .speedbar-btn {
  min-width: 24px !important;
  min-height: 22px !important;
  padding: 0 2px !important;
  writing-mode: horizontal-tb;
}
.speedbar-vertical .speedbar-sep {
  width: 24px !important;
  height: 0 !important;
  border-left: none !important;
  border-top: 1px solid var(--shadow) !important;
  margin: 2px 0 !important;
}

/* Fieldset styling for Preferences */
.style-dialog fieldset {
  border: 1px solid var(--shadow);
  padding: 8px;
  margin: 0 0 8px 0;
}
.style-dialog legend {
  padding: 0 4px;
  font-weight: bold;
}
.style-dialog input[type="range"] {
  vertical-align: middle;
}
.style-dialog .undo-val {
  display: inline-block;
  min-width: 24px;
  text-align: center;
  font-weight: bold;
}

/* SpeedBar icons */
.speedbar-btn .sb-icon {
  display: inline-block;
  vertical-align: middle;
  width: 16px;
  height: 16px;
  margin-right: 4px;
  line-height: 0;
}
.speedbar-btn .sb-icon svg {
  display: block;
}
.speedbar-btn .sb-label {
  vertical-align: middle;
  font-size: 11px;
}
.speedbar-vertical .speedbar-btn .sb-icon {
  display: block;
  margin: 0 auto 2px auto;
}
.speedbar-vertical .speedbar-btn .sb-label {
  display: block;
  text-align: center;
  font-size: 9px;
}
/* ——— Bitmap Editor ——— */
.bitmap-editor {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--face);
  font: 11px "MS Sans Serif", Tahoma, sans-serif;
}
.bitmap-editor .editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 6px;
  border-bottom: 1px solid var(--shadow);
  background: var(--face);
}
.bitmap-editor .editor-toolbar .tool-btn {
  min-width: 48px;
  padding: 2px 6px;
  font-size: 11px;
}
.bitmap-editor .editor-toolbar .tool-btn.active {
  background: var(--highlight);
  color: var(--highlight-text);
  border-color: var(--shadow);
}
.bitmap-colorbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-bottom: 1px solid var(--shadow);
  background: var(--face);
}
.bitmap-colorbar input[type="color"] {
  width: 28px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--shadow);
  cursor: pointer;
}
.bitmap-canvas-wrap {
  flex: 1;
  overflow: auto;
  background: #808080;
  padding: 8px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}
.bitmap-canvas {
  image-rendering: pixelated;
  border: 1px solid var(--shadow);
  cursor: crosshair;
  background: #fff;
}
.bitmap-editor .editor-status {
  padding: 2px 6px;
  border-top: 1px solid var(--shadow);
  background: var(--face);
  font: 11px "MS Sans Serif", Tahoma, sans-serif;
  color: #000;
}
/* ——— Menu Editor ——— */
.menu-editor {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--face);
  font: 11px "MS Sans Serif", Tahoma, sans-serif;
}
.menu-editor .editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 6px;
  border-bottom: 1px solid var(--shadow);
  background: var(--face);
}
.menu-editor .editor-toolbar .win-btn {
  min-width: 60px;
  font-size: 11px;
}
.menu-editor-split {
  flex: 1;
  display: flex;
  overflow: hidden;
}
.menu-tree-panel {
  flex: 1;
  overflow: auto;
  border-right: 1px solid var(--shadow);
  padding: 4px;
  background: #fff;
}
.menu-tree-row {
  display: flex;
  align-items: center;
  padding: 2px 4px;
  cursor: pointer;
  white-space: nowrap;
  font: 11px "MS Sans Serif", Tahoma, sans-serif;
}
.menu-tree-row:hover {
  background: var(--highlight);
}
.menu-tree-row.selected {
  background: var(--highlight);
  color: var(--highlight-text);
}
.menu-tree-icon {
  font-family: monospace;
  color: #555;
  min-width: 24px;
}
.menu-tree-label {
  flex: 1;
}
.menu-tree-id {
  color: #888;
  font-size: 10px;
  margin-left: 6px;
}
.menu-preview-panel {
  width: 160px;
  overflow: auto;
  border-right: 1px solid var(--shadow);
  padding: 4px;
  background: var(--face);
}
.menu-preview-label {
  font-size: 10px;
  font-weight: bold;
  margin-bottom: 4px;
  color: #555;
}
.menu-preview-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--shadow);
}
.menu-preview-top {
  padding: 2px 8px;
  font: 11px "MS Sans Serif", Tahoma, sans-serif;
  cursor: default;
  background: var(--face);
  border: 1px solid transparent;
}
.menu-preview-top:hover {
  background: var(--highlight);
  color: var(--highlight-text);
}
.menu-props-panel {
  width: 180px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--face);
  font: 11px "MS Sans Serif", Tahoma, sans-serif;
}
.menu-props-title {
  font-weight: bold;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--shadow);
  padding-bottom: 2px;
}
.menu-props-panel label {
  font-size: 11px;
  margin-top: 4px;
}
.menu-props-panel input {
  font: 11px "MS Sans Serif", Tahoma, sans-serif;
  padding: 1px 3px;
  border: 1px solid var(--shadow);
  background: #fff;
}
/* ——— Icon/Cursor Editor ——— */
.icon-editor {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--face);
  font: 11px "MS Sans Serif", Tahoma, sans-serif;
}
.icon-editor .editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 6px;
  border-bottom: 1px solid var(--shadow);
  background: var(--face);
}
.icon-editor .editor-toolbar .tool-btn {
  min-width: 44px;
  padding: 2px 6px;
  font-size: 11px;
}
.icon-editor .editor-toolbar .tool-btn.active {
  background: var(--highlight);
  color: var(--highlight-text);
  border-color: var(--shadow);
}
.icon-editor .toolbar-separator {
  display: inline-block;
  width: 1px;
  height: 20px;
  background: var(--shadow);
  margin: 0 4px;
  vertical-align: middle;
}
.icon-editor .bitmap-colorbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-bottom: 1px solid var(--shadow);
  background: var(--face);
}
.icon-editor .bitmap-colorbar input[type="color"] {
  width: 28px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--shadow);
  cursor: pointer;
}
.icon-transp-label {
  font-size: 10px;
  color: #555;
}
.icon-hotspot-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-bottom: 1px solid var(--shadow);
  background: var(--face);
  font-size: 11px;
}
.icon-hotspot-bar input {
  font: 11px "MS Sans Serif", Tahoma, sans-serif;
}
.icon-canvas-wrap {
  flex: 1;
  overflow: auto;
  background: #808080;
  padding: 8px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}
.icon-canvas {
  image-rendering: pixelated;
  border: 1px solid var(--shadow);
  cursor: crosshair;
}
/* ——— Script Editor ——— */
.script-editor {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--face);
  font: 11px "MS Sans Serif", Tahoma, sans-serif;
}
.script-editor .editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 6px;
  border-bottom: 1px solid var(--shadow);
  background: var(--face);
}
.script-editor .editor-toolbar .win-btn {
  min-width: 50px;
  font-size: 11px;
}
.script-textarea {
  flex: 1;
  margin: 0;
  padding: 4px;
  font: 12px "Consolas", "Courier New", monospace;
  border: none;
  border-right: 1px solid var(--shadow);
  background: #fff;
  color: #000;
  resize: none;
  white-space: pre;
  overflow: auto;
  tab-size: 4;
}
.script-textarea:focus {
  outline: none;
}