* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: system-ui, -apple-system, sans-serif;
  background: #f5f5f5;
  color: #222;
}

.container {
  padding: 2rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  max-width: 1240px;
  width: 100%;
}

h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.subtitle {
  margin-bottom: 2rem;
  color: #555;
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 3rem;
  align-items: stretch;
}

.inputs {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field[hidden] {
  display: none;
}

.dimension-mode {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border: 0;
}

.dimension-mode legend {
  margin-bottom: 0.4rem;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #444;
}

.radio-option input {
  margin: 0;
}

.tabs-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.tabs-title {
  font-size: 1rem;
  font-weight: 600;
}

.field-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #444;
}

.field input,
.field select {
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  width: 100%;
  transition: border-color 0.2s;
}

.field input:focus {
  outline: none;
  border-color: #2563eb;
}

.field-info {
  font-size: 0.8125rem;
  color: #666;
}

.preview-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.preview-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #444;
}

.preview-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  background: #f9fafb;
  border: 1px dashed #d1d5db;
  border-radius: 8px;
  padding: 1rem;
}

.preview-area canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 200px;
}

.connection-check {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.connection-check canvas {
  display: block;
  width: 100%;
  height: 280px;
  background: #f9fafb;
  border: 1px dashed #d1d5db;
  border-radius: 8px;
}

.connection-check .download-btn {
  align-self: flex-start;
  margin-top: 0;
}

.preview-rect {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2563eb;
  color: #fff;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: width 0.2s, height 0.2s;
}

.preview-info {
  font-size: 0.8125rem;
  color: #666;
}

.dimension-summary {
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem;
  background: #f9fafb;
  border-radius: 8px;
}

.construction-validation {
  display: grid;
  gap: 0.4rem;
  padding: 0.75rem;
  border-radius: 8px;
  background: #fffbeb;
}

.construction-validation[hidden],
.construction-validation p[hidden] {
  display: none;
}

.validation-errors,
.validation-warnings {
  font-size: 0.8125rem;
  line-height: 1.4;
}

.validation-errors {
  color: #b91c1c;
}

.validation-warnings {
  color: #92400e;
}

.preview-3d-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 2rem;
}

.preview-3d {
  width: 100%;
  height: 440px;
  overflow: hidden;
  background: #f9fafb;
  border: 1px dashed #d1d5db;
  border-radius: 8px;
  cursor: grab;
  touch-action: none;
}

.preview-3d:active {
  cursor: grabbing;
}

.preview-3d canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.download-btn {
  margin-top: 0.75rem;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #222;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.download-btn:hover {
  background: #f9fafb;
  border-color: #2563eb;
}

#download-btn {
  min-height: 3rem;
  padding: 0.8rem 1.25rem;
  border-color: #1d4ed8;
  background: #2563eb;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
}

#download-btn:hover {
  border-color: #1e40af;
  background: #1d4ed8;
}

#download-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 760px) {
  .layout {
    grid-template-columns: 1fr;
  }
}.feedback-section {
  margin-top: 24px;
  padding: 18px;
  text-align: center;
  border-top: 1px solid #e2e2e2;
}

.feedback-question {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
}

.feedback-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.feedback-btn {
  min-width: 54px;
  height: 42px;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  background: #ffffff;
  font-size: 22px;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.feedback-btn:hover {
  background: #f4f4f4;
  transform: translateY(-1px);
}

.feedback-btn:active {
  transform: translateY(0);
}

.feedback-message {
  min-height: 20px;
  margin: 10px 0 0;
  font-size: 14px;
}
