.ceg-app,
.ceg-app * { box-sizing: border-box; }

.ceg-app {
  --ceg-accent: #5b3df5;
  margin-top: 32px;
  display: grid;
  grid-template-columns: minmax(300px, 410px) minmax(320px, 1fr);
  gap: 28px;
  align-items: start;
  background: #ffffff;
  border-radius: 28px;
  box-shadow: 0 22px 60px rgba(15, 23, 42, .12);
  padding: 28px;
  border: 1px solid #e5eaf1;
  position: relative;
  z-index: 1;
}

.ceg-app .ceg-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}


.ceg-app .ceg-event-head {
  background: linear-gradient(135deg, var(--ceg-accent), #0f172a);
  color: #fff;
  border-radius: 24px;
  padding: 22px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}

.ceg-app .ceg-event-head .ceg-kicker {
  display: inline-block;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  margin-bottom: 12px;
}

.ceg-app .ceg-event-head h3 {
  margin: 0 0 6px;
  font-size: clamp(28px, 3vw, 34px);
  line-height: 1.05;
  color: #fff !important;
}

.ceg-app .ceg-event-head p {
  margin: 0;
  opacity: .92;
  color: rgba(255,255,255,.92) !important;
}

.ceg-app .ceg-field-group label {
  display: block;
  font-weight: 800;
  margin-bottom: 8px;
  color: #0f172a !important;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.ceg-app .ceg-field-group input[type="text"],
.ceg-app .ceg-field-group input[type="file"] {
  width: 100%;
  max-width: 100%;
  border: 1px solid #cdd8e5 !important;
  border-radius: 16px !important;
  padding: 14px 16px !important;
  background: #fff !important;
  min-height: 54px;
  color: #0f172a !important;
  box-shadow: inset 0 1px 2px rgba(15,23,42,.04);
}

.ceg-app .ceg-field-group input[type="text"]::placeholder {
  color: #64748b !important;
}

.ceg-app .ceg-field-group input[type="text"]:focus,
.ceg-app .ceg-field-group input[type="file"]:focus {
  outline: none;
  border-color: var(--ceg-accent) !important;
  box-shadow: 0 0 0 3px rgba(91,61,245,.14);
}

.ceg-app .ceg-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.ceg-app .ceg-btn,
.ceg-app .ceg-download {
  appearance: none !important;
  -webkit-appearance: none !important;
  border-radius: 16px !important;
  padding: 14px 12px !important;
  min-height: 56px;
  font-weight: 800 !important;
  font-size: 15px !important;
  line-height: 1.1;
  cursor: pointer;
  text-align: center;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease, background .15s ease;
  box-shadow: none;
  text-transform: none !important;
}

.ceg-app .ceg-btn {
  border: 2px solid #63d9ff !important;
  background: linear-gradient(180deg, #ffffff 0%, #eefbff 100%) !important;
  color: #0f172a !important;
  text-shadow: none !important;
}

.ceg-app .ceg-btn:hover,
.ceg-app .ceg-btn:focus {
  background: linear-gradient(180deg, #f8feff 0%, #dcf7ff 100%) !important;
  border-color: #22d3ee !important;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(34,211,238,.16) !important;
  color: #0f172a !important;
}

.ceg-app .ceg-download {
  border: 2px solid #22d3ee !important;
  background: linear-gradient(135deg, var(--ceg-accent), #0f172a) !important;
  color: #ffffff !important;
  width: 100%;
  text-shadow: 0 1px 1px rgba(0,0,0,.25);
}

.ceg-app .ceg-download:hover,
.ceg-app .ceg-download:focus {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(91,61,245,.24) !important;
}

.ceg-app .ceg-help {
  margin: 4px 0 0;
  color: #475569 !important;
  font-size: 14px;
  line-height: 1.5;
}

.ceg-app .ceg-right {
  min-width: 0;
}

.ceg-app .ceg-canvas-shell {
  background: radial-gradient(circle at top, rgba(20,40,100,.25), rgba(15,23,42,1) 58%);
  border-radius: 28px;
  padding: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 560px;
  overflow: hidden;
}

.ceg-app .ceg-canvas-preview {
  max-width: 100%;
  width: auto;
  height: auto;
  display: block;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,.25);
  touch-action: none;
}

.ceg-message {
  padding: 16px;
  border-radius: 14px;
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
}

@media (max-width: 900px) {
  .ceg-app {
    grid-template-columns: 1fr;
    padding: 20px;
    margin-top: 20px;
  }

  .ceg-app .ceg-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ceg-app .ceg-canvas-shell {
    min-height: 420px;
    padding: 16px;
  }
}

.ceg-app .ceg-field-group input[type="file"] {
  padding: 10px 12px !important;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
}

.ceg-app .ceg-field-group input[type="file"]::file-selector-button,
.ceg-app .ceg-field-group input[type="file"]::-webkit-file-upload-button {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  margin-right: 12px;
  background: linear-gradient(135deg, var(--ceg-accent), #0f172a);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.ceg-app .ceg-controls {
  margin-top: 2px;
}

.ceg-app .ceg-btn {
  border: 2px solid #1fc8ea !important;
  background: linear-gradient(180deg, #ffffff 0%, #dbf7ff 100%) !important;
  color: #0b1324 !important;
  box-shadow: 0 6px 18px rgba(34,211,238,.10) !important;
}

.ceg-app .ceg-btn:hover,
.ceg-app .ceg-btn:focus {
  background: linear-gradient(180deg, #ffffff 0%, #c6f2ff 100%) !important;
  box-shadow: 0 12px 24px rgba(34,211,238,.18) !important;
}

.ceg-app .ceg-btn:disabled,
.ceg-app .ceg-download:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.ceg-app .ceg-footer-credit {
  grid-column: 1 / -1;
  margin-top: 6px;
  padding-top: 4px;
  text-align: center;
  color: #64748b !important;
  font-size: 14px;
}

.ceg-app .ceg-footer-credit a {
  color: var(--ceg-accent) !important;
  font-weight: 800;
  text-decoration: none;
}

.ceg-app .ceg-footer-credit a:hover,
.ceg-app .ceg-footer-credit a:focus {
  text-decoration: underline;
}
