/* =========================================
   全体テーマカラー定義
   ここを書き換えると全体の色味を調整しやすい
========================================= */
:root {
  --bg: #f7f8fb;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --acc: #2563eb;
  --danger: #dc2626;
  --ok: #059669;
  --bd: #e5e7eb;
  --radius: 16px;
}

/* 余白やサイズ計算を安定化 */
* {
  box-sizing: border-box;
}

/* ページ全体 */
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Helvetica,
    Arial,
    "Noto Sans JP",
    "Hiragino Kaku Gothic ProN",
    "Meiryo",
    sans-serif;
  line-height: 1.6;
}

/* 外枠 */
.wrap {
  max-width: 960px;
  margin: 24px auto;
  padding: 16px;
}

/* カード本体 */
.card {
  background: var(--card);
  border: 1px solid var(--bd);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .06);
  padding: 24px;
}

/* 見出し */
h1 {
  font-size: 1.6rem;
  margin: 0 0 16px;
}

/* 説明文 */
.desc {
  color: var(--muted);
  margin-bottom: 20px;
}

/* フォーム全体 */
form {
  display: grid;
  gap: 16px;
}

/* fieldsetの標準枠を消す */
fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

/* 汎用グリッド */
.grid {
  display: grid;
  gap: 12px;
}

/* 2カラム */
.g2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* 3カラム（今は未使用でも将来拡張用に残す） */
.g3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* ラベル */
label {
  display: flex;
  gap: 6px;
  align-items: center;
  font-weight: 600;
  margin-bottom: 6px;
}

/* 入力系共通 */
input[type="text"],
input[type="date"],
input[type="time"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--bd);
  border-radius: 12px;
  background: #fff;
  font: inherit;
}

/* テキストエリア */
textarea {
  min-height: 150px;
  resize: vertical;
}

/* 補助文字 */
.muted {
  color: var(--muted);
  font-weight: 400;
}

/* 横並びグループ */
.inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* 選択肢チップ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--bd);
  border-radius: 999px;
  background: #fff;
}

/* 操作ボタン行 */
.actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* 音声入力ブロック縦並び */
.actions-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

/* 音声入力のボタン横並び */
.btn-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ボタン共通 */
button {
  appearance: none;
  border: none;
  background: var(--acc);
  color: #fff;
  font-weight: 700;
  border-radius: 12px;
  padding: 12px 18px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .25);
  transition: transform .04s ease;
}

/* 押下時 */
button:active {
  transform: translateY(1px);
}

/* 白背景のサブボタン */
.ghost {
  background: #fff;
  color: var(--acc);
  border: 1px solid var(--acc);
}

/* 危険操作ボタン */
.danger {
  background: var(--danger);
}

/* 成功時文字色 */
.ok {
  color: var(--ok);
  font-weight: 700;
}

/* エラー表示 */
.error {
  background: #fff3f3;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 12px 14px;
  border-radius: 12px;
}

/* 成功表示 */
.success {
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  color: #065f46;
  padding: 12px 14px;
  border-radius: 12px;
}

/* 必須マーク */
.req::after {
  content: "*";
  color: var(--danger);
  margin-left: 4px;
  font-weight: 700;
}

/* ヒント文 */
.hint {
  font-size: .92rem;
  color: var(--muted);
}

/* 音声入力ボタン */
.mic {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px dashed var(--bd);
  border-radius: 999px;
  background: #fafafa;
  cursor: pointer;
}

/* 録音中の見た目 */
.mic[data-active="true"] {
  border-color: var(--acc);
}

/* スクリーンリーダー専用 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* スマホ時は1カラムにする */
@media (max-width: 720px) {
  .g2,
  .g3 {
    grid-template-columns: 1fr;
  }
}