/*
  ファイル名: css/style.css
  アプリ名: 救護班ポケットガイド
  バージョン: v0.1.6
  更新日: 2026-06-03
  変更履歴: v0.1.0 スマホ優先UI、カード、ナビ、フォーム、注意表示を追加
            v0.1.1 activeナビ表示の対象data属性変更に対応
            v0.1.2 アプリ全体のバージョン更新に合わせてヘッダーコメントを更新
            v0.1.3 キャッシュ判別用クエリ適用に合わせてヘッダーコメントを更新
            v0.1.4 出動前準備のカテゴリ切替、補足、下部ナビ重なり対策を追加
            v0.1.5 救護活動Tipsの注意文表示を追加
            v0.1.6 救護活動Tipsの小見出し付きカード表示を追加
*/

:root {
  --bg: #f4f7f6;
  --surface: #ffffff;
  --surface-soft: #eef5f3;
  --text: #17211f;
  --muted: #5d6d68;
  --primary: #0f766e;
  --primary-dark: #0b5f59;
  --accent: #c2410c;
  --warning-bg: #fff7ed;
  --warning-border: #fed7aa;
  --border: #d7e2de;
  --ready: #e7f7ee;
  --partial: #edf2ff;
  --planned: #f3f0f7;
  --shadow: 0 8px 22px rgba(23, 33, 31, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  line-height: 1.65;
  padding-bottom: calc(112px + env(safe-area-inset-bottom));
}

button,
input,
textarea {
  font: inherit;
}

.app-header {
  background: linear-gradient(135deg, #0f766e, #285c71);
  color: #ffffff;
  padding: calc(18px + env(safe-area-inset-top)) 20px 22px;
}

.app-header h1 {
  font-size: 1.55rem;
  line-height: 1.25;
  margin: 2px 0 4px;
}

.version-label,
.header-note {
  margin: 0;
  opacity: 0.9;
}

.version-label {
  font-size: 0.8rem;
  letter-spacing: 0;
}

.header-note {
  font-size: 0.95rem;
}

.app-shell {
  width: min(100%, 960px);
  margin: 0 auto;
  padding: 18px 14px 118px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.section-heading {
  margin: 0 0 14px;
}

.section-heading h2,
.content-section h2 {
  font-size: 1.35rem;
  line-height: 1.35;
  margin: 0 0 6px;
}

.section-heading p,
.content-section > p {
  margin: 0;
  color: var(--muted);
}

.menu-grid {
  display: grid;
  gap: 12px;
}

.menu-card,
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.menu-card {
  width: 100%;
  min-height: 112px;
  padding: 16px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}

.menu-card:focus-visible,
.button:focus-visible,
.bottom-nav button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid #99f6e4;
  outline-offset: 2px;
}

.menu-card h3 {
  margin: 8px 0 6px;
  font-size: 1.08rem;
}

.menu-card p {
  margin: 0;
  color: var(--muted);
}

.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.78rem;
  font-weight: 700;
}

.badge-ready {
  background: var(--ready);
  color: #17633f;
}

.badge-partial {
  background: var(--partial);
  color: #334899;
}

.badge-planned {
  background: var(--planned);
  color: #67507d;
}

.view-toolbar {
  margin-bottom: 14px;
}

.content-section {
  display: grid;
  gap: 14px;
}

.card {
  padding: 16px;
}

.card h3 {
  font-size: 1.08rem;
  margin: 0 0 8px;
}

.card p,
.card ul,
.card ol {
  margin-top: 0;
  margin-bottom: 0;
}

.stack {
  display: grid;
  gap: 12px;
}

.callout {
  border: 1px solid var(--warning-border);
  background: var(--warning-bg);
  border-radius: 8px;
  padding: 14px;
  color: #70340f;
}

.callout strong {
  display: block;
  color: #7c2d12;
}

.tip-warning {
  box-shadow: none;
}

.tip-subsection {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.tip-subsection h4 {
  font-size: 1rem;
  margin: 0;
}

.info-box {
  border: 1px solid #b8ded8;
  background: var(--surface-soft);
  border-radius: 8px;
  padding: 14px;
}

.checklist {
  display: grid;
  gap: 10px;
}

.category-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 6px 0;
  background: var(--bg);
}

.tab-button {
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: #173c38;
  font-weight: 700;
  cursor: pointer;
}

.tab-button.is-active {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.check-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: start;
  gap: 10px;
  min-height: 52px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdfc;
}

.check-item-rich {
  min-height: 62px;
}

.check-item input {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  accent-color: var(--primary);
}

.check-label {
  display: block;
  font-weight: 700;
}

.item-note {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 2px;
}

.subsection {
  display: grid;
  gap: 10px;
}

.subsection h4 {
  font-size: 1rem;
  margin: 2px 0 0;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 12px;
  min-height: 46px;
}

.field textarea {
  min-height: 108px;
  resize: vertical;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

.button-primary {
  background: var(--primary);
  color: #ffffff;
}

.button-primary:active {
  background: var(--primary-dark);
}

.button-secondary {
  background: #e5efec;
  color: #173c38;
}

.button-danger {
  background: #fee2e2;
  color: #991b1b;
}

.preview {
  min-height: 260px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f9fbfa;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}

.message {
  min-height: 24px;
  color: var(--primary-dark);
  font-weight: 700;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.bottom-nav button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: #eef5f3;
  color: #173c38;
  font-size: 0.9rem;
  font-weight: 700;
}

.bottom-nav button.is-active {
  background: var(--primary);
  color: #ffffff;
}

@media (min-width: 720px) {
  .app-header {
    padding-left: 28px;
    padding-right: 28px;
  }

  .app-shell {
    padding: 24px 20px 128px;
  }

  .menu-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .form-grid.two-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bottom-nav {
    width: min(100%, 960px);
    left: 50%;
    transform: translateX(-50%);
    border: 1px solid var(--border);
    border-bottom: 0;
    border-radius: 12px 12px 0 0;
  }
}
