.tool-ui {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.drop-zone {
  border: 2px dashed #2A2D3A;
  border-radius: 12px;
  padding: 2.75rem 1.5rem;
  text-align: center;
  cursor: pointer;
  background: #1A1D27;
  transition: border-color 0.2s, background-color 0.2s;
}

.drop-zone.drag-over {
  border-color: #4F8EF7;
  background: rgba(79, 142, 247, 0.08);
}

.file-label {
  color: #4F8EF7;
  cursor: pointer;
  text-decoration: underline;
  font-weight: 500;
}

.editor-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: #1A1D27;
  border: 1px solid #2A2D3A;
  border-radius: 12px;
  padding: 1.25rem;
}

.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid #2A2D3A;
  padding-bottom: 0.875rem;
}

.image-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.image-title {
  font-weight: 600;
  color: #F0F2F8;
  word-break: break-all;
}

.image-dims {
  font-size: 0.8rem;
  color: #6B7280;
}

/* Tabs */
.mode-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid #2A2D3A;
  padding-bottom: 0.75rem;
}

.mode-tab {
  background: transparent;
  border: 1px solid #2A2D3A;
  color: #6B7280;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-tab.active {
  background: #4F8EF7;
  border-color: #4F8EF7;
  color: #FFFFFF;
}

.mode-tab:hover:not(.active) {
  border-color: #4F8EF7;
  color: #F0F2F8;
}

/* Dimension inputs */
.dimensions-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 120px;
}

.input-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #F0F2F8;
}

.custom-number-input {
  background: #0F1117;
  border: 1px solid #2A2D3A;
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  color: #F0F2F8;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  outline: none;
  width: 100%;
  transition: border-color 0.2s;
}

.custom-number-input:focus {
  border-color: #4F8EF7;
}

.lock-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0F1117;
  border: 1px solid #2A2D3A;
  color: #6B7280;
  border-radius: 8px;
  width: 42px;
  height: 42px;
  margin-top: 1.35rem;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.lock-btn.locked {
  border-color: #4F8EF7;
  color: #4F8EF7;
  background: rgba(79, 142, 247, 0.1);
}

.lock-btn:hover {
  border-color: #4F8EF7;
}

/* Presets */
.preset-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.preset-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #6B7280;
  font-weight: 600;
  margin-right: 0.25rem;
}

.preset-chip {
  background: #0F1117;
  border: 1px solid #2A2D3A;
  color: #6B7280;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-size: 0.775rem;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  transition: all 0.2s;
}

.preset-chip:hover {
  border-color: #4F8EF7;
  color: #F0F2F8;
}

/* Controls Grid */
.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  border-top: 1px solid #2A2D3A;
  padding-top: 1rem;
}

.control-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.control-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.825rem;
  font-weight: 500;
  color: #F0F2F8;
}

.control-val {
  font-family: 'JetBrains Mono', monospace;
  color: #4F8EF7;
}

.custom-range {
  width: 100%;
  accent-color: #4F8EF7;
  cursor: pointer;
}

.custom-select {
  background: #0F1117;
  border: 1px solid #2A2D3A;
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  color: #F0F2F8;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
}

.custom-select:focus {
  border-color: #4F8EF7;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  text-align: center;
}

.stat-box {
  background: #0F1117;
  border: 1px solid #2A2D3A;
  border-radius: 8px;
  padding: 0.75rem 0.5rem;
}

.stat-label {
  font-size: 0.725rem;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  font-weight: 600;
  color: #F0F2F8;
}

.stat-value.highlight {
  color: #4ade80;
}

/* Previews */
.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}

@media (max-width: 640px) {
  .preview-grid {
    grid-template-columns: 1fr;
  }
}

.preview-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: #0F1117;
  border: 1px solid #2A2D3A;
  border-radius: 8px;
  padding: 0.75rem;
  overflow: hidden;
}

.preview-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.img-container {
  width: 100%;
  max-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-conic-gradient(#1A1D27 0% 25%, #141720 0% 50%) 50% / 16px 16px;
  border-radius: 6px;
  overflow: hidden;
}

.img-container img {
  max-width: 100%;
  max-height: 240px;
  object-fit: contain;
}

/* Buttons */
.btn-primary {
  background: #4F8EF7;
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-secondary {
  background: transparent;
  color: #F0F2F8;
  border: 1px solid #2A2D3A;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-secondary:hover {
  border-color: #4F8EF7;
  color: #FFFFFF;
}

.btn-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-row .btn-primary {
  flex: 2;
  min-width: 200px;
}

.btn-row .btn-secondary {
  flex: 1;
  min-width: 140px;
}
