:host {
  display: block;
}

.theme-grid-editor__frame {
  display: grid;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(circle at top, hsl(var(--primary) / 0.05), transparent 45%),
    linear-gradient(180deg, hsl(var(--background) / 0.98), hsl(var(--card) / 0.98));
}

.theme-grid-editor__grid {
  position: absolute;
  inset: 0;
  display: grid;
  pointer-events: none;
}

.theme-grid-editor__cell {
  border-top: 1px solid hsl(var(--border) / 0.65);
  border-left: 1px solid hsl(var(--border) / 0.65);
}

.theme-grid-editor__item {
  position: relative;
  z-index: 1;
  padding: 0.35rem;
}

.theme-grid-editor__item-body {
  height: 100%;
  border: 1px solid hsl(var(--border) / 0.8);
  border-radius: 0.5rem;
  background: linear-gradient(180deg, hsl(var(--card) / 0.98), hsl(var(--background) / 0.98));
  box-shadow: 0 1px 2px rgb(0 0 0 / 8%);
  cursor: grab;
  padding: 0.9rem;
}

.theme-grid-editor__item:active .theme-grid-editor__item-body {
  cursor: grabbing;
}

.theme-grid-editor__item--selected .theme-grid-editor__item-body {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 1px hsl(var(--primary));
}

.theme-grid-editor__item--disabled .theme-grid-editor__item-body {
  cursor: not-allowed;
}

.theme-grid-editor__item:focus-visible {
  outline: none;
}

.theme-grid-editor__item:focus-visible .theme-grid-editor__item-body {
  box-shadow: 0 0 0 2px hsl(var(--primary) / 0.25);
}

.theme-grid-editor__handle {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  height: 0.95rem;
  width: 0.95rem;
  border: 0;
  border-radius: 0.25rem;
  background: hsl(var(--primary));
  box-shadow: 0 0 0 2px hsl(var(--background));
  cursor: nwse-resize;
}

.theme-grid-editor__disabled {
  border: 1px dashed hsl(var(--border));
}
