/* === ベース設定 === */
body {
  font-family: sans-serif;
  padding: 1rem;
  background: #f9f9f9;
  max-width: 500px;
  margin: auto;
}

/* === 入力系共通スタイル === */
textarea,
input,
select,
button {
  display: block;
  width: 100%;
  margin: 0.4rem 0;
  padding: 0.5rem;
  font-size: 0.9rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  box-sizing: border-box;
  background-color: #fff;
}

/* === ボタン共通スタイル === */
button {
  background: #007bff;
  color: white;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button:hover {
  background: #0056b3;
}

button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

/* === 特殊ボタン（ビビッド緑） === */
#analyzeButton {
  background-color: #000000;    /* 黒背景 */
  color: #ffffff;               /* 白文字 */
  border: none;
  border-radius: 6px;
  padding: 0.8rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#analyzeButton:hover:enabled {
  background-color: #222222;    /* 少し明るい黒（ホバー） */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

#analyzeButton:disabled {
  background-color: #999999;    /* 無効時はグレー */
  color: #ffffff;
  cursor: not-allowed;
  opacity: 0.6;
}

/* === セレクトボックスカスタマイズ === */
select {
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg fill="%23999" height="20" viewBox="0 0 24 24" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
}

/* === レイアウト系 === */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 1rem;
}

.header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.record-settings {
  display: flex;
  align-items: center;
  font-size: 0.8rem;
  gap: 0.3rem;
}

.inline-group {
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
}

.inline-group input,
.inline-group select {
  flex: 1;
  margin: 0;
}

/* 音声録音設定ラベル */
.record-duration {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  align-items: center;
  background-color: #f8f8f8;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  box-shadow: 0 0 5px rgba(0,0,0,0.1);
  font-size: 0.8rem;
}

.record-duration label {
  margin-right: 0.3rem;
  font-weight: bold;
}

.record-duration input {
  width: 3.5rem;
  padding: 0.2rem;
  font-size: 0.8rem;
}

/* テキスト出力表示枠（ChatGPTコスト等） */
#cost {
  background: white;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  white-space: pre-wrap;
  margin-top: 0.5rem;
}

/* 認識結果（textarea） */
.recognized-container {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

#recognizedText {
  width: 85%;
  resize: vertical;
  padding: 0.4rem 0.6rem;
  font-size: 1rem;
  background-color: #ddd;
  border: none;
  border-radius: 6px;
  min-height: 4.2rem;     /* ← ✅ 高さを2行分くらい確保 */
  box-sizing: border-box;
  flex-shrink: 0;
}

#clearRecognizedText {
  height: 4.2rem;         /* ← ✅ ボタン高さも合わせて統一 */
  padding: 0.4rem 0.6rem;
  font-size: 1rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  box-sizing: border-box;
  flex: 1;
  cursor: pointer;
  flex-shrink: 0;
}


/* === モバイル対応 === */
@media (max-width: 400px) {
  .inline-group {
    flex-direction: column;
  }
}
