/* ══════════════════════════════════════════════
   Ocean Flame Theme Creator
   Design: unitreign.github.io warm-dark palette
   ══════════════════════════════════════════════ */


:root {
  /* ── Warm dark palette (matches unitreign.github.io) ── */
  --bg:        #1a1917;
  --surface:   #23221f;
  --surface2:  #2a2926;
  --surface3:  #33312c;
  --border:    #33312c;
  --border2:   #3d3a34;
  --text:      #e8e4dc;
  --muted:     #8a857b;
  --muted2:    #6b6760;
  --hover:     #2a2926;
  --accent:    #9b6fd4;
  --accent-dim: rgba(155, 111, 212, 0.15);
  --accent-mid: rgba(155, 111, 212, 0.35);
  --green:     #9fbf78;
  --red:       #c97070;
  --yellow:    #e8a87c;
  --blue:      #78a0bf;

  /* ── Typography ── */
  --font-mono:    'DM Mono', 'Courier New', monospace;
  --font-display: 'Newsreader', Georgia, serif;

  /* ── Geometry ── */
  --radius:    5px;
  --radius-sm: 3px;
  --radius-lg: 8px;
  --transition: 0.35s ease;
  --shadow:    0 4px 20px rgba(0,0,0,0.5);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
.logo span { color: var(--accent); }
html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ── Screens ── */
.screen { width: 100%; height: 100%; position: absolute; inset: 0; }
.hidden { display: none !important; }

/* ── Scrollbars ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted2); }

/* ════════════════════════════════════════
   WELCOME SCREEN
   ════════════════════════════════════════ */
#welcome-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}


.welcome-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  z-index: 1;
}

.welcome-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.logo-icon-wrap {
  width: 60px; height: 60px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  color: var(--accent);
}

.welcome-logo h1 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.3px;
  font-style: italic;
}

.welcome-logo p {
  color: var(--muted);
  font-size: 12px;
  font-family: var(--font-mono);
}

.welcome-cards {
  display: flex;
  gap: 14px;
}

.welcome-card {
  width: 200px;
  padding: 22px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  position: relative;
}

.welcome-card:hover {
  border-color: var(--accent);
  background: var(--hover);
}

.welcome-card .card-icon {
  font-size: 20px;
  color: var(--accent);
  margin-bottom: 2px;
}

.welcome-card .card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  font-family: var(--font-mono);
}

.welcome-card .card-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

.welcome-card .card-arrow {
  position: absolute;
  bottom: 18px; right: 18px;
  color: var(--muted2);
  font-size: 11px;
  transition: color var(--transition), transform var(--transition);
}

.welcome-card:hover .card-arrow { color: var(--accent); transform: translateX(2px); }

.welcome-card .card-badge {
  display: inline-block;
  padding: 2px 7px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-mid);
  border-radius: 10px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.welcome-footer {
  font-size: 11px;
  color: var(--muted2);
  font-family: var(--font-mono);
}

.welcome-footer a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.welcome-footer a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* ════════════════════════════════════════
   EDITOR LAYOUT
   ════════════════════════════════════════ */
#editor {
  display: flex;
  flex-direction: column;
}

/* Top Bar */
#top-bar {
  height: 44px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  flex-shrink: 0;
  gap: 10px;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-logo-icon {
  font-size: 15px;
  color: var(--accent);
}

.app-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
  font-style: italic;
  color: var(--text);
}

.device-badge {
  padding: 2px 8px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Editor Body */
#editor-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

/* Toolbar */
#toolbar {
  width: 44px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  gap: 2px;
  flex-shrink: 0;
}

.tool-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tool-separator {
  width: 24px;
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.tool-btn {
  width: 32px; height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: background var(--transition), color var(--transition);
}

.tool-btn:hover {
  background: var(--hover);
  color: var(--text);
}

.tool-btn.active {
  background: var(--accent-dim);
  color: var(--accent);
}

/* Canvas Wrapper */
#canvas-wrapper {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  background-image:
    linear-gradient(45deg, #141412 25%, transparent 25%),
    linear-gradient(-45deg, #141412 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #141412 75%),
    linear-gradient(-45deg, transparent 75%, #141412 75%);
  background-size: 14px 14px;
  background-position: 0 0, 0 7px, 7px -7px, -7px 0px;
  position: relative;
  min-height: 0;
}

#canvas-hint {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--muted2);
  pointer-events: none;
  white-space: nowrap;
  font-family: var(--font-mono);
}

#canvas-scaler {
  position: relative;
  flex-shrink: 0;
}

#canvas-stage {
  position: absolute;
  top: 0; left: 0;
  transform-origin: top left;
  background: #fff;
  overflow: hidden;
  cursor: default;
  box-shadow: 0 0 0 1px var(--border), var(--shadow);
}

/* Canvas Elements */
.canvas-element {
  position: absolute;
  box-sizing: border-box;
  cursor: move;
  user-select: none;
}

.canvas-element.locked { cursor: default; }
.canvas-element.bg-element { cursor: default; }

.canvas-element img {
  width: 100%; height: 100%;
  display: block;
  pointer-events: none;
}

.canvas-text-el {
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.2;
}

/* Selection Box */
#selection-box {
  position: absolute;
  border: 1.5px solid var(--accent);
  pointer-events: none;
  z-index: 9999;
  box-sizing: border-box;
}

.resize-handle {
  position: absolute;
  width: 8px; height: 8px;
  background: var(--accent);
  border: 1.5px solid var(--bg);
  border-radius: 1px;
  pointer-events: all;
  z-index: 10000;
}

.resize-handle.nw { top: -5px; left: -5px; cursor: nw-resize; }
.resize-handle.n  { top: -5px; left: calc(50% - 4px); cursor: n-resize; }
.resize-handle.ne { top: -5px; right: -5px; cursor: ne-resize; }
.resize-handle.e  { top: calc(50% - 4px); right: -5px; cursor: e-resize; }
.resize-handle.se { bottom: -5px; right: -5px; cursor: se-resize; }
.resize-handle.s  { bottom: -5px; left: calc(50% - 4px); cursor: s-resize; }
.resize-handle.sw { bottom: -5px; left: -5px; cursor: sw-resize; }
.resize-handle.w  { top: calc(50% - 4px); left: -5px; cursor: w-resize; }

/* Button Layout Element */
.btn-layout-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-layout-buttons-h {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.btn-layout-buttons-v {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.btn-layout-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex-shrink: 0;
  pointer-events: none;
  overflow: hidden;
}

.btn-layout-btn i { line-height: 1; }
.btn-layout-btn span {
  font-size: 10px;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  font-family: var(--font-mono);
}

/* Right Panel */
#right-panel {
  width: 256px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  min-height: 0;
}

.panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.panel-tab {
  flex: 1;
  height: 34px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 400;
  font-family: var(--font-mono);
  transition: color var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
}

.panel-tab:hover { color: var(--text); }
.panel-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

/* Layers Panel */
#layers-list {
  padding: 4px;
}

.layers-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 180px;
  color: var(--muted2);
  font-size: 11px;
  text-align: center;
  font-family: var(--font-mono);
}

.layers-empty i { font-size: 24px; }

.layer-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 5px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  border: 1px solid transparent;
}

.layer-item:hover { background: var(--hover); }
.layer-item.selected {
  background: var(--accent-dim);
  border-color: var(--accent-mid);
}

.layer-drag-handle {
  color: var(--muted2);
  cursor: grab;
  font-size: 10px;
  padding: 2px;
  flex-shrink: 0;
}

.layer-drag-handle:active { cursor: grabbing; }

.layer-thumb {
  width: 26px; height: 18px;
  border-radius: 2px;
  background: var(--surface2);
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--border);
}

.layer-thumb img { width: 100%; height: 100%; object-fit: cover; }
.layer-thumb-icon {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px;
  color: var(--muted);
}

.layer-type-icon {
  font-size: 10px;
  color: var(--muted2);
  width: 12px;
  text-align: center;
  flex-shrink: 0;
}

.layer-name {
  flex: 1;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: text;
  border-radius: 2px;
  padding: 1px 3px;
}

.layer-name:focus {
  outline: 1px solid var(--accent);
  background: var(--surface2);
  white-space: normal;
}

.layer-actions {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

.layer-action-btn {
  width: 20px; height: 20px;
  border: none;
  background: transparent;
  color: var(--muted2);
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  transition: background var(--transition), color var(--transition);
}

.layer-action-btn:hover { background: var(--surface2); color: var(--text); }
.layer-action-btn.danger:hover { color: var(--red); }
.layer-action-btn.hidden-layer { color: var(--muted); }

.layer-item.drag-over-top    { border-top: 2px solid var(--accent); }
.layer-item.drag-over-bottom { border-bottom: 2px solid var(--accent); }
.layer-item.dragging { opacity: 0.4; }

/* Properties Panel */
#properties-content {
  padding: 10px;
}

.no-selection {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 180px;
  color: var(--muted2);
  text-align: center;
  line-height: 1.5;
  font-size: 11px;
  font-family: var(--font-mono);
}

.no-selection i { font-size: 24px; }

.prop-section { margin-bottom: 14px; }

.prop-section-title {
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted2);
  margin-bottom: 7px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
}

.prop-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.prop-label {
  font-size: 11px;
  color: var(--muted);
  width: 72px;
  flex-shrink: 0;
  font-family: var(--font-mono);
}

.prop-value { flex: 1; }

.prop-row-full { margin-bottom: 6px; }
.prop-row-full .prop-label { display: block; width: auto; margin-bottom: 3px; }

/* Form Controls */
.input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 7px;
  color: var(--text);
  font-size: 11px;
  font-family: var(--font-mono);
  outline: none;
  transition: border-color var(--transition);
}

.input:focus { border-color: var(--accent); }
.input-sm { padding: 2px 5px; font-size: 11px; }
.input-search { padding-left: 26px; }

.search-wrap { position: relative; margin-bottom: 10px; }
.search-icon {
  position: absolute;
  left: 8px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted2);
  font-size: 11px;
  pointer-events: none;
}

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%238a857b'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  padding-right: 20px;
  cursor: pointer;
}

.range-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

input[type="range"] {
  flex: 1;
  appearance: none;
  height: 3px;
  background: var(--border2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg);
}

.range-value {
  font-size: 10px;
  color: var(--muted);
  width: 30px;
  text-align: right;
  flex-shrink: 0;
  font-family: var(--font-mono);
}

.color-swatch {
  width: 28px; height: 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color var(--transition);
}

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

.toggle-group {
  display: flex;
  gap: 2px;
}

.toggle-btn {
  flex: 1;
  height: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  display: flex; align-items: center; justify-content: center;
  gap: 3px;
  font-family: var(--font-mono);
}

.toggle-btn:hover { background: var(--hover); color: var(--text); }
.toggle-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent-mid);
  color: var(--accent);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.checkbox-row input[type="checkbox"] {
  accent-color: var(--accent);
  width: 12px; height: 12px;
  cursor: pointer;
}

.checkbox-row label {
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-mono);
}

/* Buttons */
.btn {
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 400;
  font-family: var(--font-mono);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-dim);
  border-color: var(--accent-mid);
  color: var(--accent);
}

.btn-primary:hover {
  background: rgba(155,111,212,0.25);
  border-color: var(--accent);
  color: var(--text);
}

.btn-secondary {
  background: var(--surface2);
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover { background: var(--surface3); }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn-ghost:hover { background: var(--hover); color: var(--text); border-color: var(--border); }

.btn-danger {
  background: transparent;
  color: var(--red);
  border-color: rgba(201, 112, 112, 0.3);
}

.btn-danger:hover { background: rgba(201,112,112,0.1); }

.btn-sm { height: 23px; padding: 0 8px; font-size: 11px; }

.btn-icon {
  width: 26px; height: 26px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  transition: background var(--transition), color var(--transition);
}

.btn-icon:hover { background: var(--hover); color: var(--text); }
.btn-full { width: 100%; justify-content: center; }

/* ════════════════════════════════════════
   MODALS
   ════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  width: 440px;
}

.modal-sm { width: 300px; }
.modal-md { width: 500px; }
.modal-lg { width: 660px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-header h2 {
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-mono);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 7px;
}

.modal-header h2 i { color: var(--accent); }

.modal-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.modal-subtitle {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 16px;
  font-family: var(--font-mono);
}

.modal-footer {
  padding: 11px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-footer-actions { display: flex; gap: 6px; }
.modal-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 14px; }

/* Device Cards */
.device-cards { display: flex; gap: 12px; }

.device-card {
  flex: 1;
  padding: 18px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.device-card:hover { border-color: var(--accent); background: var(--hover); }
.device-icon { font-size: 24px; color: var(--accent); margin-bottom: 3px; }
.device-name { font-size: 14px; font-weight: 500; color: var(--text); font-family: var(--font-mono); }
.device-dims { font-size: 11px; color: var(--muted); font-family: var(--font-mono); }
.device-info { font-size: 10px; color: var(--muted2); font-family: var(--font-mono); }

/* ════════════════════════════════════════
   WIZARD
   ════════════════════════════════════════ */
#wizard-step-indicator {
  font-size: 11px;
  color: var(--muted2);
  font-family: var(--font-mono);
}

.wizard-step { display: flex; flex-direction: column; gap: 14px; }

.wizard-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  font-family: var(--font-mono);
}

.wizard-subtitle {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
}

.layout-style-cards { display: flex; gap: 10px; }

.layout-style-card {
  flex: 1;
  padding: 14px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  transition: border-color var(--transition), background var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.layout-style-card:hover { border-color: var(--border2); background: var(--hover); }
.layout-style-card.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.layout-style-preview {
  width: 56px; height: 40px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.layout-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--border2);
}

.layout-style-card.selected .layout-dot { background: var(--accent); }
.layout-preview-v { flex-direction: column !important; }

.layout-style-card span {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
}

.layout-style-card.selected span { color: var(--accent); }

.wizard-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.wizard-buttons-list { display: flex; flex-direction: column; gap: 6px; }

.wizard-btn-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.wizard-btn-num {
  width: 17px; height: 17px;
  background: var(--surface2);
  border-radius: 50%;
  font-size: 10px;
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-mono);
}

.wizard-icon-btn {
  width: 28px; height: 28px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: border-color var(--transition);
  font-size: 12px;
}

.wizard-icon-btn:hover { border-color: var(--accent); }

.style-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.style-field { display: flex; flex-direction: column; gap: 3px; }
.style-field label { font-size: 10px; color: var(--muted); font-family: var(--font-mono); }

.color-row { display: flex; align-items: center; gap: 5px; }

/* ════════════════════════════════════════
   ICON PICKER
   ════════════════════════════════════════ */
#icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 3px;
  max-height: 280px;
  overflow-y: auto;
}

.icon-item {
  height: 48px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  gap: 3px;
  padding: 3px;
}

.icon-item:hover { border-color: var(--accent); background: var(--hover); }
.icon-item.selected { border-color: var(--accent); background: var(--accent-dim); }
.icon-item i { font-size: 16px; color: var(--text); }
.icon-item span {
  font-size: 8px;
  color: var(--muted2);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  font-family: var(--font-mono);
}

/* ════════════════════════════════════════
   COLOR PICKER
   ════════════════════════════════════════ */
.cp-body { display: flex; flex-direction: column; gap: 10px; }

#cp-sv-wrap {
  position: relative;
  width: 240px; height: 150px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: crosshair;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

#cp-sv-canvas { display: block; }

#cp-sv-cursor {
  position: absolute;
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.5);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

#cp-hue-wrap {
  position: relative;
  height: 18px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: crosshair;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

#cp-hue-canvas { display: block; }

#cp-hue-cursor {
  position: absolute;
  width: 3px; height: 100%;
  background: white;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4);
  top: 0;
  pointer-events: none;
  transform: translateX(-50%);
}

#cp-bottom { display: flex; align-items: center; gap: 8px; }

#cp-preview-swatch {
  width: 32px; height: 26px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

#cp-hex-input { font-family: var(--font-mono); font-size: 12px; }

/* ════════════════════════════════════════
   TOAST
   ════════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.toast {
  padding: 7px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 11px;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 7px;
  animation: toast-in 0.2s ease forwards;
  box-shadow: var(--shadow);
}

.toast.success { border-color: rgba(159,191,120,0.4); }
.toast.success i { color: var(--green); }
.toast.error { border-color: rgba(201,112,112,0.4); }
.toast.error i { color: var(--red); }
.toast.info i { color: var(--blue); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════════════
   MISC / UTILS
   ════════════════════════════════════════ */
.divider { height: 1px; background: var(--border); margin: 7px 0; }
.text-muted { color: var(--muted); font-size: 11px; font-family: var(--font-mono); }

.export-option {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.export-option label { font-size: 12px; font-weight: 500; color: var(--text); font-family: var(--font-mono); }
.export-option p { font-size: 11px; color: var(--muted); font-family: var(--font-mono); }

.export-btn-select { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.export-btn-select label { font-size: 11px; color: var(--muted); font-family: var(--font-mono); }

.export-preview-sel { display: flex; gap: 4px; flex-wrap: wrap; }

.export-preview-btn {
  padding: 3px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--muted);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}

.export-preview-btn:hover { border-color: var(--accent); color: var(--text); }
.export-preview-btn.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent-mid);
}

.prop-img-preview {
  width: 100%;
  height: 54px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  margin-bottom: 5px;
}

.prop-img-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.prop-img-preview span { font-size: 10px; color: var(--muted2); font-family: var(--font-mono); }

/* Custom icon input at bottom of picker */
.icon-custom-wrap {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 10px;
}
.icon-custom-label {
  font-size: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.icon-custom-row {
  display: flex;
  gap: 6px;
}
.icon-custom-row .input {
  flex: 1;
  font-size: 11px;
  font-family: var(--font-mono);
}

/* ── Button image upload UI (per-button glyph/bg in properties + wizard) ── */
.btn-icon-sm {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
  padding: 0;
}
.btn-icon-sm:hover {
  background: var(--surface3);
  color: var(--text);
}

.btn-img-thumb {
  width: 26px;
  height: 26px;
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.12s;
}
.btn-img-thumb:hover {
  border-color: var(--accent);
}

/* ── List Layout element (canvas) ── */
.list-layout-el {
  box-sizing: border-box;
  overflow: hidden;
}
.ll-struct-info {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
  padding: 4px 0;
}
.ll-struct-info b { color: var(--text2); }
