* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] { display: none !important; }

:root {
  /* 2026-08-28 デザイン刷新：生成り地×白カード（会員サイトと同じ family）
     グリーン（主）× オレンジ（差し色） */
  --green: #2E7062;
  --green-light: #DCEBE6;
  --green-pale: #EEF6F3;
  --green-dark: #245A4E;
  --amber: #E8912C;
  --amber-light: #FCEFDC;
  --amber-dark: #C0741A;
  --red: #C0483C;
  --red-light: #FBECEA;
  --gray: #6E6862;
  --faint: #9A938B;
  --line: #E9E5DD;
  --tile: #F1EEE8;
  --bg: #F4F2EE;
  --white: #FFFFFF;
  --text: #1F1D1A;
  --text-light: #6E6862;
  --radius: 20px;
  --radius-s: 14px;
  --shadow: 0 1px 3px rgba(31,29,26,0.05);
  --head-h: 56px;
}

body {
  font-family: -apple-system, 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

/* ヘッダー */
.header {
  background: var(--green);
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
}

.logo-icon {
  font-size: 28px;
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}

.logo-text small {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.9;
}

/* メインセクション */
.main {
  padding: 24px 20px 40px;
}

.hero {
  text-align: center;
  margin-bottom: 24px;
}

.hero-text {
  font-size: 16px;
  color: var(--text-light);
  line-height: 1.8;
}

/* アップロードカード */
.upload-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}

.upload-area {
  border: 2px dashed #C8E6D4;
  border-radius: 12px;
  background: var(--green-light);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  transition: border-color 0.2s;
  margin-bottom: 16px;
}

.upload-area:hover, .upload-area.drag-over {
  border-color: var(--green);
  background: #D5F0E0;
}

.upload-placeholder {
  text-align: center;
  pointer-events: none;
}

.upload-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.upload-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--green-dark);
  margin-bottom: 4px;
}

.upload-hint {
  font-size: 12px;
  color: var(--gray);
}

.preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  position: absolute;
  inset: 0;
}

/* 写真を選んだあと：アップロード枠を「＋追加」バーに縮める */
.upload-area.has-photos {
  min-height: 0;
  padding: 12px;
  margin-bottom: 12px;
}
.upload-area.has-photos .upload-icon {
  font-size: 22px;
  margin-bottom: 0;
}
.upload-area.has-photos .upload-label {
  font-size: 14px;
}

/* 複数写真のプレビュー（コース料理・複数皿） */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 4px;
}
.preview-cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: #F0F3F1;
}
.preview-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.preview-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.preview-remove:hover { background: rgba(0,0,0,0.75); }

/* 食べた日 */
.date-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 4px 2px;
}
.date-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.date-input {
  flex: 0 0 auto;
  padding: 10px 12px;
  border: 1.5px solid #E3EBE6;
  border-radius: 12px;
  background: #FAFCFB;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.date-input:focus {
  border-color: var(--green);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(39,174,96,0.12);
}

/* ===== 食事の種類（選択式） ===== */
.meal-field {
  margin-top: 18px;
}

.meal-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.meal-optional {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray);
  background: #EEF2F0;
  border-radius: 999px;
  padding: 1px 8px;
}

/* セグメント（iOS風）：ひとつの帯の上で、選んだものだけ白く浮く */
.meal-select {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  background: #EAF3ED;
  border-radius: 14px;
  padding: 4px;
}

.meal-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 2px 8px;
  background: transparent;
  border: none;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 600;
  color: #6D8377;
  cursor: pointer;
  transition: background .18s, color .18s, box-shadow .18s;
  -webkit-tap-highlight-color: transparent;
}

.meal-chip .meal-emoji {
  font-size: 17px;
  line-height: 1;
  filter: grayscale(0.35);
  opacity: 0.7;
  transition: filter .18s, opacity .18s, transform .18s;
}

.meal-chip.active {
  background: var(--white);
  color: var(--green-dark);
  box-shadow: 0 2px 8px rgba(30,84,73,0.14);
}

.meal-chip.active .meal-emoji {
  filter: none;
  opacity: 1;
  transform: translateY(-1px);
}

/* ===== ひとことメモ（モダン版） ===== */
.note-field {
  position: relative;
  margin-top: 16px;
}

.note-field-icon {
  position: absolute;
  top: 14px;
  left: 14px;
  font-size: 15px;
  opacity: 0.5;
  pointer-events: none;
}

.note-input {
  width: 100%;
  padding: 13px 16px 13px 40px;
  border: 1.5px solid #E3EBE6;
  border-radius: 14px;
  background: #FAFCFB;
  font-size: 15px;
  font-family: inherit;
  line-height: 1.6;
  color: var(--text);
  resize: none;
  outline: none;
  box-sizing: border-box;
  transition: border-color .15s, background .15s, box-shadow .15s;
}

.note-input:focus {
  border-color: var(--green);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(39,174,96,0.12);
}

.note-input::placeholder {
  color: #B7C4BC;
  font-size: 13px;
}

.note-count {
  position: absolute;
  right: 12px;
  bottom: 8px;
  font-size: 11px;
  color: #B7C4BC;
  pointer-events: none;
}

.btn-analyze {
  width: 100%;
  padding: 16px;
  margin-top: 12px;
  background: var(--green);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-analyze:hover:not(:disabled) {
  background: var(--green-dark);
}

.btn-analyze:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-icon {
  font-size: 18px;
}

.notes {
  padding: 0 4px;
}

.notes p {
  font-size: 12px;
  color: var(--gray);
  margin-bottom: 4px;
}

/* ローディング */
.loading {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.loading-inner {
  text-align: center;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #C8E6D4;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-inner p {
  font-size: 16px;
  color: var(--text);
  line-height: 1.8;
}

.loading-inner small {
  font-size: 13px;
  color: var(--gray);
}

/* 結果セクション */
.result {
  padding-bottom: 48px;
}

.result-header {
  background: var(--green);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.result-header h2 {
  color: white;
  font-size: 17px;
  font-weight: 700;
}

.btn-back {
  background: none;
  border: none;
  color: white;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 0;
  white-space: nowrap;
}

/* 送信した写真（結果画面） */
.result-imgs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 16px 20px 0;
}
.result-imgs.multi {
  grid-template-columns: 1fr 1fr;
}
.result-imgs img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: block;
}
.result-imgs.multi img {
  max-height: 160px;
}

/* 総評コメントカード（点数は出さない） */
.summary-card {
  background: var(--white);
  margin: 16px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  border-left: 4px solid var(--green);
}
.summary-icon { font-size: 26px; line-height: 1.2; flex-shrink: 0; }
.summary-text {
  flex: 1;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
  font-weight: 600;
}
.summary-card.flash { animation: scoreflash 1s ease; }

/* 共通カード */
.card {
  background: var(--white);
  margin: 0 20px 12px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text);
}

/* 食品タグ */
.food-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.food-tag {
  background: var(--green-light);
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
}

/* 良い点 */
.good-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.good-list li {
  font-size: 14px;
  color: var(--text);
  padding-left: 20px;
  position: relative;
  line-height: 1.6;
}

.good-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
}

/* チェック項目 */
.issues-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.issue-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
}

.issue-item.ok {
  background: var(--green-light);
}

.issue-item.caution {
  background: var(--amber-light);
}

.issue-item.warning {
  background: var(--red-light);
}

.issue-badge {
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1;
  margin-top: 1px;
}

.issue-content {
  flex: 1;
}

.issue-category {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 3px;
}

.issue-item.ok .issue-category { color: var(--green-dark); }
.issue-item.caution .issue-category { color: #D68910; }
.issue-item.warning .issue-category { color: #C0392B; }

.issue-detail {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.6;
}

/* アドバイスカード */
.advice-card {
  background: #EBF5FB;
  border-left: 4px solid #3498DB;
}

.advice-text {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
}

/* Dr.MaMaメッセージ */
.mama-card {
  background: #FDF8FF;
  border-left: 4px solid #9B59B6;
}

.mama-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.mama-avatar {
  font-size: 32px;
}

.mama-name {
  font-size: 13px;
  font-weight: 700;
  color: #7D3C98;
}

.mama-message {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
}

/* 再分析ボタン */
.btn-retry {
  display: block;
  width: calc(100% - 40px);
  margin: 20px 20px 0;
  padding: 16px;
  background: var(--white);
  color: var(--green);
  border: 2px solid var(--green);
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s;
}

.btn-retry:hover {
  background: var(--green-light);
}

/* ===== お名前ゲート ===== */
.name-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: linear-gradient(160deg, var(--green) 0%, var(--green-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.name-gate-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 24px;
  width: 100%;
  max-width: 360px;
  text-align: center;
}
.name-gate-icon { font-size: 44px; }
.name-gate-title {
  font-size: 22px;
  color: var(--green-dark);
  margin: 8px 0 6px;
}
.name-gate-text {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 20px;
}
.name-gate-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border: 2px solid var(--green-light);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s;
}
.name-gate-input:focus { border-color: var(--green); }
.name-gate-btn {
  width: 100%;
  margin-top: 14px;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  color: white;
  background: var(--green);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}
.name-gate-btn:hover { background: var(--green-dark); }
.name-gate-hint {
  margin-top: 14px;
  font-size: 12px;
  color: var(--gray);
}
.name-gate-input.shake { animation: shake 0.4s; border-color: var(--red); }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ===== ヘッダーのユーザー表示 ===== */
.header-inner { justify-content: space-between; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.18);
  padding: 6px 8px 6px 12px;
  border-radius: 999px;
}
.user-name {
  color: white;
  font-size: 13px;
  font-weight: 600;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-change {
  color: var(--green-dark);
  background: white;
  border: none;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* ===== プロフィール入力（ゲート内） ===== */
.name-gate { overflow-y: auto; }
.name-gate-card { margin: auto; max-width: 380px; }
.name-gate .name-gate-input { padding: 12px 14px; font-size: 15px; }
.pf-field { text-align: left; margin-top: 12px; }
.pf-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
}
.pf-req {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--green);
  border-radius: 999px;
  padding: 1px 7px;
  margin-left: 4px;
  vertical-align: middle;
}
.pf-hint-inline { font-size: 11px; color: var(--gray); margin-top: 5px; }
.pf-row { display: flex; gap: 10px; }
.pf-half { flex: 1; min-width: 0; }
.sex-select {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  background: #EAF3ED;
  border-radius: 12px;
  padding: 3px;
}
.sex-chip {
  padding: 9px 2px;
  background: transparent;
  border: none;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  color: #6D8377;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}
.sex-chip.active {
  background: var(--white);
  color: var(--green-dark);
  box-shadow: 0 2px 6px rgba(30,84,73,0.14);
}

/* ===== ヒアリング（確認質問） ===== */
.clarify { padding-bottom: 40px; }
.clarify-intro {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--amber-light);
  margin: 16px 20px;
  padding: 16px;
  border-radius: var(--radius);
  border-left: 4px solid var(--amber);
}
.clarify-intro-icon { font-size: 26px; line-height: 1; }
.clarify-intro p { font-size: 14px; line-height: 1.7; color: var(--text); }
.clarify-list { padding: 0 20px; }
.clarify-item {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-bottom: 12px;
}
.clarify-q { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 12px; line-height: 1.5; }
.clarify-opts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.clarify-chip {
  padding: 8px 14px;
  border: 1.5px solid #D8E6DD;
  background: #FAFCFB;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: .15s;
  -webkit-tap-highlight-color: transparent;
}
.clarify-chip.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.clarify-free {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #E3EBE6;
  border-radius: 10px;
  background: #FAFCFB;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.clarify-free:focus {
  border-color: var(--green);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(39,174,96,0.12);
}
.clarify .btn-analyze { width: calc(100% - 40px); margin: 8px 20px 0; }
.clarify .btn-retry { margin-top: 10px; }

/* ===== スタッフ添削パネル ===== */
.staff-card {
  background: #F4F7FB;
  border: 1.5px dashed #B9C7D6;
  box-shadow: none;
}
.staff-toggle {
  width: 100%;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 700;
  color: #34557A;
  cursor: pointer;
  text-align: left;
  padding: 2px;
}
.staff-note { font-size: 12px; color: #5B7089; margin: 12px 0; line-height: 1.6; }

/* チャットログ */
.chat-log {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px 2px;
  margin-bottom: 10px;
}
.chat-bubble {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 15px;
  font-size: 13.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-bubble.ai {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #DCE4EC;
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.chat-bubble.me {
  align-self: flex-end;
  background: #34557A;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-bubble.typing { color: #8A99AA; letter-spacing: 2px; opacity: .7; }

.chat-name {
  width: 100%;
  padding: 8px 11px;
  border: 1.5px solid #D3DDE8;
  border-radius: 9px;
  background: #fff;
  font-size: 12px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  margin-bottom: 8px;
}
.chat-name:focus { border-color: #34557A; box-shadow: 0 0 0 3px rgba(52,85,122,0.12); }

.chat-input-row { display: flex; gap: 8px; align-items: flex-end; }
.chat-input {
  flex: 1;
  min-width: 0;
  padding: 11px 13px;
  border: 1.5px solid #D3DDE8;
  border-radius: 12px;
  background: #fff;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.6;
  color: var(--text);
  outline: none;
  resize: none;
  transition: border-color .15s, box-shadow .15s;
}
.chat-input:focus { border-color: #34557A; box-shadow: 0 0 0 3px rgba(52,85,122,0.12); }
.chat-send {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: #34557A;
  color: #fff;
  font-size: 17px;
  cursor: pointer;
  transition: background .2s, opacity .2s;
}
.chat-send:hover:not(:disabled) { background: #29456A; }
.chat-send:disabled { opacity: .5; cursor: default; }

/* 直した箇所を軽く光らせる（.summary-card.flash で使用） */
@keyframes scoreflash {
  0% { box-shadow: 0 0 0 0 rgba(52,85,122,0.45); }
  100% { box-shadow: var(--shadow); }
}

/* ===== スタッフモード バナー / 改善メモ ===== */
.staff-banner {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #34557A;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
}
.staff-banner button {
  background: rgba(255,255,255,.2);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.staff-fab {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 40;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  background: #34557A;
  color: #fff;
  font-size: 24px;
  box-shadow: 0 4px 14px rgba(0,0,0,.28);
  cursor: pointer;
}
.staff-fab:hover { background: #29456A; }
.af-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(20,40,30,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.af-panel {
  background: var(--white);
  width: 100%;
  max-width: 380px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,.3);
}
.af-panel-head {
  background: #34557A;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-weight: 700;
}
.af-panel-head button {
  background: rgba(255,255,255,.2);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
}
.af-desc { font-size: 12px; color: var(--text-light); padding: 14px 16px 6px; line-height: 1.6; }
.af-select, .af-textarea, .af-name {
  width: calc(100% - 32px);
  margin: 6px 16px;
  padding: 11px 13px;
  border: 1.5px solid #D6E2DA;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.6;
  color: var(--text);
  outline: none;
  background: #fff;
}
.af-textarea { resize: vertical; }
.af-select:focus, .af-textarea:focus, .af-name:focus {
  border-color: #34557A;
  box-shadow: 0 0 0 3px rgba(52,85,122,.12);
}
.af-send {
  display: block;
  width: calc(100% - 32px);
  margin: 10px 16px 16px;
  padding: 13px;
  background: #34557A;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.af-send:disabled { opacity: .5; cursor: default; }
.af-done {
  margin: 0 16px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--green-dark);
  background: var(--green-light);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: center;
}

/* ===== スタッフ意見フォーム（結果画面） ===== */
.staff-fb-title { font-size: 14px; font-weight: 700; color: #34557A; margin-bottom: 2px; }
.staff-fb-input {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid #D3DDE8;
  border-radius: 11px;
  background: #fff;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.6;
  color: var(--text);
  outline: none;
  resize: vertical;
  margin-top: 8px;
}
.staff-fb-input:focus { border-color: #34557A; box-shadow: 0 0 0 3px rgba(52,85,122,.12); }
.staff-fb-name {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #D3DDE8;
  border-radius: 9px;
  background: #fff;
  font-size: 12px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  margin-top: 8px;
}
.staff-fb-name:focus { border-color: #34557A; box-shadow: 0 0 0 3px rgba(52,85,122,.12); }
.staff-fb-send {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  background: #34557A;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.staff-fb-send:hover:not(:disabled) { background: #29456A; }
.staff-fb-send:disabled { opacity: .5; cursor: default; }

/* ===== 各画面の「この画面へのご意見」欄（スタッフ試用中のみ表示） ===== */
.screen-fb {
  margin: 16px 20px 0;
  padding: 12px 14px;
  background: #F4F7FB;
  border: 1.5px dashed #B9C7D6;
  border-radius: 12px;
}
.name-gate-card .screen-fb { margin: 18px 0 0; text-align: left; }
.screen-fb-label { font-size: 12px; font-weight: 700; color: #34557A; margin-bottom: 8px; }
.screen-fb-text {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #D3DDE8;
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.6;
  color: var(--text);
  outline: none;
  resize: vertical;
}
.screen-fb-text:focus { border-color: #34557A; box-shadow: 0 0 0 3px rgba(52,85,122,.12); }
.screen-fb-send {
  margin-top: 8px;
  padding: 9px 18px;
  background: #34557A;
  color: #fff;
  border: none;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.screen-fb-send:disabled { opacity: .5; cursor: default; }
.screen-fb-done {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--green-dark);
}

/* スクショ添付（改善フィードバック） */
.screen-fb-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.screen-fb-file, .af-file {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #34557A;
  background: #E7EEF6;
  border: 1.5px solid #C9D6E5;
  border-radius: 9px;
  padding: 8px 12px;
  cursor: pointer;
  white-space: nowrap;
}
.screen-fb-file:hover, .af-file:hover { background: #DCE6F2; }
.screen-fb-fname { display: block; margin-top: 6px; font-size: 11px; color: #34557A; word-break: break-all; }
.af-file { display: block; text-align: center; margin: 8px 16px 0; }

/* ============================================================
   2026-08-28 デザイン刷新（参考UIに寄せる）
   生成りの地／白の角丸カード／行リスト／丸ピル／下線タブ
   ここから下が新しい見た目。上の定義を必要なぶんだけ上書きする。
   ============================================================ */

body{ font-weight:500; letter-spacing:.005em; }

/* ---- ヘッダー：白・中央にタイトル・左右にアイコン ---- */
.header{
  background:#fff; border-bottom:1px solid var(--line);
  padding:0; height:var(--head-h);
}
.header-inner{
  height:var(--head-h); max-width:720px; margin:0 auto; padding:0 6px;
  display:grid; grid-template-columns:52px 1fr auto; align-items:center; gap:4px;
}
.head-left{ display:flex; align-items:center; }
.logo{ color:var(--text); justify-content:center; gap:7px; }
.logo-icon{ font-size:19px; }
.logo-text{ font-size:15.5px; font-weight:800; line-height:1.25; text-align:center; }
.logo-text small{ font-size:10.5px; font-weight:700; color:var(--faint); opacity:1; }

.icon-btn{
  width:42px; height:42px; border:0; background:transparent; cursor:pointer;
  display:flex; align-items:center; justify-content:center; color:var(--text);
  border-radius:50%; padding:0; -webkit-tap-highlight-color:transparent;
}
.icon-btn:hover{ background:var(--bg); }
.icon-btn svg{ width:22px; height:22px; stroke:currentColor; stroke-width:1.9; fill:none;
  stroke-linecap:round; stroke-linejoin:round; }

.user-chip{
  display:flex; align-items:center; gap:6px; background:transparent;
  padding:0 4px 0 0; border-radius:999px;
}
.user-name{ font-size:12.5px; font-weight:700; color:var(--gray); max-width:88px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.user-change{
  font-size:11.5px; font-weight:700; color:var(--green-dark);
  background:var(--green-light); border:0; border-radius:999px; padding:4px 11px; cursor:pointer;
}

/* ---- 本文の枠 ---- */
.main,.result,.clarify,.history{ max-width:720px; margin:0 auto; padding:18px 16px 90px; }
.hero{ margin-bottom:16px; }
.hero-text{ font-size:15px; font-weight:700; color:var(--gray); line-height:1.7; text-wrap:pretty; }

/* ---- カード全般 ---- */
.card,.upload-card,.summary-card,.name-gate-card,.af-panel{
  background:#fff; border:0; border-radius:var(--radius); box-shadow:var(--shadow);
}
.card{ padding:18px 20px; margin-bottom:12px; }
.card-title{ font-size:15.5px; font-weight:800; color:var(--text); margin-bottom:12px; }
.upload-card{ padding:16px; margin-bottom:14px; }

/* ---- 写真えらび ---- */
.upload-area{
  background:var(--tile); border:1.5px dashed #d8d2c7; border-radius:var(--radius-s);
  padding:30px 16px;
}
.upload-area:hover,.upload-area.drag-over{ border-color:var(--green); background:var(--green-pale); }
.upload-icon{ font-size:32px; }
.upload-label{ font-size:15px; font-weight:700; color:var(--text); }
.upload-hint{ font-size:12px; color:var(--faint); }
.preview-cell img{ border-radius:12px; }
.preview-remove{ background:rgba(31,29,26,.62); border:0; }

/* ---- 日付・食事の種類・メモ ---- */
.date-field,.meal-field,.note-field{ margin-top:14px; }
.date-label,.meal-label{ font-size:12.5px; font-weight:700; color:var(--gray); }
.meal-optional{ font-size:10.5px; font-weight:700; color:var(--faint);
  background:var(--tile); border-radius:999px; padding:2px 8px; margin-left:6px; }
.date-input,.note-input,.clarify-free,.name-gate-input,
.af-select,.af-textarea,.af-name,.staff-fb-input,.staff-fb-name,.screen-fb-text{
  border:1.5px solid var(--line); border-radius:var(--radius-s); background:#fff;
  color:var(--text); font-family:inherit;
}
.date-input:focus,.note-input:focus,.clarify-free:focus,.name-gate-input:focus,
.af-select:focus,.af-textarea:focus,.af-name:focus,.staff-fb-input:focus,
.staff-fb-name:focus,.screen-fb-text:focus{ border-color:var(--green); outline:none; }
.note-count{ color:var(--faint); font-size:11px; }

/* ---- 食事の種類：帯のなかで切り替えるかたち（参考UIのアイコンタブ） ---- */
.meal-select{ background:var(--tile); border-radius:var(--radius-s); padding:4px; gap:3px; }
.meal-chip{ border-radius:11px; color:var(--gray); font-size:11px; font-weight:700; }
.meal-chip .meal-emoji{ filter:grayscale(.5); opacity:.65; }
.meal-chip.active{ background:#fff; color:var(--green-dark); box-shadow:0 1px 4px rgba(31,29,26,.10); }
.meal-chip.active .meal-emoji{ filter:none; opacity:1; }

/* ---- ヒアリングの選択肢：線の丸チップ ---- */
.clarify-chip{
  background:#fff; border:1.3px solid var(--line); color:var(--gray);
  border-radius:999px; padding:8px 15px; font-size:13px; font-weight:700;
  font-family:inherit; cursor:pointer; transition:.12s;
}
.clarify-chip:hover{ border-color:var(--green); color:var(--green-dark); }
.clarify-chip.active{ background:var(--green); border-color:var(--green); color:#fff; }

/* ---- ボタン ---- */
.btn-analyze,.name-gate-btn,.af-send,.staff-fb-send,.screen-fb-send,.chat-send{
  background:var(--green); color:#fff; border:0; border-radius:999px;
  font-weight:700; font-family:inherit; cursor:pointer;
}
.btn-analyze{ padding:16px; font-size:16.5px; margin-top:16px; }
.btn-analyze:hover:not(:disabled){ background:var(--green-dark); }
.btn-retry{
  background:#fff; color:var(--green-dark); border:1.3px solid #cfe0da;
  border-radius:999px; font-weight:700; padding:14px; width:100%;
}
.btn-retry:hover{ background:var(--green-pale); }
.btn-back{
  background:transparent; border:0; color:var(--green-dark);
  font-weight:700; font-size:13.5px; cursor:pointer; padding:6px 4px;
}

/* ---- 見出し（結果・ヒアリング・履歴）：緑の帯はやめて、地の上に置く ---- */
.result-header{
  background:transparent; position:static; padding:0;
  display:flex; align-items:center; gap:10px; margin-bottom:16px;
}
.result-header h2{ font-size:20px; font-weight:800; color:var(--text); }
.btn-back{ color:var(--green-dark); }

/* ---- 総評 ---- */
.summary-card{
  display:flex; gap:12px; padding:18px 20px; margin-bottom:12px; border-left:0;
}
.summary-icon{ font-size:20px; line-height:1.6; }
.summary-text{ font-size:15px; line-height:1.85; color:var(--text); font-weight:700; text-wrap:pretty; }

/* ---- 検出食品：線のチップ ---- */
.food-tag{
  background:#fff; color:var(--green-dark); border:1.3px solid var(--green);
  border-radius:999px; padding:5px 13px; font-size:12.5px; font-weight:700;
}

/* ---- 良い点 ---- */
.good-list li{ font-size:14px; line-height:1.85; color:var(--text); }
.good-list li::before{ color:var(--green); }

/* ---- チェック項目：ピル＋本文 ---- */
.issue-item{ background:transparent !important; padding:12px 0; border-radius:0; position:relative; }
.issue-item + .issue-item::before{
  content:""; position:absolute; left:0; right:0; top:0; height:1px; background:var(--line);
}
.issue-badge{ display:none; }
.issue-category{
  display:inline-block; font-size:11.5px; font-weight:800; border-radius:999px;
  padding:2px 11px; margin-bottom:6px;
}
.issue-item.ok .issue-category{ background:var(--green-light); color:var(--green-dark); }
.issue-item.caution .issue-category{ background:var(--amber-light); color:var(--amber-dark); }
.issue-item.warning .issue-category{ background:var(--red-light); color:var(--red); }
.issue-detail{ font-size:13.5px; line-height:1.85; color:var(--gray); text-wrap:pretty; }

/* ---- 改善アドバイス・Dr.MaMa ---- */
.advice-card{ background:var(--amber-light); }
.advice-text{ font-size:14px; line-height:1.85; color:var(--text); text-wrap:pretty; }
.mama-card{ background:var(--green-pale); }
.mama-avatar{ background:#fff; border-radius:50%; width:40px; height:40px;
  display:flex; align-items:center; justify-content:center; font-size:21px; }
.mama-name{ font-size:12.5px; font-weight:800; color:var(--green-dark); }
.mama-message{ font-size:14px; line-height:1.85; color:var(--text); text-wrap:pretty; }

/* ---- プロフィール入力 ---- */
.name-gate-card{ padding:28px 22px 24px; border-radius:24px; }
.name-gate-title{ font-size:20px; font-weight:800; }
.name-gate-text{ font-size:13.5px; color:var(--gray); }
.pf-label{ font-size:12.5px; font-weight:700; color:var(--gray); }
.pf-req{ background:var(--amber-light); color:var(--amber-dark); font-size:10.5px;
  border-radius:999px; padding:1px 8px; margin-left:5px; font-weight:800; }
.sex-chip{
  background:#fff; border:1.3px solid var(--line); color:var(--gray);
  border-radius:999px; font-size:12.5px; font-weight:700; padding:8px 0; cursor:pointer; font-family:inherit;
}
.sex-chip.active{ background:var(--green); border-color:var(--green); color:#fff; }
.name-gate-btn{ padding:15px; font-size:16px; }
.name-gate-hint,.pf-hint-inline{ font-size:11.5px; color:var(--faint); }

/* ---- ヒアリング ---- */
.clarify-intro{
  background:var(--green-pale); border-radius:var(--radius-s);
  padding:14px 16px; margin-bottom:14px; font-size:13.5px; line-height:1.8; color:var(--gray);
}
.clarify-item{ background:#fff; border-radius:var(--radius); box-shadow:var(--shadow);
  padding:16px 18px; margin-bottom:12px; }
.clarify-q{ font-size:14.5px; font-weight:700; color:var(--text); margin-bottom:10px; }
.clarify-hint{ font-size:11.5px; color:var(--faint); margin:-4px 0 9px; }

/* ---- スタッフまわり（見た目だけ揃える） ---- */
.staff-banner{ background:var(--green-dark); }
.staff-fab{ background:var(--green-dark); box-shadow:0 4px 14px rgba(31,29,26,.22); }
.staff-card{ background:var(--tile); }
.screen-fb{ background:#fff; border:1px solid var(--line); border-radius:var(--radius-s); }
.notes p{ color:var(--faint); font-size:12px; }
.loading-inner{ background:#fff; border-radius:var(--radius); }
.spinner{ border-top-color:var(--green); }

/* ---- これまでの記録（履歴）---- */
.history-lead{ font-size:13px; color:var(--gray); margin-bottom:14px; }
.history-list{
  background:#fff; border-radius:var(--radius); box-shadow:var(--shadow);
  overflow:hidden; margin-bottom:16px;
}
.history-list:empty{ display:none; }
.hrow{
  display:flex; align-items:center; gap:13px; width:100%;
  padding:13px 15px; background:transparent; border:0; cursor:pointer;
  text-align:left; font-family:inherit; position:relative; transition:.12s;
  -webkit-tap-highlight-color:transparent;
}
.hrow + .hrow::before{
  content:""; position:absolute; left:76px; right:0; top:0; height:1px; background:var(--line);
}
.hrow:hover{ background:#faf9f6; }
.hrow.is-flat{ cursor:default; opacity:.6; }
.hrow-thumb{
  flex:0 0 auto; width:48px; height:48px; border-radius:var(--radius-s);
  background:var(--tile); overflow:hidden; display:flex; align-items:center;
  justify-content:center; font-size:21px;
}
.hrow-thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.hrow-b{ flex:1 1 auto; min-width:0; display:flex; flex-direction:column; gap:2px; }
.hrow-head{
  display:flex; align-items:center; gap:8px; flex-wrap:wrap;
  font-size:14.5px; font-weight:700; color:var(--text);
}
.hrow-meal{
  font-size:11px; font-weight:800; color:var(--gray);
  background:var(--tile); border-radius:999px; padding:2px 9px;
}
.hrow-sum{
  font-size:12.5px; color:var(--gray); line-height:1.6;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.hrow-chev{
  flex:0 0 auto; width:9px; height:9px; margin-right:2px;
  border-right:2px solid #c3bcb2; border-top:2px solid #c3bcb2; transform:rotate(45deg);
}
.history-empty,.history-loading{
  text-align:center; color:var(--faint); font-size:13.5px; line-height:1.9; padding:36px 0;
}
@media (max-width:400px){
  .hrow{ padding:12px; gap:11px; }
  .hrow-thumb{ width:44px; height:44px; }
  .hrow + .hrow::before{ left:67px; }
}

/* はじめの登録画面も、地は生成りに（濃い緑の全面はやめる） */
.name-gate{ background:var(--bg); }
.name-gate-icon{ font-size:34px; }

/* ===== 2026-09-21 送るだけ・記録カレンダー ===== */
.btn-quick{
  width:100%; margin-top:10px; padding:14px; display:flex; align-items:center; justify-content:center; gap:8px;
  background:#fff; color:var(--green-dark); border:1.5px solid var(--green); border-radius:999px;
  font-size:15px; font-weight:700; font-family:inherit; cursor:pointer;
}
.btn-quick:hover:not(:disabled){ background:var(--green-pale); }
.btn-quick:disabled{ opacity:.4; cursor:not-allowed; }
.quick-hint{ font-size:12px; color:var(--faint); margin-top:8px; line-height:1.7; text-wrap:pretty; }

.icon-btn-label{ flex-direction:column; gap:1px; width:48px; height:48px; border-radius:14px; }
.icon-btn-label span{ font-size:10px; font-weight:800; color:var(--green-dark); line-height:1; }
.icon-btn-label svg{ width:21px; height:21px; color:var(--green-dark); }

.sent{ max-width:720px; margin:0 auto; padding:28px 16px 90px; }
.sent-card{ background:#fff; border-radius:var(--radius); box-shadow:var(--shadow); padding:30px 20px 22px; text-align:center; }
.sent-ico{ font-size:42px; }
.sent-title{ font-size:21px; font-weight:800; margin:6px 0 10px; }
.sent-text{ font-size:14px; line-height:1.9; color:var(--gray); margin-bottom:6px; }
.sent-card .btn-retry{ margin-top:10px; }

.cal{ padding:16px 14px 14px; margin:0 0 4px; }
.cal-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.cal-month{ font-size:17px; font-weight:800; display:flex; align-items:baseline; gap:8px; }
.cal-month small{ font-size:12px; font-weight:700; color:var(--green-dark); background:var(--green-light); border-radius:999px; padding:2px 9px; }
.cal-month small:empty{ display:none; }
.cal-nav{ width:36px; height:36px; border:0; border-radius:50%; background:transparent; color:var(--gray);
  font-size:24px; line-height:1; cursor:pointer; font-family:inherit; }
.cal-nav:hover{ background:var(--tile); }
.cal-week,.cal-grid{ display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); }
.cal-week{ border-bottom:1px solid var(--line); padding-bottom:6px; margin-bottom:4px; }
.cal-week span{ text-align:center; font-size:11px; font-weight:700; color:var(--faint); }
.cal-week span:first-child{ color:#d0685c; }
.cal-week span:last-child{ color:#5a82b8; }
.cal-grid{ row-gap:2px; }
.cal-cell{ min-width:0; height:52px; border:0; background:transparent; padding:4px 0 0; cursor:pointer;
  font-family:inherit; display:flex; flex-direction:column; align-items:center; gap:4px; -webkit-tap-highlight-color:transparent; }
.cal-cell.is-blank{ cursor:default; }
.cal-num{ width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  font-size:14px; font-weight:600; color:var(--text); transition:background .12s; }
.cal-cell.is-sun .cal-num{ color:#d0685c; }
.cal-cell.is-sat .cal-num{ color:#5a82b8; }
.cal-cell:not(.has-rec) .cal-num{ opacity:.55; }
.cal-cell.has-rec .cal-num{ font-weight:800; }
.cal-cell:hover .cal-num{ background:var(--tile); }
.cal-cell.is-today .cal-num{ box-shadow:inset 0 0 0 1.5px var(--green); color:var(--green-dark); opacity:1; }
.cal-cell.is-sel .cal-num{ background:var(--green); color:#fff; opacity:1; box-shadow:none; }
.cal-dots{ display:flex; gap:3px; height:6px; align-items:center; }
.cal-dots b{ font-size:9px; line-height:6px; color:var(--faint); }
.cal-dot{ display:inline-block; width:6px; height:6px; border-radius:50%; background:#b9b2a8; }
.cal-dot.m-am{ background:#f0a93b; }
.cal-dot.m-noon{ background:#2e9a7e; }
.cal-dot.m-pm{ background:#46508c; }
.cal-dot.m-snack{ background:#e07a9a; }
.cal-dot.m-drink{ background:#58a6d6; }
.cal-dot.is-busy{ animation:calblink 1.2s ease-in-out infinite; }
@keyframes calblink{ 50%{ opacity:.25; } }
.cal-legend{ display:flex; flex-wrap:wrap; justify-content:center; gap:4px 12px; margin-top:10px; padding-top:10px; border-top:1px solid var(--line); }
.cal-legend span{ font-size:11px; color:var(--gray); display:inline-flex; align-items:center; gap:4px; }
.history-day{ font-size:16px; font-weight:800; margin:16px 2px 10px; }
.history-none{ font-size:13.5px; color:var(--faint); padding:6px 2px 12px; }
.hrow-st{ display:inline-block; margin-left:8px; font-size:11px; font-weight:800; border-radius:999px; padding:1px 9px; vertical-align:1px; }
.hrow-st.analyzing{ background:var(--amber-light); color:var(--amber-dark); }
.hrow-st.failed{ background:var(--tile); color:var(--gray); }
.name-gate-member{ margin-top:14px; padding:12px 14px; background:var(--green-pale); border-radius:12px; font-size:12.5px; line-height:1.8; color:var(--green-dark); text-align:center; }
.name-gate-member a{ color:var(--green-dark); font-weight:800; }
