/* TZ v5 B-12 — Blocks constructor + edit modal styles. */

.cw-bk-host { margin-bottom: 16px; }
.cw-bk-card {
  padding: 14px;
  background: rgba(168, 85, 247, 0.05);
  border: 1px solid rgba(168, 85, 247, 0.22);
  border-radius: 10px;
}
.cw-bk-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.cw-bk-title {
  font: 600 13px/1.2 inherit;
  color: rgba(216, 180, 254, 0.95);
}
.cw-bk-head-actions {
  display: flex;
  gap: 6px;
}
.cw-bk-preset-select {
  padding: 5px 8px;
  background: rgba(0, 0, 0, 0.20);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.85);
  font: 11.5px/1.2 inherit;
}
.cw-bk-auto-row {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.cw-bk-auto-row .cw-bk-btn-ghost {
  flex: 1;
  text-align: center;
}
.cw-bk-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cw-bk-row {
  display: grid;
  grid-template-columns: 16px 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  cursor: default;
}
.cw-bk-row.is-dragging { opacity: 0.4; }
.cw-bk-row.is-drop-target { border-color: rgba(168, 85, 247, 0.50); background: rgba(168, 85, 247, 0.10); }
.cw-bk-handle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.30);
  cursor: grab;
}
.cw-bk-handle:active { cursor: grabbing; }
.cw-bk-name {
  font: 500 12.5px/1.2 inherit;
  color: rgba(255, 255, 255, 0.92);
  overflow: hidden;
  text-overflow: ellipsis;
}
.cw-bk-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.55);
}
.cw-bk-intent {
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}
.cw-bk-intent--commercial { background: rgba(34, 197, 94, 0.14); color: rgba(187, 247, 208, 0.94); }
.cw-bk-intent--informational { background: rgba(56, 189, 248, 0.14); color: rgba(186, 230, 253, 0.94); }
.cw-bk-intent--transactional { background: rgba(245, 158, 11, 0.14); color: rgba(254, 215, 170, 0.94); }
.cw-bk-intent--social-proof { background: rgba(168, 85, 247, 0.14); color: rgba(216, 180, 254, 0.94); }
.cw-bk-intent--navigational { background: rgba(99, 102, 241, 0.14); color: rgba(199, 210, 254, 0.94); }
.cw-bk-range {
  padding: 1px 5px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
}
.cw-bk-kw { padding: 1px 5px; }
.cw-bk-done {
  color: rgba(34, 197, 94, 0.95);
  font-weight: 600;
}
.cw-bk-actions {
  display: inline-flex;
  gap: 2px;
}
.cw-bk-btn-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  cursor: pointer;
  transition: background 100ms ease, color 100ms ease;
}
.cw-bk-btn-icon:hover { background: rgba(255, 255, 255, 0.06); color: rgba(255, 255, 255, 0.95); }
.cw-bk-btn-danger:hover { background: rgba(239, 68, 68, 0.16); color: rgba(254, 202, 202, 0.95); }
.cw-bk-empty {
  padding: 14px;
  text-align: center;
  color: rgba(255, 255, 255, 0.45);
  font-size: 11.5px;
  border: 1px dashed rgba(255, 255, 255, 0.10);
  border-radius: 6px;
}
.cw-bk-foot {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.cw-bk-btn-ghost {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.78);
  font: 500 12px/1.2 inherit;
  cursor: pointer;
}
.cw-bk-btn-ghost:disabled { opacity: 0.4; cursor: not-allowed; }
.cw-bk-btn-ghost:hover:not(:disabled) {
  background: rgba(168, 85, 247, 0.10);
  border-color: rgba(168, 85, 247, 0.35);
  color: rgba(255, 255, 255, 0.95);
}
.cw-bk-btn-primary {
  margin-left: auto;
  padding: 6px 14px;
  background: linear-gradient(145deg, rgba(168, 85, 247, 0.85), rgba(139, 92, 246, 0.85));
  border: 0;
  border-radius: 7px;
  color: #fff;
  font: 600 12px/1.2 inherit;
  cursor: pointer;
}
.cw-bk-btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.cw-bk-btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.cw-bk-status {
  margin-top: 8px;
  min-height: 14px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
}
.cw-bk-status--ok { color: rgba(34, 197, 94, 0.92); }
.cw-bk-status--err { color: rgba(239, 68, 68, 0.92); }

/* ─── Block edit modal ─────────────────────────────────────────── */
.cw-bm-modal[hidden] { display: none; }
.cw-bm-modal {
  position: fixed;
  inset: 0;
  z-index: 9200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 7vh 16px 24px;
}
.cw-bm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 16, 0.72);
}
.cw-bm-dialog {
  position: relative;
  width: min(540px, 100%);
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  background: #1a1d24;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.60);
  overflow: hidden;
}
.cw-bm-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.cw-bm-title {
  margin: 0;
  font: 600 15px/1.2 "Playfair Display", Georgia, serif;
  color: rgba(255, 255, 255, 0.94);
}
.cw-bm-close {
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 16px;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
}
.cw-bm-close:hover { background: rgba(255, 255, 255, 0.06); color: rgba(255, 255, 255, 0.95); }
.cw-bm-body { padding: 16px 18px; overflow-y: auto; flex: 1; }
.cw-bm-section + .cw-bm-section { margin-top: 12px; }
.cw-bm-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.cw-bm-label {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.cw-bm-hint {
  color: rgba(255, 255, 255, 0.35);
  text-transform: none;
  font-weight: normal;
}
.cw-bm-input, .cw-bm-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.92);
  font: 12.5px/1.45 inherit;
  resize: vertical;
}
.cw-bm-input:focus, .cw-bm-textarea:focus {
  outline: 2px solid rgba(168, 85, 247, 0.50);
  border-color: rgba(168, 85, 247, 0.50);
}
.cw-bm-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.18);
}
.cw-bm-btn-ghost {
  padding: 7px 14px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.75);
  font: 500 12.5px/1.2 inherit;
  cursor: pointer;
}
.cw-bm-btn-ghost:hover { background: rgba(255, 255, 255, 0.05); color: rgba(255, 255, 255, 0.95); }
.cw-bm-btn-primary {
  padding: 7px 16px;
  background: linear-gradient(145deg, rgba(168, 85, 247, 0.85), rgba(139, 92, 246, 0.85));
  border: 0;
  border-radius: 7px;
  color: #fff;
  font: 600 12.5px/1.2 inherit;
  cursor: pointer;
}
.cw-bm-btn-primary:hover { filter: brightness(1.08); }
body.cw-bm-modal-open { overflow: hidden; }
