/* ─── GrapesJS Dark Chrome Theme ─── */
/* This file is imported AFTER grapesjs/dist/css/grapes.min.css */
/* via app/javascript/document_editor.js so overrides take effect. */

/*
 * Override GrapesJS CSS custom properties globally.
 * This propagates the dark theme to ALL internal elements
 * that reference var(--gjs-*) variables.
 */
:root {
  --gjs-main-color: #1e1e2e;
  --gjs-primary-color: #1e1e2e;
  --gjs-secondary-color: #e4e4ef;
  --gjs-tertiary-color: oklch(50% .18 250);
  --gjs-quaternary-color: oklch(58% .16 250);
  --gjs-font-color: #e4e4ef;
  --gjs-font-color-active: #ffffff;
  --gjs-main-dark-color: #3a3a4e;
  --gjs-secondary-dark-color: #252536;
  --gjs-main-light-color: rgba(255, 255, 255, 0.08);
  --gjs-secondary-light-color: rgba(255, 255, 255, 0.7);
  --gjs-soft-light-color: rgba(255, 255, 255, 0.02);
  --gjs-color-blue: oklch(58% .16 250);
  --gjs-color-red: #ef4444;
  --gjs-color-yellow: #f59e0b;
  --gjs-color-green: #22c55e;
  --gjs-color-highlight: oklch(58% .16 250);
  --gjs-color-warn: #f59e0b;
  --gjs-light-border: rgba(255, 255, 255, 0.06);
  --gjs-arrow-color: #9999aa;
  --gjs-dark-text-shadow: rgba(0, 0, 0, 0.3);
  --gjs-main-font: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --gjs-font-size: 0.75rem;
  --gjs-placeholder-background-color: oklch(50% .18 250);
  --gjs-left-width: 320px;
  --gjs-canvas-top: 0;
}

/* Core editor container — font + bg */
.gjs-editor-cont {
  border-radius: 0;
  overflow: hidden;
  background-color: #1e1e2e;
  font-family: var(--gjs-main-font);
  font-size: var(--gjs-font-size);
  color: var(--gjs-font-color);
}

/* Force Inter on ALL GrapesJS children */
.gjs-editor-cont *,
.gjs-editor-cont input,
.gjs-editor-cont select,
.gjs-editor-cont textarea,
.gjs-editor-cont button {
  font-family: var(--gjs-main-font);
}

/* GrapesJS built-in color classes */
.gjs-one-bg {
  background-color: #1e1e2e;
}

.gjs-two-color {
  color: #e4e4ef;
}

.gjs-three-bg {
  background-color: oklch(50% .18 250);
}

.gjs-four-color,
.gjs-four-color-h:hover {
  color: oklch(58% .16 250);
}

/* ── Editor container — fill parent and establish layout ── */
.gjs-editor {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* ── Canvas ── */
.gjs-cv-canvas {
  background-color: #1e1e2e;
  top: 60px !important;
  height: calc(100% - 80px) !important;
}

/* Center the document frame within the canvas */
.gjs-frame-wrapper {
  display: flex;
  justify-content: center;
}

.gjs-frame-wrapper__right {
  display: none;
}

.gjs-frame {
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3), 0 1px 4px rgba(0, 0, 0, 0.2);
  border-radius: 2px;
  margin: 0 auto;
}

/* ── Panels ── */
.gjs-pn-panel {
  background-color: #1e1e2e;
  border-color: #3a3a4e;
}

/* .gjs-pn-commands is hidden — see bottom of file */

.gjs-pn-views-container {
  background-color: #1e1e2e;
  border-left: 1px solid #3a3a4e;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
  scrollbar-color: #4a4a5e #1e1e2e;
  width: 320px !important;
  overflow-x: hidden;
  overflow-y: auto;
}

.gjs-pn-views {
  background-color: #252536;
  border-bottom: 2px solid #3a3a4e;
  width: 320px !important;
}

/* Panel tab buttons */
.gjs-pn-btn {
  color: #9999aa;
  border-radius: 4px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.gjs-pn-btn:hover {
  color: #e4e4ef;
  background-color: rgba(255, 255, 255, 0.06);
}

.gjs-pn-btn.gjs-pn-active {
  color: oklch(58% .16 250);
  background-color: oklch(50% .18 250 / 0.12);
  box-shadow: none;
}

.gjs-pn-btn svg {
  fill: currentColor;
}

/* ── Blocks panel ── */
.gjs-blocks-c {
  background-color: #1e1e2e;
  padding: 8px;
}

.gjs-block {
  padding: 14px 10px;
  border: 1px solid #3a3a4e;
  border-radius: 6px;
  background-color: #252536;
  color: #9999aa;
  min-height: 90px;
  justify-content: center;
  align-items: center;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.gjs-block:hover {
  border-color: oklch(58% .16 250 / 0.5);
  background-color: #2a2a3e;
  color: #e4e4ef;
  box-shadow: 0 0 0 1px oklch(50% .18 250 / 0.15);
}

.gjs-block__media {
  width: 40px;
  height: 40px;
  margin-bottom: 6px;
  color: inherit;
}

/* Ensure SVGs inside block media scale properly */
.gjs-block__media svg {
  width: 100%;
  height: 100%;
}

.gjs-block-label {
  font-size: 11px;
  color: inherit;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.3;
  text-align: center;
}

/* Block category headers */
.gjs-block-category .gjs-title {
  display: flex;
  align-items: center;
  background-color: #252536;
  border-bottom: 1px solid #3a3a4e;
  font-size: 11px;
  font-weight: 600;
  color: #9999aa;
  padding: 10px 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.gjs-block-category .gjs-title:hover {
  color: #e4e4ef;
}

/* Block category collapse caret */
.gjs-block-category .gjs-caret-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  color: #6b6b7e;
  flex-shrink: 0;
  transition: transform 0.15s ease, color 0.15s ease;
}

.gjs-block-category .gjs-title:hover .gjs-caret-icon {
  color: #e4e4ef;
}

.gjs-block-category .gjs-caret-icon svg {
  width: 10px;
  height: 10px;
  fill: currentColor;
}

/* ── Style manager ── */
.gjs-sm-sector {
  border-bottom: 1px solid #3a3a4e;
}

.gjs-sm-sector .gjs-sm-sector-title {
  background-color: #252536;
  border-color: #3a3a4e;
  font-size: 11px;
  font-weight: 600;
  color: #9999aa;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.gjs-sm-sector .gjs-sm-sector-title:hover {
  color: #e4e4ef;
}

.gjs-sm-properties {
  background-color: #1e1e2e;
  padding: 8px 10px;
}

.gjs-sm-property .gjs-sm-label {
  font-size: 11px;
  color: #6b6b7e;
}

.gjs-sm-composite {
  background-color: #252536;
  border-radius: 3px;
}

/* ── Form fields / inputs ── */
.gjs-field {
  background-color: #2a2a3e;
  border: 1px solid #4a4a5e;
  border-radius: 4px;
  color: #e4e4ef;
  font-size: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.gjs-field:focus-within {
  border-color: oklch(50% .18 250);
  box-shadow: 0 0 0 2px oklch(50% .18 250 / 0.15);
}

.gjs-field input,
.gjs-field select,
.gjs-field textarea {
  background-color: transparent;
  color: #e4e4ef;
}

/* Select option styling (all contexts) */
.gjs-select option,
.gjs-field-select option,
.gjs-field select option,
.gjs-clm-select option,
.gjs-sm-select option,
.gjs-sm-unit option,
.gjs-fields option {
  background-color: #2a2a3e;
  color: #e4e4ef;
}

/* Select dropdown arrow */
.gjs-sel-arrow {
  color: #9999aa;
}

.gjs-d-s-arrow {
  border-top-color: #9999aa;
}

/* Field arrows (numeric spinners) */
.gjs-field-arrows {
  color: #9999aa;
}

.gjs-field-arrow-u {
  border-bottom-color: #9999aa;
}

.gjs-field-arrow-d {
  border-top-color: #9999aa;
}

/* Field unit labels */
.gjs-field-unit {
  color: #6b6b7e;
  font-size: 10px;
}

/* Color input field */
.gjs-field-color {
  width: 100%;
}

.gjs-field-color input {
  color: #e4e4ef;
}

.gjs-field-colorp {
  border-left: 1px solid #3a3a4e;
}

.gjs-field-color-picker {
  box-shadow: 0 0 1px #3a3a4e;
}

/* Checkbox */
.gjs-field-checkbox {
  cursor: pointer;
}

.gjs-field-checkbox input:checked + .gjs-chk-icon {
  border-color: oklch(58% .16 250);
}

.gjs-chk-icon {
  border-color: transparent;
}

/* Radio buttons */
.gjs-radio-items {
  display: flex;
}

.gjs-radio-item {
  border-left-color: #3a3a4e;
  color: #9999aa;
}

.gjs-radio-item:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: #e4e4ef;
}

.gjs-radio-item input:checked + .gjs-radio-item-label {
  background-color: oklch(50% .18 250 / 0.15);
  color: oklch(58% .16 250);
}

.gjs-radio-item-label {
  cursor: pointer;
  color: inherit;
}

/* Range slider */
.gjs-field-range {
  background-color: transparent;
  border: none;
  box-shadow: none;
}

.gjs-field-range input::-webkit-slider-thumb {
  background-color: oklch(58% .16 250);
  border-color: oklch(50% .18 250);
}

.gjs-field-range input::-moz-range-thumb {
  background-color: oklch(58% .16 250);
  border-color: oklch(50% .18 250);
}

.gjs-field-range input::-webkit-slider-runnable-track {
  background-color: #3a3a4e;
}

.gjs-field-range input::-moz-range-track {
  background-color: #3a3a4e;
}

/* Primary buttons */
.gjs-btn-prim {
  background-color: rgba(255, 255, 255, 0.08);
  color: #e4e4ef;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.gjs-btn-prim:hover {
  background-color: rgba(255, 255, 255, 0.12);
}

.gjs-btn-prim:active {
  background-color: rgba(255, 255, 255, 0.15);
}

/* Transparent add buttons */
.gjs-add-trasp {
  color: #9999aa;
  border: none;
  background: none;
}

.gjs-add-trasp:hover {
  color: #e4e4ef;
}

.gjs-add-trasp:active {
  background-color: rgba(0, 0, 0, 0.2);
}

/* ── Selector / class manager ── */
.gjs-clm-tags {
  background-color: #1e1e2e;
  padding: 6px;
}

.gjs-clm-tags .gjs-sm-composite {
  background-color: #252536;
}

.gjs-clm-tag {
  background-color: #2a2a3e;
  border: 1px solid #4a4a5e;
  color: #e4e4ef;
  border-radius: 3px;
}

.gjs-clm-tag .gjs-clm-close {
  color: #9999aa;
}

.gjs-clm-tag .gjs-clm-close:hover {
  color: #ef4444;
}

.gjs-clm-tags #gjs-clm-new {
  background-color: #2a2a3e;
  color: #e4e4ef;
}

.gjs-clm-sels-info {
  color: #6b6b7e;
}

/* ── Layer manager ── */
.gjs-layers {
  background-color: #1e1e2e;
  padding: 4px 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.gjs-layer {
  background-color: transparent;
  border-bottom: none;
  color: #9999aa;
  padding: 0;
  margin: 0;
}

.gjs-layer-title {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  font-size: 12px;
  border-radius: 4px;
  margin: 1px 6px;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.gjs-layer-title:hover {
  background-color: rgba(255, 255, 255, 0.04);
  color: #e4e4ef;
}

.gjs-layer.gjs-selected > .gjs-layer-title {
  background-color: oklch(50% .18 250 / 0.12);
  color: oklch(58% .16 250);
}

/* Indentation for nested layers */
.gjs-layer-children {
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  margin-left: 12px;
}

.gjs-layer-name {
  color: inherit;
  font-size: 12px;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.gjs-layer.gjs-selected > .gjs-layer-title .gjs-layer-name {
  font-weight: 500;
}

.gjs-layer-count {
  color: #6b6b7e;
  font-size: 10px;
  margin-left: 4px;
  flex-shrink: 0;
}

.gjs-layer-vis {
  color: #6b6b7e;
  cursor: pointer;
  flex-shrink: 0;
  padding: 2px;
  border-radius: 3px;
  transition: color 0.12s ease, background-color 0.12s ease;
}

.gjs-layer-vis:hover {
  color: #e4e4ef;
  background-color: rgba(255, 255, 255, 0.06);
}

/* Caret/arrow for collapsible layers */
.gjs-layer-caret {
  color: #6b6b7e;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.12s ease;
}

.gjs-layer-caret:hover {
  color: #e4e4ef;
}

/* Hidden layer visual indicator */
.gjs-layer.gjs-layer-hidden > .gjs-layer-title {
  opacity: 0.4;
}

.gjs-layer.gjs-layer-hidden > .gjs-layer-title .gjs-layer-vis {
  color: #ef4444;
  opacity: 1;
}

/* ── Trait manager ── */
.gjs-trt-traits {
  background-color: #1e1e2e;
  padding: 8px;
}

.gjs-trt-trait {
  border-bottom: 1px solid #3a3a4e;
  padding: 6px 0;
}

.gjs-trt-trait .gjs-label {
  color: #9999aa;
  font-size: 11px;
}

/* ── Modal dialogs ── */
.gjs-mdl-container {
  font-family: var(--gjs-main-font);
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.gjs-mdl-dialog {
  background-color: #1e1e2e;
  border: 1px solid #3a3a4e;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  color: #e4e4ef;
  text-shadow: none;
}

.gjs-mdl-header {
  border-bottom: 1px solid #3a3a4e;
  padding: 15px 15px 10px;
}

.gjs-mdl-title {
  font-size: 14px;
  font-weight: 600;
  color: #e4e4ef;
}

.gjs-mdl-content {
  padding: 12px 15px;
  color: #e4e4ef;
}

.gjs-mdl-btn-close {
  color: #9999aa;
  font-size: 20px;
  cursor: pointer;
}

.gjs-mdl-btn-close:hover {
  color: #e4e4ef;
}

/* ── Asset manager ── */
.gjs-am-assets {
  background-color: #1e1e2e;
}

.gjs-am-assets-cont {
  background-color: #252536;
  border-radius: 6px;
}

.gjs-am-assets-header {
  color: #9999aa;
}

.gjs-am-asset {
  border-bottom: 1px solid #3a3a4e;
  color: #e4e4ef;
}

.gjs-am-asset:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

.gjs-am-highlight {
  background-color: oklch(50% .18 250 / 0.1);
}

.gjs-am-preview-cont {
  background-color: #2a2a3e;
  border-radius: 4px;
}

.gjs-am-meta {
  color: #e4e4ef;
}

.gjs-am-dimensions {
  color: #6b6b7e;
}

.gjs-am-close {
  color: #9999aa;
}

.gjs-am-close:hover {
  color: #ef4444;
}

/* Asset upload area */
.gjs-am-file-uploader {
  background-color: #252536;
  border: 2px dashed #3a3a4e;
  border-radius: 6px;
  color: #9999aa;
  transition: border-color 0.15s ease;
}

.gjs-am-file-uploader:hover {
  border-color: oklch(50% .18 250 / 0.5);
}

/* Add asset URL input */
.gjs-am-add-asset input {
  background-color: #2a2a3e;
  border: 1px solid #4a4a5e;
  border-radius: 4px;
  color: #e4e4ef;
  padding: 6px 10px;
}

.gjs-am-add-asset button {
  background-color: oklch(50% .18 250);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
}

.gjs-am-add-asset button:hover {
  background-color: oklch(58% .16 250);
}

/* ── Code editor ── */
.gjs-cm-editor {
  background-color: #1a1a2e;
  border: 1px solid #3a3a4e;
  border-radius: 4px;
}

.gjs-cm-editor-c {
  background-color: #1a1a2e;
}

.gjs-cm-editor .CodeMirror {
  background-color: #1a1a2e;
  color: #e4e4ef;
}

/* ── Selection & hover outlines ── */
.gjs-selected {
  outline: 2px solid oklch(50% .18 250) !important;
  outline-offset: -2px;
}

.gjs-hovered {
  outline: 1px dashed oklch(58% .16 250 / 0.6) !important;
}

/* ── Component toolbar ── */
.gjs-toolbar {
  background-color: #252536 !important;
  border: 1px solid #3a3a4e !important;
  border-radius: 6px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 1px !important;
  padding: 3px !important;
  width: auto !important;
  min-width: max-content !important;
}

.gjs-toolbar-item {
  width: auto !important;
  color: #9999aa;
  padding: 5px;
  transition: color 0.15s ease, background-color 0.15s ease;
  border-radius: 4px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.gjs-toolbar-item:hover {
  color: #e4e4ef;
  background-color: rgba(255, 255, 255, 0.08);
}

/* Delete button turns red on hover */
.gjs-toolbar-item:last-child:hover {
  color: #ef4444;
  background-color: rgba(239, 68, 68, 0.1);
}

/* SVG icons inside toolbar items */
.gjs-toolbar-item svg {
  display: block;
  pointer-events: none;
}

/* ── Drop zone placeholder ── */
.gjs-placeholder {
  border: 2px dashed oklch(50% .18 250) !important;
  background-color: oklch(50% .18 250 / 0.06);
}

/* Badge (component type label) */
.gjs-badge {
  background-color: oklch(50% .18 250);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 2px;
  font-family: var(--gjs-main-font);
}

/* Resize handles */
.gjs-resizer-h {
  border: 2px solid oklch(50% .18 250);
  border-radius: 50%;
  width: 10px;
  height: 10px;
  background-color: white;
}

/* ── Rich text editor toolbar ── */
.gjs-rte-toolbar {
  background-color: #252536;
  border: 1px solid #3a3a4e;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  padding: 4px;
  z-index: 10;
  font-family: var(--gjs-main-font);
}

.gjs-rte-action {
  color: #9999aa;
  border: none;
  border-radius: 3px;
  padding: 4px 7px;
  font-size: 13px;
  transition: color 0.12s ease, background-color 0.12s ease;
  cursor: pointer;
}

.gjs-rte-action:hover {
  color: #e4e4ef;
  background-color: rgba(255, 255, 255, 0.06);
}

.gjs-rte-active {
  color: oklch(58% .16 250);
  background-color: oklch(50% .18 250 / 0.12);
}

/* RTE font-size select inside toolbar */
.gjs-rte-toolbar .gjs-field {
  background-color: #2a2a3e;
  border: 1px solid #4a4a5e;
  color: #e4e4ef;
  font-size: 11px;
}

.gjs-rte-toolbar .gjs-field select {
  color: #e4e4ef;
}

/* ── Spectrum color picker overrides ── */
.sp-container {
  background-color: #252536;
  border: 1px solid #3a3a4e;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  font-family: var(--gjs-main-font);
}

.sp-input {
  background-color: #2a2a3e !important;
  border: 1px solid #4a4a5e !important;
  color: #e4e4ef !important;
  border-radius: 3px;
}

.sp-cancel,
.sp-choose {
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  padding: 4px 10px;
  font-family: var(--gjs-main-font);
}

.sp-cancel {
  color: #9999aa !important;
  background-color: rgba(255, 255, 255, 0.06);
}

.sp-cancel:hover {
  color: #e4e4ef !important;
}

.sp-choose {
  background-color: oklch(50% .18 250);
  color: white;
}

.sp-choose:hover {
  background-color: oklch(58% .16 250);
}

.sp-palette-container {
  border-right: 1px solid #3a3a4e;
}

.sp-preview {
  border: 1px solid #4a4a5e;
}

/* ── Export/import dialog ── */
.gjs-export-dl {
  color: #e4e4ef;
}

/* ── Custom scrollbars for dark panels ── */
.gjs-editor-cont ::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.gjs-editor-cont ::-webkit-scrollbar-track {
  background: transparent;
}

.gjs-editor-cont ::-webkit-scrollbar-thumb {
  background-color: #4a4a5e;
  border-radius: 3px;
}

.gjs-editor-cont ::-webkit-scrollbar-thumb:hover {
  background-color: #6b6b7e;
}

/* ── Category general (titles, collapsible sections) ── */
.gjs-title {
  color: #9999aa;
  background-color: #252536;
  border-bottom: 1px solid #3a3a4e;
}

.gjs-title:hover {
  color: #e4e4ef;
}

/* ── Variable pills (canvas & outside) ── */
[data-variable] {
  background-color: #dbeafe;
  color: #1e40af;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 0.9em;
  white-space: nowrap;
}

/* ── Code editor title colors (override hardcoded browns) ── */
.gjs-cm-editor#gjs-cm-htmlmixed #gjs-cm-title {
  color: oklch(58% .16 250);
}

.gjs-cm-editor#gjs-cm-css #gjs-cm-title {
  color: oklch(70% .12 250);
}

/* ── Spectrum color picker — override tan/brown border ── */
.sp-container {
  border-color: #3a3a4e;
}

.sp-container button {
  font-family: var(--gjs-main-font);
}

/* ── Right panel alignment fixes ── */

/* Style manager property rows — proper layout */
.gjs-sm-property {
  box-sizing: border-box;
  padding: 4px 0;
}

.gjs-sm-property .gjs-sm-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gjs-sm-property .gjs-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  width: 100%;
}

/* Composite property fields — align in rows */
.gjs-sm-composite .gjs-sm-property {
  padding: 2px 4px;
}

/* Trait manager — fix alignment */
.gjs-trt-trait {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.gjs-trt-trait .gjs-label {
  flex: 0 0 auto;
  min-width: 60px;
}

.gjs-trt-trait .gjs-field {
  flex: 1;
  min-width: 0;
}

/* Layer items — title container */
.gjs-layer-title-c {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

/* Selector manager — fix tag layout */
.gjs-clm-tags .gjs-clm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
}

.gjs-clm-tags .gjs-clm-tag-status {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Block grid — consistent 2-column sizing */
.gjs-blocks-c {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gjs-block {
  width: calc(50% - 3px) !important;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 !important; /* Override GrapesJS default margin: 10px 2.5% 5px */
}

/* Category toggle caret color */
.gjs-caret-icon {
  color: #6b6b7e;
  transition: color 0.15s ease;
}

.gjs-title:hover .gjs-caret-icon {
  color: #e4e4ef;
}

/* GrapesJS preset-webpage overrides — these can add brownish defaults */
.gjs-pn-panel .gjs-pn-btn path {
  fill: currentColor;
}

/* Hide ALL default GrapesJS top panels — we have our own top bar + toolbar */
.gjs-pn-commands,
.gjs-pn-options,
.gjs-pn-devices-c {
  display: none !important;
}

/* ── Ensure no default text-shadow from GrapesJS ── */
.gjs-editor-cont .gjs-pn-panel,
.gjs-editor-cont .gjs-sm-sector,
.gjs-editor-cont .gjs-clm-tags,
.gjs-editor-cont .gjs-trt-traits,
.gjs-editor-cont .gjs-blocks-c {
  text-shadow: none;
}

/* ── Fix input/select inside right panel ── */
.gjs-pn-views-container .gjs-field,
.gjs-pn-views-container .gjs-sm-composite {
  box-sizing: border-box;
}

.gjs-pn-views-container select,
.gjs-pn-views-container input {
  box-sizing: border-box;
  max-width: 100%;
}

/* ── Fix GrapesJS default ghost element ── */
.gjs-cv-canvas .gjs-ghost {
  background-color: #2a2a3e;
  border-color: oklch(50% .18 250 / 0.4);
  color: #e4e4ef;
}
