/* FITNESS OS — iOS ライクなデザイントークンとコンポーネント */
:root {
  /* 2026-10-30 クリーン刷新：白基調・淡い空色の光・丸いピル型。カード（トレカ）的な装飾は使わない */
  --navy: #26324d;
  --navy-2: #3a4868;
  --bg: #f3f6fa;
  --card: #ffffff;
  --card-2: #f1f5f9;
  --text: #1d273a;
  --text-2: #5f6b82;
  --text-3: #8f9aae;
  --sep: rgba(38, 60, 100, 0.09);
  --accent: #16b3c6;
  --accent-2: #4b8cf2;
  --accent-soft: #e4f6f9;
  --grad-primary: linear-gradient(120deg, #1fc2c9 0%, #3aa6ea 55%, #5b87f4 100%);
  --holo: linear-gradient(90deg, #7fe3ee, #a7b9ff 30%, #f2b8e8 55%, #ffe39a 78%, #9ff0cb);
  --meal: #0fa58f;
  --meal-soft: #e2f6f2;
  --workout: #7461e8;
  --workout-soft: #eeebfd;
  --body: #3b86ee;
  --body-soft: #e5effd;
  --protein: #1fae69;
  --fat: #a874ee;
  --carbs: #4a8cf5;
  --kcal: #f5902f;
  --edit-bg: #f6f9fc;
  --edit-border: #dce4ee;
  --edit-focus: #22b3cc;
  --danger: #e04848;
  --success: #17a463;
  --radius: 22px;
  --radius-sm: 16px;
  --tap: 44px;
  --header-h: 60px;
  --tabbar-h: 58px;
  --shadow: 0 1px 2px rgba(30, 55, 100, 0.04), 0 6px 18px rgba(30, 60, 110, 0.06);
  --font: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic UI', system-ui, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --navy: #d3def5;
    --navy-2: #a9badf;
    --bg: #0c1220;
    --card: #151d2f;
    --card-2: #1c2539;
    --text: #eef2fa;
    --text-2: #a9b3c8;
    --text-3: #7a859b;
    --sep: rgba(200, 220, 255, 0.09);
    --accent: #3fd0dc;
    --accent-2: #6aa2ff;
    --accent-soft: rgba(63, 208, 220, 0.14);
    --grad-primary: linear-gradient(120deg, #23b9c4 0%, #3b98e6 55%, #5a7ff0 100%);
    --meal: #2cc2b0;
    --meal-soft: rgba(44, 194, 176, 0.14);
    --workout: #a48cf5;
    --workout-soft: rgba(164, 140, 245, 0.16);
    --body: #5aa2f5;
    --body-soft: rgba(90, 162, 245, 0.15);
    --protein: #43c27a;
    --fat: #b88cf0;
    --carbs: #66a1ff;
    --kcal: #ffa24d;
    --edit-bg: #231d16;
    --edit-border: #4a3a26;
    --edit-focus: #f0a95a;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}
html.sheet-open, html.sheet-open body { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--body) 55%, transparent); outline-offset: 2px; }
.icon { flex: none; display: block; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Shell ---------- */
.app-header {
  position: sticky; top: 0; z-index: 20;
  padding: env(safe-area-inset-top) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 0.5px solid var(--sep);
}
.header-row { height: var(--header-h); display: flex; align-items: center; gap: 4px; }
.page-title { font-size: 22px; font-weight: 700; margin: 0 4px; letter-spacing: 0.01em; flex: 1; }
.date-nav { display: flex; align-items: center; flex: 1; min-width: 0; gap: 2px; }
.date-button {
  flex: 1; min-width: 0; border: 0; background: none; padding: 4px 6px; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; line-height: 1.2;
}
.date-button:active { background: var(--sep); }
.date-main { font-size: 20px; font-weight: 700; white-space: nowrap; }
.date-sub { font-size: 13px; color: var(--text-2); font-weight: 600; }
.date-sub.is-today { color: var(--body); }
.icon-btn {
  width: var(--tap); height: var(--tap); flex: none; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: none; color: var(--navy);
}
.icon-btn:active { background: var(--sep); }
.today-pill {
  border: 0; border-radius: 999px; padding: 6px 12px; background: var(--navy); color: var(--bg);
  font-size: 14px; font-weight: 700; flex: none; min-height: 34px;
}
.save-badge {
  font-size: 12px; font-weight: 600; color: var(--text-3); min-width: 0; white-space: nowrap;
  position: absolute; right: max(14px, env(safe-area-inset-right)); bottom: 2px;
  transition: opacity 0.2s;
}
.save-badge[data-state='idle'] { opacity: 0; }
.save-badge[data-state='saving'] { color: var(--text-2); }
.save-badge[data-state='saved'] { color: var(--success); }
.save-badge[data-state='error'] { color: var(--danger); }

main.content {
  padding: 12px max(16px, env(safe-area-inset-right)) calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 28px) max(16px, env(safe-area-inset-left));
  max-width: 640px; margin: 0 auto;
}

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 4px max(8px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(8px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--card) 86%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-top: 0.5px solid var(--sep);
}
.tab {
  height: var(--tabbar-h); border: 0; background: none; color: var(--text-3);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; font-weight: 600; text-decoration: none;
}
.tab[aria-current='page'] { color: var(--navy); }

/* ---------- Sections & cards ---------- */
.section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 20px; font-weight: 700; margin: 24px 4px 10px;
}
.section-title .dot { width: 10px; height: 10px; border-radius: 50%; }
.section-title .spacer { flex: 1; }
.section-title .sub { font-size: 14px; color: var(--text-2); font-weight: 600; }
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; margin-bottom: 12px;
}
.card.flush { padding: 0; overflow: hidden; }
.muted { color: var(--text-2); }
.small { font-size: 14px; }
.tiny { font-size: 12px; }
.empty { color: var(--text-3); font-size: 15px; padding: 6px 0; }

/* Phone-first shortcuts: larger tap targets, no route-changing hash fragments. */
.home-jumps, .bm-jumps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 8px 0 14px; }
.quick-jump {
  min-height: 46px; border: 1px solid var(--sep); background: var(--card);
  color: var(--navy); border-radius: 12px; padding: 8px 4px;
  font-size: 13px; font-weight: 700; line-height: 1.3; text-align: center;
}
.quick-jump:active { background: var(--card-2); }
#home-meals, #home-workout, #home-body, [id^='body-'] { scroll-margin-top: calc(var(--header-h) + env(safe-area-inset-top) + 16px); }
.wx-quick-add { min-height: 44px; margin: 0 0 10px; }
.wx-completion-hint { margin: 4px 12px 6px 14px; color: var(--text-2); font-size: 12px; line-height: 1.5; }
.bm-jumps { margin-top: 10px; }
.bm-jumps .quick-jump { background: var(--body-soft); color: var(--body); }
.bm-details > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Summary */
.summary-top { display: flex; align-items: baseline; gap: 6px; }
.summary-kcal { font-size: 34px; font-weight: 800; color: var(--kcal); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.summary-unit { font-size: 15px; color: var(--text-2); font-weight: 600; }
.summary-target { margin-left: auto; font-size: 14px; color: var(--text-2); text-align: right; }
.bar { height: 8px; border-radius: 99px; background: var(--card-2); overflow: hidden; margin: 8px 0 12px; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: currentColor; max-width: 100%; transition: width 0.3s ease; }
.pfc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pfc-item .label { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 5px; }
.pfc-item .label i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.pfc-item .value { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.pfc-item .value small { font-size: 13px; color: var(--text-2); font-weight: 600; }
.pfc-item .bar { margin: 4px 0 0; height: 6px; }
.c-protein { color: var(--protein); } .c-fat { color: var(--fat); } .c-carbs { color: var(--carbs); } .c-kcal { color: var(--kcal); }
/* Daily review: editorial hierarchy, compact on the 393px iPhone 15 viewport. */
.daily-focus { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--sep); }
.daily-focus h3 { margin: 0 0 8px; font-size: 15px; font-weight: 800; letter-spacing: 0.01em; }
.daily-focus-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.daily-focus-grid > div { display: flex; flex-direction: column; gap: 3px; padding: 10px; border-radius: 12px; background: var(--card-2); min-width: 0; }
.daily-focus-grid strong { font-size: 15px; font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; }
.daily-focus p { margin: 9px 0 0; line-height: 1.5; }
.daily-caution { font-size: 13px; font-weight: 600; color: var(--text-2); }
.summary-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 0.5px solid var(--sep); font-size: 14px; color: var(--text-2); }
.summary-meta b { color: var(--text); font-variant-numeric: tabular-nums; }
.badge-sample { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--card-2); color: var(--text-2); border: 0.5px solid var(--sep); white-space: nowrap; }
.badge-src-official { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); border-color: transparent; }
.badge-src-standard { background: var(--body-soft); color: var(--body); border-color: transparent; }

/* Meal card */
.meal-card { padding: 0; overflow: hidden; }
.meal-head { display: flex; align-items: center; gap: 8px; padding: 12px 8px 8px 16px; }
.meal-name { font-size: 17px; font-weight: 700; white-space: nowrap; }
.meal-total { margin-left: auto; font-size: 15px; font-weight: 700; color: var(--kcal); font-variant-numeric: tabular-nums; }
.meal-total small { color: var(--text-2); font-weight: 600; }
.meal-card.is-empty .meal-head { padding: 8px 10px 8px 16px; min-height: 60px; }
.meal-empty { margin-left: auto; font-size: 14px; color: var(--text-3); font-weight: 600; }
.btn.btn-compact { flex: none; white-space: nowrap; min-height: 40px; padding: 8px 14px; font-size: 15px; }
.meal-pfc { font-size: 12px; color: var(--text-2); padding: 0 16px 8px; font-variant-numeric: tabular-nums; }
.entry {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 0; background: none; padding: 10px 16px; border-top: 0.5px solid var(--sep); min-height: 56px;
}
.entry:active { background: var(--card-2); }
.entry-main { flex: 1; min-width: 0; }
.entry-name { font-size: 16px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.entry-sub { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; margin-top: 2px; }
.entry-kcal { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; flex: none; }
.entry-kcal small { font-size: 12px; color: var(--text-2); font-weight: 600; }
.meal-actions { display: flex; gap: 8px; padding: 8px 12px 12px; border-top: 0.5px solid var(--sep); }
.meal-card .meal-actions:first-child { border-top: 0; }
.btn {
  min-height: var(--tap); border-radius: 12px; border: 0; padding: 10px 16px; font-weight: 700; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; }
.btn-primary { background: var(--navy); color: var(--bg); }
.btn-meal { background: var(--meal-soft); color: var(--meal); flex: 1; }
.btn-workout { background: var(--workout-soft); color: var(--workout); }
.btn-tint { background: var(--card-2); color: var(--navy); }
.btn-plain { background: transparent; color: var(--navy); }
.btn-danger { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.btn-block { width: 100%; }
.btn-big { min-height: 52px; font-size: 17px; }
.btn-square { width: var(--tap); padding: 0; flex: none; }

/* Inputs (編集できる場所は控えめな暖色) */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 14px; font-weight: 700; color: var(--text-2); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-row.three { grid-template-columns: repeat(3, 1fr); }
.field-row.four { grid-template-columns: repeat(4, 1fr); }
.input, select.input, textarea.input {
  width: 100%; min-height: var(--tap); border-radius: 12px; border: 1px solid var(--edit-border);
  background: var(--edit-bg); padding: 10px 12px; font-size: 17px; appearance: none; -webkit-appearance: none;
}
textarea.input { min-height: 72px; resize: vertical; line-height: 1.4; }
select.input {
  background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 26px;
}
.input:focus { outline: none; border-color: var(--edit-focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--edit-focus) 25%, transparent); }
.input::placeholder { color: var(--text-3); }
.input.invalid { border-color: var(--danger); }
.search {
  display: flex; align-items: center; gap: 8px; background: var(--card-2); border-radius: 12px; padding: 0 12px; min-height: var(--tap);
  border: 1px solid var(--sep);
}
.search input { flex: 1; min-width: 0; border: 0; background: none; font-size: 17px; padding: 10px 0; outline: none; }
.search .icon { color: var(--text-3); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--sep); background: var(--card); border-radius: 999px; padding: 7px 14px; min-height: 44px;
  font-size: 15px; font-weight: 600; color: var(--text); display: inline-flex; align-items: center; gap: 6px;
}
.chip small { color: var(--text-3); font-weight: 600; }
.chip[aria-pressed='true'] { background: var(--navy); color: var(--bg); border-color: var(--navy); }
.chip[aria-pressed='true'] small { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.chips.workout .chip[aria-pressed='true'] { background: var(--workout); border-color: var(--workout); color: #fff; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--card-2); border-radius: 11px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: none; border-radius: 9px; min-height: 44px; font-size: 15px; font-weight: 600; color: var(--text-2); padding: 4px 6px; }
.seg button[aria-pressed='true'] { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }

/* Lists in sheets */
.list-section-title { font-size: 13px; font-weight: 700; color: var(--text-2); margin: 18px 4px 6px; display: flex; align-items: center; gap: 6px; }
.list { background: var(--card); border-radius: var(--radius-sm); overflow: hidden; }
.sheet .list { background: var(--card); border: 0.5px solid var(--sep); }
.row { display: flex; align-items: center; border-top: 0.5px solid var(--sep); }
.row:first-child { border-top: 0; }
.row-main {
  flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 11px 4px 11px 14px; min-height: 58px;
  display: flex; flex-direction: column; justify-content: center;
}
.row-main:active { background: var(--card-2); }
.row-title { font-size: 16px; font-weight: 600; line-height: 1.3; word-break: break-word; }
.row-sub { font-size: 13px; color: var(--text-2); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.star-btn { width: 48px; height: 48px; border: 0; background: none; display: grid; place-items: center; color: var(--text-3); flex: none; }
.star-btn[aria-pressed='true'] { color: #f5b301; }
.more-hint { text-align: center; font-size: 14px; color: var(--text-2); padding: 12px; }
.store-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.store-btn {
  border: 0.5px solid var(--sep); background: var(--card); border-radius: 12px; min-height: 52px; padding: 8px 12px;
  text-align: left; font-weight: 700; font-size: 15px; display: flex; flex-direction: column; justify-content: center;
}
.store-btn:disabled { opacity: 0.45; }
.store-btn small { font-weight: 600; color: var(--text-3); font-size: 12px; }
.crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 12px 2px 8px; font-size: 15px; }
.crumbs button { border: 0; background: none; color: var(--body); font-weight: 700; padding: 6px 2px; }

/* Amount editor */
.food-hero { padding: 4px 2px 12px; }
.food-hero h3 { margin: 0 0 4px; font-size: 20px; line-height: 1.3; word-break: break-word; }
.amount-row { display: flex; align-items: center; gap: 10px; }
.amount-row .input { font-size: 28px; font-weight: 700; text-align: center; height: 60px; font-variant-numeric: tabular-nums; }
.amount-unit { font-size: 18px; font-weight: 700; color: var(--text-2); white-space: nowrap; flex: none; }
.stepper { width: 56px; height: 60px; border-radius: 14px; border: 0; background: var(--card-2); font-size: 26px; font-weight: 600; color: var(--navy); flex: none; }
.preview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; background: var(--card-2); border-radius: 14px; padding: 12px 8px; margin: 14px 0; text-align: center; }
.preview b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.preview span { font-size: 12px; font-weight: 700; }
.note-box { background: var(--card-2); border-radius: 12px; padding: 10px 12px; font-size: 14px; color: var(--text-2); margin: 10px 0; }
.warn-box { background: color-mix(in srgb, var(--kcal) 12%, transparent); color: var(--text); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin: 10px 0; }
.error-box { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin: 10px 0; white-space: pre-line; }
.sticky-actions {
  position: sticky; bottom: 0; margin: 16px -16px -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, transparent, var(--card) 18px); display: flex; gap: 10px;
}

/* Workout */
.wx-card { padding: 0; overflow: hidden; border-left: 4px solid var(--workout); }
.wx-head { display: flex; align-items: center; gap: 8px; padding: 12px 6px 4px 14px; }
.wx-name { font-size: 17px; font-weight: 700; line-height: 1.3; flex: 1; min-width: 0; word-break: break-word; }
.part-tag { font-size: 12px; font-weight: 700; color: var(--workout); background: var(--workout-soft); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.prev-line { display: flex; align-items: center; gap: 8px; padding: 2px 10px 8px 14px; font-size: 13px; color: var(--text-2); }
.prev-line .txt { flex: 1; min-width: 0; font-variant-numeric: tabular-nums; }
.prev-line button { border: 0; background: var(--workout-soft); color: var(--workout); font-weight: 700; font-size: 13px; border-radius: 999px; padding: 6px 10px; min-height: 44px; flex: none; }
.set-head, .set-row {
  display: grid; grid-template-columns: 44px minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 0.95fr) 44px; gap: 4px; align-items: center;
  padding: 0 8px 0 6px;
}
.set-head { font-size: 11px; font-weight: 700; color: var(--text-3); padding-top: 4px; padding-bottom: 2px; text-align: center; }
.set-row { padding-top: 5px; padding-bottom: 5px; }
.set-row .input { min-height: 46px; padding: 8px 6px; text-align: center; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.set-row select.input { padding-right: 18px; background-position: calc(100% - 12px) 52%, calc(100% - 7px) 52%; text-align-last: center; }
.set-no {
  width: 44px; height: 46px; border: 0; background: none; font-weight: 700; color: var(--text-2); font-size: 15px; padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1;
}
.set-no small { font-size: 10px; color: var(--workout); font-weight: 700; }
.set-no.has-pain small { color: var(--danger); }
.done-btn { width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--sep); background: var(--card); color: var(--text-3); display: grid; place-items: center; }
.done-btn[aria-pressed='true'] { background: var(--workout); border-color: var(--workout); color: #fff; }
.set-row.done .input { background: var(--workout-soft); border-color: transparent; }
.set-detail { margin: 2px 10px 8px 52px; padding: 12px; background: var(--card-2); border-radius: 12px; }
.set-detail .field { margin-bottom: 10px; }
.set-detail .input { background: var(--edit-bg); }
.pain-scale { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pain-scale button { border: 0; border-radius: 8px; min-height: 44px; background: var(--card); font-weight: 700; font-size: 14px; padding: 0; color: var(--text-2); }
.pain-scale button[aria-pressed='true'] { background: var(--danger); color: #fff; }
.wx-actions { display: flex; gap: 8px; padding: 8px 10px 12px 14px; flex-wrap: wrap; }
.wx-actions .btn { min-height: 40px; font-size: 14px; padding: 8px 12px; }
.wx-note { padding: 0 12px 12px 14px; }
.fatigue { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.fatigue button { border: 1px solid var(--sep); background: var(--card); border-radius: 12px; min-height: 48px; font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.fatigue button small { font-size: 10px; color: var(--text-3); font-weight: 600; }
.fatigue button[aria-pressed='true'] { background: var(--workout); color: #fff; border-color: var(--workout); }
.fatigue button[aria-pressed='true'] small { color: rgba(255, 255, 255, 0.8); }

/* Body */
.body-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.unit-input { position: relative; }
.unit-input .input { padding-right: 44px; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.unit-input em { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--text-2); font-weight: 600; font-size: 15px; pointer-events: none; }

/* Sheet */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(8, 12, 20, 0); display: flex; align-items: flex-end; justify-content: center;
  transition: background 0.2s ease;
}
.sheet-backdrop.open { background: rgba(8, 12, 20, 0.38); }
.sheet {
  width: 100%; max-width: 640px; max-height: calc(100dvh - env(safe-area-inset-top) - 24px); background: var(--bg);
  border-radius: 20px 20px 0 0; display: flex; flex-direction: column; transform: translateY(100%); transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.18);
}
.sheet-tall { height: calc(100dvh - env(safe-area-inset-top) - 24px); }
.sheet-backdrop.open .sheet { transform: translateY(0); }
.sheet-backdrop.closing .sheet { transform: translateY(100%); }
.sheet-grabber { width: 38px; height: 5px; border-radius: 3px; background: var(--text-3); opacity: 0.45; margin: 8px auto 0; flex: none; }
.sheet-header { display: flex; align-items: center; gap: 4px; padding: 4px 6px 6px; flex: none; }
.sheet-header-spacer { width: var(--tap); flex: none; }
.sheet-title { flex: 1; text-align: center; font-size: 17px; font-weight: 700; margin: 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 4px 16px 16px; }
.sheet-page { padding-bottom: env(safe-area-inset-bottom); }
.sheet-footer { flex: none; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 0.5px solid var(--sep); background: var(--bg); }
.sheet .sticky-actions { background: linear-gradient(to bottom, transparent, var(--bg) 18px); }
.menu-list .row-main { min-height: 52px; }

/* Calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 8px; }
.cal-title { font-size: 19px; font-weight: 700; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-wd { font-size: 12px; font-weight: 700; color: var(--text-3); padding: 4px 0; }
.cal-wd.sun, .cal-day.sun .num { color: #e05252; }
.cal-wd.sat, .cal-day.sat .num { color: var(--body); }
.cal-day { border: 0; background: none; height: 50px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 0; }
.cal-day .num { font-size: 17px; font-weight: 600; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; font-variant-numeric: tabular-nums; }
.cal-day.today .num { box-shadow: inset 0 0 0 2px var(--body); }
.cal-day.selected .num { background: var(--navy); color: var(--bg) !important; }
.cal-day .dots { display: flex; gap: 3px; height: 5px; }
.cal-day .dots i { width: 5px; height: 5px; border-radius: 50%; }
.cal-legend { display: flex; gap: 14px; justify-content: center; font-size: 12px; color: var(--text-2); margin-top: 10px; }
.cal-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }

/* Dialog & toast */
.dialog-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(8, 12, 20, 0.4); display: grid; place-items: center; padding: 24px; }
.dialog { background: var(--card); border-radius: 18px; padding: 20px; width: 100%; max-width: 340px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25); }
.dialog-text { margin: 0 0 16px; font-size: 16px; white-space: pre-line; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.toast-host {
  position: fixed; left: 0; right: 0; z-index: 90; pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 8px;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px); padding: 0 16px;
}
.toast {
  pointer-events: auto; max-width: 520px; display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-radius: 14px;
  background: var(--navy); color: var(--bg); font-size: 15px; font-weight: 600; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
  animation: toast-in 0.18s ease-out; white-space: pre-line;
}
.toast-success { background: var(--success); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }
.toast-action { border: 0; background: rgba(255, 255, 255, 0.22); color: inherit; font-weight: 800; border-radius: 10px; padding: 6px 12px; min-height: 34px; }
.toast.leaving { opacity: 0; transform: translateY(6px); transition: all 0.2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
.done-btn[aria-pressed='true'] .icon { animation: pop 0.25s ease-out; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Library & settings */
.lib-row-meta { font-variant-numeric: tabular-nums; }
.settings-group { margin-bottom: 22px; }
.settings-group h3 { font-size: 13px; color: var(--text-2); font-weight: 700; margin: 0 4px 6px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 0.5px solid var(--sep); font-size: 15px; }
.kv:first-child { border-top: 0; }
.kv span:last-child { color: var(--text-2); text-align: right; }
.update-banner {
  position: fixed; left: 12px; right: 12px; top: calc(env(safe-area-inset-top) + 8px); z-index: 70; margin: 0 auto; max-width: 520px;
  background: var(--navy); color: var(--bg); border-radius: 14px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px;
}
.update-banner button { margin-left: auto; border: 0; border-radius: 10px; background: var(--bg); color: var(--navy); font-weight: 800; padding: 8px 12px; min-height: 36px; }
.boot-error { padding: 24px; }

/* 小さい画面（iPhone SE 第1世代など 320px 幅） */
@media (max-width: 359px) {
  .meal-empty { display: none; }
  .pfc-grid { gap: 8px; }
  .pfc-item .label { font-size: 12px; white-space: nowrap; }
  .pfc-item .value { font-size: 18px; }
  .summary-kcal { font-size: 30px; }
  .unit-input .input { font-size: 18px; padding-right: 36px; }
  .date-main { font-size: 18px; }
  .set-head, .set-row { gap: 4px; padding-right: 8px; }
}

/* トレーニング場所 */
.location-row { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.location-label { font-size: 14px; font-weight: 700; color: var(--text-2); flex: none; }
.location-row .seg { flex: 1; }
.loc-tag { font-size: 12px; font-weight: 700; color: var(--body); background: var(--body-soft); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.row-unavailable .row-title { color: var(--text-2); }
.row-sub .need { color: var(--danger); font-weight: 600; }
.seg-wrap { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); }
.sample-warning { margin: 10px 0 0; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--kcal) 12%, transparent); font-size: 13px; color: var(--text); }
.sample-banner { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--kcal) 12%, transparent); font-size: 13px; line-height: 1.5; }
.kv-input { display: flex; gap: 8px; align-items: center; }
.kv-input .input { flex: 1; min-width: 0; }
.kv-input .btn { flex: none; white-space: nowrap; }

/* ---------- 筋肉マップ ---------- */
:root {
  --skin: #ece8e2;
  --skin-line: #cfc8be;
  --m-none: #dcd7cf;
  --m-low: color-mix(in srgb, var(--workout) 32%, #fff);
  --m-ok: color-mix(in srgb, var(--workout) 68%, #fff);
  --m-high: var(--workout);
}
@media (prefers-color-scheme: dark) {
  :root {
    --skin: #262c3a;
    --skin-line: #3a4254;
    --m-none: #353c4d;
    --m-low: color-mix(in srgb, var(--workout) 38%, #161b26);
    --m-ok: color-mix(in srgb, var(--workout) 70%, #161b26);
    --m-high: var(--workout);
  }
}
.mm-top { display: flex; gap: 10px; align-items: center; }
.mm-top .seg { flex: 1; }
.mm-top { flex-wrap: wrap; }
.mm-top .seg-zoom { flex: 1 1 100%; }
.sparse-note { margin: 0 2px 10px; padding: 8px 10px; border-radius: 10px; background: var(--body-soft); font-size: 13px; }
.pain-box { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--kcal) 12%, transparent); font-size: 13px; }
.pain-box ul { margin: 4px 0; padding-left: 18px; }
.pain-box p { margin: 4px 0 0; color: var(--text-2); }
.mm-target { margin-top: 12px; font-size: 14px; }
.mm-target summary { font-weight: 700; color: var(--text-2); cursor: pointer; min-height: 36px; display: flex; align-items: center; }
.target-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.target-row .input { width: 76px; text-align: center; }
.done-btn.pending { border-color: var(--workout); border-style: dashed; color: var(--workout); }
.done-btn.legacy { background: var(--workout-soft); color: var(--workout); border-color: transparent; }
.pending-note { color: color-mix(in srgb, var(--kcal) 70%, var(--text)); }
.vol-list { background: var(--card-2); border-radius: 12px; padding: 4px 12px; }
.vol-row { display: flex; justify-content: space-between; padding: 6px 0; border-top: 0.5px solid var(--sep); font-size: 15px; }
.vol-row:first-child { border-top: 0; }
.vol-row b { font-variant-numeric: tabular-nums; }
.compare { margin: 6px 0 0 14px; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.compare th { text-align: left; color: var(--text-3); font-weight: 600; padding: 2px 10px 2px 0; }
.compare td { padding: 2px 10px 2px 0; }
.compare tr[data-dir='1'] td:last-child { color: var(--success); font-weight: 700; }
.compare tr[data-dir='-1'] td:last-child { color: var(--text-2); }
.growth.growth-mixed { color: color-mix(in srgb, var(--kcal) 70%, var(--text)); }
.role-chip.role-primary { background: var(--workout); border-color: var(--workout); color: #fff; }
.role-chip.role-secondary { background: var(--workout-soft); border-color: var(--workout); color: var(--workout); }
.role-chip.role-stabilizer { background: var(--card-2); border-style: dashed; }
.role-chip small { color: inherit; opacity: 0.85; }
.mm-caption { margin: 8px 4px 10px; }
.mm-card { padding: 10px 8px 12px; }
.mm-figure { display: flex; justify-content: center; }
.body-map { width: min(100%, 300px); height: auto; max-height: 58vh; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.body-map.zoom-upper, .body-map.zoom-lower { width: min(100%, 340px); max-height: none; }
.body-outline path, .body-outline ellipse { fill: var(--skin); stroke: var(--skin-line); stroke-width: 1.6; }
.body-fill path, .body-fill ellipse { fill: var(--skin); stroke: none; }
.body-lines path { stroke: var(--skin); stroke-width: 0.9; fill: none; pointer-events: none; }
.muscle { stroke: var(--card); stroke-width: 0.9; pointer-events: none; transition: fill 0.15s, stroke-width 0.1s; }
/* 操作用の透明なタップ領域（見た目の図形より外側まで押せる） */
.muscle-hit { fill: transparent; stroke: transparent; pointer-events: all; cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; }
.body-silhouette, .body-lines { pointer-events: none; }
.muscle[data-status='none'] { fill: var(--m-none); stroke-dasharray: 2 1.5; stroke: var(--skin-line); }
.muscle[data-status='low'] { fill: var(--m-low); }
.muscle[data-status='ok'] { fill: var(--m-ok); }
.muscle[data-status='high'] { fill: var(--m-high); }
.muscle.selected { stroke: var(--text); stroke-width: 2.4; stroke-dasharray: none; filter: drop-shadow(0 0 2px color-mix(in srgb, var(--kcal) 80%, transparent)); }
.muscle.focused { stroke: var(--body); stroke-width: 2.6; stroke-dasharray: none; }
.mm-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; font-size: 12px; color: var(--text-2); margin-top: 6px; }
.mm-legend span { display: inline-flex; align-items: center; gap: 4px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw-none { background: var(--m-none); outline: 1px dashed var(--skin-line); outline-offset: -1px; }
.sw-low { background: var(--m-low); }
.sw-ok { background: var(--m-ok); }
.sw-high { background: var(--m-high); }
.mm-plan-links { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 2px 0; }
.pill-link { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 12px; border-radius: 999px; background: var(--workout-soft); color: var(--workout); font-weight: 700; font-size: 14px; text-decoration: none; }
.mm-detail { margin-top: 12px; scroll-margin-top: calc(var(--header-h) + 12px); }
.mm-h { font-size: 17px; margin: 0 0 8px; }
.mm-detail-head { display: flex; align-items: center; gap: 8px; }
.mm-name { font-size: 20px; margin: 0; flex: 1; min-width: 0; }
.status-pill { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; background: var(--card-2); color: var(--text-2); vertical-align: middle; }
.status-pill.st-low { background: color-mix(in srgb, var(--kcal) 16%, transparent); color: color-mix(in srgb, var(--kcal) 70%, var(--text)); }
.status-pill.st-ok { background: var(--workout-soft); color: var(--workout); }
.status-pill.st-high { background: var(--workout); color: #fff; }
.mm-metric { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 6px 0 6px; flex-wrap: wrap; }
.mm-metric-label { font-size: 14px; font-weight: 700; color: var(--text-2); }
.mm-metric-value b { font-size: 26px; font-variant-numeric: tabular-nums; }
.mm-metric-value small { color: var(--text-3); font-size: 13px; margin-left: 4px; }
.range-bar { position: relative; height: 12px; border-radius: 6px; background: var(--card-2); overflow: hidden; }
.range-bar .range-band { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--workout) 14%, transparent); border-left: 1.5px solid color-mix(in srgb, var(--workout) 50%, transparent); border-right: 1.5px solid color-mix(in srgb, var(--workout) 50%, transparent); }
.range-bar .range-fill { position: absolute; left: 0; top: 3px; bottom: 3px; border-radius: 4px; background: var(--m-ok); }
.range-bar .range-fill.st-low { background: var(--m-low); }
.range-bar .range-fill.st-high { background: var(--m-high); }
.mm-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 14px; }
.mm-facts dt { color: var(--text-2); font-weight: 600; }
.mm-facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.mm-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.badge { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 8px; }
.badge-recover { background: var(--body-soft); color: var(--body); }
.badge-warn { background: color-mix(in srgb, var(--kcal) 14%, transparent); color: color-mix(in srgb, var(--kcal) 70%, var(--text)); }
.badge-danger { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.mm-reasons { margin-top: 10px; font-size: 14px; }
.mm-reasons summary, .definition summary, .mm-all summary { font-weight: 700; color: var(--text-2); cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.mm-reasons ul, .definition ul { margin: 4px 0 0; padding-left: 20px; }
.mm-reasons li, .definition li { margin: 2px 0; }
.definition { font-size: 13px; color: var(--text-2); }
.definition p { margin: 4px 0 0; line-height: 1.6; }
.mm-all { margin-top: 16px; }
.mm-all .chips { margin-top: 8px; }
.role-tag { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; }
.role-primary { background: var(--workout-soft); color: var(--workout); }
.role-secondary { background: var(--card-2); color: var(--text-2); }
.fav-mark { color: #f5b301; }
.row-chevron { color: var(--text-3); padding-right: 10px; display: grid; place-items: center; }
.chip-static { cursor: default; }

/* 予定・マイセット・成果レポート */
.plan-card { border-left: 4px solid color-mix(in srgb, var(--workout) 45%, transparent); padding: 12px; }
.plan-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.plan-title { font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.plan-card .list { background: var(--card-2); }
.plan-row .row-main { padding-left: 12px; min-height: 52px; }
.plan-actions { display: flex; align-items: center; gap: 4px; padding-right: 4px; }
.plan-started .row-title { color: var(--text-2); }
.done-tag { color: var(--success); font-weight: 700; }
.action-head { margin: 0 2px 12px; }
.warn-line { color: var(--danger); font-size: 13px; font-weight: 600; margin: 6px 0 0; }
.set-stepper-row { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 12px; font-weight: 700; }
.set-stepper { display: flex; align-items: center; gap: 12px; }
.set-stepper b { min-width: 2ch; text-align: center; font-size: 20px; font-variant-numeric: tabular-nums; }
.row-inline { gap: 8px; padding: 10px 10px 10px 14px; flex-wrap: wrap; }
.row-inline .row-title { width: 100%; }
.row-inline .input { flex: 1; min-width: 0; min-height: 42px; }
.action-title { display: flex; align-items: center; gap: 8px; }
.action-title .icon { flex: none; color: var(--workout); }
.preset-card { padding: 4px 0 0; margin-bottom: 10px; }
.preset-card p { padding: 0 14px; }
.set-row.warmup .input { color: var(--text-2); border-style: dashed; }
.set-row.warmup .set-no { color: var(--text-3); }
.report-date { font-weight: 700; margin: 0 2px 10px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stat-tile { background: var(--card-2); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.stat-label { font-size: 12px; font-weight: 700; color: var(--text-2); }
.stat-value { font-size: 22px; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12px; color: var(--text-2); }
.report-h { font-size: 15px; margin: 18px 2px 8px; }
.report-ex { padding: 2px 12px 12px 0; border-top: 0.5px solid var(--sep); }
.report-ex:first-child { border-top: 0; }
.report-ex .row-sub { padding-left: 14px; }
.report-sets { margin: 2px 0 6px; padding-left: 36px; font-size: 15px; font-variant-numeric: tabular-nums; }
.report-sets li { margin: 1px 0; }
.pain-tag { color: var(--danger); font-size: 13px; }
.growth { margin: 6px 0 0 14px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.growth.growth-up { font-weight: 700; color: var(--success); }
.report-ex .small.muted { padding-left: 14px; }
.suggestions { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.6; }
.growth .fact { display: inline-block; margin: 2px 6px 2px 0; padding: 2px 8px; border-radius: 8px; background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success); font-size: 13px; font-weight: 700; }
.growth .fact.fact-mixed { background: color-mix(in srgb, var(--kcal) 14%, transparent); color: color-mix(in srgb, var(--kcal) 70%, var(--text)); }
.compare-note { margin: 4px 0 0 14px; }
.region-switch { display: flex; gap: 6px; margin: 6px 0 2px; flex-wrap: wrap; }
.region-switch .chip { min-height: 40px; }


/* ---------- 負傷・違和感マップ：44px 以上を目安にした操作点と左右選択 ---------- */
.injury-intro { margin-bottom: 12px; }
.injury-intro h2 { color: var(--navy); }
.injury-map-card { padding: 12px 9px; margin-bottom: 12px; }
.injury-map-card .seg { max-width: 340px; margin: 0 auto; }
.injury-figure-wrap { display: flex; justify-content: center; align-items: center; padding: 10px 0 2px; }
.injury-map { display: block; width: min(100%, 340px); max-height: 58vh; touch-action: manipulation; }
.injury-figure { fill: color-mix(in srgb, var(--body) 10%, var(--card)); stroke: color-mix(in srgb, var(--body) 34%, var(--text-3)); stroke-width: 1.8px; stroke-linejoin: round; }
.injury-sides { fill: var(--text-2); font-size: 14px; font-weight: 700; text-anchor: middle; }
.injury-point-visual { fill: color-mix(in srgb, var(--body) 45%, var(--card)); stroke: var(--card); stroke-width: 2; pointer-events: none; }
.injury-point.has-injury .injury-point-visual { fill: #eb6147; }
.injury-point.is-selected .injury-point-visual { fill: var(--workout); stroke: var(--workout); stroke-width: 4; }
.injury-point-hit { fill: transparent; stroke: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.injury-point-hit:focus-visible { stroke: var(--workout); stroke-width: 3; }
.injury-area-list { display: flex; flex-wrap: wrap; gap: 7px; padding: 8px 0 12px; }
.injury-part-group { padding: 8px 6px; margin-top: 8px; border-top: 1px solid var(--sep); }
.injury-part-group summary, .injury-attention summary { font-size: 14px; font-weight: 700; cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.injury-active-row { border-bottom: 1px solid var(--sep); padding: 12px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.injury-active-row:last-child { border: none; }
.injury-active-row p { margin: 6px 0 0; }
.injury-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.injury-actions .btn { min-height: 38px; padding: 6px 9px; font-size: 12px; }
.injury-filters { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 12px 0; }
.injury-filters select { min-width: 0; width: 100%; }
.injury-score { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.injury-score input { flex: 1; min-width: 0; }
.injury-score b { min-width: 52px; font-size: 18px; color: var(--workout); }
.injury-attention { padding-top: 10px; border-top: 1px solid var(--sep); }
.injury-alert { color: var(--danger); font-weight: 700; }
@media(max-width:350px) { .tab { font-size: 10px; } .tab .icon { height: 23px; width: 23px; } .injury-map { width: 310px; } .injury-filters { grid-template-columns: 1fr; } }

/* iPhone15 (393px): per-exercise attachments and secondary BIG3 section */
.wx-attachment { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; padding: 8px 0 6px; }
.wx-attachment label { display:flex; flex-direction:column; gap:5px; flex:1 1 145px; min-width:0; }
.wx-attachment select, .wx-attachment input { min-height:44px; }
.wx-attachment input:not([hidden]) { flex:1 1 145px; min-width:0; }
.wx-attachment .tiny { width:100%; margin:0; }

/* Existing pull-up logs: visible grip + hand-width controls at iPhone 15 width. */
.pullup-card-conditions { margin: 10px 0; padding: 12px; border-radius: 14px; background: var(--card-2); }
.pullup-card-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.pullup-card-fields label { display: flex; min-width: 0; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 750; }
.pullup-card-fields select { width: 100%; min-width: 0; min-height: 44px; }
.pullup-card-conditions p { margin: 8px 0 0; line-height: 1.45; }
.pullup-card-conditions .btn { margin-top: 9px; min-height: 44px; }

/* Food search（第4回：検索を先頭に。種類チップは横スクロールで1行） */
.picker-top { position: sticky; top: -4px; z-index: 3; background: var(--bg); margin: -4px -16px 0; padding: 4px 16px 8px; border-bottom: 0.5px solid transparent; }
.picker-top .chips { margin-top: 8px; }
.chips-scroll { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; overscroll-behavior-x: contain; padding-bottom: 2px; }
.chips-scroll::-webkit-scrollbar { display: none; }
.chips-scroll .chip { flex: none; }
.chain-chips, [data-testid='genre-chips'] { margin: 10px 0 2px; }
.search-clear { width: 36px; height: 36px; margin-right: -6px; color: var(--text-3); }
.search-clear[hidden] { display: none; }
.row-brand { font-weight: 700; color: var(--text); }
.tag-recent { font-size: 11px; font-weight: 700; color: var(--body); }
.more-btn { margin-top: 10px; }
.chip-serving { display: inline-flex; flex-direction: column; gap: 0; align-items: center; justify-content: center; line-height: 1.15; padding: 5px 12px; }
.chip-serving small { font-size: 11px; }
.source-details { margin: 4px 0 10px; padding: 0 2px; font-size: 14px; color: var(--text-2); }
.source-details > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; }
.source-details p { margin: 4px 0 8px; line-height: 1.5; overflow-wrap: anywhere; }
.source-details a { color: var(--body); font-weight: 700; }
/* 検索欄：独自の消去ボタンを使うので、ブラウザ標準の × は出さない（二重表示の防止） */
.picker-top input[type='search']::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
/* 種類チップ：393px でも 6 種類すべてが横スクロールなしで見えるよう 3 列 × 2 段。押せる高さは 44px を保つ */
.kind-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.kind-grid .chip { min-height: 44px; padding: 6px 4px; justify-content: center; text-align: center; white-space: nowrap; font-size: 15px; }
.kind-grid { margin-top: 8px; }

/* 補食画面：お気に入りとは別の固定ショートカット。狭いiPhoneでも縦横はみ出さない。 */
.supplement-quick { padding: 12px 0; }
.supplement-quick > strong { display:block; font-size:13px; margin-bottom:8px; }
.supplement-quick-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.supplement-quick-list > .chip { min-width:0; min-height:44px; white-space:normal; overflow-wrap:anywhere; line-height:1.35; text-align:center; }
@media (max-width:360px) { .supplement-quick-list { grid-template-columns:1fr; } }


/* 2026-10 usability pass: fewer taps at 393 CSS px; preserve system dark mode. */
.wx-reuse {
  border: 1px solid var(--sep);
  background: linear-gradient(115deg,var(--workout-soft),var(--card) 68%);
  padding: 14px 14px 12px;
  margin: 8px 0 14px;
  box-shadow: var(--shadow);
}
.wx-reuse-heading b { font-size: 16px; line-height: 1.35; color: var(--text); }
.wx-reuse-heading p { margin: 4px 0 11px; line-height: 1.5; }
.wx-reuse-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.wx-reuse-actions .btn { min-width: 0; min-height: 48px; padding: 8px; font-size: 14px; white-space: normal; }
.wx-reuse-actions .btn .icon { flex: none; }
.wx-reuse-list { display: flex; flex-direction: column; gap: 8px; }
.wx-reuse-day { width: 100%; min-height: 60px; border: 1px solid var(--sep); border-radius: 12px; background: var(--card-2); color: var(--text); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; text-align: left; }
.wx-reuse-day span { display: flex; flex-direction: column; gap: 3px; }
.wx-reuse-day small { color: var(--text-2); font-size: 12px; }
.wx-reuse-day:active { border-color: var(--workout); }
.meal-recent-copy { width: 100%; text-align: left; color: var(--meal); background: var(--meal-soft); min-height: 44px; border: 0; border-top: 1px solid var(--sep); padding: 9px 16px; font-size: 13px; font-weight: 750; display: flex; gap: 8px; align-items: center; }
.meal-recent-copy[hidden] { display: none; }
.bm-last-value { display: block; font-size: 12px; color: var(--body); padding: 2px 1px 0; line-height: 1.5; }
.bm-field { min-width: 0; }
.bm-field .input { min-width: 0; }
.injury-quick h3 { margin: 0 0 6px; font-size: 17px; }
.injury-quick p { margin: 6px 0 10px; }
.injury-quick-buttons { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.injury-quick-buttons button { min-width: 0; min-height: 48px; padding: 8px; }
@media(max-width: 355px) {
 .wx-reuse-actions { grid-template-columns: 1fr; }
 .injury-quick-buttons { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media(prefers-reduced-motion: reduce) {
 .wx-reuse-day, .meal-recent-copy { transition: none; }
}

.cal-dots .cal-dot-pending, .dots .cal-dot-pending, .cal-legend .cal-dot-pending {
  background: transparent !important;
  border: 2px solid var(--workout);
  box-sizing: border-box;
}

/* Subpixel rounding on iPhone 15 could make a 44px tap hit report 43.99998px. */
[data-testid="kind-chips"] [data-kind] { min-height: 46px; }

/* Saved meal presets: compact, thumb-friendly, iPhone 15 (393 CSS px). */
.meal-preset-quick { width:100%; display:flex; gap:9px; align-items:center; text-align:left; min-height:48px; padding:10px 16px; background:var(--meal-soft); color:var(--meal); font-size:14px; font-weight:750; border:0; border-top:1px solid var(--sep); }
.meal-preset-quick[hidden] { display:none; }
.meal-preset-quick:disabled { opacity:.55; }
.meal-preset-title { font-size:15px; margin:8px 4px 10px; }
.meal-preset-list { border-radius:13px; overflow:hidden; border:1px solid var(--sep); margin-bottom:12px; }
.meal-preset-row { display:flex; align-items:stretch; gap:4px; border-bottom:1px solid var(--sep); background:var(--card); }
.meal-preset-row:last-child { border-bottom:0; }
.meal-preset-apply { min-width:0; min-height:58px; flex:1; padding:10px 12px; display:flex; flex-direction:column; justify-content:center; gap:3px; text-align:left; background:transparent; border:0; color:var(--text); }
.meal-preset-apply .row-sub { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:100%; font-size:12px; color:var(--text-2); }
.meal-preset-delete { align-self:center; margin-right:6px; flex-shrink:0; }
.meal-preset-history { margin-top:16px; }

/* =====================================================================
   2026-10-30 クリーン刷新（ゲームUIのような軽やかさ・清潔感）
   方針：白〜淡いブルーグレーの地、空色の光、丸いピル型の操作部品、
   薄い境界線とやわらかい影。トレカ風の枠や装飾は使わない。
   ===================================================================== */

/* 背景：固定のやわらかな光（iOS は background-attachment:fixed が効かないため疑似要素で） */
body { background: var(--bg); letter-spacing: 0.01em; }
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(120% 60% at 110% -10%, rgba(110, 215, 235, 0.20), transparent 60%),
    radial-gradient(90% 50% at -20% 105%, rgba(170, 160, 255, 0.14), transparent 62%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.55) 0 1px, transparent 1px 22px),
    var(--bg);
}
@media (prefers-color-scheme: dark) {
  body::before {
    background:
      radial-gradient(120% 60% at 110% -10%, rgba(60, 190, 220, 0.14), transparent 60%),
      radial-gradient(90% 50% at -20% 105%, rgba(120, 100, 240, 0.12), transparent 62%),
      var(--bg);
  }
}

/* ヘッダー：白いすりガラス＋下端に虹色の細い光 */
.app-header {
  background: color-mix(in srgb, var(--card) 78%, transparent);
  border-bottom: 0;
  box-shadow: 0 1px 0 var(--sep);
}
.app-header::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1.5px;
  background: var(--holo); opacity: 0.55; pointer-events: none;
}
.page-title { font-size: 21px; font-weight: 800; letter-spacing: 0.04em; }
.date-main { font-size: 19px; font-weight: 800; letter-spacing: 0.02em; }
.date-sub { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; }
.date-sub.is-today { color: var(--accent); }
.icon-btn { color: var(--text-2); }
.icon-btn:active, .date-button:active { background: var(--accent-soft); }
.today-pill { background: var(--grad-primary); color: #fff; box-shadow: 0 4px 12px rgba(40, 150, 220, 0.28); }

/* 本文の下余白：浮いたタブバーぶん */
main.content { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 44px); }

/* タブバー：画面下に浮かぶ白いピル。選択中は淡い空色の丸 */
.tabbar {
  left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  padding: 5px 6px; border-radius: 28px; border-top: 0;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  box-shadow: 0 0 0 1px var(--sep), 0 10px 30px rgba(30, 60, 110, 0.14);
  max-width: 560px; margin: 0 auto;
}
.tab { height: 52px; border-radius: 22px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; color: var(--text-3); transition: color 0.15s, background 0.15s; }
.tab[aria-current='page'] { color: var(--accent); background: var(--accent-soft); }
.tab[aria-current='page'] .icon { filter: drop-shadow(0 2px 4px color-mix(in srgb, var(--accent) 35%, transparent)); }
.toast-host { bottom: calc(var(--tabbar-h) + max(10px, env(safe-area-inset-bottom)) + 18px); }

/* 見出し：小さな空色のバー＋太字。行末に細いフェード線 */
.section-title { font-size: 18px; font-weight: 800; letter-spacing: 0.04em; margin: 28px 4px 12px; }
.section-title .dot { width: 5px; height: 18px; border-radius: 3px; }
.section-title .sub { font-size: 13px; font-weight: 700; }

/* 面：白い地にごく薄い枠とやわらかい影（角は大きく丸く） */
.card { border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--sep); padding: 16px 18px; margin-bottom: 14px; }
.card.flush, .meal-card, .wx-card { padding: 0; }
.wx-card { border-left: 1px solid var(--sep); }
.plan-card { border-left: 1px solid var(--sep); }
.list, .sheet .list { border-radius: var(--radius-sm); border: 1px solid var(--sep); }

/* 数値：やや細身で整った数字 */
.summary-kcal { font-size: 36px; font-weight: 800; letter-spacing: -0.02em; }
.pfc-item .label { font-size: 12px; letter-spacing: 0.04em; }
.pfc-item .value { font-weight: 800; }

/* 進捗バー：淡い溝＋グラデーションで光る塗り */
.bar { height: 10px; background: color-mix(in srgb, var(--text-3) 14%, transparent); }
.bar > i {
  background: linear-gradient(90deg, color-mix(in srgb, currentColor 55%, #fff), currentColor);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.pfc-item .bar { height: 7px; }

/* ボタン：すべてピル型 */
.btn { border-radius: 999px; font-weight: 800; letter-spacing: 0.03em; transition: transform 0.12s, box-shadow 0.15s, filter 0.15s; }
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--grad-primary); color: #fff;
  box-shadow: 0 6px 16px rgba(40, 150, 220, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-primary:active { filter: brightness(0.96); }
.btn-tint { background: var(--card); color: var(--text); box-shadow: 0 0 0 1px var(--sep), 0 2px 6px rgba(30, 60, 110, 0.05); }
.btn-plain { color: var(--accent); }
.btn-meal { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--meal) 18%, transparent); }
.btn-workout { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--workout) 18%, transparent); }
.btn.btn-compact { border-radius: 999px; }

/* チップ・切り替え */
.chip { border-radius: 999px; font-weight: 700; box-shadow: 0 1px 2px rgba(30, 60, 110, 0.04); }
.chip[aria-pressed='true'] {
  background: var(--grad-primary); color: #fff; border-color: transparent;
  box-shadow: 0 4px 12px rgba(40, 150, 220, 0.26);
}
.chip[aria-pressed='true'] small { color: rgba(255, 255, 255, 0.85); }
.chips.workout .chip[aria-pressed='true'] { background: linear-gradient(120deg, #8a7bf2, var(--workout)); box-shadow: 0 4px 12px rgba(110, 90, 230, 0.26); }
.seg { border-radius: 999px; padding: 4px; background: color-mix(in srgb, var(--text-3) 12%, transparent); }
.seg button { border-radius: 999px; font-weight: 700; }
.seg button[aria-pressed='true'] { color: var(--accent); box-shadow: 0 2px 8px rgba(30, 60, 110, 0.12); }
.quick-jump { border-radius: 999px; background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(30, 60, 110, 0.05); }

/* 入力欄：淡いブルーグレー。フォーカスで空色のリング */
.input, select.input, textarea.input { border-radius: 14px; }
.input:focus { border-color: var(--edit-focus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--edit-focus) 18%, transparent); }
.search { border-radius: 999px; background: var(--card); box-shadow: 0 0 0 1px var(--sep), 0 2px 8px rgba(30, 60, 110, 0.05); border: 0; }
.amount-row .input { border-radius: 18px; }
.stepper { border-radius: 999px; background: var(--card); box-shadow: 0 0 0 1px var(--sep), 0 2px 6px rgba(30, 60, 110, 0.06); color: var(--accent); }
.preview, .note-box, .daily-focus-grid > div, .stat-tile, .big3-result, .vol-list, .set-detail { border-radius: 16px; }

/* 筋トレのセット行 */
.done-btn { border-radius: 999px; }
.done-btn[aria-pressed='true'] { background: linear-gradient(135deg, #8a7bf2, var(--workout)); border-color: transparent; box-shadow: 0 3px 10px rgba(110, 90, 230, 0.32); }
.fatigue button, .pain-scale button { border-radius: 14px; }
.fatigue button[aria-pressed='true'] { background: linear-gradient(135deg, #8a7bf2, var(--workout)); border-color: transparent; }
.part-tag, .loc-tag, .status-pill, .badge { border-radius: 999px; }

/* シート（下から出る画面） */
.sheet { border-radius: 28px 28px 0 0; background: var(--bg); box-shadow: 0 -10px 40px rgba(20, 40, 80, 0.18); }
.sheet::before { content: ''; position: absolute; left: 24px; right: 24px; top: 0; height: 1.5px; background: var(--holo); opacity: 0.5; border-radius: 2px; }
.sheet { position: relative; }
.sheet-title { font-weight: 800; letter-spacing: 0.04em; }
.sheet-footer { background: color-mix(in srgb, var(--bg) 92%, transparent); }
.sheet-backdrop.open { background: rgba(14, 26, 48, 0.32); }

/* カレンダー */
.cal-day .num { border-radius: 999px; }
.cal-day.today .num { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-day.selected .num { background: var(--grad-primary); color: #fff !important; box-shadow: 0 4px 10px rgba(40, 150, 220, 0.3); }

/* ダイアログ・トースト・更新バナー */
.dialog { border-radius: 26px; border: 1px solid var(--sep); }
.toast { border-radius: 999px; padding: 11px 18px; background: color-mix(in srgb, var(--navy) 94%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.toast-action { border-radius: 999px; }
.update-banner { border-radius: 999px; background: var(--grad-primary); color: #fff; box-shadow: 0 8px 22px rgba(40, 150, 220, 0.3); }
.update-banner button { border-radius: 999px; background: #fff; color: var(--accent-2); }

/* 筋肉マップの色をやや明るく */
.pill-link { border-radius: 999px; }

/* タップ時のわずかな反応（動きを減らす設定では止まる） */
.row-main, .entry, .chip, .tab, .quick-jump { transition: background 0.15s, transform 0.12s; }
.chip:active, .quick-jump:active { transform: scale(0.97); }
.is-busy { pointer-events: none; }

/* ホームの上部：カロリーの丸ゲージ */
.summary-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.kcal-ring { width: 92px; height: 92px; flex: none; }
.kcal-ring .ring-track { fill: none; stroke: color-mix(in srgb, var(--text-3) 15%, transparent); stroke-width: 9; }
.kcal-ring .ring-fill { fill: none; stroke: url(#kcal-grad); stroke-width: 9; stroke-linecap: round; transition: stroke-dasharray 0.4s ease; }
.kcal-ring .stop-a { stop-color: #ffc35a; }
.kcal-ring .stop-b { stop-color: #f5822f; }
.kcal-ring.is-over .stop-a { stop-color: #ff9a7a; }
.kcal-ring.is-over .stop-b { stop-color: var(--danger); }
.kcal-ring .ring-pct { text-anchor: middle; font-size: 15px; font-weight: 800; fill: var(--text); font-family: var(--font); }
.summary-side { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.summary-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; color: var(--text-3); }
.summary-side .summary-top { flex-wrap: wrap; gap: 4px 6px; }
.summary-side .summary-unit { font-size: 14px; }
.summary-left { font-size: 15px; font-weight: 800; color: var(--accent); }
.summary-left.is-over { color: var(--danger); }
.pfc-item { min-width: 0; }
.pfc-item .value { font-size: 19px; white-space: nowrap; }
.pfc-item .value small { font-size: 12px; }
.hint-details { margin-top: 8px; }
.hint-details > summary { font-size: 13px; font-weight: 700; color: var(--text-3); cursor: pointer; min-height: 36px; display: flex; align-items: center; list-style: none; }
.hint-details > summary::-webkit-details-marker { display: none; }
.hint-details > summary::before { content: 'ⓘ'; margin-right: 6px; }
.hint-details p { margin: 0 0 4px; line-height: 1.6; }
.daily-focus { border-top-color: var(--sep); }

/* 今週：週目標の丸・体重平均・体脂肪の距離（面ではなく、地の上に軽く置く） */
.week-panel { margin: 4px 2px 6px; }
.week-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 10px 2px 10px; }
.week-title { font-size: 18px; font-weight: 800; letter-spacing: 0.06em; margin: 0; }
.week-count { font-size: 13px; font-weight: 800; color: var(--workout); background: var(--workout-soft); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.week-count.is-reached { color: #fff; background: linear-gradient(120deg, #8a7bf2, var(--workout)); box-shadow: 0 4px 12px rgba(110, 90, 230, 0.28); }
.week-dots { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.week-dot { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.week-dot-mark { width: 30px; height: 30px; border-radius: 50%; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--sep), 0 1px 3px rgba(30, 60, 110, 0.05); position: relative; }
.week-dot.is-done .week-dot-mark { background: linear-gradient(135deg, #9b8cf6, var(--workout)); box-shadow: 0 3px 10px rgba(110, 90, 230, 0.3); }
.week-dot.is-done .week-dot-mark::after { content: ''; position: absolute; left: 50%; top: 46%; width: 7px; height: 12px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: translate(-50%, -60%) rotate(45deg); }
.week-dot.is-current .week-dot-mark { outline: 2px solid var(--accent); outline-offset: 2px; }
.week-dot-label { font-size: 11px; font-weight: 700; color: var(--text-3); }
.week-dot.is-current .week-dot-label { color: var(--accent); }
.week-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.week-stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 18px; background: color-mix(in srgb, var(--card) 72%, transparent); box-shadow: 0 0 0 1px var(--sep); min-width: 0; }
.week-stat-label { font-size: 11.5px; font-weight: 700; color: var(--text-3); letter-spacing: 0.04em; }
.week-stat b { font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.25; }
.week-stat b small { font-size: 12px; color: var(--text-2); font-weight: 700; }
.week-stat b.is-empty { color: var(--text-3); }
.week-stat .delta { display: block; font-style: normal; font-size: 12px; font-weight: 800; color: var(--text-2); }
.week-stat .delta.tone-good { color: var(--success); }
.week-stat .delta.tone-fast, .week-stat .delta.tone-up { color: color-mix(in srgb, var(--kcal) 75%, var(--text)); }
.week-stat-note { font-size: 11.5px; color: var(--text-2); line-height: 1.45; }
.week-stat-note a { color: var(--accent); font-weight: 700; }
.backup-nudge { display: block; margin-top: 10px; padding: 10px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 700; text-decoration: none; color: color-mix(in srgb, var(--kcal) 70%, var(--text)); background: color-mix(in srgb, var(--kcal) 11%, transparent); border-radius: 16px; line-height: 1.5; }
@media (max-width: 359px) { .week-stats { grid-template-columns: 1fr; } .week-dot-mark { width: 26px; height: 26px; } }

/* =====================================================================
   2026-10-30 第2弾：透明感（すりガラス）と立体感
   背景に色のある光を置き、面は半透明＋ぼかしで透かす。
   上辺の白いハイライトと重ねた影で浮き上がらせ、ボタンは押し込める厚みを持たせる。
   ===================================================================== */
:root {
  --glass: rgba(255, 255, 255, 0.58);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --glass-tile: rgba(255, 255, 255, 0.55);
  --glass-line: rgba(255, 255, 255, 0.85);
  --glass-hi: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -1px 0 rgba(255, 255, 255, 0.35);
  --depth-1: 0 1px 2px rgba(25, 50, 100, 0.05), 0 4px 10px rgba(25, 55, 110, 0.06);
  --depth-2: 0 1px 2px rgba(25, 50, 100, 0.05), 0 10px 24px rgba(30, 60, 120, 0.10), 0 28px 48px -28px rgba(30, 60, 130, 0.30);
  --depth-3: 0 2px 4px rgba(25, 50, 100, 0.06), 0 18px 40px rgba(30, 60, 130, 0.18);
  --blur: saturate(170%) blur(22px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --glass: rgba(34, 46, 74, 0.52);
    --glass-strong: rgba(26, 36, 60, 0.80);
    --glass-tile: rgba(255, 255, 255, 0.05);
    --glass-line: rgba(255, 255, 255, 0.10);
    --glass-hi: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 -1px 0 rgba(0, 0, 0, 0.25);
    --depth-1: 0 2px 6px rgba(0, 0, 0, 0.25);
    --depth-2: 0 2px 4px rgba(0, 0, 0, 0.25), 0 14px 32px rgba(0, 0, 0, 0.35);
    --depth-3: 0 4px 8px rgba(0, 0, 0, 0.3), 0 22px 48px rgba(0, 0, 0, 0.45);
  }
}

/* 背景：透けて見えるよう、空色・ラベンダー・ピーチの光をはっきりめに */
body::before {
  background:
    radial-gradient(60% 38% at 100% 0%, rgba(90, 210, 235, 0.42), transparent 70%),
    radial-gradient(55% 34% at -5% 32%, rgba(165, 150, 255, 0.30), transparent 70%),
    radial-gradient(60% 36% at 105% 62%, rgba(120, 190, 255, 0.28), transparent 70%),
    radial-gradient(55% 30% at 0% 100%, rgba(255, 196, 160, 0.30), transparent 70%),
    linear-gradient(180deg, #f6f9fc 0%, #eef3f9 100%);
}
@media (prefers-color-scheme: dark) {
  body::before {
    background:
      radial-gradient(60% 38% at 100% 0%, rgba(40, 180, 210, 0.30), transparent 70%),
      radial-gradient(55% 34% at -5% 32%, rgba(120, 90, 240, 0.28), transparent 70%),
      radial-gradient(60% 36% at 105% 62%, rgba(60, 120, 240, 0.20), transparent 70%),
      radial-gradient(55% 30% at 0% 100%, rgba(240, 120, 120, 0.14), transparent 70%),
      linear-gradient(180deg, #0c1322 0%, #0a0f1c 100%);
  }
}

/* すりガラスの面 */
.card, .week-stat {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line);
  box-shadow: var(--glass-hi), var(--depth-2);
}
.week-stat { box-shadow: var(--glass-hi), var(--depth-1); }
.list, .sheet .list, .meal-preset-list { background: var(--glass); border-color: var(--glass-line); box-shadow: var(--glass-hi), var(--depth-1); }
.plan-card .list { background: var(--glass-tile); }
.preview, .note-box, .daily-focus-grid > div, .stat-tile, .big3-result, .vol-list, .set-detail, .pullup-card-conditions {
  background: var(--glass-tile);
  box-shadow: inset 0 0 0 1px var(--glass-line), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.row-main:active, .entry:active { background: rgba(120, 170, 230, 0.10); }

/* ヘッダー・タブバー・シート：より強いガラス */
.app-header { background: color-mix(in srgb, var(--glass-strong) 70%, transparent); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); }
.tabbar {
  background: var(--glass-strong);
  -webkit-backdrop-filter: saturate(180%) blur(26px); backdrop-filter: saturate(180%) blur(26px);
  box-shadow: var(--glass-hi), 0 0 0 1px var(--glass-line), var(--depth-3);
}
.tab[aria-current='page'] {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), color-mix(in srgb, var(--accent) 16%, rgba(255, 255, 255, 0.6)));
  box-shadow: inset 0 1px 0 #fff, 0 4px 12px color-mix(in srgb, var(--accent) 22%, transparent);
}
@media (prefers-color-scheme: dark) {
  .tab[aria-current='page'] { background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), color-mix(in srgb, var(--accent) 22%, transparent)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12); }
}
.sheet {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(170%) blur(30px); backdrop-filter: saturate(170%) blur(30px);
  box-shadow: inset 0 1px 0 var(--glass-line), 0 -12px 44px rgba(20, 40, 80, 0.22);
}
.sheet-footer, .picker-top { background: transparent; }
.sheet-footer { -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.dialog { background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--glass-hi), var(--depth-3); }

/* 立体ボタン：上に光・下に厚み。押すと沈む */
.btn { transition: transform 0.1s ease, box-shadow 0.15s ease, filter 0.15s; }
.btn-primary {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -3px 0 rgba(10, 60, 140, 0.22),
    0 8px 20px rgba(40, 150, 220, 0.34),
    0 2px 4px rgba(40, 120, 200, 0.2);
  text-shadow: 0 1px 1px rgba(10, 60, 120, 0.25);
}
.btn-primary:active { transform: translateY(2px) scale(0.99); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -1px 0 rgba(10, 60, 140, 0.2), 0 3px 8px rgba(40, 150, 220, 0.3); }
.btn-tint, .quick-jump, .stepper {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.62));
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 #fff, inset 0 -2px 0 rgba(40, 70, 120, 0.07), 0 0 0 1px var(--sep), var(--depth-1);
}
.btn-tint:active, .quick-jump:active, .stepper:active { transform: translateY(1px); box-shadow: inset 0 1px 0 #fff, 0 0 0 1px var(--sep), 0 1px 3px rgba(30, 60, 110, 0.08); }
.btn-meal, .btn-workout, .meal-recent-copy, .meal-preset-quick {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 -2px 0 rgba(0, 0, 0, 0.04), 0 4px 12px rgba(30, 60, 110, 0.06);
}
.btn-meal { background: linear-gradient(180deg, color-mix(in srgb, var(--meal-soft) 70%, #fff), var(--meal-soft)); }
.btn-workout { background: linear-gradient(180deg, color-mix(in srgb, var(--workout-soft) 70%, #fff), var(--workout-soft)); }
@media (prefers-color-scheme: dark) {
  .btn-tint, .quick-jump, .stepper { background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.04)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 0 1px var(--sep), var(--depth-1); }
  .btn-meal { background: linear-gradient(180deg, rgba(44, 194, 176, 0.24), var(--meal-soft)); }
  .btn-workout { background: linear-gradient(180deg, rgba(164, 140, 245, 0.26), var(--workout-soft)); }
}

/* チップ・切り替え：ガラスの粒。選択中はふっくら */
.chip {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.6));
  border-color: var(--glass-line);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px var(--sep), 0 2px 6px rgba(30, 60, 110, 0.06);
}
.chip[aria-pressed='true'], .chips.workout .chip[aria-pressed='true'] {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 -2px 0 rgba(10, 60, 140, 0.2), 0 6px 14px rgba(40, 150, 220, 0.30);
}
.seg { background: rgba(120, 150, 190, 0.14); box-shadow: inset 0 1px 3px rgba(30, 60, 110, 0.10); }
.seg button[aria-pressed='true'] { background: linear-gradient(180deg, #fff, rgba(255, 255, 255, 0.85)); box-shadow: inset 0 1px 0 #fff, 0 3px 10px rgba(30, 60, 110, 0.16); }
@media (prefers-color-scheme: dark) {
  .chip { background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.04)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 0 1px var(--sep); }
  .seg { background: rgba(0, 0, 0, 0.25); }
  .seg button[aria-pressed='true'] { background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.08)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 3px 10px rgba(0, 0, 0, 0.3); }
}

/* 入力欄：少しくぼんだガラス */
.input, select.input, textarea.input, .search {
  background: rgba(255, 255, 255, 0.66);
  box-shadow: inset 0 2px 4px rgba(30, 60, 110, 0.07), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}
.search { box-shadow: inset 0 2px 4px rgba(30, 60, 110, 0.06), 0 0 0 1px var(--sep), 0 4px 12px rgba(30, 60, 110, 0.06); }
.set-row.done .input { background: color-mix(in srgb, var(--workout-soft) 80%, transparent); }
@media (prefers-color-scheme: dark) {
  .input, select.input, textarea.input, .search { background: rgba(0, 0, 0, 0.22); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.04); }
}

/* カロリーの丸ゲージ：光るリング */
.kcal-ring .ring-track { stroke: rgba(120, 150, 190, 0.16); }
.kcal-ring .ring-fill { filter: drop-shadow(0 3px 5px rgba(245, 130, 47, 0.38)); }
.kcal-ring.is-over .ring-fill { filter: drop-shadow(0 3px 5px rgba(224, 72, 72, 0.38)); }
.summary-kcal { text-shadow: 0 2px 10px rgba(245, 144, 47, 0.25); }

/* 週の丸：ガラス玉。実施日は光沢のある球 */
.week-dot-mark {
  background: radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.45) 60%);
  box-shadow: inset 0 0 0 1px var(--glass-line), inset 0 -2px 4px rgba(30, 60, 110, 0.08), 0 3px 8px rgba(30, 60, 110, 0.08);
}
.week-dot.is-done .week-dot-mark {
  background: radial-gradient(circle at 35% 28%, #c9c0ff 0%, #8f7ff4 45%, var(--workout) 100%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.7), inset 0 -3px 5px rgba(60, 30, 160, 0.3), 0 5px 12px rgba(110, 90, 230, 0.38);
}
@media (prefers-color-scheme: dark) {
  .week-dot-mark { background: radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04) 60%); }
}

/* 見出しの印：小さな光沢バー */
.section-title .dot { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 2px 6px rgba(30, 60, 110, 0.18); }

/* 完了ボタン：押すと沈む立体 */
.done-btn { background: linear-gradient(180deg, #fff, rgba(255, 255, 255, 0.7)); box-shadow: inset 0 1px 0 #fff, 0 2px 5px rgba(30, 60, 110, 0.10); }
.done-btn[aria-pressed='true'] { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -2px 0 rgba(60, 30, 160, 0.25), 0 4px 10px rgba(110, 90, 230, 0.35); }
@media (prefers-color-scheme: dark) { .done-btn { background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); } }

/* ガラスが使えない環境では不透明に戻す（読みやすさ優先） */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card, .week-stat, .list, .tabbar, .sheet, .dialog { background: var(--card); }
}
/* ガラスに斜めの光沢（左上が明るく、右下が透ける） */
.card, .week-stat { background: linear-gradient(155deg, rgba(255, 255, 255, 0.80) 0%, rgba(255, 255, 255, 0.52) 55%, rgba(255, 255, 255, 0.40) 100%); }
@media (prefers-color-scheme: dark) {
  .card, .week-stat { background: linear-gradient(155deg, rgba(58, 74, 112, 0.58) 0%, rgba(30, 40, 66, 0.48) 60%, rgba(22, 30, 52, 0.42) 100%); }
}

/* 自己ベスト：行がふわっと光る（1回だけ） */
@keyframes pb-glow { 0% { box-shadow: 0 0 0 0 rgba(255, 200, 80, 0); } 35% { box-shadow: 0 0 0 4px rgba(255, 200, 80, 0.45), 0 6px 18px rgba(255, 170, 40, 0.35); } 100% { box-shadow: 0 0 0 0 rgba(255, 200, 80, 0); } }
.set-row.is-pb { border-radius: 14px; animation: pb-glow 1.4s ease-out 1; }
.set-row.is-pb .done-btn { background: linear-gradient(135deg, #ffd36b, #f5a524); }

/* 性能：ぼかし（backdrop-filter）は重ねるほど描画が重くなる（WebKit で顕著）。
   ぼかすのはヘッダー・タブバー・シートの3層だけにし、面は半透明のグラデーションで透明感を出す。 */
.card, .week-stat, .btn-tint, .quick-jump, .stepper, .dialog, .sheet-footer, .toast {
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.dialog { background: var(--card); }

/* バーコード */
.search-row { display: flex; align-items: center; gap: 8px; }
.search-row .search { flex: 1; min-width: 0; }
.scan-btn { flex: none; width: 46px; height: 46px; border-radius: 999px; color: var(--accent); background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.62)); box-shadow: inset 0 1px 0 #fff, 0 0 0 1px var(--sep), var(--depth-1); }
@media (prefers-color-scheme: dark) { .scan-btn { background: rgba(255,255,255,0.08); box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 0 0 1px var(--sep); } }
.pending-barcode { margin: 8px 2px 0; padding: 8px 12px; border-radius: 14px; font-size: 13px; font-weight: 700; color: var(--accent); background: var(--accent-soft); }
.scan-frame { position: relative; border-radius: 22px; overflow: hidden; background: #0b1220; aspect-ratio: 4 / 3; box-shadow: var(--depth-2); }
.scan-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-guide { position: absolute; left: 10%; right: 10%; top: 32%; bottom: 32%; border-radius: 16px; box-shadow: 0 0 0 9999px rgba(8, 14, 28, 0.38); border: 2px solid rgba(255, 255, 255, 0.9); }
.scan-guide::after { content: ''; position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: linear-gradient(90deg, transparent, #3fd0dc, transparent); animation: scan-line 1.6s ease-in-out infinite; }
@keyframes scan-line { 0%, 100% { transform: translateY(-18px); opacity: 0.6; } 50% { transform: translateY(18px); opacity: 1; } }
.scan-status { text-align: center; font-size: 14px; font-weight: 700; color: var(--text-2); margin: 10px 4px 0; }

/* 筋肉タブ：筋肉マップ／不調の切り替え */
.muscle-switch { margin: 4px 0 14px; }
.seg-link { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 999px; font-size: 15px; font-weight: 700; color: var(--text-2); text-decoration: none; }
.seg-link[aria-current='page'] { color: var(--accent); background: linear-gradient(180deg, #fff, rgba(255,255,255,0.85)); box-shadow: inset 0 1px 0 #fff, 0 3px 10px rgba(30,60,110,0.16); }
@media (prefers-color-scheme: dark) { .seg-link[aria-current='page'] { background: rgba(255,255,255,0.12); box-shadow: inset 0 1px 0 rgba(255,255,255,0.15); } }

/* 不調の入力（タップ中心） */
.injury-quick-buttons { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.injury-step { display: flex; align-items: center; gap: 8px; margin: 16px 2px 8px; font-size: 15px; }
.injury-step:first-child { margin-top: 4px; }
.step-no { width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; background: var(--grad-primary); box-shadow: 0 2px 6px rgba(40,150,220,0.3); }
.seg-wrap-auto { grid-auto-flow: column; }
.injury-levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.injury-level { min-height: 64px; border-radius: 18px; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: var(--card); box-shadow: inset 0 0 0 1px var(--sep), var(--depth-1); color: var(--text); }
.injury-level small { font-size: 11px; color: var(--text-3); font-weight: 700; }
.injury-level[aria-pressed='true'].lv-2 { background: linear-gradient(135deg, #ffe7a8, #ffc65a); box-shadow: 0 4px 12px rgba(240,170,40,0.35); }
.injury-level[aria-pressed='true'].lv-4 { background: linear-gradient(135deg, #ffc49a, #ff8d5a); color: #fff; box-shadow: 0 4px 12px rgba(240,110,60,0.35); }
.injury-level[aria-pressed='true'].lv-7 { background: linear-gradient(135deg, #ff9a9a, var(--danger)); color: #fff; box-shadow: 0 4px 12px rgba(224,72,72,0.38); }
.injury-level[aria-pressed='true'] small { color: inherit; opacity: 0.85; }
.injury-more { margin: 14px 0; }
.injury-fold > summary { font-weight: 800; cursor: pointer; min-height: 44px; display: flex; align-items: center; }

/* 履歴・分析 */
.hx-section { margin-top: 4px; }
.hx-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.hx-stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 16px; background: var(--glass-tile); box-shadow: inset 0 0 0 1px var(--glass-line); min-width: 0; }
.hx-stat-label { font-size: 11.5px; font-weight: 700; color: var(--text-3); }
.hx-stat b { font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; }
.hx-stat-sub { font-size: 11.5px; color: var(--text-2); }
.hx-bars { position: relative; height: 96px; margin: 16px 0 4px; display: flex; align-items: flex-end; gap: 3px; }
.hx-bars.span-90 { gap: 1px; }
.hx-bar { flex: 1; min-width: 0; border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, #ffc35a, var(--kcal)); }
.hx-bar.has-workout { background: linear-gradient(180deg, #a99bf7, var(--workout)); }
.hx-bar.is-empty { background: color-mix(in srgb, var(--text-3) 18%, transparent); }
.hx-target { position: absolute; left: 0; right: 0; border-top: 1.5px dashed color-mix(in srgb, var(--text-2) 60%, transparent); pointer-events: none; }
.hx-legend { margin: 6px 2px 0; }
.hx-insights { margin: 12px 0 0; padding-left: 18px; font-size: 14px; line-height: 1.6; }
.hx-insights li { margin: 4px 0; }
.hx-ranks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.hx-rank h3 { font-size: 14px; margin: 0 0 6px; }
.hx-rank ol { margin: 0; padding-left: 18px; font-size: 13px; }
.hx-rank li { display: list-item; margin: 3px 0; }
.hx-rank li span { overflow-wrap: anywhere; }
.hx-rank li b { margin-left: 4px; color: var(--text-2); font-size: 12px; }
.hx-days { padding: 0; }
.hx-day { border-top: 1px solid var(--sep); }
.hx-day:first-child { border-top: 0; }
.hx-day > summary { list-style: none; display: grid; grid-template-columns: 64px 1fr auto; gap: 8px; align-items: center; padding: 12px 14px; min-height: 56px; cursor: pointer; }
.hx-day > summary::-webkit-details-marker { display: none; }
.hx-date { font-weight: 800; font-size: 15px; display: flex; flex-direction: column; line-height: 1.2; }
.hx-date small { font-size: 11px; color: var(--text-3); font-weight: 700; }
.hx-date.sun small { color: #e05252; } .hx-date.sat small { color: var(--body); }
.hx-day-main { display: flex; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; }
.hx-day-main b { font-size: 17px; }
.hx-day-main small { font-size: 11px; color: var(--text-2); margin-left: 2px; }
.hx-p { font-size: 13px; font-weight: 700; color: var(--protein); }
.hx-tags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.hx-tag { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.hx-tag.workout { color: var(--workout); background: var(--workout-soft); }
.hx-tag.body { color: var(--body); background: var(--body-soft); }
.hx-day-body { padding: 0 14px 14px; }
.hx-meal { margin: 4px 0; font-size: 13.5px; line-height: 1.55; }
.hx-meal b { font-size: 12px; color: var(--text-2); margin-right: 4px; }
.hx-hit { text-decoration: none; color: inherit; }
#history-search, [data-testid='history-search'] { margin-bottom: 8px; }
@media (max-width: 359px) { .hx-ranks { grid-template-columns: 1fr; } .injury-quick-buttons { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* 演出：浮かぶ数字・記録の手応え */
.fx-float { position: fixed; z-index: 95; transform: translate(-50%, 0); pointer-events: none; font-weight: 900; font-size: 20px; letter-spacing: 0.02em; animation: fx-float 1.05s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; text-shadow: 0 2px 8px rgba(255,255,255,0.7); }
.fx-kcal { color: var(--kcal); }
.fx-good { color: #e8a313; font-size: 24px; }
@keyframes fx-float { 0% { opacity: 0; transform: translate(-50%, 6px) scale(0.8); } 20% { opacity: 1; transform: translate(-50%, -6px) scale(1.08); } 100% { opacity: 0; transform: translate(-50%, -54px) scale(1); } }
.toast-success { animation: toast-in 0.18s ease-out, toast-pop 0.42s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes toast-pop { 0% { transform: scale(0.9); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }
.toast-success .icon { animation: pop 0.35s ease-out; }
.set-row.done .done-btn { animation: done-press 0.3s ease-out; }
@keyframes done-press { 0% { transform: scale(0.85); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
.kcal-ring .ring-fill { animation: ring-in 0.7s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes ring-in { from { stroke-dasharray: 0 999; } }

/* 今日のやること：次はこれ＋残り。済んだものにチェック */
.next-panel { margin: 2px 0 14px; }
.next-panel:empty { display: none; }
.next-head { display: flex; align-items: baseline; justify-content: space-between; margin: 6px 4px 8px; }
.next-head h2 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: 0.06em; }
.next-count { font-size: 14px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.next-progress { height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--text-3) 16%, transparent); overflow: hidden; margin: 0 4px 12px; }
.next-progress i { display: block; height: 100%; border-radius: 99px; background: var(--grad-primary); transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.next-main {
  position: relative; width: 100%; text-align: left; border: 0; border-radius: 24px; padding: 16px 52px 16px 18px; color: #fff;
  display: flex; flex-direction: column; gap: 3px; background: var(--grad-primary);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), inset 0 -3px 0 rgba(10,60,140,0.22), 0 10px 24px rgba(40,150,220,0.32);
  transition: transform 0.1s ease;
}
.next-main:active { transform: translateY(2px) scale(0.99); }
.next-main-tag { font-size: 11px; font-weight: 800; letter-spacing: 0.12em; opacity: 0.9; }
.next-main b { font-size: 19px; font-weight: 800; text-shadow: 0 1px 1px rgba(10,60,120,0.25); }
.next-main small { font-size: 12.5px; opacity: 0.92; line-height: 1.45; }
.next-main-go { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 999px; display: grid; place-items: center; font-weight: 900; background: rgba(255,255,255,0.22); animation: next-nudge 1.8s ease-in-out 3; }
@keyframes next-nudge { 0%, 100% { transform: translate(0, -50%); } 50% { transform: translate(4px, -50%); } }
.next-clear { border-radius: 24px; padding: 16px 18px; display: flex; flex-direction: column; gap: 3px; background: linear-gradient(135deg, #e9fbf3, #e5f3ff); box-shadow: inset 0 0 0 1px var(--glass-line), var(--depth-1); }
.next-clear b { font-size: 17px; color: var(--success); }
.next-clear small { font-size: 12.5px; color: var(--text-2); }
@media (prefers-color-scheme: dark) { .next-clear { background: linear-gradient(135deg, rgba(23,164,99,0.18), rgba(59,134,238,0.14)); } }
.next-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.next-item { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px 6px 8px; border: 0; border-radius: 999px; font-size: 13.5px; font-weight: 700; color: var(--text); background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.6)); box-shadow: inset 0 1px 0 #fff, 0 0 0 1px var(--sep); }
@media (prefers-color-scheme: dark) { .next-item { background: rgba(255,255,255,0.07); box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 0 0 1px var(--sep); } }
.next-check { width: 20px; height: 20px; border-radius: 999px; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--text-3) 60%, transparent); position: relative; flex: none; }
.next-item.is-done { color: var(--text-3); }
.next-item.is-done .next-item-label { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--text-3) 60%, transparent); }
.next-item.is-done .next-check { background: var(--success); box-shadow: none; }
.next-item.is-done .next-check::after { content: ''; position: absolute; left: 50%; top: 45%; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: translate(-50%, -55%) rotate(45deg); }
.daily-focus > summary { font-size: 14px; font-weight: 800; cursor: pointer; min-height: 40px; display: flex; align-items: center; list-style: none; color: var(--text-2); }
.daily-focus > summary::-webkit-details-marker { display: none; }
.daily-focus > summary::after { content: '＋'; margin-left: auto; color: var(--text-3); }
.daily-focus[open] > summary::after { content: '－'; }
.barcode-hit { margin: 8px 0 0; font-size: 12.5px; color: var(--text-2); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.barcode-relink { border: 0; background: none; color: var(--accent); font-weight: 800; font-size: 12.5px; padding: 6px 0; min-height: 36px; }

.option-details { margin-top: 10px; }
.option-group { margin: 8px 0 10px; }
.option-label { margin: 0 2px 4px; }

.topping-edit { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.topping-edit-name { font-size: 14px; font-weight: 600; min-width: 0; }
.topping-g { width: 72px; padding: 6px 8px; text-align: right; }
.topping-add { margin-top: 12px; }
.topping-add-panel { margin-top: 8px; display: grid; gap: 8px; }

.recipe-list { list-style: none; margin: 8px 0 4px; padding: 0; display: grid; gap: 4px; }
.recipe-list li { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 4px 0; border-bottom: 1px solid var(--line, rgba(128,128,128,.18)); }

.recipe-edit { display: inline-flex; align-items: center; gap: 6px; }
.recipe-panel { margin-top: 4px; }

/* ---------- 量の入力：カスタマイズ（セット・サイド・種類・トッピング）と材料 ---------- */
/* 合計（kcal・PFC）は、下の選択を変えている間も見えるよう上に固定する */
.preview-sticky { position: sticky; top: -4px; z-index: 4; margin: 0 -16px; padding: 4px 16px 0; background: var(--bg); }
.preview-sticky .preview { margin: 10px 0 8px; }
.cz-result-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 10px; padding: 10px 12px; border-radius: 14px; background: var(--accent-soft); font-size: 14px; line-height: 1.4; }
.cz-result-k { font-size: 12px; font-weight: 700; color: var(--text-2); }
.cz-result-name { font-weight: 700; color: var(--text); overflow-wrap: anywhere; flex: 1 1 60%; }
.cz-result-sub { flex-basis: 100%; font-size: 12px; color: var(--text-2); }
.cz-pill { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--card); color: var(--text-2); white-space: nowrap; }
.cz-pill.is-estimate { background: color-mix(in srgb, var(--kcal) 16%, var(--card)); color: color-mix(in srgb, var(--kcal) 75%, var(--text)); }
.cz-pill.is-saved { background: color-mix(in srgb, var(--success) 14%, var(--card)); color: var(--success); }

.cz-card { margin: 10px 0; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
.cz-card > summary { list-style: none; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; min-height: 52px; padding: 10px 40px 10px 14px; position: relative; cursor: pointer; }
.cz-card > summary::-webkit-details-marker { display: none; }
.cz-card > summary::after { content: ''; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: translateY(-70%) rotate(45deg); transition: transform .2s; }
.cz-card[open] > summary::after { transform: translateY(-30%) rotate(-135deg); }
.cz-sum-title { font-size: 16px; font-weight: 800; color: var(--text); }
.cz-sum-note { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); min-width: 0; overflow-wrap: anywhere; }
.cz-delta { font-weight: 800; color: var(--kcal); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cz-delta.is-minus { color: var(--success); }

.cz-sections { padding: 0 14px 6px; }
.cz-section { padding: 12px 0 14px; border-top: 1px solid var(--sep); }
.cz-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.cz-sec-head h4 { margin: 0; font-size: 15px; font-weight: 800; color: var(--text); }
.cz-sec-status { display: inline-flex; gap: 6px; align-items: baseline; font-size: 13px; color: var(--text-2); text-align: right; min-width: 0; }
.cz-sec-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 52vw; }
.cz-help { margin: 4px 0 8px; font-size: 12px; line-height: 1.5; color: var(--text-3); }
.cz-section .option-group + .option-group { margin-top: 10px; }
.cz-section .option-label { font-size: 12px; font-weight: 700; color: var(--text-2); margin: 0 0 6px; }
.cz-chips { gap: 6px; }
.chip.cz-chip { min-height: 40px; padding: 6px 12px; font-size: 14px; gap: 5px; }
.chip.cz-chip small { font-size: 11px; font-weight: 700; }

.cz-list { list-style: none; margin: 8px 0 0; padding: 0; }
.cz-list-tight { margin-top: 10px; padding: 4px 10px; border-radius: 14px; background: var(--card-2); }
.cz-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; padding: 4px 0; border-bottom: 1px solid var(--sep); }
.cz-row:last-child { border-bottom: 0; }
.cz-row.is-option { color: var(--text-2); }
.cz-row-name { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; font-size: 14px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.cz-row-name small { font-size: 11px; font-weight: 600; color: var(--text-3); }
.cz-tag { display: inline-block; padding: 1px 7px; border-radius: 999px; background: var(--card-2); font-size: 11px !important; color: var(--text-2) !important; }
.cz-qty { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.cz-qty-ro { font-weight: 700; font-variant-numeric: tabular-nums; padding-right: 6px; }
.cz-g { width: 58px; height: 38px; border: 1px solid var(--edit-border); border-radius: 10px; background: var(--edit-bg); text-align: right; padding: 0 8px; font-size: 16px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.cz-g:focus { outline: none; border-color: var(--edit-focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--edit-focus) 20%, transparent); }
.cz-unit { font-size: 13px; color: var(--text-3); margin-right: 2px; }
.cz-step, .cz-x { width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--sep); background: var(--card); color: var(--text); font-size: 18px; font-weight: 700; display: inline-grid; place-items: center; padding: 0; }
.cz-x { color: var(--text-3); font-size: 18px; }
.cz-link { border: 0; background: none; padding: 0; color: var(--accent); font-size: 12px; font-weight: 700; min-height: 24px; }

.cz-search-wrap { margin-top: 12px; }
.cz-search { width: 100%; height: 44px; border-radius: 12px; border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--edit-border)); background: var(--edit-bg); padding: 0 12px 0 36px; font-size: 16px; color: var(--text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238f9aae' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 12px 50%; }
.cz-search:focus { outline: none; border-style: solid; border-color: var(--edit-focus); }
.cz-search::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
.cz-results { list-style: none; margin: 6px 0 0; padding: 0; border-radius: 12px; overflow: hidden; }
.cz-results:empty { display: none; }
.cz-results li + li { border-top: 1px solid var(--sep); }
.cz-result { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 6px 12px; border: 0; background: var(--card-2); text-align: left; color: var(--text); }
.cz-result:active { background: var(--accent-soft); }
.cz-add { flex: none; font-size: 13px; font-weight: 800; color: var(--accent); }
.cz-empty { padding: 10px 12px; font-size: 13px; color: var(--text-3); background: var(--card-2); }
.cz-body { padding: 0 14px 14px; }
.cz-foot { margin: 8px 0 0; font-size: 12px; color: var(--text-3); line-height: 1.5; }
.cz-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* サイズ（並・大盛・得 など）：量の入力の上。大盛りがどれか一目で分かるよう、名前を大きく、中身（麺1.5玉など）とkcalを下に */
.size-box { margin: 4px 0 14px; padding: 12px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); }
.size-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.size-head h4 { margin: 0; font-size: 16px; font-weight: 800; color: var(--text); }
.size-head span { font-size: 12px; color: var(--text-2); }
.size-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.size-chip { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 64px; padding: 6px 4px; border-radius: 14px; border: 1px solid var(--sep); background: var(--card-2); color: var(--text); text-align: center; line-height: 1.2; }
.size-chip b { font-size: 15px; font-weight: 800; overflow-wrap: anywhere; }
.size-chip small { font-size: 11px; font-weight: 700; color: var(--text-2); }
.size-chip .size-kcal { color: var(--kcal); font-variant-numeric: tabular-nums; }
.size-chip[aria-pressed='true'] { background: var(--grad-primary); border-color: transparent; color: #fff; box-shadow: 0 4px 12px rgba(40, 140, 220, 0.28); }
.size-chip[aria-pressed='true'] small, .size-chip[aria-pressed='true'] .size-kcal { color: rgba(255, 255, 255, 0.9); }
.size-note { margin: 8px 2px 0; font-size: 12px; line-height: 1.5; color: var(--text-3); }
.serving-chips[data-label]::before { content: attr(data-label); flex-basis: 100%; font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 2px; }

/* Evidence-based coaching, designed for mobile exercise cards. */
.coach-bubble { margin:14px 0; padding:16px; border:1px solid var(--workout,#a78bfa); border-radius:20px; background:color-mix(in srgb,var(--workout,#a78bfa) 8%,transparent); overflow-wrap:anywhere; }
.coach-person {display:flex;align-items:center;gap:10px;margin-bottom:12px;}
.coach-person small,.coach-bubble>small {display:block;opacity:.72;font-size:12px;line-height:1.6;}
.coach-avatar {display:grid;place-items:center;width:42px;height:42px;border-radius:50%;background:#293750;font-size:24px;flex-shrink:0;}
.coach-bubble h3 {font-size:17px;margin:8px 0;}
.coach-bubble p {line-height:1.7;font-size:14px;margin:10px 0;}
.coach-target {display:block;font-size:26px;color:var(--workout,#a78bfa);}
.coach-check {display:flex;align-items:center;gap:10px;min-height:48px;font-size:13px;line-height:1.6;margin:12px 0;}
.coach-check input {width:24px;height:24px;flex-shrink:0;}
.coach-kind {border-left:3px solid #43c7bc;padding-left:12px;}
.coach-history {padding:10px;border-radius:10px;background:#ffffff08;}
.coach-bubble summary {padding:12px 0;cursor:pointer;font-size:13px;}
.coach-evidence {font-size:12px;}

/* 食事の再利用・保存をメニューとしてまとめる */
.meal-menu-btn {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--meal);
  font-size: 13px;
  font-weight: 700;
}
.meal-menu-btn:active { background: var(--meal-soft); }

/* Search → record → review: compact navigation, sources beside the values. */
.home-section-nav { display:flex; gap:4px; padding:4px; margin:0 0 12px; border:1px solid var(--sep); border-radius:16px; background:var(--card); }
.home-section-nav button { flex:1; min-width:0; min-height:44px; border:0; border-radius:12px; background:transparent; color:var(--text-2); font-size:14px; font-weight:750; }
.home-section-nav button:active { background:var(--accent-soft); color:var(--accent); }
.tabbar .tab { white-space:nowrap; letter-spacing:0; }
.food-flow-hint { display:flex; align-items:center; gap:8px; margin:0 2px 10px; color:var(--text-2); font-size:12px; font-weight:650; }
.food-flow-hint span { color:var(--meal); }
.nutrition-basis-note { margin:8px 0 14px; padding:10px 12px; border-left:3px solid var(--sep); color:var(--text-2); font-size:12px; line-height:1.65; background:var(--card); border-radius:0 10px 10px 0; }
.nutrition-basis-note.is-sample { border-color:var(--danger); color:var(--danger); }
.entry-sub .badge-sample { margin-left:7px; font-size:10px; vertical-align:middle; }
.meal-destination { margin:12px 0 4px; color:var(--text-2); font-size:13px; }
.meal-destination > summary { min-height:44px; display:flex; align-items:center; cursor:pointer; font-weight:650; }
.meal-destination .seg { margin-bottom:12px; }
.home-section-nav button:focus-visible, .meal-destination > summary:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }

/* まいログ：やわらかい色と時間別の記録。既存の詳細記録画面は維持。 */

body { background:radial-gradient(ellipse at 9% -7%,rgba(209,193,255,.36),transparent 37%),var(--bg); }
.app-header { background:color-mix(in srgb,var(--bg) 84%,transparent); }
.card { box-shadow:var(--shadow); }
.content { animation:day-fade .18s ease-out; }
@keyframes day-fade {from {opacity:.88;transform:translateY(4px)} to {opacity:1;transform:none}}





.day-intro {padding:20px 18px;margin-bottom:12px;border-radius:24px;background:linear-gradient(125deg,#e3f4fe,#f3ebff 70%,#fff5e7);}
.day-intro-tag {font-size:12px;font-weight:850;letter-spacing:.05em;color:#8b6bd3;}
.day-intro h2 {font-size:21px;line-height:1.5;margin:7px 0 5px;color:#344366;}
.day-intro p {font-size:13px;line-height:1.65;color:#69788f;margin:0;}
.day-datebar {display:flex;align-items:center;gap:7px;padding:3px 0 13px;}
.day-date-name {flex:1;text-align:center;font-size:16px;font-weight:800;}
.day-date-arrow {border:0;background:var(--card);border-radius:13px;width:44px;height:44px;font-size:25px;box-shadow:var(--shadow);}
.day-date-today {border:0;background:var(--accent-soft);color:var(--accent);padding:0 13px;border-radius:13px;min-height:44px;font-weight:750;font-size:13px;}
.day-kind-actions {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:12px;}
.day-kind-button {background:var(--card);box-shadow:var(--shadow);border:2px solid transparent;border-radius:18px;min-height:91px;padding:8px 4px;
display:flex;flex-direction:column;gap:2px;align-items:center;justify-content:center;text-align:center;color:var(--text);}
.day-kind-button>span {font-size:24px;}
.day-kind-button>strong {font-size:13px;white-space:nowrap;}
.day-kind-button>small {font-size:10px;color:var(--text-2);}
.day-kind-button.active {border-color:#b3a6fa;background:color-mix(in srgb,var(--accent-soft) 45%,var(--card));}
.day-editor,.day-chart-card,.day-timeline-list {background:var(--card);border-radius:22px;box-shadow:var(--shadow);padding:16px;margin-bottom:15px;}
.day-form-title {display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;}
.day-form-title>strong {font-size:16px;}
.day-form-row {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.55fr);gap:10px;}
.day-form-row>label,.day-single-field {display:flex;flex-direction:column;min-width:0;gap:6px;margin-bottom:12px;color:var(--text-2);font-size:12px;font-weight:750;}
.day-form .input {width:100%;min-width:0;min-height:45px;border-radius:13px;}
.day-form textarea.input {resize:vertical;padding:11px;}
.day-submit {width:100%;min-height:49px;border-radius:15px;background:var(--grad-primary);border:0;}
.day-cancel {border:0;background:transparent;color:var(--accent);font-size:12px;padding:8px;}
.day-panel-title {display:flex;align-items:center;justify-content:space-between;margin:12px 2px 10px;gap:8px;}
.day-panel-title h3 {font-size:17px;margin:0;}
.day-panel-title>span,.day-panel-title>small {font-size:11px;color:var(--text-2);}
.day-overview-head {display:grid;grid-template-columns:145px 1fr;align-items:center;gap:15px;}
.day-donut {width:145px;height:145px;border-radius:50%;display:grid;place-items:center;flex-shrink:0;}
.day-donut-center {background:var(--card);width:107px;height:107px;border-radius:50%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;}
.day-donut-center b {font-size:20px;line-height:1.2;}
.day-donut-center span {font-size:11px;color:var(--text-2);}
.day-legend {display:flex;flex-direction:column;gap:9px;}
.day-legend-row {display:flex;align-items:center;gap:6px;font-size:11px;min-width:0;}
.day-legend-row i {width:9px;height:9px;border-radius:4px;flex:none;}
.day-legend-row span {flex:1;}
.day-legend-row b {font-size:11px;white-space:nowrap;}
.day-note {font-size:11px;color:var(--text-2);line-height:1.7;margin:12px 0 0;}
.day-mood-card {background:var(--card);border-radius:22px;padding:15px 16px;margin-bottom:16px;box-shadow:var(--shadow);}
.day-mood-card .day-panel-title {margin:0 0 8px;}
.day-mood-graph svg {display:block;width:100%;height:auto;color:var(--text-2);overflow:visible;}
.day-empty {font-size:13px;line-height:1.65;color:var(--text-2);margin:10px 0;}
.day-advice {background:linear-gradient(135deg,var(--card),color-mix(in srgb,#eef8f2 70%,var(--card)));}
.day-advice p {font-size:13px;line-height:1.7;margin:9px 0;}
.day-timeline-list {padding:5px 14px;}
.day-event {display:grid;grid-template-columns:43px 35px minmax(0,1fr);align-items:start;gap:8px;padding:15px 0;border-bottom:1px solid var(--sep);}
.day-event:last-child {border-bottom:0;}
.day-event-time {font-size:12px;font-weight:800;color:var(--text-2);padding-top:9px;}
.day-event-symbol {display:grid;place-items:center;width:33px;height:33px;border-radius:12px;background:var(--accent-soft);font-size:18px;}
.day-event-content {min-width:0;}
.day-event-top {display:flex;gap:6px;align-items:start;flex-wrap:wrap;}
.day-event-top b {font-size:14px;line-height:1.45;overflow-wrap:anywhere;}
.day-event-kind {font-size:10px;background:var(--card-2);border-radius:9px;padding:4px 7px;color:var(--text-2);}
.day-event-sub,.day-event-note {font-size:12px;color:var(--text-2);margin:5px 0 0;}
.day-event-actions {display:flex;flex-wrap:wrap;gap:5px;margin-top:8px;}
.day-event-actions button {border:0;background:var(--accent-soft);color:var(--accent);font-size:11px;font-weight:750;border-radius:9px;padding:8px 9px;min-height:35px;}
.day-event-actions button.day-delete {background:var(--card-2);color:var(--text-2);}
@media(max-width:355px) {.day-overview-head{grid-template-columns:120px 1fr;gap:9px}.day-donut{width:120px;height:120px}.day-donut-center{width:87px;height:87px}.day-donut-center b{font-size:16px}.day-event{grid-template-columns:38px 32px minmax(0,1fr);gap:5px}}
@media(prefers-color-scheme:dark){
.day-intro{background:linear-gradient(128deg,#263e50,#30274e 65%,#403041);}
.day-intro h2{color:#f1eefe}.day-intro p{color:#bdc0d5}
}
@media(prefers-reduced-motion:reduce){.content{animation:none}}


/* ホームの3項目サマリー：開いた瞬間に何をすればいいか伝える */
















/* まいログ：ワンタップの記録と気分選択 */
.day-quick-row{display:flex;align-items:center;flex-wrap:wrap;gap:7px;margin:0 0 15px}
.day-quick-label{font-size:11px;color:var(--text-2);font-weight:800;flex-basis:100%}
.day-quick-btn{min-height:40px;padding:7px 12px;border:1px solid var(--sep);border-radius:999px;color:var(--text);
  font-size:12px;font-weight:800;background:var(--card-2);white-space:nowrap}
.day-quick-btn:active{transform:scale(.98);background:var(--accent-soft)}
.day-mood-chips{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;width:100%}
.day-mood-chips:has(button:nth-child(6)){grid-template-columns:repeat(6,minmax(0,1fr))}
.day-mood-chip{display:flex;flex-direction:column;gap:3px;align-items:center;justify-content:center;
  min-width:0;min-height:55px;border-radius:13px;background:var(--card-2);border:2px solid transparent;padding:5px 2px;color:var(--text)}
.day-mood-chip>span{font-size:21px;line-height:1.2}
.day-mood-chip>small{font-size:10px;line-height:1.2;font-weight:700;overflow-wrap:anywhere;text-align:center}
.day-mood-chip.selected{border-color:var(--accent);background:var(--accent-soft)}
.day-mood-select{max-width:100%;min-height:38px!important;font-size:12px;margin-top:4px}
.day-task-progress{height:9px;border-radius:999px;background:var(--card-2);overflow:hidden;margin:0 2px 13px}
.day-task-progress span{display:block;height:100%;background:var(--grad-primary);border-radius:999px;transition:width .2s ease}

/* まいログ：既存の栄養・トレーニング実績を1日の流れでも確認 */
.day-connected {margin:0 0 16px}
.day-connected-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.day-connected-tile{display:flex;flex-direction:column;gap:6px;min-width:0;background:var(--card);border:1px solid var(--sep);
  border-radius:17px;padding:13px;text-decoration:none;color:var(--text);box-shadow:var(--shadow);min-height:112px}
.day-connected-tile>span{font-size:12px;color:var(--text-2);font-weight:800}
.day-connected-tile>b{font-size:15px;overflow-wrap:anywhere}
.day-connected-tile>small{font-size:11px;line-height:1.5;color:var(--text-2)}

/* 毎日のページを主役にした6タブ。320pxでも各タブ50px以上を確保 */
.tabbar{grid-template-columns:repeat(6,minmax(0,1fr))}
.tabbar .tab{font-size:10px;min-width:0;white-space:nowrap}
.tabbar .tab .icon{width:24px;height:24px}
.day-task-stack{display:flex;flex-direction:column;gap:8px;margin-bottom:12px}
.day-task-inline{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 10px;align-items:center;
  background:var(--card);border:1px solid var(--sep);padding:11px 11px;border-radius:15px}
.day-task-inline .day-task-time{font-size:11px;color:var(--text-2);grid-column:1}
.day-task-inline strong{grid-column:1;font-size:13px;line-height:1.5;overflow-wrap:anywhere}
.day-task-inline button{grid-column:2;grid-row:1/3;min-height:44px;padding:5px 12px;border:0;
  border-radius:12px;color:var(--accent);background:var(--accent-soft);font-size:12px;font-weight:850}


/* FitBuddy参照のデザイン体系：5タブ、中央＋、記録フィルタ、マイページ */

.tabbar {grid-template-columns:repeat(5,minmax(0,1fr));align-items:center;padding-top:7px;
  background:color-mix(in srgb,var(--card) 94%,transparent);box-shadow:0 -5px 24px rgba(96,84,156,.07)}
.tabbar .tab {font-size:10px;min-width:0;font-weight:750;color:var(--text-2)}
.tabbar .tab[aria-current='page'] {color:var(--accent)}
.tabbar .tab .icon {width:24px;height:24px}
.tabbar .tab-plus {position:relative;justify-content:flex-end;gap:1px;padding-bottom:2px}
.tab-plus-circle {display:grid;place-items:center;width:55px;height:55px;margin-top:-17px;color:white;border-radius:50%;
  border:4px solid var(--card);background:linear-gradient(135deg,#27cba3 0%,#6e91fa 54%,#a272ff 100%);
  box-shadow:0 6px 17px rgba(101,108,236,.3)}
.tabbar .tab-plus .icon{width:28px;height:28px}
.tab-plus-label{font-size:10px;font-weight:850;color:var(--accent)}
.quick-open {overflow:hidden}
.quick-overlay[hidden] {display:none!important}
.quick-overlay {position:fixed;inset:0;z-index:100;display:flex;align-items:flex-end;justify-content:center}
.quick-backdrop {position:absolute;inset:0;border:0;border-radius:0;background:rgba(21,29,60,.48)}
.quick-panel {position:relative;z-index:1;background:var(--card);border-radius:28px 28px 0 0;width:100%;max-width:640px;
  padding:20px 18px max(24px,env(safe-area-inset-bottom));box-shadow:0 -8px 35px #2e244640}
.quick-panel-top {display:flex;justify-content:space-between;align-items:start;margin-bottom:16px;gap:10px}
.quick-panel-top strong{font-size:20px}.quick-panel-top p{margin:4px 0 0;font-size:12px;color:var(--text-2)}
.quick-close {width:42px;height:42px;border:0;border-radius:50%;font-size:28px;background:var(--card-2);color:var(--text)}
.quick-panel-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.quick-choice{display:flex;flex-direction:column;gap:4px;min-height:99px;padding:11px;border-radius:17px;text-decoration:none;color:var(--text);
  background:linear-gradient(135deg,var(--accent-soft),var(--card));border:1px solid var(--sep)}
.quick-choice-emoji {font-size:24px}.quick-choice strong {font-size:14px}.quick-choice small{font-size:11px;color:var(--text-2)}
.quick-panel-note {font-size:11px;text-align:center;color:var(--text-2);margin:15px 0 0;line-height:1.6}
.record-intro {margin:2px 0 13px;padding:15px 17px;background:linear-gradient(115deg,#e2f6fe,#f1e9ff);
  border-radius:19px;color:#344e74}
.record-intro strong{font-size:17px}.record-intro p{font-size:12px;margin:5px 0 0}
.record-category-nav {display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;white-space:nowrap;scroll-snap-type:x proximity;
  margin:0 -16px 12px;padding:2px 16px 12px}
.record-category-nav::-webkit-scrollbar{display:none}
.record-filter-chip{flex:none;display:flex;align-items:center;gap:5px;min-height:41px;padding:6px 13px;
  border:1px solid var(--sep);border-radius:999px;background:var(--card);font-size:12px;font-weight:750;
  color:var(--text-2);text-decoration:none;scroll-snap-align:start}
.record-filter-chip.is-active{background:var(--accent-soft);color:var(--accent);border-color:var(--accent)}
.record-hub-body .day-intro {display:none}
.record-focus-title{font-size:20px;margin:0 0 12px}
.profile-hero {display:flex;align-items:center;gap:12px;padding:20px 15px;margin-bottom:17px;border-radius:23px;
 background:linear-gradient(135deg,#e0f6fe,#f1ecff,#fff5e8)}
.profile-mascot {width:88px;height:88px;object-fit:contain;flex:none;border-radius:23px}
.profile-hero span {font-size:11px;letter-spacing:.08em;font-weight:800;color:#776bd4}
.profile-hero h2 {font-size:20px;color:#364b70;line-height:1.4;margin:4px 0}
.profile-hero p {margin:0;font-size:12px;color:#61738d}
.profile-options{display:flex;flex-direction:column;gap:10px}
.profile-option{display:flex;align-items:center;gap:12px;min-height:76px;padding:13px 14px;border-radius:19px;
  background:var(--card);color:var(--text);text-decoration:none;box-shadow:var(--shadow)}
.profile-option-emoji {width:45px;height:45px;display:grid;place-items:center;border-radius:14px;background:var(--accent-soft);font-size:23px}
.profile-option-text {display:flex;flex:1;flex-direction:column;gap:4px;min-width:0}
.profile-option-text strong{font-size:15px}.profile-option-text small{font-size:11px;color:var(--text-2)}
.profile-chevron{font-size:25px;color:var(--text-3)}
.profile-local-note {font-size:12px;line-height:1.7;color:var(--text-2);margin:17px 7px}
@media(prefers-color-scheme:dark){.record-intro,.profile-hero {background:linear-gradient(120deg,#253b51,#302644);color:#eee}
 .profile-hero h2{color:#f3eaff}.profile-hero p{color:#bbb5d4}}
@media(max-height:660px){.quick-panel{max-height:88dvh;overflow:auto}.quick-choice{min-height:79px}}

/* ホームのキャラクターと栄養リングを先頭に：視認性を優先 */



[data-testid="summary"] .card:first-child{background:linear-gradient(145deg,var(--card),color-mix(in srgb,#e0f3ff 26%,var(--card)));
  border:1px solid var(--sep)}


/* 選択中のフィルタが画面の主役になる。各種別の記録は同じ時間データを使う */
.record-hub-body [data-testid="day-timeline"]{scroll-margin-top:88px}
.record-category-nav .record-filter-chip:focus-visible{outline-offset:2px}

.page-back{display:grid;place-items:center;width:44px;height:44px;flex:none;border-radius:14px;
  color:var(--accent);text-decoration:none;background:var(--accent-soft);margin-right:5px}
.quick-choice:focus-visible,.profile-option:focus-visible {outline:3px solid var(--accent);outline-offset:2px}
@media(prefers-reduced-motion:reduce){.tab-plus-circle,.quick-panel,.quick-overlay{animation:none!important;transition:none!important}}

/* Home: show what can be done next before the long detailed trackers. */











/* まいログ：1週間・1か月・3か月の気分と生活時間を分析画面で表示 */
.life-report{padding:16px;margin-top:14px}
.life-report-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:12px}
.life-report-head h3{font-size:17px;margin:0;line-height:1.5}
.life-report-link{font-size:12px;text-decoration:none;color:var(--accent);font-weight:800;white-space:nowrap}
.life-report-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:16px}
.life-report-stats>div{min-width:0;display:flex;flex-direction:column;gap:5px;text-align:center;align-items:center;
  background:color-mix(in srgb,var(--accent-soft) 48%,var(--card));border-radius:14px;padding:12px 4px}
.life-report-stats>div:nth-child(2){background:color-mix(in srgb,var(--body-soft) 48%,var(--card))}
.life-report-stats>div:nth-child(3){background:color-mix(in srgb,var(--meal-soft) 48%,var(--card))}
.life-report-stats small{font-size:10px;color:var(--text-2);line-height:1.35}
.life-report-stats b{font-size:18px;white-space:nowrap;max-width:100%;overflow-wrap:anywhere}
.life-report h4{font-size:14px;margin:15px 0 9px}
.life-trend svg{display:block;width:100%;height:auto;max-height:205px;color:var(--text-2);overflow:visible}
.life-activity-chart{display:grid;grid-template-columns:124px minmax(0,1fr);gap:12px;align-items:center}
.life-activity-donut{display:grid;place-items:center;width:124px;height:124px;border-radius:50%}
.life-activity-donut>span{display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:2px;width:92px;height:92px;border-radius:50%;background:var(--card);font-size:12px;color:var(--text-2)}
.life-activity-donut b{font-size:16px;color:var(--text)}
.life-activity-legend{display:flex;flex-direction:column;gap:7px;min-width:0}
.life-activity-legend>div{display:flex;align-items:center;gap:7px;font-size:11px;line-height:1.45}
.life-activity-legend i{width:9px;height:9px;border-radius:3px;flex:none}
.life-activity-legend span{flex:1;min-width:0}
.life-activity-legend b{white-space:nowrap}
.life-report-insights{background:var(--card-2);border-radius:14px;padding:10px 12px}
.life-report-insights p{font-size:12px;margin:6px 0;line-height:1.6}
@media(max-width:360px){.life-report-stats b{font-size:15px}.life-activity-chart{grid-template-columns:110px 1fr;gap:7px}
 .life-activity-donut{width:110px;height:110px}.life-activity-donut>span{width:81px;height:81px}}

/* 1日0〜24時の時間配置。2重計上せず1活動1行で表示 */
.day-time-map{margin-bottom:16px}
.day-time-map-card{background:var(--card);box-shadow:var(--shadow);border-radius:21px;padding:15px 13px}
.day-time-map-card .day-panel-title{margin:0 0 11px}
.day-time-map-card .day-panel-title h3{font-size:16px}
.day-time-ruler{display:flex;justify-content:space-between;align-items:center;margin:0 0 7px 42% ;
  font-size:10px;color:var(--text-2);padding:0 2px}
.day-time-row{display:grid;grid-template-columns:minmax(0,42%) minmax(0,58%);align-items:center;gap:0;min-height:42px;border-bottom:1px solid var(--sep)}
.day-time-row:last-child{border-bottom:0}
.day-time-info{display:flex;flex-direction:column;min-width:0;gap:3px;padding:6px 6px 6px 0}
.day-time-info strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
.day-time-info small{font-size:10px;color:var(--text-2)}
.day-time-track{position:relative;height:20px;border-radius:7px;overflow:hidden;background:linear-gradient(to right,transparent calc(25% - .5px),var(--sep) 25%,transparent calc(25% + .5px),transparent calc(50% - .5px),var(--sep) 50%,transparent calc(50% + .5px),transparent calc(75% - .5px),var(--sep) 75%,transparent calc(75% + .5px)),var(--card-2)}
.day-time-block{position:absolute;top:3px;bottom:3px;min-width:2px;border-radius:5px;box-shadow:0 1px 3px rgba(32,22,80,.15)}
@media(max-width:360px){.day-time-info strong{font-size:11px}.day-time-ruler{font-size:9px}}

/* 挨拶と設定画面の情報階層。保存済みの各機能へのリンクはそのまま */

.profile-group-label{font-size:13px;font-weight:850;color:var(--text-2);margin:17px 6px 0}
.profile-group-label:first-child{margin-top:2px}
.profile-options .profile-option{transition:transform .12s ease,background .12s ease}
.profile-options .profile-option:active{transform:scale(.99);background:var(--accent-soft)}

/* 予定の手動繰り越し。元の日の記録は残す */
.day-task-inline-actions{display:flex;gap:5px;align-items:center;grid-column:2;grid-row:1/3}
.day-task-inline-actions button{grid-column:auto;grid-row:auto;padding:5px 8px}
.day-task-inline-actions .day-task-carry{background:var(--card-2);color:var(--text-2)}
@media(max-width:355px){.day-task-inline{grid-template-columns:minmax(0,1fr)}
 .day-task-inline-actions{grid-column:1;grid-row:auto;justify-content:flex-start;margin-top:5px}}

/* ホームの気分チェックイン。数字を作らず、入力した実績だけを楽しく表示。 */



















/* 気分を活動と一緒に記録したときだけ表示する、観測値の比較 */
.life-activity-moods{display:flex;flex-direction:column;gap:12px}
.life-mood-row{display:flex;flex-direction:column;gap:6px}
.life-mood-row-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.life-mood-row-head strong{font-size:12px}
.life-mood-row-head span{font-size:11px;color:var(--text-2);white-space:nowrap}
.life-mood-row-track{height:10px;border-radius:99px;background:var(--card-2);overflow:hidden}
.life-mood-row-track span{display:block;height:100%;border-radius:99px}

/* 情報は「予定→タイムライン→既存記録→詳しいグラフ」の順に。 */
.day-chart-disclosure{margin:0 0 20px;min-width:0}
.day-chart-disclosure-trigger{cursor:pointer;min-height:65px;display:flex;flex-direction:column;
 justify-content:center;gap:5px;background:var(--card);border-radius:18px;padding:14px 16px;
 box-shadow:var(--shadow);border:1px solid var(--sep);list-style:none}
.day-chart-disclosure-trigger::-webkit-details-marker{display:none}
.day-chart-disclosure-trigger>span{font-size:15px;font-weight:850;color:var(--text)}
.day-chart-disclosure-trigger>small{font-size:11px;color:var(--text-2);line-height:1.55}
.day-chart-disclosure[open]>.day-chart-disclosure-trigger{margin-bottom:12px;background:var(--accent-soft)}
.day-chart-disclosure-trigger:focus-visible{outline:3px solid var(--accent);outline-offset:2px}







@keyframes mairog-float {0%,100%{transform:translateY(0) rotate(-1deg)}
 50%{transform:translateY(-5px) rotate(2deg)}}


/* Home ToDo: show the next steps inline; completion is one tap, without changing tabs. */














/* Small in-place ToDo input: collapsed until actively needed. */










