/*
 * AI主任と話す（VOICE-MVP-02）／話して記録（VOICE-MVP-01）の表示。
 * ★主操作（答える・話し終わった・保存）は大きく。スマホで片手でも押しやすく。
 * ★AI主任の言葉は大きく、会話の記録（履歴）は小さく。画面は確認と修正のためのもの。
 */

:root {
  --voice-rec: #b3261e;        /* 録音中の赤（文字・点。背景には使わない） */
}
@media (prefers-color-scheme: dark) {
  :root { --voice-rec: #f2766b; }
}

/* 誰の記録か */
.voice-person { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.voice-avatar { flex: 0 0 auto; display: inline-flex; }
.voice-person-main { display: flex; flex-direction: column; min-width: 0; }
.voice-name { font-size: 20px; font-weight: 700; }
.voice-context { font-size: 14px; color: var(--text-muted); }

.voice-phase { margin: 0 0 14px; }

/* 主操作は大きく */
.voice-big { min-height: 76px; font-size: 20px; border-radius: 14px; }
.voice-stop { margin-top: 16px; }

.voice-help { margin: 10px 0 0; font-size: 14px; color: var(--text-muted); }
.voice-note-warn { margin: 10px 0 0; font-size: 15px; font-weight: 700; color: var(--text); }

/* 録音中 */
.voice-rec-indicator { margin: 8px 0 0; font-size: 18px; font-weight: 700; color: var(--voice-rec); text-align: center; }
.voice-rec-dot { animation: voice-blink 1.2s steps(2, start) infinite; }
.voice-rec-time {
  margin: 4px 0 0;
  font-size: 44px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.voice-rec-purpose { margin: 0 0 6px; font-size: 14px; color: var(--text-muted); text-align: center; }

@keyframes voice-blink { to { visibility: hidden; } }

/* 処理中 */
.voice-processing { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 28px 0; }
.voice-processing-text { margin: 0; font-size: 18px; font-weight: 700; }
.voice-spinner {
  width: 36px;
  height: 36px;
  border: 4px solid var(--surface-2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: voice-spin 0.9s linear infinite;
}
@keyframes voice-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .voice-rec-dot, .voice-spinner { animation: none; }
}

/* 追加の質問（1問だけ） */
.voice-q-label { margin: 0 0 6px; font-size: 14px; color: var(--text-muted); }
.voice-question {
  margin: 0 0 14px;
  padding: 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 18px;
  font-weight: 700;
}
#voice-clarify .btn { margin-top: 10px; }
.voice-answer-text-row { margin-top: 10px; }
.voice-answer-text, .voice-handover-text {
  width: 100%;
  min-height: 88px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  box-sizing: border-box;
}

/* ---- AI主任との会話（VOICE-MVP-02）---------------------------------- */

/* AI主任の言葉。★短く・大きく・読みやすく */
.ai-say {
  display: flex;
  gap: 10px;
  margin: 0 0 14px;
  padding: 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.ai-mark {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}
.ai-say-main { min-width: 0; }
.ai-name { display: block; font-size: 13px; color: var(--text-muted); }
.ai-line { margin: 2px 0 0; font-size: 19px; font-weight: 700; line-height: 1.5; white-space: pre-wrap; }

/* 今どちらの番か（🎙 聞いています… ／ 🎙 話してください） */
.voice-state { margin: 0 0 10px; font-size: 17px; font-weight: 700; text-align: center; }
.voice-state.is-recording { color: var(--voice-rec); }

/* 小さく添える［終了］［文字で入力］ */
.voice-talk-small { display: flex; justify-content: space-between; margin-top: 12px; }
.voice-talk-small .btn-plain { min-height: var(--tap-min); padding: 0 4px; font-size: 14px; }

/* 山田主任が理解している内容（コンパクト） */
.voice-understanding {
  margin-top: 18px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-2);
}
.voice-understanding-title { margin: 0 0 8px; font-size: 15px; }
.voice-understanding-list { margin: 0; padding: 0; list-style: none; font-size: 15px; }
.voice-understanding-list li { display: flex; gap: 8px; padding: 3px 0; }
/* 名前は折り返さない（「テスト利用／者A」のように切れないように） */
.voice-understanding-list .u-label { flex: 0 0 auto; max-width: 46%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-muted); }
.voice-understanding-list .u-value { min-width: 0; }
.voice-details { margin-top: 6px; min-height: var(--tap-min); color: var(--primary); }

/* 会話（直前の数回だけ。★保存しない） */
.voice-history-box { margin-top: 16px; }
.voice-history-title { margin: 0 0 6px; font-size: 14px; color: var(--text-muted); }
.voice-history { margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--text-muted); }
.voice-history li { margin: 4px 0; white-space: pre-wrap; }
.voice-history .h-who { font-weight: 700; }

/* 保存前の確認 */
.voice-section-title { margin: 4px 0 8px; font-size: 17px; }
.voice-sub-title { margin: 18px 0 6px; font-size: 15px; }
.voice-record-text { min-height: 150px; }
.voice-items { margin: 0; padding-left: 20px; font-size: 15px; }
.voice-items li { margin: 3px 0; }
.voice-vitals { padding: 0; }
.voice-meals { margin-top: 14px; }
.voice-handover-body { margin: 6px 0 0; }
.voice-transcript-box { margin: 16px 0 0; }
.voice-transcript-box > summary { min-height: var(--tap-min); padding: 10px 0; color: var(--primary); cursor: pointer; }
.voice-transcript { margin: 0; white-space: pre-wrap; font-size: 15px; color: var(--text); }
.voice-notices { margin: 10px 0 0; padding-left: 20px; font-size: 14px; color: var(--text); }
.voice-confirm-actions { display: flex; gap: 10px; margin-top: 16px; }
.voice-confirm-actions .btn { flex: 1 1 0; min-height: 52px; padding: 0 8px; font-size: 16px; }

/* 緊急・重要の候補（職員が選ぶ） */
.voice-emergency {
  margin: 0 0 16px;
  padding: 12px;
  border: 2px solid var(--emergency, #b3261e);
  border-radius: 12px;
  background: var(--surface);
}
.voice-emergency-q { margin: 0 0 6px; font-size: 17px; font-weight: 700; }
.voice-emergency-reason { margin: 0 0 10px; font-size: 14px; color: var(--text-muted); }
.voice-emergency-choice { flex-wrap: wrap; }
.voice-emergency-choice .choice-btn { flex: 1 1 40%; min-height: 52px; }
.voice-emergency-detail { margin-top: 12px; }

/* うまくいかなかったとき */
.voice-error-text { margin: 0 0 12px; font-size: 16px; font-weight: 700; }
.voice-error-actions .btn { margin-top: 10px; }
.voice-unavailable-text { font-size: 15px; }

.voice-cancel { display: block; margin: 8px auto 0; }

/* 開発用（斜線の背景は .dev-note） */
.voice-demo-title { margin: 0 0 6px; font-weight: 700; }
.voice-demo-list { flex-wrap: wrap; }
.voice-demo-list .choice-btn { flex: 1 1 45%; }
.voice-demo-skip { margin-top: 6px; }

/* タイムラインの「音声から」札 */
.tag-voice { background: var(--surface-2); }

/* 勤務記録の最終確認（MVP-06）★見る順は 要確認 → 利用者ごと → 申し送り */
.report-attention { list-style: none; margin: 0; padding: 0; }
.report-attention-item {
  padding: 8px 10px;
  margin-bottom: 6px;
  border-left: 4px solid var(--caution, #c77700);
  background: var(--surface-2);
  border-radius: 6px;
}
.report-residents { display: flex; flex-direction: column; gap: 10px; }
.report-card {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-1, #fff);
}
.report-card-caution { border-left: 4px solid var(--caution, #c77700); }
.report-card-name { margin: 0 0 6px; font-size: 16px; }
.report-card-text { margin: 0; line-height: 1.7; }
/* ★未確認は未確認のまま見せる（「異常なし」で埋めない） */
.report-unconfirmed { margin: 6px 0 0; font-size: 14px; color: var(--text-2, #555); }
.report-empty { margin: 0; font-size: 14px; color: var(--text-2, #555); }
.report-handoff { list-style: none; margin: 0; padding: 0; }
.report-handoff-item { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.report-handoff-name { flex: 0 0 auto; font-weight: 600; }
.report-handoff-lines { flex: 1 1 auto; }
.report-hint { margin: 0 0 6px; font-size: 14px; color: var(--text-2, #555); }
.report-card-mark { display: inline-block; min-width: 2.2em; margin-right: 6px; font-size: 13px; color: var(--text-2, #555); }

/* 保存済み記録の訂正（MVP-07）★ふだんは最新だけ。履歴だらけにしない */
.entry-correction-row { display: flex; gap: 10px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.entry-corrected-mark { font-size: 13px; color: var(--text-2, #555); }
.entry-correction-link { font-size: 13px; }
.entry-correction-panel { margin-top: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; }
.entry-correction-title { margin: 0 0 6px; font-size: 15px; }
.entry-correction-note, .entry-correction-state { margin: 6px 0; font-size: 13px; color: var(--text-2, #555); }
.entry-correction-label { margin: 8px 0 2px; font-size: 12px; color: var(--text-2, #555); }
.entry-correction-before { margin: 0; padding: 6px 8px; background: var(--surface-2); border-radius: 6px; text-decoration: line-through; }
.entry-correction-reason { width: 100%; padding: 6px 8px; }
.entry-history { margin: 0; padding-left: 18px; }
.entry-history-item { margin-bottom: 8px; }
.entry-history-item.is-original .entry-history-text { color: var(--text-2, #555); }
.entry-history-meta { font-size: 12px; color: var(--text-2, #555); }
.entry-history-text { margin: 2px 0 0; }
.report-decision-item { padding: 10px; margin-bottom: 10px; border: 1px solid var(--border); border-radius: 8px; }
.report-decision-head { margin: 0 0 6px; font-weight: 600; }
.report-decision-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* 職員管理（MVP-08B・管理者だけ） */
.accounts-temp { margin-bottom: 12px; }
.accounts-temp-text { margin: 0 0 6px; font-weight: 600; word-break: break-all; }
.accounts-new .field select { width: 100%; padding: 8px; }
.accounts-list { display: flex; flex-direction: column; gap: 10px; }
.account-row { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.account-row.is-disabled { opacity: 0.7; }
.account-name { margin: 0; font-weight: 600; }
.account-meta, .account-status { margin: 2px 0; font-size: 13px; color: var(--text-2, #555); }
.account-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.account-select { padding: 6px; max-width: 100%; }
.account-danger { color: var(--danger, #b3261e); }
