:root {
  color-scheme: light;
  --bg: #f6f5f2;
  --surface: #ffffff;
  --text: #262320;
  --muted: #6b6259;
  --accent: #b3603f;
  --accent-dark: #8a4530;
  --border: #e4ddd3;
  --result-bg: #fbf7f0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  line-height: 1.7;
}

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.app-header h1 {
  font-size: 1.4rem;
  margin-bottom: 8px;
  color: var(--accent-dark);
}

.app-header .lead {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 0;
}

.intro-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.intro-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--muted);
}

.intro-form input[type="text"],
.intro-form textarea {
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  resize: vertical;
}

.tone-select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.tone-select legend {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0 4px;
}

.tone-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text);
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

button {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}

button#submit-btn {
  background: var(--accent-dark);
  color: #fff;
}

button#submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}

.result {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result-card {
  background: var(--result-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
}

.result-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.result-head h2 {
  font-size: 1.05rem;
  margin: 0;
  color: var(--accent-dark);
}

.copy-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 12px;
  font-size: 0.8rem;
}

.char-count {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 4px 0 8px;
}

.script-text {
  white-space: pre-wrap;
  font-size: 0.95rem;
  margin: 0;
}

.disclaimer {
  margin-top: 20px;
  font-size: 0.8rem;
  color: var(--muted);
}

@media (max-width: 480px) {
  .app {
    padding: 16px 12px 40px;
  }
}
