/* 高齢者・タッチ操作配慮: 大きい文字、大きいタップ領域、高コントラスト */
:root {
  --bg: #f4f1ea;
  --card: #ffffff;
  --ink: #1f2328;
  --muted: #5c6470;
  --line: #d8d2c4;
  --accent: #2f6f4f;       /* 落ち着いた緑 */
  --accent-ink: #ffffff;
  --emergency: #c62828;    /* 緊急の赤 */
  --notice: #1565c0;
  --radius: 14px;
  --tap: 64px;             /* 最小タップ高 */
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-size: 20px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

/* ヘッダ */
.header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; background: var(--accent); color: var(--accent-ink);
  position: sticky; top: 0; z-index: 10;
}
.header h1 { font-size: 24px; margin: 0; }
.header-right { display: flex; align-items: center; gap: 12px; font-size: 16px; }
.name-btn {
  background: rgba(255,255,255,.18); color: #fff; border: none;
  padding: 8px 12px; border-radius: 10px; font-size: 16px; cursor: pointer;
}

/* 緊急時の案内（救急の代替ではないことを明示） */
.emergency-note {
  margin: 0; padding: 10px 16px; text-align: center;
  background: #fff3f3; color: var(--emergency);
  border-bottom: 1px solid var(--line); font-size: 16px;
}
.emergency-note strong { font-size: 18px; }

/* 定型ボタン */
.templates {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; padding: 16px;
}
.tpl {
  min-height: 84px; border: 3px solid var(--accent); background: var(--card);
  color: var(--accent); border-radius: var(--radius);
  font-size: 22px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform .05s ease;
}
.tpl:active { transform: scale(.97); }
.tpl-emergency {
  border-color: var(--emergency); color: #fff; background: var(--emergency);
  grid-column: 1 / -1; min-height: 96px; font-size: 28px;
}
.tpl-notice { border-color: var(--notice); color: var(--notice); }

/* タブ */
.tabs {
  display: flex; gap: 8px; padding: 0 16px; margin-top: 4px;
  border-bottom: 2px solid var(--line);
}
.tab {
  background: none; border: none; padding: 14px 16px; font-size: 19px;
  color: var(--muted); cursor: pointer; border-bottom: 4px solid transparent;
  margin-bottom: -2px;
}
.tab.active { color: var(--ink); font-weight: 700; border-bottom-color: var(--accent); }

/* フィード */
.feed { padding: 16px; display: flex; flex-direction: column; gap: 12px; padding-bottom: 110px; }
.empty { color: var(--muted); text-align: center; padding: 30px 0; }
.post {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start;
}
.post.is-emergency { border-color: var(--emergency); border-width: 2px; background: #fff5f5; }
.post.is-done { opacity: .55; }
.post-dot {
  width: 14px; height: 14px; border-radius: 50%; margin-top: 8px; flex: 0 0 auto;
  background: var(--accent);
}
.post.is-emergency .post-dot { background: var(--emergency); }
.post.is-notice .post-dot { background: var(--notice); }
.post-main { flex: 1; min-width: 0; }
.post-body { font-size: 21px; }
.post-meta { color: var(--muted); font-size: 15px; margin-top: 4px; }
.post-author { font-weight: 700; color: var(--ink); }
.post-action {
  border: 2px solid var(--accent); color: var(--accent); background: #fff;
  border-radius: 10px; padding: 10px 14px; font-size: 16px; cursor: pointer; flex: 0 0 auto;
}
.post-action.done { border-color: var(--muted); color: var(--muted); }

/* 音声フッタ */
.footer {
  position: fixed; bottom: 0; left: 0; right: 0; padding: 14px 16px;
  background: linear-gradient(transparent, var(--bg) 30%);
  display: flex; justify-content: center;
}
.voice-btn {
  width: 100%; max-width: 520px; min-height: var(--tap);
  background: var(--ink); color: #fff; border: none; border-radius: 999px;
  font-size: 22px; font-weight: 700; cursor: pointer;
}
.voice-btn.recording { background: var(--emergency); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .7; } }

/* 緊急バナー */
.alert-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: var(--emergency); color: #fff; padding: 18px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 22px; font-weight: 700;
}
.alert-close {
  background: #fff; color: var(--emergency); border: none; border-radius: 8px;
  padding: 8px 14px; font-size: 16px; cursor: pointer;
}

/* モーダル */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-card {
  background: var(--card); border-radius: var(--radius); padding: 20px;
  width: 100%; max-width: 480px;
}
.modal-card h2 { margin: 0 0 12px; font-size: 22px; }
.modal-status {
  background: #fff8e1; border: 1px solid #ffe082; border-radius: 8px;
  padding: 8px 10px; font-size: 15px; color: #7a5b00;
}
.modal-label { display: block; font-size: 16px; color: var(--muted); margin-top: 12px; }
.modal-label select, .modal-label textarea {
  display: block; width: 100%; margin-top: 6px; font-size: 20px; padding: 12px;
  border: 2px solid var(--line); border-radius: 10px; font-family: inherit;
}
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.btn-cancel, .btn-submit {
  flex: 1; min-height: 56px; border-radius: 10px; font-size: 19px; font-weight: 700; cursor: pointer;
}
.btn-cancel { background: #fff; border: 2px solid var(--line); color: var(--muted); }
.btn-submit { background: var(--accent); border: 2px solid var(--accent); color: #fff; }

.hidden { display: none !important; }
