/* ============================================================
   Canva Page (Dargan Forum) — EPW-PRO-299
   ============================================================ */
body.canva-active #expanded-title,
body.canva-active #detail-panel,
body.canva-active #bg-layer,
body.canva-active #eoins-stuff,
body.canva-active #epw-new-item-fab,
body.canva-active #c4-link { display: none !important; }

/* Hide speech-to-text mic buttons */
#canva-view .epw-stt-mic { display: none !important; }

/* Design grid inside expanded event card */
.cnv-design-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  padding: 16px 0;
}

.cnv-design-card {
  border: 1px solid #e8e8f0;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.cnv-design-card:hover {
  box-shadow: 0 3px 12px rgba(0,0,0,0.08);
  border-color: #ea580c;
}

/* Thumbnail */
.cnv-design-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #f1f5f9;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cnv-design-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cnv-design-thumb-placeholder {
  font-size: 12px;
  color: #94a3b8;
}

/* Info section */
.cnv-design-info {
  padding: 10px 12px 6px;
}
.cnv-design-title {
  font-weight: 600;
  font-size: 13px;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cnv-design-type {
  font-size: 11px;
  color: #ea580c;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 2px;
}
.cnv-design-meta {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

/* Action buttons */
.cnv-design-actions {
  display: flex;
  gap: 6px;
  padding: 6px 12px 10px;
}
.cnv-action-btn {
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #e2e8f0;
  color: #475569;
  background: #f8fafc;
  transition: all 0.15s;
}
.cnv-action-btn:hover {
  border-color: #ea580c;
  color: #ea580c;
  background: #fff7ed;
}
.cnv-action-edit {
  background: #ea580c;
  color: #fff;
  border-color: #ea580c;
}
.cnv-action-edit:hover {
  background: #c2410c;
  border-color: #c2410c;
  color: #fff;
}
.cnv-action-refresh {
  padding: 5px 8px;
  font-size: 13px;
  min-width: unset;
  background: #f0fdf4;
  color: #16a34a;
  border-color: #bbf7d0;
}
.cnv-action-refresh:hover {
  background: #16a34a;
  color: #fff;
  border-color: #16a34a;
}

/* URL-paste link form */
.cnv-link-form {
  padding: 16px 0 8px;
}
.cnv-link-form--hidden {
  display: none;
}
.cnv-link-prompt {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 10px;
}
.cnv-link-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.cnv-link-type {
  padding: 7px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  background: #fff;
  color: #334155;
  flex-shrink: 0;
}
.cnv-link-input {
  flex: 1;
  min-width: 200px;
  padding: 7px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
}
.cnv-link-input:focus, .cnv-link-type:focus {
  outline: none;
  border-color: #ea580c;
}
.cnv-link-btn {
  padding: 7px 16px;
  border-radius: 6px;
  border: none;
  background: #ea580c;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.cnv-link-btn:hover { background: #c2410c; }
.cnv-link-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.cnv-link-error {
  font-size: 11px;
  color: #dc2626;
  margin-top: 6px;
  min-height: 16px;
}
.cnv-add-design-toggle {
  padding: 4px 0 8px;
}

/* Lightbox overlay for inline view */
.cnv-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
  align-items: center;
  justify-content: center;
}
.cnv-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  cursor: pointer;
}
.cnv-lightbox-content {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}
.cnv-lightbox-content h3 {
  margin: 0 0 12px;
  font-size: 15px;
  color: #1e293b;
  padding-right: 30px;
}
.cnv-lightbox-content img {
  max-width: 100%;
  max-height: 75vh;
  border-radius: 6px;
  display: block;
}
.cnv-lightbox-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: #64748b;
  cursor: pointer;
  line-height: 1;
}
.cnv-lightbox-close:hover {
  color: #ea580c;
}

/* Progressive button states */
.cnv-btn-disabled {
  opacity: 0.3 !important;
  pointer-events: none !important;
  cursor: not-allowed !important;
}
.cnv-action-map.cnv-btn-done {
  background: #7c3aed;
  color: #fff;
  border-color: #7c3aed;
}
.cnv-action-map.cnv-btn-done::after { content: ' ✓'; }
.cnv-action-content-map.cnv-btn-done {
  background: #ea580c;
  color: #fff;
  border-color: #ea580c;
}
.cnv-action-content-map.cnv-btn-done::after { content: ' ✓'; }

/* Map Fields button */
.cnv-action-map {
  background: #f0e8ff;
  color: #7c3aed;
  border-color: #7c3aed;
}
.cnv-action-map:hover { background: #7c3aed; color: #fff; border-color: #7c3aed; }

.cnv-action-content-map {
  background: #fff7ed;
  color: #ea580c;
  border-color: #ea580c;
}
.cnv-action-content-map:hover { background: #ea580c; color: #fff; border-color: #ea580c; }

/* Step badge in modal header */
.cnv-step-badge {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 10px;
}

/* Content Mapping modal — narrower body (no overlay thumbnail needed) */
.cnv-content-map-content {
  max-width: 780px;
}
.cnv-content-map-body {
  flex-direction: column !important;
}
.cnv-content-map-body .cnv-map-thumb-wrap {
  max-height: 140px;
  overflow: hidden;
  border-radius: 6px;
  margin-bottom: 16px;
}
.cnv-content-map-body .cnv-map-thumb-wrap img {
  width: 100%;
  object-fit: cover;
  object-position: top;
}
.cnv-slot-pill {
  display: inline-block;
  color: #fff;
  border-radius: 12px;
  padding: 3px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.cnv-content-map-row td { vertical-align: middle; }
.cnv-content-map-meta {
  font-size: 11px;
  color: #64748b;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cnv-content-spk-select { width: 200px; }

/* Mapping modal */
.cnv-map-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.cnv-map-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  cursor: pointer;
}
.cnv-map-content {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 12px;
  width: min(960px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
  overflow: hidden;
}
.cnv-map-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid #f0f0f4;
}
.cnv-map-header h3 { margin: 0; font-size: 14px; flex: 1; }
.cnv-map-confirmed-badge {
  padding: 2px 10px; border-radius: 10px; font-size: 11px; font-weight: 700;
  background: #e3fcef; color: #006644;
}
.cnv-map-unconfirmed-badge {
  padding: 2px 10px; border-radius: 10px; font-size: 11px; font-weight: 700;
  background: #fff3cd; color: #856404;
}
.cnv-map-body {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex: 1;
}
/* Thumbnail with overlay */
.cnv-map-thumb-wrap {
  position: relative;
  background: #f8fafc;
  border-bottom: 1px solid #f0f0f4;
  line-height: 0;
}
.cnv-map-thumb-wrap img {
  width: 100%;
  display: block;
  max-height: 340px;
  object-fit: contain;
}
#cnv-map-overlays {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.cnv-map-overlay-box {
  position: absolute;
  border: 2px solid;
  border-radius: 3px;
  box-sizing: border-box;
  transition: box-shadow 0.15s;
}
.cnv-map-overlay-box--highlight {
  box-shadow: 0 0 0 3px rgba(255,255,255,0.6) inset;
}
.cnv-map-overlay-label {
  position: absolute;
  top: -18px;
  left: 0;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
  line-height: 1.6;
  pointer-events: none;
}
/* Mapping table */
.cnv-map-table-wrap {
  padding: 14px 20px;
}
.cnv-map-instruction {
  font-size: 12px;
  color: #64748b;
  margin: 0 0 10px;
}
.cnv-map-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.cnv-map-table th {
  text-align: left;
  font-size: 11px;
  color: #64748b;
  padding: 4px 8px;
  border-bottom: 1px solid #e8e8f0;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.cnv-map-table td {
  padding: 5px 8px;
  border-bottom: 1px solid #f4f4f8;
  vertical-align: middle;
}
.cnv-map-row:hover td { background: #fafaff; }
.cnv-map-type-badge {
  display: inline-block;
  padding: 3px 0;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  min-width: 52px;
}
.cnv-map-select, .cnv-map-slot-select {
  font-size: 11px;
  padding: 3px 6px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
}
.cnv-map-value {
  color: #64748b;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Field type label + Dewey badge above the select */
.cnv-ft-label {
  font-size: 10px;
  color: #94a3b8;
  margin-bottom: 3px;
  line-height: 1.3;
}
.cnv-dewey-badge {
  display: inline-block;
  background: #ede9fe;
  color: #5b21b6;
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* Content Mapping column */
.cnv-map-content-cell {
  min-width: 160px;
}
.cnv-content-map-name {
  font-weight: 600;
  color: #1e293b;
  font-size: 11px;
}
.cnv-content-map-dewey {
  display: inline-block;
  background: #e0f2fe;
  color: #0369a1;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 700;
  margin-left: 4px;
  letter-spacing: 0.2px;
}
.cnv-content-map-none {
  color: #cbd5e1;
}

.cnv-map-footer {
  padding: 12px 20px;
  border-top: 1px solid #f0f0f4;
  display: flex;
  align-items: center;
}

/* Responsive */
@media (max-width: 768px) {
  .cnv-design-grid {
    grid-template-columns: 1fr;
  }
}
