* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f4f4;
  color: #222;
}

.wrap {
  width: min(1100px, calc(100% - 32px));
  margin: 32px auto;
}

h1, h2, h3 {
  line-height: 1.2;
}

.intro {
  max-width: 760px;
}

.card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 14px;
  padding: 22px;
  margin: 18px 0;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04);
}

.settings {
  display: grid;
  gap: 14px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 0;
}

.tab,
button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: #222;
  color: #fff;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
}

.tab {
  background: #ddd;
  color: #222;
}

.tab.active {
  background: #222;
  color: #fff;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

form {
  display: grid;
  gap: 16px;
  max-width: 720px;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  font: inherit;
  border: 1px solid #bbb;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

textarea {
  resize: vertical;
}

.prompt-box {
  margin-top: 22px;
  border: 1px solid #ddd;
  background: #fafafa;
  border-radius: 12px;
  padding: 14px;
}

.prompt-box summary {
  cursor: pointer;
  font-weight: 800;
}

.prompt-box p {
  margin: 12px 0;
}

.prompt-box pre {
  min-height: 0;
  max-height: 480px;
  white-space: pre-wrap;
}

.placeholder {
  font-weight: 800;
}

.timer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  padding: 14px;
  border-radius: 10px;
  background: #f8f8f8;
  border: 1px solid #e1e1e1;
}

#timer {
  font-variant-numeric: tabular-nums;
  font-size: 1.25rem;
}

.result-message {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #f0f0f0;
  white-space: pre-wrap;
}

.result-message.success {
  background: #e8f8ed;
}

.result-message.error {
  background: #ffecec;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

#resultImage {
  display: block;
  max-width: 100%;
  margin-top: 12px;
  border-radius: 10px;
}

pre {
  overflow: auto;
  background: #111;
  color: #f4f4f4;
  padding: 16px;
  border-radius: 10px;
  min-height: 200px;
}

code {
  background: #eee;
  padding: 2px 5px;
  border-radius: 5px;
}

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


.environment-switch {
  display: grid;
  gap: 10px;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 14px;
  margin: 0;
}

.environment-switch legend {
  font-weight: 800;
  padding: 0 6px;
}

.radio-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.radio-row input {
  width: auto;
}
