/* リセットと基本スタイル */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif;
  background: linear-gradient(180deg, #F5F7F5 0%, #F0F2EF 100%); color: #1C1C1E; font-size: 17px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}
.hidden { display: none !important; }

/* セットアップ画面 */
.setup-screen {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px;
}
.setup-title { font-size: 32px; font-weight: 800; }
.setup-subtitle { font-size: 15px; color: #8E8E93; margin: 4px 0 28px; }
.setup-form { width: 100%; max-width: 360px; }
.form-group { margin-bottom: 18px; }
.form-label { font-size: 15px; font-weight: 600; color: #3C3C43; margin-bottom: 5px; display: block; }
.form-input {
  width: 100%; padding: 13px 16px; border: 1px solid #D1D1D6; border-radius: 12px;
  font-size: 17px; background: #fff; -webkit-appearance: none;
}
.form-input:focus { outline: none; border-color: #007AFF; box-shadow: 0 0 0 3px rgba(0,122,255,.12); }
.form-hint { font-size: 13px; color: #8E8E93; margin-top: 4px; }
.setup-toast {
  background: #34C759; color: #fff; padding: 12px 20px; border-radius: 12px;
  margin-bottom: 16px; font-size: 15px; text-align: center; display: none;
}
.btn-primary {
  width: 100%; padding: 15px; background: #007AFF; color: #fff; border: none;
  border-radius: 14px; font-size: 18px; font-weight: 600; cursor: pointer; margin-top: 8px;
}
.btn-primary:active { background: #0056CC; }
.btn-primary:disabled { background: #A2A2A7; }

/* ヘッダー */
.header {
  background: linear-gradient(180deg, #fff 0%, #F8FAF8 100%);
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid #E8ECE8; position: sticky; top: 0; z-index: 100;
}
.header-left, .header-right { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.header-left { min-width: 70px; }
.header-right { min-width: 70px; justify-content: flex-end; }
.header-center { text-align: center; flex: 1; }
.header-day { font-size: 20px; color: #1C1C1E; font-weight: 700; }
.header-time { font-size: 13px; color: #8E8E93; margin-top: 1px; }
.header-icon {
  width: 40px; height: 40px; border-radius: 12px; background: rgba(0,0,0,.04);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.header-icon i { font-size: 22px; color: #3C3C43; }
.header-icon:active { background: rgba(0,0,0,.08); }

/* エネルギーバー（三層カード） */
.energy-bar {
  background: linear-gradient(150deg, #FFFBF5, #FFF5E8, #FFFAF2);
  margin: 12px 16px; padding: 0;
  border-radius: 18px;
  box-shadow: 0 2px 12px rgba(232,160,48,.10), 0 0 0 0.5px rgba(232,160,48,.08);
  overflow: hidden;
}
/* 液体平衡バー */
.fluid-bar {
  display: flex; gap: 18px; padding: 10px 20px;
  border-top: 1px solid rgba(232,160,48,.08);
  font-size: 13px; color: #A07840; font-weight: 500;
  background: rgba(255,255,255,.45);
}

/* 第1層：热量リング + 数値 */
.nut-layer1 {
  display: flex; align-items: center; gap: 18px;
  padding: 18px 20px 14px;
}
.energy-ring-wrap { position: relative; width: 90px; height: 90px; flex-shrink: 0; }
.energy-ring {
  width: 90px; height: 90px; border-radius: 50%;
  background: conic-gradient(#E5E5EA 0% 100%);
  display: flex; align-items: center; justify-content: center;
  transition: background .6s cubic-bezier(0.2, 0.9, 0.3, 1); will-change: background;
}
.energy-ring-inner {
  width: 68px; height: 68px; border-radius: 50%;
  background: linear-gradient(135deg, #FFFCF7, #FFF6EC);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.energy-ring-pct { font-size: 22px; font-weight: 800; line-height: 1; }
.energy-ring-sub { font-size: 11px; color: #8E8E93; margin-top: 2px; }
.energy-info { flex: 1; min-width: 0; }
.energy-info-title { font-size: 13px; color: #8E8E93; font-weight: 500; }
.energy-info-kcal { font-size: 22px; font-weight: 700; margin: 2px 0; }
.energy-info-kcal .unit { font-size: 14px; font-weight: 400; color: #8E8E93; }
.energy-info-detail { font-size: 13px; color: #8E8E93; line-height: 1.5; }

/* 第2層：三大栄養素（蛋白質・脂肪・炭水化物） */
.nut-layer2 {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px;
  padding: 0 20px 14px;
  border-top: 1px solid rgba(232,160,48,.08);
  padding-top: 14px;
}
.macro-col { display: flex; flex-direction: column; gap: 4px; }
.macro-head {
  display: flex; justify-content: space-between; align-items: baseline;
}
.macro-label { font-size: 12px; color: #8E8E93; font-weight: 500; }
.macro-val { font-size: 15px; font-weight: 700; line-height: 1; }
.macro-unit { font-size: 11px; font-weight: 400; color: #8E8E93; margin-left: 1px; }
.macro-track {
  height: 4px; background: #F2F2F7; border-radius: 2px; overflow: hidden;
}
.macro-fill {
  height: 100%; border-radius: 2px;
  transition: width .6s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.macro-target { font-size: 11px; color: #C7C7CC; }

/* 第3層：微量元素（Ca・VitD・Fe・Zn） */
.nut-layer3 {
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid rgba(232,160,48,.08);
  background: rgba(255,255,255,.35);
}
.micro-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.micro-top { display: flex; align-items: center; gap: 3px; }
.micro-icon { font-size: 14px; flex-shrink: 0; }
.micro-label { font-size: 11px; color: #8E8E93; font-weight: 500; }
.micro-val { font-size: 16px; font-weight: 800; line-height: 1; }
.micro-track {
  width: 100%; height: 3px; background: #ECECEC; border-radius: 1.5px; overflow: hidden;
}
.micro-fill {
  height: 100%; border-radius: 1.5px;
  transition: width .6s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.micro-detail { font-size: 10px; color: #C7C7CC; white-space: nowrap; }

/* アクションパネル（フルワイドバーレイアウト） */
.action-panel {
  padding: 12px 16px 4px;
  display: flex; flex-direction: column; gap: 8px;
}

/* フルワイドアクションバー共通 */
.action-bar {
  display: flex; align-items: center; gap: 14px;
  width: 100%; min-height: 64px; padding: 16px 18px;
  border: none; border-radius: 16px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, filter .12s ease;
  font-size: 18px; font-weight: 700;
  text-align: left;
}
.action-bar:active { transform: scale(0.98); filter: brightness(0.95); }

/* アイコン丸背景 */
.action-bar-icon {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px;
  flex-shrink: 0;
}
.action-bar-icon i { font-size: 24px; }

/* ラベル */
.action-bar-label { flex: 1; white-space: nowrap; }

/* 右矢印 */
.action-bar-arrow {
  flex-shrink: 0; opacity: 0.4; font-size: 18px;
  display: flex; align-items: center;
}

/* 喂养：柔和暖色 */
.action-bar.feed { background: #FFF8F0; color: #C2750A; }
.action-bar.feed .action-bar-icon { background: rgba(245,158,11,.12); }
.action-bar.feed .action-bar-icon i { color: #E8A030; }

/* 排尿：淡雅紫 */
.action-bar.urine { background: #F8F4FF; color: #7C5CC4; }
.action-bar.urine .action-bar-icon { background: rgba(167,139,250,.12); }
.action-bar.urine .action-bar-icon i { color: #A78BFA; }

/* 补水：清透蓝 */
.action-bar.water { background: #F2F9FE; color: #1878A8; }
.action-bar.water .action-bar-icon { background: rgba(56,189,248,.10); }
.action-bar.water .action-bar-icon i { color: #50B8E8; }

/* 用药：柔和玫瑰 */
.action-bar.med { background: #FFF6F7; color: #C4264A; }
.action-bar.med .action-bar-icon { background: rgba(251,113,133,.10); }
.action-bar.med .action-bar-icon i { color: #F0889A; }

/* 排便：暖棕 */
.action-bar.stool { background: #F5F0E8; color: #8B7355; }
.action-bar.stool .action-bar-icon { background: rgba(160,130,90,.12); }
.action-bar.stool .action-bar-icon i { color: #B8956A; }

/* 今日時間線（時間帯グループ化） */
.timeline-section {
  margin: 12px 16px; padding-bottom: 70px;
}
.timeline-title {
  font-size: 14px; font-weight: 700; color: #636366;
  margin-bottom: 10px; padding: 0 2px;
  letter-spacing: 0.5px;
}
.timeline-empty {
  text-align: center; padding: 40px 20px; color: #AEAEB2; font-size: 15px;
  background: linear-gradient(135deg, #FAFAFA, #F5F5F5);
  border-radius: 16px; line-height: 1.8;
}
/* 撤销ボタン（record-row内） */
.tl-undo {
  background: none; border: 1px solid #FF3B30; color: #FF3B30;
  padding: 3px 8px; border-radius: 8px; font-size: 12px; cursor: pointer;
  flex-shrink: 0; display: flex; align-items: center; margin-left: auto;
}
.tl-undo:active { background: #FFF5F4; }
/* record-row に撤销ボタンを含むため調整 */
.timeline-section .record-row { align-items: center; }

/* 記録モーダル内パーツ */
.rec-section { margin-bottom: 16px; }
.rec-label { font-size: 15px; font-weight: 600; color: #1C1C1E; margin-bottom: 8px; }
.rec-hint { font-size: 13px; font-weight: 400; color: #8E8E93; }
.time-picker-input {
  width: 100%; padding: 10px 14px; border: 1px solid #D1D1D6; border-radius: 10px;
  font-size: 17px; background: #fff; -webkit-appearance: none; color: #1C1C1E;
}
.time-picker-input:focus { outline: none; border-color: #007AFF; box-shadow: 0 0 0 3px rgba(0,122,255,.12); }

/* 勺数タップセレクター */
.tap-selector { display: flex; gap: 8px; }
.tap-btn {
  flex: 1; padding: 12px 0; border: 2px solid #D1D1D6; border-radius: 12px;
  background: #fff; font-size: 20px; font-weight: 700; cursor: pointer;
  text-align: center; color: #1C1C1E;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
}
.tap-btn.selected { border-color: #FF9500; background: #FFF3E0; color: #FF9500; }
.tap-btn:active { transform: scale(.95); }

/* ml スライダー */
.slider-control { display: flex; align-items: center; gap: 14px; }
.ml-slider {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 8px; border-radius: 4px; background: #E5E5EA; outline: none;
}
.ml-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 26px; height: 26px; border-radius: 50%;
  background: #fff; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.15), 0 0 0 1px rgba(0,0,0,.04);
  border: 2px solid #FF9500;
}
.water-slider::-webkit-slider-thumb { border-color: #5AC8FA; }
.urine-slider::-webkit-slider-thumb { border-color: #AF52DE; }
.slider-val { font-size: 22px; font-weight: 700; color: #FF9500; min-width: 70px; text-align: right; }
.slider-unit { font-size: 14px; font-weight: 400; color: #8E8E93; }

/* 異常タグ */
.abnormal-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.abn-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 12px; border: 1.5px solid #E5E5EA;
  background: #F9F9FB; font-size: 13px; cursor: pointer; color: #636366;
  transition: all .2s ease;
}
.abn-tag::before {
  content: ''; display: block; width: 7px; height: 7px; border-radius: 50%;
  background: #C7C7CC; flex-shrink: 0;
  transition: background .2s ease;
}
.abn-tag.selected {
  border-color: #E8868A; background: #FFF0F0; color: #C44040; font-weight: 600;
}
.abn-tag.selected::before { background: #E8868A; }
.abn-tag:active { transform: scale(.96); }

/* 備考入力 */
.feed-note-input {
  width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1.5px solid #D1D1D6; border-radius: 10px;
  font-size: 14px; color: #3C3C43; background: #fff; outline: none;
}
.feed-note-input:focus { border-color: #007AFF; box-shadow: 0 0 0 3px rgba(0,122,255,.12); }
.feed-note-input::placeholder { color: #C7C7CC; }

/* ウィザードステッパー進捗バー */
.wiz-stepper {
  display: flex; align-items: flex-start; margin-bottom: 18px; padding: 0 2px;
}
.wiz-step-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0;
}
.wiz-step-circle {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #C7C7CC;
  background: #F2F2F7; border: 2px solid #D1D1D6;
  transition: all .25s ease;
}
.wiz-step-circle.active {
  background: #FF9500; color: #fff; border-color: #FF9500;
  box-shadow: 0 2px 8px rgba(255,149,0,.25);
}
.wiz-step-circle.done {
  background: #34C759; color: #fff; border-color: #34C759;
}
.wiz-step-circle.done i { font-size: 14px; }
.wiz-step-name {
  font-size: 11px; color: #C7C7CC; font-weight: 500; white-space: nowrap;
}
.wiz-step-item.active .wiz-step-name { color: #FF9500; font-weight: 600; }
.wiz-step-item.done .wiz-step-name { color: #34C759; }
.wiz-step-line {
  flex: 1; height: 2px; background: #E5E5EA; margin-top: 14px;
  min-width: 12px; transition: background .25s ease;
}
.wiz-step-line.done { background: #34C759; }
.wiz-title {
  font-size: 20px; font-weight: 700; color: #1C1C1E; margin-bottom: 4px;
  display: flex; align-items: center; gap: 6px;
}
.wiz-title-icon { font-size: 22px; color: #E8A030; }
.wiz-desc {
  font-size: 14px; color: #8E8E93; margin-bottom: 16px;
}
.wiz-nav {
  display: flex; justify-content: space-between; align-items: center; margin-top: 12px; gap: 12px;
}
.wiz-btn-next {
  flex: 1; padding: 14px; background: #FF9500; color: #fff; border: none;
  border-radius: 14px; font-size: 17px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.wiz-btn-next:active { background: #E08600; }
.wiz-btn-next i { font-size: 16px; }
.wiz-btn-prev {
  padding: 14px 20px; background: #F2F2F7; color: #8E8E93; border: none;
  border-radius: 14px; font-size: 15px; font-weight: 500; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.wiz-btn-prev:active { background: #E5E5EA; }
.wiz-btn-prev i { font-size: 14px; }
.wiz-quick-pick {
  display: flex; gap: 8px;
}
.wiz-quick-pick .tap-btn { font-size: 16px; }

/* ウィザード確認サマリー */
.wiz-summary {
  background: #F9F9FB; border-radius: 14px; padding: 14px 16px; margin-bottom: 16px;
}
.wiz-sum-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; font-size: 15px; color: #3C3C43;
}
.wiz-sum-icon { margin-right: 10px; font-size: 18px; color: #AEAEB2; display: flex; align-items: center; }
.wiz-sum-icon i { font-size: 18px; }
.wiz-sum-divider {
  height: 1px; background: #E5E5EA; margin: 6px 0;
}
.wiz-sum-total {
  font-weight: 700; font-size: 16px; color: #1C1C1E;
}
.wiz-nav .btn-complete { flex: 1; margin-top: 0; }

/* 用药ウィザード — 玫瑰色テーマ */
.med-wiz .wiz-step-circle.active {
  background: #E8728A; border-color: #E8728A;
  box-shadow: 0 2px 8px rgba(232,114,138,.25);
}
.med-wiz .wiz-step-item.active .wiz-step-name { color: #E8728A; }
.med-icon { color: #E8728A !important; }
.wiz-btn-next.med-btn { background: #E8728A; }
.wiz-btn-next.med-btn:active { background: #D4566E; }
.med-wiz .tap-btn.selected {
  border-color: #E8728A; background: #FFF0F3; color: #C4264A;
}
.slider-val.med-val { color: #E8728A; }
.med-slider::-webkit-slider-thumb { border-color: #E8728A !important; }

/* 確認ボタン */
.btn-complete {
  width: 100%; padding: 15px; background: #34C759; color: #fff; border: none;
  border-radius: 14px; font-size: 18px; font-weight: 700; cursor: pointer; margin-top: 8px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-complete i { font-size: 18px; }
.btn-complete:active { background: #28A745; }

/* 完了トースト */
.feed-toast {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,.8); color: #fff; padding: 16px 28px; border-radius: 16px;
  font-size: 17px; font-weight: 600; z-index: 300; text-align: center;
  animation: toastIn .35s cubic-bezier(0.2, 0.9, 0.3, 1), toastOut .4s cubic-bezier(0.4, 0, 0.2, 1) 1.2s forwards;
  line-height: 1.6; pointer-events: none;
}
@keyframes toastIn { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.85); } 60% { opacity: 1; transform: translate(-50%,-50%) scale(1.02); } 100% { opacity: 1; transform: translate(-50%,-50%) scale(1); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; } }

/* ボトムバー */
.bottom-bar {
  position: fixed; bottom: 0; left: 0; right: 0; background: #FAFAF8;
  border-top: 1px solid #EEECE8; display: flex;
  padding: 6px 0; padding-bottom: calc(6px + env(safe-area-inset-bottom));
  z-index: 100;
}
.tab-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 2px; border: none; background: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent; padding: 4px 0;
}
.tab-icon { line-height: 1; display: flex; align-items: center; justify-content: center; }
.tab-icon i { font-size: 26px; color: #8E8E93; }
.tab-item.emergency .tab-icon i { color: #FF3B30; }
.tab-label { font-size: 10px; font-weight: 500; color: #8E8E93; }
.tab-item.emergency .tab-label { color: #FF3B30; }
.tab-item:active { opacity: .6; }

/* モーダル */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0); z-index: 200; display: none;
  align-items: flex-end; justify-content: center;
  transition: background .3s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.modal-overlay.visible { display: flex; }
.modal-overlay.active { display: flex; background: rgba(0,0,0,.4); }
.modal-overlay.closing { background: rgba(0,0,0,0); }
.modal-content {
  background: #fff; width: 100%; max-height: 80vh;
  border-radius: 20px 20px 0 0; overflow-y: auto; padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  animation: slideUp .35s cubic-bezier(0.2, 0.9, 0.3, 1);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  will-change: transform;
}
.modal-overlay.closing .modal-content {
  animation: slideDown .3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
body.modal-open { position: fixed; width: 100%; overflow: hidden; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes slideDown { from { transform: translateY(0); } to { transform: translateY(100%); } }
.modal-title {
  font-size: 20px; font-weight: 700; margin-bottom: 14px;
  display: flex; justify-content: space-between; align-items: center;
}
.modal-close {
  font-size: 28px; cursor: pointer; color: #636366; padding: 6px;
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: #F2F2F7; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.modal-close:active { background: #E5E5EA; }
.modal-bottom-close {
  width: 100%; padding: 14px; border: none; border-radius: 12px;
  background: #F2F2F7; color: #3C3C43; font-size: 17px; font-weight: 600;
  cursor: pointer; margin-top: 16px; -webkit-tap-highlight-color: transparent;
}
.modal-bottom-close:active { background: #E5E5EA; }

.emergency-item { padding: 12px; margin-bottom: 8px; background: #F2F2F7; border-radius: 10px; }
.emergency-item summary { font-size: 16px; font-weight: 600; cursor: pointer; list-style: none; }
.emergency-item summary::before { content: '\25B6 '; font-size: 11px; }
.emergency-item[open] summary::before { content: '\25BC '; }
.emergency-item p { margin-top: 8px; font-size: 15px; line-height: 1.7; color: #3C3C43; }

.settings-group { margin-bottom: 16px; }
.settings-label { font-size: 13px; color: #8E8E93; margin-bottom: 2px; }
.settings-value { font-size: 17px; }

/* 資料庫セクション */
.ref-section { margin-top: 24px; }
.ref-section-title {
  font-size: 13px; color: #8E8E93; margin-bottom: 12px;
  font-weight: 600; letter-spacing: 0.5px;
}
.ref-card {
  background: #fff; border-radius: 14px;
  margin-bottom: 12px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 0 0 0.5px rgba(0,0,0,.06);
}
.ref-card-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; cursor: pointer; font-size: 16px; font-weight: 600; color: #1C1C1E;
}
.ref-card-arrow { color: #C7C7CC; font-size: 13px; transition: transform 0.2s; }
.ref-card-body { padding: 0 16px 16px; }
.ref-card-sub { font-size: 12px; color: #8E8E93; font-weight: 400; margin-top: 2px; }

/* 栄養成分テーブル */
.nut-table { width: 100%; border-collapse: collapse; margin-top: 4px; }
.nut-table thead th {
  font-size: 12px; color: #8E8E93; font-weight: 600; padding: 6px 0 8px;
  border-bottom: 1.5px solid #E5E5EA; text-align: left;
}
.nut-table thead th:last-child { text-align: right; }
.nut-table tbody tr { border-bottom: 0.5px solid #F2F2F7; }
.nut-table tbody tr:last-child { border-bottom: none; }
.nut-table td { padding: 10px 0; font-size: 15px; }
.nut-name { color: #3C3C43; }
.nut-val { text-align: right; font-weight: 600; color: #1C1C1E; font-variant-numeric: tabular-nums; }
.nut-unit { text-align: right; font-size: 13px; color: #8E8E93; width: 30px; padding-left: 4px; }
.nut-divider { height: 1px; background: #E5E5EA; margin: 14px 0; }
.nut-footnote { font-size: 11px; color: #AEAEB2; margin-top: 12px; line-height: 1.4; }

/* レポートリンク */
.ref-report {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border-radius: 14px; padding: 16px;
  text-decoration: none; color: inherit;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 0 0 0.5px rgba(0,0,0,.06);
  margin-bottom: 12px;
}
.ref-report:active { background: #F9F9FB; }
.ref-report-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: linear-gradient(135deg, #FF6B6B, #EE5A24);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.ref-report-text { flex: 1; min-width: 0; }
.ref-report-title { font-size: 15px; font-weight: 600; color: #1C1C1E; }
.ref-report-desc { font-size: 12px; color: #8E8E93; margin-top: 2px; }
.ref-report-arrow { font-size: 16px; color: #C7C7CC; flex-shrink: 0; }

.main-screen { display: none; padding-bottom: 70px; }
.hl { font-weight: 700; color: #007AFF; }

/* フィードバック */
.fb-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.fb-tag {
  padding: 8px 16px; border-radius: 20px; border: 1.5px solid #D1D1D6;
  background: #fff; font-size: 15px; cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
}
.fb-tag.selected { border-color: #007AFF; background: #EBF2FF; color: #007AFF; font-weight: 600; }
.fb-textarea {
  width: 100%; min-height: 100px; padding: 12px; border: 1px solid #D1D1D6;
  border-radius: 12px; font-size: 16px; resize: vertical; font-family: inherit;
  -webkit-appearance: none;
}
.fb-textarea:focus { outline: none; border-color: #007AFF; box-shadow: 0 0 0 3px rgba(0,122,255,.12); }
.fb-textarea::placeholder { color: #C7C7CC; }
.fb-list { max-height: 50vh; overflow-y: auto; }
.fb-list-empty { text-align: center; color: #8E8E93; padding: 30px 0; font-size: 15px; }
.fb-item { padding: 12px 0; border-bottom: 1px solid #F2F2F7; cursor: pointer; }
.fb-item:last-child { border-bottom: none; }
.fb-item:active { background: #F2F2F7; }
.fb-item-head { display: flex; align-items: center; margin-bottom: 4px; }
.fb-item-meta { font-size: 12px; color: #8E8E93; }
.fb-item-meta-sep { margin: 0 4px; color: #C7C7CC; }
.fb-item-tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 10px; background: #EBF2FF; color: #007AFF; font-weight: 600; margin-bottom: 4px; }
.fb-item-time { font-size: 12px; color: #C7C7CC; }
.fb-item-summary { font-size: 14px; color: #8E8E93; line-height: 1.4; }
.fb-item-detail { font-size: 15px; color: #3C3C43; line-height: 1.5; }
.fb-item-arrow { font-size: 12px; color: #C7C7CC; margin-right: 2px; }
.fb-status { font-size: 11px; padding: 1px 6px; border-radius: 8px; font-weight: 600; }
.fb-status-pending { background: #F2F2F7; color: #8E8E93; }
.fb-status-progress { background: #FFF3E0; color: #FF9500; }
.fb-status-resolved { background: #E8F5E9; color: #34C759; }
.fb-status-clickable { cursor: pointer; position: relative; }
.fb-status-clickable::after { content: ' ⟳'; font-size: 9px; }
.fb-status-clickable:active { opacity: .6; }
.fb-resolved-section { margin-top: 12px; border-top: 1px solid #F2F2F7; padding-top: 8px; }
.fb-resolved-header { font-size: 14px; color: #8E8E93; padding: 8px 0; cursor: pointer; font-weight: 600; }
.fb-resolved-header:active { color: #636366; }
.fb-resolved-arrow { font-size: 12px; color: #C7C7CC; margin-right: 2px; }
.fb-dev-reply { margin-top: 10px; padding: 10px 12px; background: #F2F2F7; border-radius: 10px; font-size: 14px; color: #3C3C43; line-height: 1.5; }
.fb-dev-reply-title { font-size: 12px; font-weight: 600; color: #8E8E93; margin-bottom: 4px; }
.fb-write-btn { width: 100%; margin-top: 14px; padding: 12px; border: none; border-radius: 12px; background: #007AFF; color: #fff; font-size: 16px; font-weight: 600; cursor: pointer; }
.fb-back-btn {
  background: #EBF2FF; border: none; color: #007AFF; font-size: 16px; font-weight: 600;
  cursor: pointer; padding: 10px 18px; margin-bottom: 12px; border-radius: 10px;
  -webkit-tap-highlight-color: transparent;
}
.fb-back-btn:active { background: #D6E4FF; }
.fb-success { text-align: center; padding: 30px 20px; }
.fb-success-emoji { font-size: 48px; display: flex; justify-content: center; }
.fb-success-emoji i { font-size: 48px; color: #34C759; }
.fb-success-text { font-size: 18px; font-weight: 600; margin-top: 10px; color: #1C1C1E; }
.fb-success-sub { font-size: 15px; color: #8E8E93; margin-top: 6px; }
.fb-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid #F2F2F7;
}
.fb-action-btn {
  background: #F9F9FB; border: none; border-radius: 8px;
  padding: 6px 14px; font-size: 13px; color: #8E8E93; cursor: pointer;
}
.fb-action-btn:active { background: #E8E8ED; }
.fb-action-btn.delete { color: #FF3B30; background: #FFF5F4; }
.fb-action-btn.delete:active { background: #FFE0DE; }
.fb-comments { margin-top: 14px; padding-top: 10px; border-top: 1px solid #F2F2F7; max-height: 240px; overflow-y: auto; overscroll-behavior: contain; }
.fb-comment {
  padding: 10px 14px; margin-bottom: 8px; border-radius: 14px;
  font-size: 14px; line-height: 1.5; color: #3C3C43;
  white-space: pre-wrap; word-break: break-word;
}
.fb-comment.user-comment { background: #EBF2FF; margin-left: 20px; border-bottom-right-radius: 4px; }
.fb-comment.dev-comment { background: #F2F2F7; margin-right: 20px; border-bottom-left-radius: 4px; border-left: 3px solid #007AFF; }
.fb-comment-author { font-size: 12px; font-weight: 600; color: #8E8E93; margin-bottom: 4px; display: flex; align-items: center; }
.fb-comment-time { font-size: 11px; color: #C7C7CC; margin-left: 6px; font-weight: 400; }
.fb-comment-input { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.fb-comment-textarea {
  flex: 1; min-height: 38px; max-height: 80px; padding: 9px 14px;
  border: 1.5px solid #E5E5EA; border-radius: 20px; font-size: 15px;
  font-family: inherit; resize: none; -webkit-appearance: none;
  background: #F9F9FB; transition: border-color .25s ease, background .25s ease;
}
.fb-comment-textarea:focus { outline: none; border-color: #007AFF; background: #fff; box-shadow: 0 0 0 3px rgba(0,122,255,.1); }
.fb-comment-textarea::placeholder { color: #C7C7CC; }
.fb-comment-send {
  width: 38px; height: 38px; border-radius: 50%; border: none;
  background: #007AFF; color: #fff; font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.fb-comment-send:disabled { background: #D1D1D6; }
.fb-comment-send:active { background: #0056CC; }

/* 操作ガイド */
.guide-group-label {
  font-size: 13px; font-weight: 700; color: #8E8E93; letter-spacing: 1px;
  padding: 18px 4px 6px; margin-top: 4px; text-transform: uppercase;
}
.guide-group-label.flow { color: #007AFF; }
.guide-group-label.care { color: #34C759; }
.guide-group-label.emergency { color: #FF3B30; }
.guide-section { margin-bottom: 16px; }
.guide-section summary {
  font-size: 17px; font-weight: 700; cursor: pointer; list-style: none;
  padding: 15px 18px; background: #fff; border-radius: 14px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06); border-left: 4px solid #007AFF;
  transition: box-shadow .25s ease, background .2s ease;
}
.guide-section summary:active { background: #F5F5FA; }
.guide-section summary::after { content: '\25B6'; font-size: 12px; color: #8E8E93; margin-left: auto; transition: transform .3s ease; }
.guide-section[open] summary::after { transform: rotate(90deg); }
.guide-section summary::before { content: none; }
.guide-section.flow-section summary { border-left-color: #007AFF; }
.guide-section.care-section summary { border-left-color: #34C759; }
.guide-section.danger-section summary { border-left-color: #FF3B30; background: #FFF5F4; color: #C62828; }
.guide-section.danger-section summary::after { color: #FF3B30; }
.guide-body {
  padding: 16px 20px; margin-top: 6px; background: #F9F9FB;
  border-radius: 14px; font-size: 16px; line-height: 1.85; color: #3C3C43;
}
.guide-step {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 10px;
  border-radius: 10px; margin-bottom: 4px;
}
.guide-step:nth-child(odd) { background: rgba(0,0,0,.02); }
.guide-step:last-child { margin-bottom: 0; }
.guide-step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; background: #007AFF; color: #fff;
  border-radius: 50%; font-size: 14px; font-weight: 700; flex-shrink: 0; margin-top: 1px;
}
.guide-section.care-section .guide-step-num { background: #34C759; }
.guide-step-text { flex: 1; }
.guide-step-text strong { color: #1C1C1E; }
.guide-key {
  display: inline-block; background: #E8F0FE; color: #1A56DB;
  padding: 1px 7px; border-radius: 6px; font-weight: 700; font-size: 15px; white-space: nowrap;
}
.guide-key.warn { background: #FFF2F0; color: #D32F2F; }
.guide-warn {
  background: #FFF5F4; border: 1px solid #FFCDD2; border-radius: 12px;
  padding: 12px 16px; margin: 8px 0; font-size: 15px; color: #C62828; line-height: 1.7;
}
.guide-ok { background: #E8F5E9; border-radius: 12px; padding: 12px 16px; margin: 8px 0; font-size: 15px; color: #2E7D32; }
.guide-table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 15px; border-radius: 12px; overflow: hidden; }
.guide-table th { background: #E8EDF3; padding: 12px 14px; text-align: left; font-weight: 700; color: #1C1C1E; }
.guide-table td { padding: 12px 14px; border-bottom: 1px solid #F2F2F7; vertical-align: top; }
.guide-table tr:nth-child(even) td { background: #FAFBFC; }
.guide-table .danger { color: #C62828; font-weight: 600; background: #FFF8F7; }
.guide-danger-list { list-style: none; padding: 0; margin: 0; }
.guide-danger-list li {
  padding: 12px 16px; margin-bottom: 8px; background: #FFF5F4;
  border-left: 4px solid #FF3B30; border-radius: 10px; font-size: 16px; font-weight: 600; color: #C62828;
}
.guide-source {
  background: #F5F5FA; border-radius: 10px; padding: 12px 16px;
  margin-top: 20px; text-align: center; font-size: 13px; color: #8E8E93;
}

/* ========== 記録タブ ========== */
.records-modal-content { max-height: 90vh; }
.records-subtabs {
  display: flex; gap: 0; margin-bottom: 14px;
  background: #F2F2F7; border-radius: 10px; padding: 3px;
}
.records-subtab {
  flex: 1; padding: 9px 0; border: none; background: transparent;
  border-radius: 8px; font-size: 15px; font-weight: 600;
  color: #8E8E93; cursor: pointer; text-align: center;
  transition: background .2s, color .2s;
}
.records-subtab.active {
  background: #fff; color: #007AFF;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

/* カレンダー */
.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.cal-header-title { font-size: 17px; font-weight: 700; }
.cal-nav-btn {
  background: none; border: none; font-size: 22px;
  color: #007AFF; cursor: pointer; padding: 4px 12px;
}
.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  text-align: center; font-size: 12px; color: #8E8E93;
  font-weight: 600; margin-bottom: 4px;
}
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 2px; margin-bottom: 6px;
}
.cal-cell {
  aspect-ratio: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  border-radius: 10px; font-size: 14px; cursor: pointer;
  position: relative; transition: background .15s;
}
.cal-cell:active { opacity: 0.6; }
.cal-cell.today { font-weight: 700; }
.cal-cell.selected { background: #007AFF; color: #fff; }
.cal-cell.selected .cal-dot { opacity: 0.8; }
.cal-cell.empty { cursor: default; }
.cal-cell .cal-dot {
  width: 6px; height: 6px; border-radius: 50%;
  position: absolute; bottom: 3px;
}
.cal-legend {
  display: flex; justify-content: center; gap: 16px;
  padding: 4px 0 2px; font-size: 12px; color: #8E8E93;
}
.cal-legend-item { display: flex; align-items: center; gap: 4px; }
.cal-legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* 日詳細 */
.cal-day-detail {
  margin-top: 10px; padding: 14px; background: #F9F9FB;
  border-radius: 14px;
}
.cal-day-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px;
  margin-bottom: 12px;
}
.cal-day-stat {
  background: #fff; padding: 10px 12px; border-radius: 10px;
}
.cal-day-stat .stat-val { font-size: 20px; font-weight: 700; }
.cal-day-stat .stat-label { font-size: 12px; color: #8E8E93; }

/* 時間帯グラデーション帯 */
.period-band {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border-radius: 12px; margin-top: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.period-label { font-size: 15px; font-weight: 700; }
.period-summary { font-size: 13px; color: #636366; font-weight: 600; }
.period-empty { text-align: center; color: #C7C7CC; font-size: 13px; padding: 10px 0; }

/* 記録行（色付きドット付き） */
.record-row {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 7px 4px; font-size: 13px;
  border-bottom: 1px solid #F2F2F7;
}
.record-time { color: #8E8E93; font-weight: 500; white-space: nowrap; min-width: 40px; }
.record-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  margin-top: 4px;
}
.record-info { flex: 1; color: #1C1C1E; line-height: 1.4; }
.record-by { color: #C7C7CC; font-size: 11px; white-space: nowrap; }

/* 統計 */
.stats-range-selector { display: flex; gap: 8px; margin-bottom: 14px; }
.stats-range-btn {
  flex: 1; padding: 10px; border: 2px solid #D1D1D6;
  border-radius: 12px; background: #fff; font-size: 15px;
  font-weight: 600; cursor: pointer; text-align: center;
  transition: border-color .15s, background .15s, color .15s;
}
.stats-range-btn.selected {
  border-color: #007AFF; background: #EBF2FF; color: #007AFF;
}
.stats-summary-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-bottom: 16px;
}
.stats-card {
  background: #fff; padding: 14px; border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.stats-card .card-val { font-size: 24px; font-weight: 800; color: #1C1C1E; }
.stats-card .card-unit { font-size: 13px; color: #8E8E93; }
.stats-card .card-label { font-size: 13px; color: #8E8E93; margin-top: 2px; }
.chart-wrap {
  background: #fff; border-radius: 14px; padding: 14px;
  margin-bottom: 14px; box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.chart-wrap canvas { max-height: 200px; }
.chart-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
