.vector-window {
  width: 100%;
  height: calc(100dvh - 32px);
  max-width: 1800px;
  max-height: calc(100dvh - 32px);
}

.vector-layout {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.vector-area {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--background);
}

.vector-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  cursor: crosshair;
}

.vector-viewport[data-tool="select"] {
  cursor: default;
}

.vector-viewport[data-tool="hand"] {
  cursor: grab;
}

.vector-viewport[data-tool="hand"]:active {
  cursor: grabbing;
}

.vector-stage {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  flex-shrink: 0;
  width: var(--vector-width);
  height: var(--vector-height);
  min-width: var(--vector-width);
  min-height: var(--vector-height);
  max-width: none;
  max-height: none;
  transform-origin: 0 0;
  overflow: hidden;
  box-shadow: 0 8px 40px var(--shadow);
}

.vector-viewport > svg.vector-stage {
  width: var(--vector-width);
  height: var(--vector-height);
  max-width: none;
  max-height: none;
}

.vector-resize-nw,
.vector-resize-se {
  cursor: nwse-resize;
}

.vector-resize-ne,
.vector-resize-sw {
  cursor: nesw-resize;
}

.vector-toolbar-dock {
  position: absolute;
  bottom: 24px;
  left: 50%;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100% - 24px);
  transform: translateX(-50%);
}

.vector-toolbar,
.vector-history-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 6px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 8px 32px var(--shadow);
}

.vector-toolbar {
  overflow-x: auto;
  overflow-y: hidden;
}

.vector-history-toolbar {
  flex-shrink: 0;
}

.vector-history-toolbar button:disabled {
  opacity: 0.2;
  cursor: default;
  transform: none;
}

.vector-zoom-label {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 8;
  min-width: 56px;
  padding: 6px 12px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--sidebar);
  color: var(--secondary);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.vector-inspector {
  display: flex;
  flex-direction: column;
  flex: 0 0 280px;
  gap: 16px;
  width: 280px;
  min-width: 0;
  min-height: 0;
  padding: 12px;
  border-left: 2px solid var(--border);
  background: var(--sidebar);
  overflow-x: hidden;
  overflow-y: auto;
}

.vector-properties,
.vector-layers {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.vector-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.vector-color-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 36px;
  color: var(--secondary);
  font-size: 12px;
}

.vector-color-field > span {
  flex-shrink: 0;
  width: 44px;
}

.vector-color-field input[type="color"] {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--transparent);
  overflow: hidden;
  cursor: pointer;
}

.vector-color-field input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.vector-color-field input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 4px;
}

.vector-color-field input[type="text"] {
  flex: 1;
  min-width: 0;
  width: 100%;
  min-height: 32px;
  padding: 6px 8px;
  border: 2px solid var(--border);
  border-radius: 6px;
  outline: none;
  background: var(--background);
  color: var(--text);
  font-size: 12px;
  text-transform: uppercase;
}

.vector-color-field input[type="text"]:focus {
  border-color: var(--brand);
}

.vector-inspector textarea {
  width: 100%;
  min-height: 80px;
  padding: 8px;
  border: 2px solid var(--border);
  border-radius: 6px;
  outline: none;
  background: var(--background);
  color: var(--text);
  font-size: 14px;
  resize: vertical;
}

.vector-inspector textarea:focus {
  border-color: var(--brand);
}

.vector-alignment-tools {
  display: flex;
  justify-content: space-between;
  gap: 2px;
  min-width: 0;
  padding: 4px;
  border-radius: 6px;
  background: var(--background);
}

.vector-alignment-tools button {
  width: 28px;
  height: 28px;
  padding: 4px;
}

.vector-alignment-tools svg {
  width: 16px;
  height: 16px;
}

.vector-layer-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 320px;
  overflow-y: auto;
}

.vector-layer-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 36px;
  padding: 4px;
  border: 2px solid var(--transparent);
  border-radius: 6px;
  background: var(--surface);
}

.vector-layer-row.active {
  border-color: var(--brand);
  background: var(--selected);
}

.vector-layer-row .icon-button {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 4px;
}

.vector-layer-row svg {
  width: 14px;
  height: 14px;
}

.vector-layer-name {
  flex: 1;
  min-width: 0;
  padding: 4px;
  color: var(--text);
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vector-inspector-empty {
  padding: 16px 4px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.vector-inspector-toggle {
  display: none;
}

.vector-preview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: 160px;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--sidebar);
  overflow: hidden;
  transition: background 120ms ease, border-color 160ms ease;
}

.vector-preview:hover {
  background: var(--surface);
  border-color: var(--muted);
}

.vector-preview img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.vector-preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 160px;
  color: var(--muted);
  font-size: 14px;
}

.vector-preview-placeholder svg {
  width: 28px;
  height: 28px;
}

.vector-preview-placeholder small {
  font-size: 12px;
}

.vector-inspector .sketch-range-control input[type="range"] {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  touch-action: none;
}