.ucm-app {
  box-sizing: border-box;
  position: relative;
  min-height: 360px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  overflow: hidden;
  background: #f8fafc;
  color: #111827;
  font-family: Quicksand, "Atkinson Hyperlegible", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ucm-app *,
.ucm-app *::before,
.ucm-app *::after {
  box-sizing: border-box;
}

.ucm-toolbar {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
}

.ucm-toolbar-title {
  font-weight: 800;
  color: var(--ucm-primary, #1f2937);
  margin-right: 8px;
  white-space: nowrap;
}

.ucm-select,
.ucm-button {
  min-height: 32px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #ffffff;
  color: #111827;
  font-size: 13px;
  line-height: 1;
  font-family: inherit;
}

.ucm-select {
  max-width: 180px;
  padding: 0 28px 0 10px;
}

.ucm-button {
  padding: 0 12px;
  cursor: pointer;
}

.ucm-button:hover,
.ucm-select:hover {
  border-color: var(--ucm-accent, #f59e0b);
}

.ucm-icon-button {
  width: 34px;
  padding: 0;
  font-size: 18px;
}

.ucm-button-danger {
  color: #991b1b;
}

.ucm-status {
  margin-left: auto;
  color: #64748b;
  font-size: 12px;
  white-space: nowrap;
}

.ucm-canvas-host {
  width: 100%;
  height: calc(100% - 48px);
  min-height: 312px;
}

.ucm-app:not(:has(.ucm-toolbar)) .ucm-canvas-host {
  height: 100%;
}

.ucm-error {
  padding: 18px;
  color: #991b1b;
  background: #fef2f2;
}

.ucm-share-dialog {
  position: absolute;
  z-index: 20;
  right: 18px;
  top: 64px;
  width: min(520px, calc(100% - 36px));
  padding: 16px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.22);
  color: #0f172a;
}

.ucm-share-dialog p {
  margin: 6px 0 10px;
  color: #475569;
  font-size: 13px;
}

.ucm-share-input {
  box-sizing: border-box;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
}

.ucm-share-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 10px;
}

@media (max-width: 720px) {
  .ucm-toolbar {
    height: auto;
    min-height: 48px;
    flex-wrap: wrap;
  }

  .ucm-toolbar-title {
    width: 100%;
  }

  .ucm-status {
    margin-left: 0;
  }

  .ucm-canvas-host {
    height: calc(100% - 96px);
  }
}
