* {
  box-sizing: border-box;
}
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #0f172a;
  color: #e5e7eb;
}
header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #1f2937;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
header h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}
header span {
  font-size: 0.85rem;
  color: #9ca3af;
}
.container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem;
}
.panel {
  flex: 1 1 320px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #020617;
  border-radius: 0.75rem;
  border: 1px solid #1f2937;
  overflow: hidden;
}
.panel-header {
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #1f2937;
  background: #020617;
}
.panel-title {
  font-size: 0.9rem;
  font-weight: 600;
}
.panel-subtitle {
  font-size: 0.75rem;
  color: #9ca3af;
}
.panel-body {
  padding: 0.75rem 1rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
textarea {
  width: 100%;
  flex: unset;
  resize: vertical;
  min-height: 260px;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid #374151;
  background: #020617;
  color: #e5e7eb;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.85rem;
  line-height: 1.4;
}
textarea:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 1px;
  border-color: #3b82f6;
}
.controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
button {
  border: none;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #1d4ed8;
  color: #e5e7eb;
  transition: background 0.15s ease, transform 0.05s ease;
  white-space: nowrap;
}
button.secondary {
  background: #111827;
  border: 1px solid #374151;
}
button:hover {
  background: #2563eb;
  transform: translateY(-0.5px);
}
button.secondary:hover {
  background: #1f2937;
}
button:active {
  transform: translateY(0);
}
.filename {
  font-size: 0.75rem;
  color: #9ca3af;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
footer {
  padding: 0.6rem 1.5rem 1rem;
  font-size: 0.75rem;
  color: #6b7280;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }
  .panel {
    flex: 1 1 100%;
  }
  textarea {
    min-height: 200px;
  }
}
.input-fields {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 12px;
}

.field-row label {
  text-align: right;
  white-space: nowrap;
  font-weight: bold;
}

.field-row input {
  width: 120px;
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  border: 1px solid #374151;
  background: #0f172a;
  color: #e5e7eb;
}

/* Slider */

.field-row.inertia-tools {
  grid-template-columns: 1fr;
  justify-items: end;
}

.inertia-tools-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
}

.inertia-tools-wrap input[type="range"] {
  width: 100%;
  padding: 0.25rem 0;
}

.inertia-presets {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.25rem;
}

.inertia-presets button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-radius: 999px;
  border: 1px solid #374151;
  background: #111827;
  color: #e5e7eb;
  font-size: 0.75rem;
  cursor: pointer;
}

.inertia-presets button:hover {
  background: #1f2937;
}
