/* Scoped to the article visual editor so it does not restyle the admin shell. */
#stealth-cms-editor {
  --ve-primary: hsl(207 90% 54%);
  --ve-border: #e2e8f0;
  --ve-muted: #64748b;
  font-size: 14px;
  color: #0f172a;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  flex: 1 1 auto;
  position: relative;
}
#stealth-cms-editor .cms-paste-modal {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.35);
}
#stealth-cms-editor .cms-paste-modal[hidden] { display: none; }
#stealth-cms-editor .cms-paste-modal-card {
  background: #fff;
  color: #0f172a;
  border-radius: 0.85rem;
  padding: 1.15rem 1.4rem;
  min-width: 12rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}
#stealth-cms-editor .cms-paste-spinner {
  width: 1.6rem;
  height: 1.6rem;
  border: 3px solid #e2e8f0;
  border-top-color: hsl(207 90% 54%);
  border-radius: 50%;
  animation: cms-paste-spin 0.7s linear infinite;
}
#stealth-cms-editor .cms-paste-msg {
  margin: 0;
  font-size: 0.9rem;
  color: #334155;
}
@keyframes cms-paste-spin {
  to { transform: rotate(360deg); }
}
#stealth-cms-editor .cms-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(14rem, 17rem);
  gap: 0.75rem;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
}
#stealth-cms-editor .cms-canvas-col {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#stealth-cms-editor .cms-surface-wrap {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  background: #eef2f7;
  color: #0f172a;
  border: 1px solid var(--ve-border);
  border-radius: 1rem;
  padding: 0;
}
#stealth-cms-editor .cms-side-col {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
#stealth-cms-editor .cms-format-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  flex-shrink: 0;
  margin: 0 0 0.4rem;
  padding: 0.35rem 0.65rem;
  background: #fff;
  color: #0f172a;
  border: 1px solid var(--ve-border);
  border-radius: 0.85rem;
}
#stealth-cms-editor .cms-format-sep {
  width: 1px;
  height: 1.25rem;
  background: var(--ve-border);
  color: var(--ve-border);
  margin: 0 0.25rem;
}
#stealth-cms-editor .cms-format-bar select {
  max-width: 9.5rem;
  height: 1.85rem;
  padding: 0 0.4rem;
  font-size: 0.8rem;
}
#stealth-cms-editor .cms-toolbox h3,
#stealth-cms-editor .cms-props-card h3 { margin-top: 0; font-size: 0.95rem; }
#stealth-cms-editor .cms-toolbox,
#stealth-cms-editor .cms-props-card {
  background: #fff;
  color: #0f172a;
  border: 1px solid var(--ve-border);
  border-radius: 1rem;
  padding: 0.85rem;
}
#stealth-cms-editor .cms-props-card { position: static; }
#stealth-cms-editor .cms-toolbox-group {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ve-muted);
  margin: 0.75rem 0 0.35rem;
}
#stealth-cms-editor .cms-widget-list { display: flex; flex-direction: column; gap: 0.375rem; }
#stealth-cms-editor .cms-widget {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px dashed var(--ve-border);
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: grab;
  user-select: none;
}
#stealth-cms-editor .cms-widget i {
  width: 0.95rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--ve-muted);
  pointer-events: none;
}
#stealth-cms-editor .cms-widget:active { cursor: grabbing; }
#stealth-cms-editor .cms-widget.is-armed { outline: 2px solid #2563eb; background: #dbeafe; color: #0f172a; }
#stealth-cms-editor .cms-widget.is-armed i { color: #2563eb; }
#stealth-cms-editor .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: var(--ve-primary);
  color: #fff;
  border: none;
  padding: 0.35rem 0.7rem;
  border-radius: 0.6rem;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
}
#stealth-cms-editor .btn-outline {
  background: transparent;
  color: #0f172a;
  border: 1px solid var(--ve-border);
}
#stealth-cms-editor .btn-outline:hover { background: #f8fafc; color: #0f172a; }
#stealth-cms-editor .btn-sm { padding: 0.3rem 0.6rem; font-size: 0.75rem; }
#stealth-cms-editor .btn:disabled { opacity: 0.45; cursor: not-allowed; }
#stealth-cms-editor .text-muted { color: var(--ve-muted); font-size: 0.75rem; }
#stealth-cms-editor .cms-props-grid {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.45rem 0.65rem;
  align-items: center;
  font-size: 0.8125rem;
}
#stealth-cms-editor .cms-props-grid input,
#stealth-cms-editor .cms-props-grid select,
#stealth-cms-editor textarea {
  width: 100%;
  margin: 0;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--ve-border);
  border-radius: 0.5rem;
  font-size: 0.8125rem;
}
html.dark #stealth-cms-editor .cms-props-grid select,
html.dark #stealth-cms-editor select,
.dark #stealth-cms-editor .cms-props-grid select,
.dark #stealth-cms-editor select {
  color-scheme: light;
  background-color: #ffffff;
  color: #0f172a;
}
html.dark #stealth-cms-editor .cms-props-grid option,
html.dark #stealth-cms-editor option,
html.dark #stealth-cms-editor optgroup,
.dark #stealth-cms-editor .cms-props-grid option,
.dark #stealth-cms-editor option,
.dark #stealth-cms-editor optgroup {
  color-scheme: light;
  background-color: #ffffff;
  color: #0f172a;
}
html.dark #stealth-cms-editor .cms-props-card input[type="text"],
html.dark #stealth-cms-editor .cms-props-card input[type="number"],
html.dark #stealth-cms-editor .cms-props-card input[type="search"],
html.dark #stealth-cms-editor .cms-props-card input[type="url"],
html.dark #stealth-cms-editor .cms-props-card input:not([type]),
html.dark #stealth-cms-editor .cms-props-card textarea,
html.dark #stealth-cms-editor #cms-props textarea {
  background-color: hsl(0 0% 16%);
  color: hsl(0 0% 96%);
  border-color: hsl(0 0% 28%);
  -webkit-text-fill-color: hsl(0 0% 96%);
  color-scheme: dark;
}
html.dark #stealth-cms-editor .cms-props-card input[type="text"]::placeholder,
html.dark #stealth-cms-editor .cms-props-card textarea::placeholder,
html.dark #stealth-cms-editor #cms-props textarea::placeholder {
  color: hsl(0 0% 58%);
  -webkit-text-fill-color: hsl(0 0% 58%);
}
html.dark #stealth-cms-editor,
.dark #stealth-cms-editor {
  --ve-border: hsl(0 0% 24%);
  --ve-muted: hsl(0 0% 68%);
  color: var(--foreground, hsl(0 0% 98%));
}
html.dark #stealth-cms-editor .cms-format-bar,
html.dark #stealth-cms-editor .cms-toolbox,
html.dark #stealth-cms-editor .cms-props-card,
.dark #stealth-cms-editor .cms-format-bar,
.dark #stealth-cms-editor .cms-toolbox,
.dark #stealth-cms-editor .cms-props-card {
  background: var(--card, hsl(0 0% 12%));
  color: var(--foreground, hsl(0 0% 98%));
  border-color: var(--ve-border);
}
html.dark #stealth-cms-editor .cms-widget,
.dark #stealth-cms-editor .cms-widget {
  background: var(--muted, hsl(0 0% 15%));
  color: var(--foreground, hsl(0 0% 98%));
  border-color: var(--ve-border);
}
html.dark #stealth-cms-editor .cms-widget.is-armed,
.dark #stealth-cms-editor .cms-widget.is-armed {
  background: hsl(207 90% 54% / 0.22);
  color: var(--foreground, hsl(0 0% 98%));
}
html.dark #stealth-cms-editor .cms-widget.is-armed i,
.dark #stealth-cms-editor .cms-widget.is-armed i {
  color: var(--primary-light, hsl(207 90% 64%));
}
html.dark #stealth-cms-editor .btn-outline,
.dark #stealth-cms-editor .btn-outline {
  background: transparent;
  color: var(--foreground, hsl(0 0% 98%));
  border-color: var(--ve-border);
}
html.dark #stealth-cms-editor .btn-outline:hover,
.dark #stealth-cms-editor .btn-outline:hover {
  background: var(--muted, hsl(0 0% 15%));
  color: var(--foreground, hsl(0 0% 98%));
}
html.dark #stealth-cms-editor .cms-surface-wrap,
.dark #stealth-cms-editor .cms-surface-wrap {
  background: #eef2f7;
  color: #0f172a;
  border-color: var(--ve-border);
}
html.dark #stealth-cms-editor .cms-props-grid input,
html.dark #stealth-cms-editor .cms-props-grid select,
html.dark #stealth-cms-editor textarea,
.dark #stealth-cms-editor .cms-props-grid input,
.dark #stealth-cms-editor .cms-props-grid select,
.dark #stealth-cms-editor textarea {
  border-color: var(--ve-border);
}
#stealth-cms-editor .cms-props-row-btns { display: flex; flex-wrap: wrap; gap: 0.35rem; }
#stealth-cms-editor .cms-crop-pad {
  width: 100%;
  min-height: 5.5rem;
  border: 1px solid var(--ve-border);
  border-radius: 0.5rem;
  background-color: #0f172a;
  background-repeat: no-repeat;
  cursor: grab;
  touch-action: none;
}
#stealth-cms-editor .cms-crop-pad:active { cursor: grabbing; }
#stealth-cms-editor .cms-crop-zoom-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
#stealth-cms-editor .cms-crop-zoom-row input[type="range"] {
  flex: 1;
  padding: 0;
  width: auto;
}
#stealth-cms-editor .cms-crop-zoom-val {
  flex: 0 0 2.6rem;
  font-variant-numeric: tabular-nums;
  color: var(--ve-muted);
  font-size: 0.75rem;
  text-align: right;
}
#stealth-cms-editor .cms-props-actions { margin-top: 0.75rem; }
#stealth-cms-editor .cms-subtabs { display: none; }
@media (max-width: 900px) {
  #stealth-cms-editor .cms-workspace {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(12rem, 1fr) minmax(10rem, 38%);
  }
}
