/* ================================================================
   Healthspan — オーロラ・パステルグラデーション
   ほんのり色づく白背景にミント→スカイ→ラベンダーの光を漂わせ、
   記録した行動（ボタン・チェック・アクセント）だけが
   テール→ブルー→バイオレットのグラデーションで彩られる。
   レイアウトと操作感はMaterial準拠のまま配色を衣替え。
   ================================================================ */
:root {
  --grad: linear-gradient(135deg, #14b8a6 0%, #4f8df7 55%, #a06bf8 100%);
  --grad-soft: linear-gradient(135deg, rgba(20, 184, 166, 0.14), rgba(79, 141, 247, 0.14), rgba(160, 107, 248, 0.14));
  --teal: #0ea5a0;
  --blue: #4f8df7;
  --violet: #8b5cf6;
  --bg: #fbfaff;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --surface-2: #f1f2fa;
  --outline: rgba(120, 110, 200, 0.14);
  --outline-strong: rgba(120, 110, 200, 0.30);
  --text: #232136;
  --text-2: #504e66;
  --muted: #8886a0;
  --red: #ef5d7a;
  --radius: 20px;
  --font: "Google Sans Text", "Roboto", "Noto Sans JP", "Hiragino Sans", sans-serif;
  --font-display: "Google Sans", "Google Sans Text", "Noto Sans JP", "Hiragino Sans", sans-serif;
  --shadow-1: 0 2px 10px rgba(96, 91, 168, 0.10);
  --shadow-2: 0 12px 40px -8px rgba(96, 91, 168, 0.28);
  --glow: 0 8px 24px -8px rgba(79, 141, 247, 0.55);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  padding-bottom: calc(104px + env(safe-area-inset-bottom));
}

/* 背景のオーロラ: 画面全体に淡い色の光をにじませる */
.atmosphere {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(46% 34% at 12% 0%, rgba(94, 234, 212, 0.32), transparent 70%),
    radial-gradient(50% 36% at 92% 6%, rgba(165, 180, 252, 0.36), transparent 70%),
    radial-gradient(42% 30% at 78% 46%, rgba(249, 168, 212, 0.16), transparent 70%),
    radial-gradient(55% 40% at 6% 88%, rgba(125, 211, 252, 0.22), transparent 70%),
    var(--bg);
}

.container { max-width: 560px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 14px 24px; }

/* ブランドロゴ */
.brand { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 0 0 12px; text-decoration: none; }
.brand-icon { width: 22px; height: 22px; border-radius: 6px; display: block; }
.brand-name {
  font-family: var(--font-display);
  font-size: 0.92rem; font-weight: 700; letter-spacing: 0.01em;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

h1, h2, h3 { font-family: var(--font-display); }
h1 { font-size: 1.45rem; font-weight: 500; }
h2 { font-size: 1.05rem; font-weight: 500; }
h3 { font-size: 1.1rem; font-weight: 500; }

/* グラデーション文字 */
.grad-text, .kicker {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.kicker {
  font-family: var(--font-display);
  font-size: 0.66rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  margin-bottom: 2px;
}

button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; -webkit-tap-highlight-color: transparent; }

input, textarea, select {
  font: inherit; width: 100%;
  /* 16px固定。理由: iOS Safariは16px未満の入力欄をタップすると画面を
     自動ズームするため。ラベル内の入力欄がサイズ継承で12.8pxになっていた。 */
  font-size: 16px;
  border: 1px solid var(--outline-strong); border-radius: 14px;
  padding: 12px 14px;
  background: var(--surface-solid);
  color: var(--text);
  caret-color: var(--blue);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(79, 141, 247, 0.18); }
label { display: block; font-size: 0.8rem; color: var(--muted); margin: 12px 0 4px; }
label > input, label > textarea { margin-top: 6px; }

.search {
  border-radius: 999px;
  background: var(--surface-solid);
  border-color: var(--outline);
  padding: 12px 18px;
  box-shadow: var(--shadow-1);
}
.search:focus { border-color: transparent; box-shadow: 0 0 0 2px rgba(79, 141, 247, 0.35), var(--shadow-1); }

/* リップル */
.rippleable { position: relative; overflow: hidden; }
.ripple-ink {
  position: absolute; border-radius: 50%;
  background: currentColor; opacity: 0.14;
  transform: scale(0);
  animation: ripple 0.5s ease-out forwards;
  pointer-events: none;
}
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }

/* 登場アニメーション */
.reveal { animation: rise 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.reveal:nth-child(2) { animation-delay: 0.05s; }
.reveal:nth-child(3) { animation-delay: 0.1s; }
.reveal:nth-child(4) { animation-delay: 0.15s; }
.reveal:nth-child(5) { animation-delay: 0.2s; }
.reveal:nth-child(6) { animation-delay: 0.25s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; } }

/* ---------------- 日付バー ---------------- */
.datebar {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px; margin: 6px 0 16px;
}
.dateheading { font-family: var(--font-display); font-size: 1.55rem; font-weight: 500; color: var(--text); }
.datelabel { position: relative; display: inline-block; margin: 0; color: var(--text); }
.datelabel input[type="date"] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; }
.datenav { display: flex; gap: 6px; padding-bottom: 4px; }
.nav-arrow {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 999px;
  background: var(--surface-solid); color: var(--text-2);
  box-shadow: var(--shadow-1);
  transition: color 0.15s;
}
.nav-arrow:active { color: var(--blue); }
.nav-arrow svg { width: 20px; height: 20px; }

/* ---------------- カード ---------------- */
.card {
  position: relative;
  background: var(--surface);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
  padding: 16px 15px 12px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-1);
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }

.add-btn {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 999px;
  background: var(--grad); color: #fff;
  box-shadow: var(--glow);
  transition: box-shadow 0.2s;
}
.add-btn svg { width: 15px; height: 15px; }
.add-btn:active { box-shadow: 0 3px 10px -4px rgba(79, 141, 247, 0.5); }

.entries { list-style: none; }
.entries li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 2px; border-bottom: 1px solid var(--outline);
  font-size: 0.88rem;
}
.entries li:last-child { border-bottom: none; }
.entry-body { flex: 1; min-width: 0; }
.entry-name { display: block; flex: 1; min-width: 0; font-weight: 500; }
/* この記録だけのメモ。料理名の下に小さく出す。
   理由: 辞書の内容ではなく「その日の違い」だと一目で分かるようにするため */
.entry-note {
  display: block; margin-top: 2px; font-size: 0.72rem; font-weight: 400;
  color: var(--violet); overflow-wrap: anywhere;
}
.entry-note::before { content: "＋ "; }
.note-btn {
  flex: none; color: var(--muted); padding: 4px 5px;
  border-radius: 999px; display: grid; place-items: center;
}
.note-btn svg { width: 14px; height: 14px; }
.note-btn.on { color: var(--violet); }
.note-btn:active { background: var(--surface-2); color: var(--violet); }
.entries .empty, .empty { color: var(--muted); font-size: 0.85rem; padding: 8px 2px; font-weight: 400; }
.entries .empty { display: flex; align-items: center; justify-content: space-between; }
.skip-btn {
  font-size: 0.72rem; font-weight: 500; color: var(--text-2);
  border: 1px dashed var(--outline-strong); border-radius: 999px;
  padding: 5px 11px;
}
.skip-btn:active { background: var(--surface-2); }
.entry-name.skipped { color: var(--muted); font-weight: 400; }
.workout-meta { display: block; font-size: 0.72rem; color: var(--muted); margin-top: 1px; }
.workout-metmin {
  flex: none; font-family: var(--font-display); font-size: 0.74rem; font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  margin: 0 4px;
}
.wk-fields label { margin-top: 10px; }
.analyzing {
  display: inline-block; margin-left: 8px; vertical-align: 1px;
  font-size: 0.62rem; font-weight: 700; color: var(--violet);
  background: var(--grad-soft); border-radius: 999px; padding: 2px 8px;
  animation: analyzing-pulse 1.6s ease-in-out infinite;
}
@keyframes analyzing-pulse { 50% { opacity: 0.4; } }
/* 分析が失敗したバッジ。点滅を止めて赤系にし、押せる（再分析）ことを示す。
   理由: 待てば直るものと、操作が必要なものを一目で区別するため */
.analyzing.failed {
  color: var(--red); background: var(--surface-2);
  animation: none; border: 0; cursor: pointer;
}
.analyzing.failed:active { opacity: 0.6; }
.x { color: var(--muted); padding: 4px 5px; border-radius: 999px; display: grid; place-items: center; }
.x svg { width: 14px; height: 14px; }
.x:active { background: var(--surface-2); color: var(--red); }

/* 数量ステッパー */
.qty { display: flex; align-items: center; gap: 1px; margin: 0 3px 0 6px; flex: none; }
.qty em {
  font-style: normal; font-family: var(--font-display);
  font-size: 0.76rem; font-weight: 700;
  min-width: 2em; text-align: center;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.qty-btn {
  display: grid; place-items: center;
  width: 22px; height: 22px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2);
  font-size: 0.85rem; line-height: 1;
}
.qty-btn:active { background: var(--grad-soft); color: var(--blue); }

/* ---------------- サプリ ---------------- */
.sup-group { margin-top: 8px; }
.sup-timing {
  font-family: var(--font-display);
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em;
  color: var(--muted);
  padding: 4px 0 6px; border-bottom: 1px solid var(--outline);
}
.suprow {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 2px; margin: 0;
  border-bottom: 1px solid var(--outline);
  font-size: 0.9rem; color: var(--text);
  cursor: pointer;
}
.sup-group .suprow:last-child { border-bottom: none; }
.suprow input[type="checkbox"] { display: none; }
.checkmark {
  flex: none; display: grid; place-items: center;
  width: 23px; height: 23px; border-radius: 50%;
  border: 2px solid var(--outline-strong);
  color: transparent;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.checkmark svg { width: 14px; height: 14px; }
.suprow input:checked + .checkmark {
  background: var(--grad); border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px -4px rgba(79, 141, 247, 0.55);
}
.supname { font-weight: 500; transition: color 0.2s; }
.suprow input:not(:checked) ~ .supname { color: var(--text-2); font-weight: 400; }
.supmeta { margin-left: auto; color: var(--muted); font-size: 0.78rem; }

/* ---------------- モーダル（ボトムシート） ---------------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(60, 55, 100, 0.30);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal.hidden { display: none; }
.sheet {
  background: rgba(252, 251, 255, 0.92);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  width: 100%; max-width: 560px;
  max-height: 88dvh; overflow-y: auto;
  border-radius: 28px 28px 0 0;
  padding: 8px 18px calc(24px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-2);
  animation: sheet-up 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes sheet-up { from { transform: translateY(48px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.sheet-handle {
  width: 36px; height: 4px; border-radius: 999px;
  background: var(--grad); opacity: 0.6; margin: 8px auto 14px;
}
/* メニューピッカーは固定高にする。理由: 検索で絞り込むと候補が減って
   シートが縮み、下端アンカーのため検索欄ごとiOSキーボードの裏に沈むため。
   固定高なら検索欄は常に画面上部に留まりキーボードと重ならない。 */
#picker .sheet { height: 86dvh; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sheet .search { box-shadow: none; border: 1px solid var(--outline-strong); margin-bottom: 12px; }
.btn-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

.menu-btn {
  background: var(--surface-solid); border: 1px solid var(--outline-strong);
  border-radius: 999px; padding: 9px 15px; font-size: 0.9rem; color: var(--text-2);
  transition: all 0.15s;
}
.menu-btn:active { background: var(--grad-soft); border-color: var(--blue); color: var(--text); }
.nm-cta { border-style: dashed; border-color: var(--outline-strong); color: var(--blue); font-weight: 500; }


/* タグチップ（サプリ編集で使用） */
.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.chip {
  border: 1px solid var(--outline-strong); background: var(--surface-solid);
  border-radius: 999px; padding: 7px 13px; font-size: 0.8rem; color: var(--text-2);
  transition: all 0.15s;
}
.chip.on { background: var(--grad); color: #fff; border-color: transparent; font-weight: 500; }
.chip.static { cursor: default; background: var(--grad-soft); border-color: transparent; color: var(--text-2); }
.chip.static.pending { background: var(--surface-2); color: var(--muted); }
.chip.static.failed { background: var(--surface-2); color: var(--red); }
.tag-chips.readonly { margin-top: 2px; }
.newmenu summary {
  font-family: var(--font-display);
  font-weight: 700; padding: 8px 0; cursor: pointer;
  list-style: none; font-size: 0.92rem;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.newmenu summary::-webkit-details-marker { display: none; }
.newmenu input, .newmenu textarea { margin-bottom: 8px; }
.hint { font-size: 0.76rem; color: var(--muted); margin: 4px 0; line-height: 1.6; }

/* ---------------- ボタン ---------------- */
.primary, .ghost, .danger, .tabswitch button, .tabbar a, .nu-details summary {
  font-family: var(--font-display);
}
.primary {
  background: var(--grad); color: #fff; font-weight: 700;
  border-radius: 999px; padding: 13px 24px; width: 100%;
  letter-spacing: 0.04em;
  box-shadow: var(--glow);
  transition: box-shadow 0.2s, filter 0.2s;
}
.primary:active { filter: brightness(0.94); box-shadow: 0 3px 10px -4px rgba(79, 141, 247, 0.5); }
.primary.small { width: auto; padding: 10px 18px; font-size: 0.85rem; flex: none; }
.ghost { color: var(--text-2); padding: 8px 12px; font-size: 0.9rem; font-weight: 500; border-radius: 999px; }
.ghost:active { background: var(--surface-2); }
.danger { color: var(--red); padding: 12px 16px; font-weight: 700; border-radius: 999px; }
.danger:active { background: rgba(239, 93, 122, 0.1); }
.modal-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; gap: 10px; }
.modal-actions .primary { flex: 1; width: auto; }

/* ---------------- タブバー（浮遊ピル） ---------------- */
.tabbar {
  position: fixed; z-index: 40;
  left: 50%; transform: translateX(-50%);
  bottom: max(4px, calc(env(safe-area-inset-bottom) - 16px));
  display: flex; gap: 2px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px; padding: 6px;
  box-shadow: var(--shadow-2);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-width: 72px; padding: 7px 0 6px;
  color: var(--muted); text-decoration: none;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em;
  border-radius: 999px;
  transition: color 0.2s;
}
.tab-pill {
  display: grid; place-items: center;
  width: 54px; height: 28px; border-radius: 999px;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.tab-pill svg { width: 20px; height: 20px; }
.tabbar a.active { color: var(--text); }
.tabbar a.active .tab-pill {
  background: var(--grad); color: #fff;
  box-shadow: 0 4px 14px -4px rgba(79, 141, 247, 0.55);
}
.tab-label { line-height: 1; }

/* ---------------- 当日信号 ---------------- */
.signal {
  display: flex; align-items: center; gap: 8px;
  margin: -4px 0 12px; padding: 9px 14px;
  border-radius: 999px;
  background: var(--surface);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-1);
  font-size: 0.8rem; font-weight: 500; color: var(--text-2);
  text-decoration: none;
}
.signal-dot { width: 10px; height: 10px; border-radius: 999px; flex: none; }
.signal-green .signal-dot { background: #10b981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.6); }
.signal-yellow .signal-dot { background: #f59e0b; box-shadow: 0 0 8px rgba(245, 158, 11, 0.6); }
.signal-red .signal-dot { background: var(--red); box-shadow: 0 0 8px rgba(239, 93, 122, 0.6); }

/* ---------------- スコア ---------------- */
.score-hero { display: flex; align-items: center; gap: 18px; padding-bottom: 16px; }
.ring { width: 116px; height: 116px; flex: none; }
.ring-num { font-family: var(--font-display); font-size: 30px; font-weight: 700; fill: var(--text); }
.ring-sub { font-size: 11px; fill: var(--muted); }
.score-hero-text { flex: 1; min-width: 0; }
.score-period { font-size: 0.78rem; color: var(--muted); margin-bottom: 6px; }
.score-comment { font-size: 0.92rem; font-weight: 500; line-height: 1.7; }

.scorebar-row { margin: 10px 0 14px; }
.scorebar-row:last-child { margin-bottom: 6px; }
.scorebar-head {
  display: flex; justify-content: space-between;
  font-size: 0.85rem; font-weight: 500; margin-bottom: 6px;
}
.scorebar-val { color: var(--muted); font-family: var(--font-display); font-weight: 500; }
.scorebar { height: 7px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.scorebar > div { height: 100%; border-radius: 999px; background: var(--grad); }

.score-items { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.score-items tr { border-bottom: 1px solid var(--outline); }
.score-items tr:last-child { border-bottom: none; }
.score-items td { padding: 8px 0; vertical-align: middle; }
.si-label { color: var(--text-2); }
.si-note { display: block; font-size: 0.68rem; color: var(--muted); margin-top: 1px; }
.si-value { text-align: right; font-weight: 500; white-space: nowrap; padding-right: 10px !important; }
.si-badge { text-align: right; width: 58px; }
/* 飲酒欄も既存のカード・項目表を使う。理由: 独自の背景や文字サイズによる見た目の分断を防ぐため。 */
.alcohol-card .hint, .alcohol-card .si-note { color: var(--text-2); }
.alcohol-details summary {
  display: flex; align-items: center; gap: 6px;
  min-height: 44px; list-style: none; padding-left: 0;
}
.alcohol-details summary::-webkit-details-marker { display: none; }
.alcohol-details summary svg { flex: none; }
.alcohol-details[open] summary svg { transform: rotate(90deg); }
.alcohol-details summary:focus-visible { outline: 2px solid var(--text-2); outline-offset: 2px; }
.badge {
  display: inline-block; font-size: 0.68rem; font-weight: 700;
  border-radius: 999px; padding: 3px 9px;
}
.badge-good { background: rgba(16, 185, 129, 0.14); color: #0a7d5c; }
.badge-caution { background: rgba(245, 158, 11, 0.16); color: #9a6206; }
.badge-warn { background: rgba(239, 93, 122, 0.14); color: #bf3652; }
.badge-supp { background: rgba(139, 92, 246, 0.13); color: #6d4bd6; white-space: nowrap; }
.badge-over { background: rgba(239, 93, 122, 0.22); color: #a82744; }

.sug-group { margin-bottom: 14px; }
.sug-group:last-of-type { margin-bottom: 4px; }
.sug-reason {
  font-size: 0.8rem; font-weight: 700; margin-bottom: 2px;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.sug-item {
  padding: 8px 0; border-bottom: 1px solid var(--outline);
}
.sug-list .sug-item:last-child { border-bottom: none; }
.sug-name { display: block; font-size: 0.92rem; font-weight: 500; }
.sug-why { display: block; font-size: 0.75rem; color: var(--muted); margin-top: 2px; line-height: 1.6; }
.sug-more { padding: 6px 0; font-size: 0.82rem; }
.sug-new {
  display: inline-block; margin-left: 8px; vertical-align: 1px;
  font-size: 0.66rem; font-weight: 700; color: #fff;
  background: var(--grad); border-radius: 999px; padding: 2px 8px;
}

.review-text {
  font-size: 0.9rem; line-height: 1.9; color: var(--text);
  white-space: pre-line; padding: 2px 0 8px;
}

.rec-list { list-style: none; }
.rec-list li {
  position: relative; padding: 8px 0 8px 18px;
  font-size: 0.88rem; line-height: 1.7; color: var(--text-2);
  border-bottom: 1px solid var(--outline);
}
.rec-list li:last-child { border-bottom: none; }
.rec-list li::before {
  content: ""; position: absolute; left: 2px; top: 17px;
  width: 7px; height: 7px; border-radius: 999px; background: var(--grad);
}

.tabswitch a {
  font-family: var(--font-display);
  display: inline-block; padding: 8px 16px; font-size: 0.85rem;
  color: var(--muted); font-weight: 700; text-decoration: none;
  border-radius: 999px; transition: all 0.2s;
}
.tabswitch a.on { background: var(--grad); color: #fff; box-shadow: 0 4px 12px -4px rgba(79, 141, 247, 0.5); }

.trend { width: 100%; height: auto; }
.trend-grid { stroke: var(--outline); stroke-width: 1; }
.trend-label { font-size: 9px; fill: var(--muted); }

/* ---------------- 履歴 ---------------- */
.pagehead { margin: 6px 0 16px; display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.pagehead-sub { font-family: var(--font); font-size: 0.78rem; font-weight: 400; color: var(--muted); margin-left: 10px; }
.history-day.unrecorded { opacity: 0.6; }
.daylink { color: var(--text); text-decoration: none; }
.supbadge {
  font-family: var(--font-display);
  font-size: 0.7rem; font-weight: 700; color: #fff;
  background: var(--grad);
  border-radius: 999px; padding: 4px 11px;
}
.history-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.history-table th {
  width: 3.6em; text-align: left; color: var(--muted); font-weight: 500;
  padding: 7px 4px 7px 0; vertical-align: top; white-space: nowrap;
  font-size: 0.76rem;
}
.history-table td { padding: 7px 0; color: var(--text-2); line-height: 1.7; }
.history-table tr { border-bottom: 1px solid var(--outline); }
.history-table tr:last-child { border-bottom: none; }
.textlink {
  font-weight: 700; text-decoration: none;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.day-workouts {
  font-size: 0.8rem; color: var(--text-2); margin-top: 8px;
  padding-top: 8px; border-top: 1px solid var(--outline);
}
.logout-form { text-align: center; margin-top: 24px; }
.export-row { display: flex; gap: 8px; margin: 6px 0 12px; }
.export-row select { flex: 1; }

/* ---------------- 辞書 ---------------- */
.tabswitch {
  display: flex; gap: 2px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px; padding: 4px;
  box-shadow: var(--shadow-1);
}
.tabswitch button {
  padding: 8px 18px; font-size: 0.85rem; color: var(--muted); font-weight: 700;
  border-radius: 999px; transition: all 0.2s;
}
.tabswitch button.on { background: var(--grad); color: #fff; box-shadow: 0 4px 12px -4px rgba(79, 141, 247, 0.5); }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.toolbar .search { margin-bottom: 0; }
.toolbar .hint { flex: 1; }
.dict-list { display: flex; flex-direction: column; gap: 9px; }
.dict-item {
  background: var(--surface);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 16px; padding: 13px 16px;
  text-align: left; width: 100%;
  box-shadow: var(--shadow-1);
  transition: box-shadow 0.15s;
}
.dict-item:active { box-shadow: 0 0 0 2px rgba(79, 141, 247, 0.3), var(--shadow-1); }
.dict-item .di-name { font-weight: 500; font-size: 0.95rem; }
.dict-item .di-meta { display: block; color: var(--muted); font-size: 0.76rem; margin-top: 3px; }

.nu-details { margin-top: 14px; }
.nu-details summary {
  font-weight: 700; cursor: pointer; padding: 6px 0;
  list-style: none; font-size: 0.92rem;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.nu-details summary::-webkit-details-marker { display: none; }
.nu-row { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; }
.nu-row .nu-name { flex: 2.2; }
.nu-row .nu-amount { flex: 1.3; }
.nu-row .nu-unit { flex: 1.3; }
.sch-row { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; }
.sch-row .sch-timing { flex: 1.6; }
.sch-row .sch-dose { flex: 1; }
.checkline { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: var(--text-2); margin-top: 14px; }
.checkline input { width: 18px; height: 18px; accent-color: var(--violet); }
.hidden { display: none !important; }
.noscroll { overflow: hidden; }

/* ---------------- ログイン ---------------- */
.login-wrap {
  max-width: 400px; margin: 14vh auto 0; text-align: center;
  background: var(--surface);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  padding: 44px 32px 40px;
  box-shadow: var(--shadow-2);
}
.login-kicker {
  font-family: var(--font-display);
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.24em;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  margin-bottom: 8px;
}
.login-logo {
  font-family: var(--font-display);
  font-size: 2.2rem; font-weight: 700; letter-spacing: -0.01em;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.login-sub { color: var(--muted); font-size: 0.85rem; margin: 10px 0 28px; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.error { color: var(--red); font-size: 0.88rem; margin-bottom: 12px; }
@media (max-width: 440px) {
  .login-wrap { background: transparent; border: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 32px 8px; }
}

/* ---------------- 写真から記録（2026-07-20） ---------------- */
.head-btns { display: flex; gap: 8px; }
.photo-preview {
  width: 100%; max-height: 220px; object-fit: cover;
  border-radius: 14px; margin-bottom: 12px; background: rgba(0,0,0,0.05);
}
.pending-text { color: var(--muted); font-size: 0.88rem; }
.photo-result-btn {
  width: 100%; text-align: left; padding: 10px 12px;
  border: 1px dashed var(--accent, #7c6ee6); border-radius: 12px;
  background: transparent; color: var(--accent, #7c6ee6);
  font-size: 0.9rem; cursor: pointer;
}
.ph-dish {
  display: grid; grid-template-columns: 1fr auto auto; gap: 8px;
  align-items: center; margin-bottom: 8px;
}
.ph-dish .ph-qty { width: 82px; }
.ph-actions { display: flex; gap: 10px; margin-top: 14px; }
.ph-actions .primary { flex: 1; }
.ghost.sm { padding: 4px 10px; font-size: 0.8rem; }
