body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #f4f6f9;
  margin: 0;
  padding: 16px;
  color: #333;
}

/* モーダル表示時に背景のスクロールを完全に固定 */
body.modal-open {
  overflow: hidden;
}

.container {
  max-width: 500px;
  margin: 0 auto;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 8px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* タイトルロゴ（タップで画面リフレッシュ可能） */
h1 {
  font-size: 1.2rem;
  color: #002b66;
  margin: 0;
  font-weight: bold;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.2s ease;
}

h1:hover {
  opacity: 0.75;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sheet-link {
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: 16px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
}

.record-btn {
  color: #7c2d12;
  background-color: #ffedd5;
  border: 1px solid #fed7aa;
}

.record-btn:hover {
  background-color: #fdba74;
}

.record-btn.is-recording {
  background-color: #dc3545;
  color: white;
  border-color: #dc3545;
  animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(220, 53, 69, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

.credo-btn {
  color: #002b66;
  background-color: #e8f0fe;
  border: 1px solid #b8daff;
}

.credo-btn:hover {
  background-color: #d0e1fd;
}

.icon-btn {
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.05rem;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.icon-btn:hover {
  background-color: #f0f0f0;
  transform: rotate(30deg);
}

.undo-bar {
  background-color: #fff3cd;
  border: 1px solid #ffeeba;
  color: #856404;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.record-status-bar {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.85rem;
  font-weight: bold;
  text-align: center;
  transition: all 0.3s ease;
}

.record-status-bar.info {
  background-color: #e8f0fe;
  color: #002b66;
  border: 1px solid #b8daff;
}

.record-status-bar.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.record-status-bar.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* メインカード（次当番） */
.next-card {
  background: linear-gradient(135deg, #002b66, #0056b3);
  color: white;
  padding: 24px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,43,102,0.3);
  margin-bottom: 24px;
}

.next-card .today-date {
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.15);
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 12px;
  letter-spacing: 0.03em;
}

.next-card .label { font-size: 0.9rem; opacity: 0.9; }

/* 当番メインアイコン表示 */
.next-avatar-wrapper {
  margin: 12px 0 6px 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.next-avatar-img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #ffffff;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
  background-color: #ffffff;
}

/* メインカードの名前（改行防止） */
.next-card .name { 
  font-size: 2rem; 
  font-weight: bold; 
  margin: 6px 0 10px 0; 
  white-space: nowrap; 
}

.next-card .no {
  font-size: 0.85rem;
  background: rgba(255,255,255,0.2);
  display: inline-block;
  padding: 3px 12px;
  border-radius: 12px;
  margin-bottom: 16px;
}

/* リストアイテム用アイコン */
.member-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #cbd5e1;
  background-color: #f1f5f9;
  flex-shrink: 0;
}

.btn {
  background-color: #28a745;
  color: white;
  border: none;
  font-weight: bold;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  transition: all 0.2s ease;
}

.btn:hover {
  background-color: #218838;
  transform: translateY(-1px);
}

.btn:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
  transform: none;
}

.btn-main { padding: 10px 20px; font-size: 0.95rem; display: block; margin: 0 auto; }
.btn-small { padding: 5px 12px; font-size: 0.75rem; border-radius: 14px; flex-shrink: 0; }
.btn-add { background-color: #002b66; padding: 8px 16px; border-radius: 8px; font-size: 0.85rem; box-shadow: none; }
.btn-add:hover { background-color: #00183e; }
.btn-delete { background-color: #dc3545; padding: 4px 8px; font-size: 0.75rem; border-radius: 6px; box-shadow: none; flex-shrink: 0; }
.btn-delete:hover { background-color: #bd2130; }
.btn-undo { background-color: #6c757d; padding: 6px 14px; font-size: 0.85rem; border-radius: 8px; box-shadow: none; }

.btn-step {
  background-color: #e9ecef;
  color: #495057;
  border: 1px solid #ced4da;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: none;
  font-weight: bold;
  flex-shrink: 0;
}

.btn-step:hover { background-color: #dee2e6; transform: none; }

.list-title { font-size: 1rem; margin-bottom: 12px; font-weight: bold; color: #002b66; }
.member-list { background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }

.member-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #eee;
  gap: 8px;
}

.member-item:last-child { border-bottom: none; }
.member-item.is-next { background-color: #e8f0fe; border-left: 4px solid #002b66; }

.member-info { 
  display: flex; 
  align-items: center; 
  gap: 10px; 
  min-width: 0; 
  flex: 1; 
}

.member-no { color: #888; font-size: 0.8rem; width: 36px; flex-shrink: 0; }

/* リスト一覧の名前（途中で切らせず1行固定表示） */
.member-name { 
  font-weight: bold; 
  white-space: nowrap; 
  overflow: visible; 
}

.member-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.turn-badge {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: bold;
  display: inline-block;
  text-align: center;
  white-space: nowrap;
}

.turn-badge.today { background-color: #002b66; color: white; }

/* もうすぐバッジ（2行で横幅をスマートに収めるデザイン） */
.turn-badge.soon { 
  background-color: #fff3cd; 
  color: #856404; 
  border: 1px solid #ffeeba; 
  line-height: 1.25; 
  padding: 3px 6px;
  font-size: 0.65rem;
}

.turn-badge.normal { background-color: #e9ecef; color: #495057; }

.loading { text-align: center; padding: 40px; color: #666; }

/* モーダル共通スタイル */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex; justify-content: center; align-items: center;
  z-index: 1000; padding: 12px; box-sizing: border-box;
  overscroll-behavior: contain;
}

.modal-content {
  background: white; width: 100%; max-width: 480px; max-height: 85vh;
  border-radius: 16px; box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  display: flex; flex-direction: column; overflow: hidden;
}

.modal-header { padding: 14px 18px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.modal-header h2 { font-size: 1.05rem; margin: 0; color: #002b66; font-weight: bold; }
.close-btn { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: #888; padding: 0; line-height: 1; }
.close-btn:hover { color: #333; }

.modal-body {
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1;
}

.admin-card { background: #f8f9fa; padding: 14px 16px; border-radius: 10px; margin-bottom: 20px; border: 1px solid #e9ecef; }
.admin-title { font-size: 0.85rem; font-weight: bold; color: #555; margin-bottom: 10px; }
.add-form { display: flex; flex-direction: column; gap: 8px; }
.add-input-row { display: flex; gap: 8px; }

.add-input, .search-input {
  flex: 1; padding: 8px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 0.9rem; outline: none; box-sizing: border-box;
}

.add-input:focus, .search-input:focus { border-color: #002b66; }
.search-container { margin-bottom: 10px; }
.search-input { width: 100%; background: #fff; }
.edit-list-title { font-size: 0.85rem; font-weight: bold; color: #555; margin-bottom: 4px; }

.edit-member-list {
  background: white;
  border: 1px solid #eee;
  border-radius: 8px;
  max-height: 240px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.edit-member-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid #eee; gap: 8px; }
.edit-member-item:last-child { border-bottom: none; }

.edit-controls { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.member-name-clickable {
  cursor: pointer;
  background-color: #f8fafc;
  color: #002b66;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: bold;
  border: 1px solid #cbd5e1;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.member-name-clickable:hover {
  background-color: #e2e8f0;
  border-color: #002b66;
}

.date-picker-box {
  margin-top: 12px;
  padding: 12px;
  background: #eef5ff;
  border: 1px solid #b8daff;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.date-picker-box label { font-size: 0.8rem; font-weight: bold; color: #004085; }
.date-picker-input { padding: 6px 10px; border-radius: 6px; border: 1px solid #ced4da; font-size: 0.85rem; }
.date-picker-actions { display: flex; justify-content: flex-end; gap: 6px; }

.memo-input-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8f9fa;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #e9ecef;
  margin-bottom: 16px;
}

.memo-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #333;
  resize: vertical;
  box-sizing: border-box;
  background-color: #fff;
}

.memo-textarea::placeholder {
  font-size: 0.88rem;
  color: #a0aec0;
  opacity: 0.8;
}

.memo-textarea:focus {
  outline: none;
  border-color: #002b66;
  box-shadow: 0 0 0 3px rgba(0, 43, 102, 0.12);
}

.memo-input-actions {
  display: flex;
  justify-content: flex-end;
}

.memo-timeline-header {
  font-size: 0.82rem;
  font-weight: bold;
  color: #666;
  margin-bottom: 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid #eee;
}

.memo-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.memo-accordion-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  transition: border-color 0.2s ease;
}

.memo-accordion-card.active {
  border-color: #002b66;
}

.memo-accordion-header {
  padding: 10px 14px;
  background: #f8fafc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.memo-accordion-header:hover {
  background: #f1f5f9;
}

.memo-title-preview {
  font-size: 0.92rem;
  font-weight: bold;
  color: #002b66;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.memo-date-tag {
  font-size: 0.72rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.memo-arrow {
  font-size: 0.7rem;
  transition: transform 0.2s ease;
}

.memo-accordion-card.active .memo-arrow {
  transform: rotate(180deg);
}

.memo-accordion-body {
  display: none;
  padding: 12px 14px;
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
}

.memo-accordion-card.active .memo-accordion-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.memo-full-text {
  font-size: 0.88rem;
  color: #334155;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.6;
  max-height: 120px;
  overflow-y: auto;
  padding-right: 4px;
}

.memo-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px dashed #e2e8f0;
  flex-shrink: 0;
}

.memo-card-btn {
  background: none;
  border: none;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 3px 8px;
  font-weight: bold;
  border-radius: 4px;
}

.memo-card-btn.edit { color: #0056b3; background-color: #e8f0fe; }
.memo-card-btn.delete { color: #dc3545; background-color: #fde8e8; }

.hero-concept {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.concept-card {
  background: #eaf2f8;
  border-radius: 8px;
  padding: 20px;
  color: #002b66;
}

.concept-header-tag {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #002b66;
  margin-bottom: 10px;
  font-family: 'Helvetica Neue', Arial, sans-serif;
}

.concept-main-title {
  font-size: 1.25rem;
  font-weight: bold;
  color: #002b66;
  margin-bottom: 14px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.concept-main-title .no1-highlight {
  font-size: 2.2rem;
  font-weight: 900;
  color: #002b66;
  letter-spacing: -0.02em;
  margin: 0 4px;
}

.concept-body {
  font-size: 0.88rem;
  color: #1a365d;
  line-height: 1.8;
}

.promise-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #cbd5e1;
}

.promise-tag {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: #002b66;
  margin-bottom: 8px;
}

.section-divider {
  font-size: 0.9rem;
  font-weight: bold;
  color: #002b66;
  margin: 24px 0 14px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid #002b66;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* クレド アコーディオン */
.credo-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.credo-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.credo-card:hover {
  border-color: #002b66;
}

.credo-card.highlight {
  background: #f0f7ff;
  border: 2px solid #002b66;
  box-shadow: 0 4px 12px rgba(0, 43, 102, 0.15);
}

.credo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.credo-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.credo-no {
  background: #002b66;
  color: #ffffff;
  font-weight: bold;
  font-size: 0.85rem;
  padding: 3px 10px;
  border-radius: 8px;
  display: inline-block;
  margin: 0;
}

.credo-title {
  font-weight: bold;
  font-size: 0.92rem;
  color: #1e293b;
  line-height: 1.4;
  margin: 0;
}

.credo-arrow {
  font-size: 0.75rem;
  color: #94a3b8;
  transition: transform 0.2s ease;
}

.credo-card.active .credo-arrow {
  transform: rotate(180deg);
  color: #002b66;
}

.credo-body {
  display: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
  font-size: 0.85rem;
  line-height: 1.7;
  color: #4a5568;
}

.credo-card.active .credo-body {
  display: block;
}
