.editor-body {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.logo-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: contain;
  background: #101010;
  flex-shrink: 0;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--container);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  z-index: 200;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.toast.error { border-color: #ff6b6b; color: #ff6b6b; }
.toast.success { border-color: var(--accent); color: var(--accent); }

.igs-watermark {
  position: fixed;
  right: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 5px;
  background: rgba(20, 20, 20, 0.7);
  border: 1px solid var(--border);
  border-radius: 20px;
  opacity: 0.55;
  pointer-events: none;
  z-index: 50;
}

.igs-watermark img {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: contain;
  background: #101010;
}

.igs-watermark span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .igs-watermark { bottom: 8px; right: 8px; opacity: 0.4; }
}

.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--container);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  flex-shrink: 0;
}

.toolbar-left, .toolbar-center, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.device-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.device-btn {
  background: var(--section);
  border: none;
  color: var(--text-muted);
  padding: 7px 12px;
  font-size: 12px;
  cursor: pointer;
}

.device-btn.active { background: var(--accent); color: #101010; font-weight: 700; }

.editor-layout {
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  flex: 1;
  min-height: 0;
}

.editor-panel {
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 16px;
}

.editor-panel-right { border-right: none; border-left: 1px solid var(--border); }
.editor-panel-center { border-right: 1px solid var(--border); background: #050505; display: flex; flex-direction: column; padding: 0; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

#section-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.section-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--section);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 10px;
  margin-bottom: 8px;
  cursor: pointer;
}

.section-item.selected { border-color: var(--accent); }
.section-item .drag-handle { cursor: grab; color: var(--text-muted); }
.section-item .section-label { flex: 1; font-size: 13px; }
.section-item .section-menu { position: relative; }
.section-item .section-menu-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 16px; padding: 2px 6px; }
.section-item .section-menu-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--container);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 130px;
  z-index: 20;
  overflow: hidden;
}
.section-item .section-menu-dropdown.open { display: block; }
.section-item .section-menu-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
}
.section-item .section-menu-dropdown button:hover { background: var(--section); }

.palette-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--section);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 13px;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--container);
}

.preview-frame-wrapper {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  overflow: auto;
  background: #050505;
  transition: background 0.15s;
}

.preview-frame-wrapper.light-mode { background: #e5e5e5; }

#preview-iframe {
  width: 700px;
  max-width: 100%;
  height: 2200px;
  border: none;
  background: white;
  border-radius: 8px;
  transition: width 0.15s;
}

.preview-frame-wrapper[data-device="tablet"] #preview-iframe { width: 768px; }
.preview-frame-wrapper[data-device="mobile"] #preview-iframe { width: 390px; }

.prop-group-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin: 18px 0 8px 0;
}

.align-buttons { display: flex; gap: 6px; }
.align-buttons button {
  flex: 1;
  background: var(--section);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 7px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}
.align-buttons button.active { background: var(--accent); color: #101010; border-color: var(--accent); }

.item-list-editor .item-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
  background: var(--section);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
}

.item-list-editor .item-row .item-fields { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.item-list-editor .item-row input, .item-list-editor .item-row select {
  width: 100%;
  background: var(--container);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
}

/* Mobile panel switcher: hidden on desktop, shown via media query below */
.mobile-panel-tabs {
  display: none;
  border-bottom: 1px solid var(--border);
  background: var(--container);
  flex-shrink: 0;
}

.mobile-panel-tabs button {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 12px 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.mobile-panel-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Tablet: narrower fixed side columns instead of 280/320px */
@media (max-width: 1200px) {
  .editor-layout { grid-template-columns: 230px 1fr 260px; }
}

/* Mobile: stack panels, show one at a time via tab switcher */
@media (max-width: 900px) {
  .editor-toolbar { flex-wrap: wrap; gap: 8px; row-gap: 8px; justify-content: center; }
  .toolbar-left, .toolbar-center, .toolbar-right { flex-wrap: wrap; justify-content: center; }
  .toolbar-right .btn, .toolbar-center .btn { padding: 8px 10px; font-size: 12px; }
  .device-btn { padding: 6px 8px; }

  .mobile-panel-tabs { display: flex; }

  .editor-layout { grid-template-columns: 1fr; }

  .editor-panel {
    display: none;
    border: none;
    height: 100%;
  }

  .editor-panel.mobile-active { display: flex; flex-direction: column; }
  .editor-panel-left.mobile-active,
  .editor-panel-right.mobile-active { display: block; }

  .preview-frame-wrapper { padding: 12px; }
  #preview-iframe { width: 100%; }
}

