/*
 * まいログ DESIGN v4「ゲームっぽく・ごほうび」— mairog-theme.css の後に読み込み、色・文字・部品の形を上書きする。
 * 方針：紺のステージに相棒が主役、クリーム色の面に太めの縁取りカード、押せるものは下に影のある「ぷっくり」ボタン。
 *       文字は丸ゴシックで一回り大きく。タップ領域48px以上、文字コントラスト4.5:1以上、動きは「視差効果を減らす」で止める。
 */
:root {
  --bg: #fff8ec;
  --card: #ffffff;
  --card-2: #fff3dc;
  --sep: #f0e2c4;
  --line: #f0e2c4;
  --text: #232c58;
  --text-2: #4d587f;
  --text-3: #5f6a90;
  --navy: #232c58;
  --navy-2: #3a4686;
  --accent: #3446c2;
  --accent-2: #3d6fd3;
  --accent-soft: #e9ecff;
  --yellow: #ffd84d;
  --yellow-deep: #d9a91c;
  --grad-primary: linear-gradient(120deg, #34419a, #232c58);
  --stage: radial-gradient(circle at 50% 62%, #4f5fdc 0%, #303c8e 42%, #232c58 78%);
  --sky-hero: var(--stage);
  --workout: #3446c2; --workout-soft: #e9ecff;
  --edit-bg: #ffffff;
  --edit-border: #e6d6b4;
  --edit-focus: #3446c2;
  --radius: 24px;
  --radius-sm: 17px;
  --shadow: 0 4px 0 var(--line);
  --shadow-lift: 0 6px 0 var(--line), 0 12px 26px rgba(35, 44, 88, .10);
  /* 文字：本文は太さのそろった角ゴシック（ヒラギノ角ゴは W3〜W8 がある）。
     丸ゴシック（iPhone のヒラギノ丸ゴは W4 の1つだけ）は、相棒のことば・見出しの大きな文字だけに使い、太字にしない（にじんだ太字になるため） */
  --font: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic UI', system-ui, sans-serif;
  --font-round: 'Hiragino Maru Gothic ProN', 'Hiragino Maru Gothic Pro', 'M PLUS Rounded 1c', 'Kosugi Maru', var(--font);
  /* 文字の大きさの役割（MAIROG_DESIGN_SYSTEM.md の「文字」） */
  --fs-display: 28px;  /* 日付の数字・大きな数値 */
  --fs-title: 22px;    /* 画面の見出し */
  --fs-section: 18px;  /* 節の見出し */
  --fs-body: 16px;     /* 本文・入力欄（iPhone で拡大されない最小） */
  --fs-sub: 14px;      /* 補足 */
  --fs-caption: 12px;  /* 単位・注記 */
  --fw-regular: 400; --fw-medium: 500; --fw-bold: 700; --fw-heavy: 800;
  --lh-body: 1.7;      /* 日本語の長文 */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px;
  /* 記録の種類の色（画面をまたいで同じ意味） */
  --tone-meal: #e0702a; --tone-workout: #3446c2; --tone-mood: #c2548a; --tone-task: #2f8a5b; --tone-journal: #8a5a2b; --tone-body: #6a5acd;
  --paper: #fffdf7; --paper-line: rgba(138, 90, 43, .14);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161b3a; --card: #20284f; --card-2: #29315e; --sep: #343e78; --line: #343e78;
    --text: #fbf6ea; --text-2: #d6d9ef; --text-3: #b9bedc; --navy: #fbf6ea; --navy-2: #d6d9ef;
    --accent: #aeb9ff; --accent-soft: #2e3769; --workout: #aeb9ff; --workout-soft: #2e3769;
    --edit-bg: #1b2246; --edit-border: #414c8a; --edit-focus: #ffd84d;
    --stage: radial-gradient(circle at 50% 62%, #3d4bbd 0%, #252f78 45%, #141936 80%);
    --shadow: 0 4px 0 rgba(0, 0, 0, .35);
    --shadow-lift: 0 6px 0 rgba(0, 0, 0, .35), 0 12px 26px rgba(0, 0, 0, .3);
    --tone-meal: #ffb27a; --tone-workout: #aeb9ff; --tone-mood: #f2a3c8; --tone-task: #8fd8b0; --tone-journal: #e8c39a; --tone-body: #c9bfff;
    --paper: #1d2447; --paper-line: rgba(232, 195, 154, .14);
  }
}

/* ── 土台：一回り大きい丸ゴシック ── */
body { background-image: none; font-family: var(--font); font-size: 17px; }
.tiny { font-size: 13px; }
.small { font-size: 15px; }
.section-title { font-size: 21px; font-weight: 800; margin: 26px 2px 12px; }
.section-title .dot { width: 11px; height: 11px; }
.page-title { font-size: 22px; font-weight: 800; }
h2, h3 { letter-spacing: 0; }

/* ── カード：太い縁取り＋下の影 ── */
.card, .mx-card, .day-chart-card, .day-mood-card, .day-editor, .day-timeline-list, .day-time-map-card,
.day-connected-tile, .profile-option, .quick-choice, .life-report, .week-panel, .next-panel,
.settings-group > .card, .lib-group, .kc-group, .meal-card {
  border: 3px solid var(--line);
  box-shadow: var(--shadow);
}

/* ── ボタン：ぷっくり ── */
.btn, .day-submit, .day-home-add-submit { border-radius: 18px; font-weight: 800; min-height: 52px; font-size: 16px; }
.btn-primary, .day-submit, .day-home-add-submit {
  background: var(--yellow); color: #232c58; border: 0; box-shadow: 0 5px 0 var(--yellow-deep);
}
.btn-primary:active:not(:disabled), .day-submit:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--yellow-deep); }
.btn-tint, .btn-workout, .btn-meal { background: var(--card); color: var(--text); border: 3px solid var(--line); box-shadow: 0 4px 0 var(--line); }
.btn-tint:active:not(:disabled), .btn-workout:active:not(:disabled), .btn-meal:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 var(--line); }
.btn-plain { border: 3px solid var(--line); }
.chip { border: 3px solid var(--line); font-weight: 800; box-shadow: 0 3px 0 var(--line); min-height: 46px; }
.chip[aria-pressed='true'] { background: #232c58; color: var(--yellow); border-color: #232c58; box-shadow: 0 3px 0 #11163a; }
@media (prefers-color-scheme: dark) { .chip[aria-pressed='true'] { background: var(--yellow); color: #232c58; border-color: var(--yellow); box-shadow: 0 3px 0 var(--yellow-deep); } }
.seg { background: var(--card-2); border: 3px solid var(--line); border-radius: 18px; }
.seg button, .seg .seg-link { font-weight: 800; font-size: 15px; }
.seg button[aria-pressed='true'], .seg .seg-link[aria-current='page'] { background: #232c58; color: var(--yellow); box-shadow: none; }
@media (prefers-color-scheme: dark) { .seg button[aria-pressed='true'], .seg .seg-link[aria-current='page'] { background: var(--yellow); color: #232c58; } }
.input, input[type='text'], input[type='number'], input[type='search'], input[type='date'], input[type='time'], select, textarea { border-width: 2px; border-radius: 15px; font-size: 17px; }

/* ── 下のタブ：選んでいるタブは黄色い丸 ── */
.tabbar { border-top: 3px solid var(--line); box-shadow: none; }
.tab { font-size: 12px; font-weight: 800; color: var(--text-3); }
.tab[aria-current='page'] { color: var(--text); background: var(--card-2); }
.tab-plus-circle { background: var(--yellow); color: #232c58; border: 3px solid var(--card); box-shadow: 0 5px 0 var(--yellow-deep); }
.tab-plus-circle .icon { stroke: #232c58; }
.tab-plus-label { color: var(--text); font-weight: 800; }
.app-header { border-bottom: 3px solid var(--line); }
.toast { background: #232c58; color: #fff; font-weight: 700; }

/* ── 各画面の上の見出し（記録・分析・マイページ・体型）も紺のステージ ── */
.record-intro, .hx-hero, .profile-hero, .bm-hero, .day-intro { background: var(--stage); border: 0; box-shadow: 0 6px 0 rgba(35, 44, 88, .25); }
.record-intro strong, .hx-hero h2, .profile-hero h2, .bm-hero h2, .bm-hero h1 { color: #fff; }
.record-intro p, .hx-hero p, .profile-hero p, .bm-hero p { color: #e6e9ff; }
.hx-hero small, .profile-hero span { color: var(--yellow); }
.mx-hero::before, .record-intro::before, .hx-hero::before, .profile-hero::before { background: rgba(255, 255, 255, .06); }
.record-buddy, .hx-hero-buddy, .profile-mascot { filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .3)); animation: mx-float 4.8s ease-in-out infinite; }

/* ── ホーム：相棒が主役のステージ ── */
main.content:has(> .mx-stage) { padding-left: 0; padding-right: 0; }
.mx-stage {
  position: relative; overflow: hidden; text-align: center; color: #fff;
  background: var(--stage); margin: -8px 0 0; padding: 14px 18px 30px;
}
.mx-stage-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; text-align: left; }
.mx-stage-copy { min-width: 0; }
.mx-stage .mx-hero-title { color: #fff; font-size: 26px; font-weight: 800; margin: 0; line-height: 1.25; }
.mx-stage .mx-hero-sub { color: #dfe3ff; font-size: 14px; font-weight: 700; margin: 2px 0 0; }
.mx-level { flex: none; background: var(--yellow); color: #232c58; font-weight: 800; font-size: 15px; padding: 5px 12px; border-radius: 999px; box-shadow: 0 3px 0 var(--yellow-deep); }
.mx-xp { height: 12px; border-radius: 999px; background: rgba(255, 255, 255, .2); margin: 12px 0 4px; overflow: hidden; }
.mx-xp i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--yellow), #ff9f4f); transition: width .5s var(--ease); }
.mx-xp-label { display: block; text-align: left; color: #dfe3ff; font-size: 12px; font-weight: 700; }
.mx-stage-buddy { position: relative; display: flex; flex-direction: column; align-items: center; margin-top: 4px; }
.mx-buddy-btn { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; }
.mx-stage .mx-buddy {
  width: 150px; height: 150px; margin: 0; filter: drop-shadow(0 14px 16px rgba(0, 0, 0, .35));
  animation: mx-float 3.6s ease-in-out infinite;
}
.mx-stage .mx-buddy.is-react, .mx-stage .mx-buddy.is-hop { animation: mx-hop .62s var(--ease) 1, mx-float 3.6s ease-in-out .62s infinite; }
.mx-buddy-shadow { width: 96px; height: 12px; border-radius: 50%; background: rgba(0, 0, 0, .28); margin-top: -6px; animation: mx-shadow 3.6s ease-in-out infinite; }
@keyframes mx-hop { 0% { transform: translateY(0) scale(1); } 25% { transform: translateY(2px) scale(1.1, .9); } 55% { transform: translateY(-22px) scale(.95, 1.06) rotate(-4deg); } 80% { transform: translateY(0) scale(1.04, .96); } 100% { transform: translateY(0) scale(1); } }
@keyframes mx-shadow { 0%, 100% { transform: scaleX(1); opacity: .9; } 50% { transform: scaleX(.86); opacity: .6; } }
.mx-stage .mx-bubble { margin: 10px auto 0; color: #232c58; font-size: 16px; font-weight: 800; padding: 9px 16px; border-radius: 18px; box-shadow: 0 4px 0 rgba(0, 0, 0, .18); }
.mx-stage .mx-bubble::after { right: auto; left: 50%; top: -6px; margin: 0 0 0 -7px; }
.mx-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.mx-stat { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 4px; border-radius: 16px; background: rgba(255, 255, 255, .13); color: #fff; text-decoration: none; min-height: 58px; justify-content: center; }
.mx-stat small { font-size: 12px; font-weight: 700; color: #dfe3ff; }
.mx-stat b, .mx-stat span { font-size: 19px; font-weight: 800; color: #fff; }
.mx-stage-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 6px; color: var(--yellow); font-weight: 800; font-size: 14px; text-decoration: none; }
.mx-sheet { position: relative; background: var(--bg); border-radius: 30px 30px 0 0; margin-top: -18px; padding: 16px 16px 4px; }
.mx-sheet > .mx-quick { margin-top: 0; }
.mx-quick-item { border: 3px solid var(--line); box-shadow: 0 4px 0 var(--line); border-radius: 20px; }
.mx-quick-item strong { font-size: 13px; font-weight: 800; }
.mx-quick-icon { font-size: 26px; }
.mx-quick-item:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--line); }
.next-panel { background: var(--card); }
.next-main { background: var(--yellow) !important; color: #232c58 !important; box-shadow: 0 5px 0 var(--yellow-deep) !important; border: 0 !important; font-weight: 800; }

/* ── 筋トレ：今日はどうする？（大きい3つのカード） ── */
.wx-day-card { margin-top: 4px; }
.wx-daytype-q { font-size: 17px; font-weight: 800; color: var(--text); }
.wx-daytype { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.wx-daytype-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 4px 10px; min-height: 96px;
  border-radius: 20px; border: 3px solid var(--line); background: var(--card); color: var(--text); box-shadow: 0 4px 0 var(--line);
}
.wx-daytype-btn b { font-size: 17px; font-weight: 800; }
.wx-daytype-btn small { font-size: 11px; font-weight: 700; color: var(--text-3); }
.wx-daytype-emoji { font-size: 30px; line-height: 1.1; }
.wx-daytype-btn[aria-pressed='true'] { background: #232c58; border-color: #232c58; color: var(--yellow); box-shadow: 0 4px 0 #11163a; }
.wx-daytype-btn[aria-pressed='true'] small { color: #dfe3ff; }
.wx-daytype-btn:active { transform: translateY(2px); }
@media (prefers-color-scheme: dark) {
  .wx-daytype-btn[aria-pressed='true'] { background: var(--yellow); border-color: var(--yellow); color: #232c58; box-shadow: 0 4px 0 var(--yellow-deep); }
  .wx-daytype-btn[aria-pressed='true'] small { color: #4d587f; }
}
.wx-parts { margin: 14px 0 6px; }
.wx-parts-label { display: block; font-size: 15px; font-weight: 800; margin: 0 2px 8px; }
.wx-parts .chips { margin-left: calc(-1 * var(--gutter, 16px)); margin-right: calc(-1 * var(--gutter, 16px)); padding: 0 var(--gutter, 16px) 6px; }

/* ── 筋トレ：セットは −／＋ で直す表 ── */
.wx-card { padding: 14px 12px; }
.wx-name { font-size: 18px; font-weight: 800; }
.set-head.wx-set-head, .set-row.wx-set-row { grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1fr) 48px; gap: 6px; padding: 0 2px; }
.set-row.wx-set-row { padding-top: 6px; padding-bottom: 2px; }
.set-row.wx-set-row .set-no { width: 30px; }
.wx-step { display: grid; grid-template-columns: 34px minmax(0, 1fr) 34px; align-items: center; background: var(--card-2); border-radius: 16px; padding: 3px; min-width: 0; }
.wx-step .input { min-height: 42px; border: 0; background: transparent; padding: 4px 0; font-size: 19px; font-weight: 800; box-shadow: none; min-width: 0; width: 100%; }
.wx-step select.input { background-image: none; padding: 4px 0; text-align-last: center; }
.wx-step-btn { width: 34px; height: 42px; border: 0; border-radius: 12px; background: var(--card); color: #e0607e; font-size: 22px; font-weight: 800; line-height: 1; padding: 0; box-shadow: 0 2px 0 var(--line); }
.wx-step-btn:active { transform: translateY(1px); box-shadow: none; }
.set-row.wx-set-row .done-btn { width: 48px; height: 48px; border-radius: 16px; border: 3px solid var(--line); background: var(--card-2); }
.set-row.wx-set-row .done-btn[aria-pressed='true'] { background: #3cc495; border-color: #3cc495; color: #fff; box-shadow: 0 3px 0 #239a72; }
.set-row.wx-set-row.done .wx-step { background: color-mix(in srgb, #3cc495 16%, var(--card)); }
.set-row.wx-set-row.done .input { background: transparent; }
.set-sub { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 2px 52px 8px 36px; font-size: 12px; font-weight: 700; color: var(--text-3); }
.set-sub .input { min-height: 36px; width: 74px; padding: 2px 6px; font-size: 15px; text-align: center; text-align-last: center; }
.wx-extra { margin-top: 10px; border-top: 2px dashed var(--line); padding-top: 6px; }
.wx-extra > summary { min-height: 44px; display: flex; align-items: center; font-weight: 800; font-size: 14px; color: var(--accent); cursor: pointer; }
.wx-extra[open] > summary { margin-bottom: 6px; }

/* ── 動きを減らす設定 ── */
@media (prefers-reduced-motion: reduce) {
  .mx-stage .mx-buddy, .mx-buddy-shadow, .record-buddy, .hx-hero-buddy, .profile-mascot { animation: none !important; }
}
@media (max-width: 360px) {
  .set-head.wx-set-head, .set-row.wx-set-row { grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr) 44px; gap: 4px; }
  .set-row.wx-set-row .set-no { width: 22px; }
  .set-row.wx-set-row .done-btn { width: 44px; height: 44px; }
  .wx-step { grid-template-columns: 26px minmax(0, 1fr) 26px; padding: 2px; }
  .wx-step-btn { width: 26px; font-size: 19px; }
  .wx-step .input { font-size: 16px; }
  .wx-daytype-btn b { font-size: 15px; white-space: nowrap; }
  .wx-daytype-btn small { font-size: 10px; }
  .set-sub { padding-right: 4px; }
  .mx-stat b, .mx-stat span { font-size: 17px; }
}

/* ── 大きくした文字で崩れないように ── */
.meal-head .meal-name { white-space: normal; overflow: visible; line-height: 1.3; }
.kc-recipe-card .chip { white-space: nowrap; font-size: 13px; padding: 5px 10px; }
.kc-recipe-card .chip small { font-size: 11px; }
.next-head h2 { font-size: 19px; font-weight: 800; }

/* ── 睡眠 ── */
.mx-sleep-emoji { background: #e6e9ff; }
@media (prefers-color-scheme: dark) { .mx-sleep-emoji { background: #2e3769; } }
.sl-form .day-form-title { flex-wrap: wrap; gap: 6px 10px; }
.sl-day { color: var(--text-3); font-weight: 700; font-size: 13px; }
.sl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sl-field { display: flex; flex-direction: column; gap: 6px; font-weight: 800; font-size: 15px; color: var(--text); min-width: 0; }
.sl-time { min-height: 56px; font-size: 20px !important; font-weight: 800; text-align: center; width: 100%; min-width: 0; padding-left: 6px; padding-right: 6px; }
.sl-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sl-chip { min-height: 40px; padding: 5px 11px; font-size: 14px; }
.sl-chips-label { font-size: 14px; font-weight: 800; margin-right: 2px; }
.sl-result { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 4px 0; padding: 12px 14px; border-radius: 18px; background: var(--stage); color: #fff; font-weight: 700; }
.sl-result b { font-size: 26px; font-weight: 800; color: var(--yellow); }
.sl-result small { flex-basis: 100%; color: #dfe3ff; font-size: 12px; }
.sl-panel { margin: 0 0 14px; }
.sl-stats > div b { font-size: 20px; }
.sl-bar-label { font-size: 10px; text-anchor: middle; }
.sl-avg-line { stroke: #657ac9; }
@media (max-width: 360px) { .sl-time { font-size: 17px !important; } .sl-grid { gap: 8px; } }


/* ── 全体の見直し（v4.1） ── */
[hidden] { display: none !important; }
.search { border: 3px solid var(--line) !important; box-shadow: none !important; background: var(--card); }
.search input, .search input[type='search'] { border: 0 !important; background: transparent !important; box-shadow: none !important; min-height: 44px; }
.search:focus-within { border-color: var(--edit-focus) !important; }

/* 食事：区分ごとの絵文字、PFCは見出しの下に余白をとって */
.meal-card .meal-name { font-size: 17px; font-weight: 800; }
.meal-card[data-meal='breakfast'] .meal-name::before { content: '🌅 '; }
.meal-card[data-meal='lunch'] .meal-name::before { content: '☀️ '; }
.meal-card[data-meal='dinner'] .meal-name::before { content: '🌙 '; }
.meal-card[data-meal='snack'] .meal-name::before { content: '🍪 '; }
.meal-card[data-meal='supplement'] .meal-name::before { content: '💊 '; }
.meal-head { border-bottom: 2px dashed var(--line); background: var(--card-2); }
.meal-pfc { padding: 8px 16px; font-size: 13px; font-weight: 700; }
.meal-kcal { font-size: 18px; font-weight: 800; }

/* 記録：気分は絵文字を大きく、時間はボタンでも */
.df-mood-main { margin-bottom: 4px; }
.df-mood-q { font-size: 17px; font-weight: 800; color: var(--text); }
.df-mood-main .day-mood-chips { gap: 8px; }
.df-mood-main .day-mood-chip { min-height: 78px; border-radius: 18px; border: 3px solid var(--line); background: var(--card); }
.df-mood-main .day-mood-chip span { font-size: 32px; }
.df-mood-main .day-mood-chip.selected { background: #232c58; border-color: #232c58; color: var(--yellow); }
.df-duration-label { margin-left: 6px; color: var(--accent); font-weight: 800; }
.df-duration-chips { margin: -2px 0 10px; }
.day-kind-button { border: 3px solid var(--line); box-shadow: 0 4px 0 var(--line); }
.day-kind-button.active { background: #232c58; color: var(--yellow); border-color: #232c58; }
.day-kind-button.active small { color: #dfe3ff; }
.day-event-actions button { min-height: 40px; padding: 4px 12px; border-radius: 12px; font-weight: 700; }
@media (prefers-color-scheme: dark) {
  .df-mood-main .day-mood-chip.selected, .day-kind-button.active { background: var(--yellow); border-color: var(--yellow); color: #232c58; }
  .day-kind-button.active small { color: #4d587f; }
}

/* 体重・体型：3つの画面に分ける */
.bm-nav-wrap { position: sticky; top: calc(var(--header-h, 56px) + env(safe-area-inset-top)); z-index: 5; background: var(--bg); padding: 6px 0 4px; margin: 0 0 10px; }
.bm-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bm-tabs button { font-size: 14px; white-space: nowrap; }
.bm-nav-wrap .bm-jumps { margin-top: 8px; }
.meal-card.is-empty .meal-head { border-bottom: 0; }
.meal-card.is-empty .meal-preset-quick, .meal-card.is-empty .meal-recent-copy { border-top: 2px dashed var(--line); }

/* 記録：何を記録する？（4列のタイル） */
.record-category-nav.rc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; padding: 0; overflow: visible; }
.rc-tile { display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 74px; padding: 8px 2px !important;
  border-radius: 18px !important; border: 3px solid var(--line) !important; background: var(--card) !important; box-shadow: 0 4px 0 var(--line); font-size: 13px !important; font-weight: 800; color: var(--text) !important; text-decoration: none; }
.rc-tile .rc-emoji { font-size: 26px; line-height: 1.1; }
.rc-tile.is-active { background: #232c58 !important; border-color: #232c58 !important; color: var(--yellow) !important; box-shadow: 0 4px 0 #11163a; }
.rc-tile:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--line); }
@media (prefers-color-scheme: dark) { .rc-tile.is-active { background: var(--yellow) !important; border-color: var(--yellow) !important; color: #232c58 !important; } }
/* 食事のコピー・マイセット：丸いボタン */
.meal-menu-btn { width: 44px; height: 44px; min-width: 44px; padding: 0; border-radius: 50%; border: 3px solid var(--line); background: var(--card); color: var(--text-2); display: grid; place-items: center; flex: none; }
.meal-menu-btn:active { transform: scale(.94); }
/* 下のタブ：真ん中の大きな「記録」 */
.tab-plus .tab-plus-label { font-size: 12px; }

/* ── ホーム v4.2：タイムライン・活動マップ・今日のまとめ・気分のひとこと ── */
.mx-mood-note { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 10px; }
.mx-mood-note .input { min-height: 46px; font-size: 16px; }
.hd-timeline { margin: 0 0 14px; }
.hd-list { list-style: none; margin: 0; padding: 0; display: grid; }
.hd-item { display: grid; grid-template-columns: 48px 34px minmax(0, 1fr); align-items: center; gap: 6px; padding: 9px 0; border-top: 2px dashed var(--line); }
.hd-item:first-child { border-top: 0; }
.hd-item time { font-weight: 800; color: var(--accent); font-size: 14px; }
.hd-symbol { font-size: 22px; text-align: center; }
.hd-copy { display: flex; flex-direction: column; min-width: 0; }
.hd-copy b { font-size: 15px; overflow-wrap: anywhere; }
.hd-copy small { color: var(--text-3); font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.hd-map { margin: 0 0 14px; }
.hd-digest { margin: 0 0 14px; }
.hd-digest-block { display: block; text-decoration: none; color: var(--text); padding: 12px; border-radius: 18px; background: var(--card-2); margin-top: 8px; }
.hd-digest-title { display: flex; align-items: baseline; gap: 8px; }
.hd-digest-title strong { font-size: 16px; font-weight: 800; }
.hd-digest-title b { margin-left: auto; font-size: 15px; font-weight: 800; color: var(--accent); white-space: nowrap; }
.hd-digest-title span { color: var(--text-3); font-weight: 800; }
.hd-digest-meals { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.hd-digest-meals li { display: flex; flex-direction: column; align-items: center; padding: 6px 2px; border-radius: 12px; background: var(--card); font-size: 11px; font-weight: 700; text-align: center; }
.hd-digest-meals li b { font-size: 12px; font-weight: 800; }
.hd-digest-meals li.is-empty { color: var(--text-3); }
.hd-digest-meals li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.wx-tally { margin: -4px 2px 12px; font-size: 15px; font-weight: 700; color: var(--text-2); }
.wx-tally b { font-size: 18px; color: var(--text); }

/* ── 貼り付けで登録 ── */
.fi-step { min-width: 0; margin-bottom: 14px; padding: 14px; border-radius: 20px; background: var(--card); border: 2px solid var(--line); display: grid; gap: 10px; }
.fi-step-head { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.fi-step-head b { flex: 1; min-width: 0; }
.fi-num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--yellow); color: #3a2a00; font-weight: 800; font-size: 15px; }
.fi-step .tiny { margin: 0; }
.fi-actions { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 8px; }
.fi-actions .btn { min-height: 52px; padding: 0 10px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; font-size: 15px; overflow: hidden; }
@media (max-width: 359px) { .fi-actions .btn { font-size: 14px; padding: 0 6px; } }
.fi-dishes, .fi-text, .fi-prompt { width: 100%; box-sizing: border-box; min-width: 0; font-size: 16px !important; line-height: 1.5; }
.fi-text { min-height: 120px; }
.fi-prompt { font-size: 13px !important; background: var(--card-2); }
.fi-text-wrap { position: relative; }
.fi-mini { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--card); color: var(--text-2); font: inherit; font-size: 13px; font-weight: 700; }
.fi-clear { position: absolute; right: 8px; bottom: 8px; }
.fi-preview { display: grid; gap: 10px; }
.fi-preview > .fi-step-head { margin-top: 4px; }
.fi-lead { margin: -4px 0 0; }
.fi-item { padding: 12px; display: grid; gap: 8px; transition: opacity .15s; }
.fi-item.is-off { opacity: .55; }
.fi-include { display: flex; align-items: center; gap: 10px; }
.fi-include input[type=checkbox] { width: 26px; height: 26px; flex: none; }
.fi-include .input { flex: 1; min-width: 0; min-height: 46px; font-size: 17px; font-weight: 700; }
.fi-dup { margin: 0; color: var(--danger); font-weight: 700; font-size: 13px; }
.fi-warn { margin: 0; padding: 8px 12px 8px 26px; border-radius: 12px; background: color-mix(in srgb, var(--yellow) 22%, var(--card)); font-size: 13px; font-weight: 700; }
.fi-field { margin: 0; font-size: 12px; min-width: 0; }
.fi-field > span { display: block; white-space: nowrap; overflow: hidden; text-overflow: clip; }
.fi-pfc .fi-field > span { font-size: 11px; text-align: center; }
.fi-field .input { min-height: 44px; font-size: 16px; width: 100%; }
.fi-pfc { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.fi-pfc .input { padding-left: 8px; padding-right: 6px; text-align: center; font-weight: 700; }
.fi-base { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: 6px; align-items: end; }
.fi-per { padding-bottom: 12px; font-size: 13px; font-weight: 700; color: var(--text-3); }
.input.fi-missing { border-color: var(--danger) !important; background: color-mix(in srgb, var(--danger) 6%, var(--card)); }
.fi-more summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--text-2); }
.fi-more summary small { color: var(--text-3); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.fi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.fi-wide { grid-column: 1 / -1; }
.fi-submit { position: sticky; bottom: 0; padding: 10px 0 calc(6px + env(safe-area-inset-bottom)); background: linear-gradient(to bottom, transparent, var(--bg) 30%); }
/* 食品を探す：バーコードの隣に「AIの答えを貼ってまとめて登録」 */
.paste-import-btn { position: relative; }
.paste-import-tag { position: absolute; right: -3px; bottom: -3px; min-width: 20px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--yellow); color: #3a2a00; font-size: 10px; font-weight: 800; line-height: 16px; letter-spacing: .02em; box-shadow: 0 0 0 2px var(--card); }

/* 文字の大きさ（設定）：画面全体を少し拡大する */
html[data-text-size="large"] body { zoom: 1.1; }
html[data-text-size="xlarge"] body { zoom: 1.2; }

/* 昨日の食事をまとめて追加 */
.meal-copy-day { width: 100%; margin: 0 0 12px; min-height: 56px; padding: 10px 14px; display: flex; align-items: center; gap: 10px; border-radius: 18px; border: 2px dashed var(--line); background: var(--card); color: var(--text); font: inherit; font-weight: 700; font-size: 15px; text-align: left; }
.meal-copy-day span { display: grid; gap: 2px; }
.meal-copy-day small { color: var(--text-3); font-size: 12px; font-weight: 700; }
/* 体重をすぐ記録 */
.qw-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 8px 0 6px; }
.qw-step { min-height: 52px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-weight: 800; font-size: 15px; }
.qw-field { position: relative; display: block; margin-top: 8px; }
.qw-input { width: 100%; box-sizing: border-box; min-height: 64px; text-align: center; font-size: 30px !important; font-weight: 800; padding: 0 44px !important; }
.qw-field span { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-weight: 700; }
.qw-diff { min-height: 1.4em; margin: 0 0 12px; text-align: center; font-size: 14px; font-weight: 700; color: var(--text-2); }
/* 水分 */
.wt-card { margin-top: 14px; display: grid; gap: 10px; }
.wt-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.wt-head strong { font-size: 22px; font-weight: 800; }
.wt-head small { margin-left: auto; font-size: 12px; font-weight: 700; }
.wt-cups { display: flex; flex-wrap: wrap; gap: 2px; min-height: 0; font-size: 18px; }
.wt-cups:empty { display: none; }
.wt-actions { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.wt-actions .btn { min-height: 52px; display: grid; place-items: center; gap: 0; line-height: 1.2; padding: 4px 6px; }
.wt-actions .btn small { font-size: 11px; color: var(--text-3); font-weight: 700; }
.wt-minus { min-width: 56px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); color: var(--text-2); font: inherit; font-weight: 700; font-size: 13px; }
.wt-minus:disabled { opacity: .4; }
/* 気分のひとことの候補 */
.mx-mood-phrases { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.mx-phrase { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 2px solid var(--line); background: var(--card); color: var(--text-2); font: inherit; font-size: 13px; font-weight: 700; }
.mx-phrase[aria-pressed="true"] { background: var(--yellow); color: #3a2a00; border-color: transparent; }

/* 休憩タイマー（下のタブの上に浮かぶ） */
.rest-timer { position: fixed; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top, 0px) + 70px); z-index: 60; white-space: nowrap; display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 14px; border-radius: 999px; background: #1d2550; color: #fff; border: 2px solid rgba(255,255,255,.18); box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: calc(100vw - 24px); }
.rest-label { font-size: 13px; font-weight: 700; opacity: .85; }
@media (max-width: 359px) { .rest-label { display: none; } .rest-timer { padding-left: 8px; } }
.rest-timer strong { min-width: 3.2em; text-align: center; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rest-btn { min-width: 48px; min-height: 44px; border-radius: 999px; border: 0; background: rgba(255,255,255,.16); color: #fff; font: inherit; font-size: 14px; font-weight: 800; }
.rest-skip { min-width: 44px; font-size: 16px; }
/* シートを開いている間は隠す（数え続け、閉じたらまた出る。下のボタンを隠さない） */
body:has(.sheet-backdrop) .rest-timer { display: none; }
.rest-card { margin-top: 14px; display: grid; gap: 10px; }
.rest-card-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rest-card-head small { font-size: 12px; font-weight: 700; }

/* 料理：売り場・安かった店・家にあるもので探す・食事に記録・献立 */
.kc-aisle { list-style: none; margin: 10px 2px 2px; font-size: 12px; font-weight: 800; color: var(--text-3); letter-spacing: .04em; }
.kc-aisle:first-child { margin-top: 0; }
.kc-cheap { display: block; color: var(--success, #1d8a5b); font-weight: 700; }
.kc-pantry { padding: 12px 14px; margin: 10px 0; }
.kc-pantry summary { cursor: pointer; font-weight: 800; min-height: 40px; display: flex; align-items: center; }
.kc-pantry-input { width: 100%; box-sizing: border-box; margin: 6px 0 8px; font-size: 16px !important; }
.kc-pantry-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.kc-pantry-hit { width: 100%; min-height: 52px; padding: 8px 12px; display: grid; gap: 2px; text-align: left; border-radius: 14px; border: 2px solid var(--line); background: var(--card); color: var(--text); font: inherit; }
.kc-pantry-hit b small { margin-left: 6px; color: var(--text-3); font-size: 12px; }
.kc-missing { font-size: 13px; font-weight: 700; color: var(--text-2); }
.kc-ok { font-size: 13px; font-weight: 800; color: var(--success, #1d8a5b); }
.kc-meal-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.kc-meal-choice .btn { min-height: 56px; font-size: 16px; }
.kc-menu-lead { margin: 4px 2px 10px; }
.kc-menu-day { padding: 12px 14px; margin-bottom: 10px; display: grid; gap: 8px; }
.kc-menu-day.is-today { border-color: var(--yellow); }
.kc-menu-head b { font-size: 16px; font-weight: 800; }
.kc-menu-head small { color: var(--text-3); font-weight: 700; }
.kc-menu-dishes { display: flex; flex-wrap: wrap; gap: 6px; }
.kc-menu-dish { display: inline-flex; align-items: stretch; border-radius: 14px; border: 2px solid var(--line); background: var(--card-2); overflow: hidden; }
.kc-menu-dish.is-listed { opacity: .7; }
.kc-menu-open { min-height: 44px; padding: 4px 10px; border: 0; background: none; color: var(--text); font: inherit; font-weight: 700; display: grid; text-align: left; }
.kc-menu-open small { font-size: 11px; color: var(--text-3); font-weight: 700; }
.kc-menu-x { min-width: 40px; border: 0; border-left: 2px solid var(--line); background: none; color: var(--text-3); display: grid; place-items: center; }
.kc-menu-add { min-height: 44px; padding: 0 12px; border-radius: 14px; border: 2px dashed var(--line); background: none; color: var(--text-2); font: inherit; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.kc-menu-submit { padding: 8px 0; }
.kc-menu-submit.is-sticky { position: sticky; bottom: calc(80px + env(safe-area-inset-bottom)); }

/* 相棒のレベルの見た目（帽子・きらきら・称号） */
.mx-buddy-btn { position: relative; }
.mx-buddy-hat { position: absolute; top: -14px; left: 50%; transform: translateX(-50%) rotate(-10deg); font-size: 44px; line-height: 1; pointer-events: none; filter: drop-shadow(0 2px 2px rgba(0,0,0,.15)); }
.mx-stage .mx-buddy.is-hop + .mx-buddy-hat, .mx-stage .mx-buddy.is-react + .mx-buddy-hat { animation: mx-hat-hop .62s var(--ease) 1; }
@keyframes mx-hat-hop { 0%, 100% { transform: translateX(-50%) rotate(-10deg); } 55% { transform: translate(-50%, -26px) rotate(-16deg); } }
.mx-buddy-title { display: block; margin: 2px 8px 6px; text-align: center; font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, .82); line-height: 1.5; }
.mx-stage[data-aura="sparkle"] .mx-stage-buddy::before,
.mx-stage[data-aura="gold"] .mx-stage-buddy::before,
.mx-stage[data-aura="rainbow"] .mx-stage-buddy::before { content: ''; position: absolute; top: 50%; left: 50%; width: 190px; height: 190px; transform: translate(-50%, -56%); border-radius: 50%; pointer-events: none; z-index: 0; }
.mx-stage[data-aura="sparkle"] .mx-stage-buddy::before { background: radial-gradient(circle, rgba(255,214,77,.35), transparent 65%); }
.mx-stage[data-aura="gold"] .mx-stage-buddy::before { background: radial-gradient(circle, rgba(255,196,0,.5), transparent 66%); animation: mx-aura 3s ease-in-out infinite; }
.mx-stage[data-aura="rainbow"] .mx-stage-buddy::before { background: conic-gradient(from 0deg, rgba(255,99,132,.35), rgba(255,206,86,.35), rgba(75,192,192,.35), rgba(54,162,235,.35), rgba(153,102,255,.35), rgba(255,99,132,.35)); filter: blur(14px); animation: mx-spin 8s linear infinite; }
.mx-stage-buddy > * { position: relative; z-index: 1; }
@keyframes mx-aura { 0%, 100% { opacity: .7; } 50% { opacity: 1; } }
@keyframes mx-spin { to { transform: translate(-50%, -56%) rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .mx-stage .mx-stage-buddy::before, .mx-buddy-hat { animation: none !important; } }
/* クエストで「よく抜けがち」 */
.next-item.is-focus .next-item-label::after { content: ' 🔥'; }

/* 分析：今週のふり返り */
.hx-review { margin: 12px 0; display: grid; gap: 10px; }
.hx-review-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.hx-review-head h2 { margin: 0; font-size: 18px; font-weight: 800; }
.hx-review-head small { font-size: 12px; font-weight: 700; }
.hx-review-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hx-review-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; grid-template-areas: 'e l v' 'e d d'; column-gap: 8px; align-items: center; padding: 8px 10px; border-radius: 14px; background: var(--card-2); }
.hx-review-emoji { grid-area: e; font-size: 20px; }
.hx-review-label { grid-area: l; font-size: 14px; font-weight: 700; color: var(--text-2); }
.hx-review-row b { grid-area: v; font-size: 16px; font-weight: 800; }
.hx-review-row small { grid-area: d; justify-self: end; font-size: 12px; font-weight: 700; color: var(--text-3); }
.hx-tendency { display: grid; gap: 6px; padding-top: 4px; border-top: 2px dashed var(--line); }
.hx-tendency h3 { margin: 6px 0 0; font-size: 15px; font-weight: 800; }
.hx-tendency p { margin: 0; font-size: 14px; font-weight: 700; }
.hx-tendency p small { display: block; margin-top: 2px; font-size: 12px; font-weight: 700; color: var(--text-3); }
.bm-legend { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: 4px 2px 0; }
.bm-key { display: inline-block; width: 18px; height: 0; border-top: 3px solid #168d9d; vertical-align: middle; }
.bm-key.avg { border-top: 3px dashed #f08a24; }
/* 画面ごとのはじめての案内 */
.page-guide { margin: 10px 0; }
.page-guide ul { margin: 4px 0 0; padding-left: 1.1em; display: grid; gap: 2px; font-size: 13px; font-weight: 700; }

/* 食事の時刻・写真・習慣 */
.meal-time-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-weight: 700; font-size: 14px; }
.meal-time-input { max-width: 140px; min-height: 44px; font-size: 16px !important; }
.photo-field { padding: 6px 14px 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.photo-add { min-height: 40px; padding: 0 12px; border-radius: 999px; border: 2px dashed var(--line); background: none; color: var(--text-3); font: inherit; font-size: 13px; font-weight: 700; }
.photo-thumb { width: 88px; height: 88px; object-fit: cover; border-radius: 14px; border: 2px solid var(--line); cursor: zoom-in; }
.photo-thumb.is-big { width: 100%; height: auto; max-height: 70vh; object-fit: contain; cursor: zoom-out; }
.photo-del { min-height: 36px; padding: 0 10px; border-radius: 999px; border: 2px solid var(--line); background: var(--card); color: var(--text-3); font: inherit; font-size: 12px; font-weight: 700; }
.hd-meal .hd-copy small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-card .mx-card-head { display: flex; align-items: center; gap: 8px; }
.hb-card .mx-card-head h3 { flex: 1; }
.hb-manage { border: 0; background: none; font: inherit; font-weight: 700; color: var(--accent); min-height: 40px; padding: 0 6px; }
.hb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 8px; }
.hb-item { min-height: 76px; padding: 8px 6px; display: grid; justify-items: center; gap: 2px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); color: var(--text); font: inherit; text-align: center; }
.hb-item b { font-size: 13px; font-weight: 800; line-height: 1.25; }
.hb-item small { font-size: 11px; font-weight: 700; color: var(--text-3); }
.hb-item.is-on { background: color-mix(in srgb, var(--success, #1d8a5b) 14%, var(--card)); border-color: color-mix(in srgb, var(--success, #1d8a5b) 50%, var(--line)); }
.hb-emoji { font-size: 22px; }
.hb-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.hb-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 12px; background: var(--card-2); font-weight: 700; }
.hb-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-bottom: 10px; }
/* 歩数・有酸素・生理・毎朝はかる */
.mv-card { margin-top: 14px; display: grid; gap: 10px; }
.mv-steps-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; font-weight: 700; }
.mv-steps { min-height: 48px; font-size: 18px !important; font-weight: 800; }
.mv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mv-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 12px; background: var(--card-2); font-size: 14px; font-weight: 700; }
.mv-add { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr) minmax(0, 1fr); gap: 6px; }
.mv-add .btn { grid-column: 1 / -1; min-height: 48px; }
.mv-add .input { min-height: 46px; font-size: 16px; }
.cy-card { display: grid; gap: 8px; }
.cy-card[hidden] { display: none; }
.cy-toggle { min-height: 52px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-weight: 800; font-size: 15px; }
.cy-toggle.is-on { background: color-mix(in srgb, #ee90bd 22%, var(--card)); border-color: #ee90bd; }
.qw-daily, .set-toggle { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 14px; font-weight: 700; }
.qw-daily input, .set-toggle input { width: 24px; height: 24px; flex: none; }
/* 筋トレ：推定1RM・所要時間・曜日のマイセット */
.prev-e1rm { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 999px; background: color-mix(in srgb, var(--yellow) 30%, var(--card)); font-size: 11px; font-weight: 800; }
.wk-duration { margin: -6px 2px 10px; font-size: 14px; font-weight: 700; color: var(--text-2); }
.wk-suggest { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 12px; }
.wk-suggest p { margin: 0; display: grid; }
.wk-suggest small { color: var(--text-3); font-weight: 700; }
.wk-days { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: 0 0 10px; }
.wk-days small { font-size: 12px; font-weight: 700; color: var(--text-3); margin-right: 2px; }
.wk-day { min-width: 36px; min-height: 36px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); color: var(--text-2); font: inherit; font-size: 13px; font-weight: 800; }
.wk-day[aria-pressed="true"] { background: #232c58; color: var(--yellow); border-color: transparent; }
/* 家にある食材（期限）・よく買うもの・レシピの栄養 */
.kc-pantry summary small { margin-left: 8px; color: var(--text-3); font-size: 12px; }
.kc-pantry-form { display: grid; grid-template-columns: minmax(0, 1fr) 132px auto; gap: 6px; margin: 8px 0; }
.kc-pantry-form .input { min-height: 46px; font-size: 16px; }
@media (max-width: 359px) { .kc-pantry-form { grid-template-columns: minmax(0, 1fr) auto; } .kc-pantry-date { grid-column: 1 / -1; grid-row: 2; } }
.kc-pantry-items { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 4px; }
.kc-pantry-item { display: grid; grid-template-columns: minmax(0, 1fr) auto 128px 40px; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 12px; background: var(--card-2); font-size: 14px; }
.kc-pantry-item.is-soon { background: color-mix(in srgb, var(--danger) 12%, var(--card)); }
.kc-pantry-item b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kc-pantry-item-date { min-height: 38px; font-size: 13px !important; padding: 2px 6px !important; }
.kc-expiry { font-size: 12px; font-weight: 800; color: var(--danger); }
@media (max-width: 379px) { .kc-pantry-item { grid-template-columns: minmax(0, 1fr) auto 40px; } .kc-pantry-item > button { grid-row: 1; grid-column: 3; } .kc-pantry-item-date { grid-row: 2; grid-column: 1 / -1; } }
.kc-soon { font-size: 12px; font-weight: 800; color: var(--danger); }
.kc-staples-label { margin: 8px 2px 4px; }
.kc-staples { flex-wrap: wrap; }
.kc-nutri { margin: 10px 0; padding: 12px; border-radius: 16px; background: var(--card-2); display: grid; gap: 4px; }
.kc-nutri h3 { margin: 0; font-size: 15px; }
.kc-nutri-val { margin: 0; font-size: 15px; font-weight: 700; }
.kc-nutri-val b { font-size: 20px; font-weight: 800; }
.kc-link-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 8px; }
.kc-link { display: grid; gap: 6px; padding: 10px; border-radius: 14px; background: var(--card-2); }
.kc-link > div:first-child { display: flex; gap: 8px; align-items: baseline; }
.kc-link small { color: var(--text-3); font-weight: 700; }
.kc-link-food { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; font-weight: 700; }
.kc-link-food .kc-num { width: 84px; }
.kc-link-hit { width: 100%; text-align: left; border: 0; background: none; font: inherit; }
/* 分析：PFCの割合・食事の時間・月の画像 */
:root { --pfc-p: #3aa676; --pfc-f: #f0a43a; --pfc-c: #5b8def; }
.hx-pfc { display: flex; align-items: center; gap: 14px; padding: 8px 4px; }
.hx-pfc-donut { flex: none; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; position: relative; }
.hx-pfc-donut::after { content: ''; position: absolute; inset: 18px; border-radius: 50%; background: var(--card); }
.hx-pfc-donut span { position: relative; z-index: 1; font-size: 13px; font-weight: 800; }
.hx-pfc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 14px; font-weight: 700; }
.hx-pfc .k { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.hx-pfc .k.p { background: var(--pfc-p); } .hx-pfc .k.f { background: var(--pfc-f); } .hx-pfc .k.c { background: var(--pfc-c); }
.hx-review-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; font-weight: 700; }
.hx-month-img { margin: 0 0 12px; }
/* 料理：月の食費 */
.kc-month { margin-top: 12px; display: grid; gap: 8px; }
.kc-month h2 { margin: 0; font-size: 17px; }
.kc-month .kc-spend-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kc-budget-row { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.kc-budget { width: 130px; }
.kc-over { color: var(--danger); font-weight: 800; }
.kc-per-kcal { font-weight: 700; }

/* 実績・チャレンジ・帽子・アルバム・季節 */
.is-user-hidden { display: none !important; }
.ch-card { display: grid; gap: 8px; }
.ch-title { margin: 0; font-size: 16px; font-weight: 800; }
.mx-buddy-season { position: absolute; right: -6px; bottom: 18px; font-size: 34px; line-height: 1; pointer-events: none; }
.gm-card { margin-top: 12px; display: grid; gap: 8px; }
.gm-card h3 { margin: 0; font-size: 17px; }
.gm-badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.gm-badge { display: grid; justify-items: center; gap: 2px; padding: 10px 6px; border-radius: 16px; background: var(--card-2); text-align: center; opacity: .55; }
.gm-badge.is-earned { opacity: 1; background: color-mix(in srgb, var(--yellow) 22%, var(--card)); }
.gm-badge-emoji { font-size: 28px; }
.gm-badge b { font-size: 12px; font-weight: 800; line-height: 1.3; }
.gm-badge small { font-size: 11px; color: var(--text-3); font-weight: 700; }
.gm-hats { display: flex; flex-wrap: wrap; gap: 8px; }
.gm-hat { min-width: 56px; min-height: 56px; padding: 0 12px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); font: inherit; font-size: 26px; font-weight: 800; color: var(--text); }
.gm-hat:first-child { font-size: 13px; }
.gm-hat[aria-pressed="true"] { border-color: var(--yellow); background: color-mix(in srgb, var(--yellow) 25%, var(--card)); }
.gm-album { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.gm-album li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; font-size: 14px; font-weight: 700; }
.gm-album time { color: var(--text-3); font-weight: 800; }
/* ホームの並び（設定） */
.settings-summary { cursor: pointer; list-style: none; }
.settings-summary h3 { display: inline; }
.hl-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.hl-row { display: grid; grid-template-columns: minmax(0, 1fr) 40px 40px 62px; gap: 6px; align-items: center; padding: 4px 4px 4px 10px; border-radius: 12px; background: var(--card-2); font-size: 14px; font-weight: 700; }
.hl-row.is-off span { opacity: .5; }
.hl-btn, .hl-toggle { min-height: 40px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-weight: 800; }
.hl-btn:disabled { opacity: .35; }
.hl-toggle[aria-pressed="false"] { color: var(--text-3); }
/* 引っぱって更新 */
.pull-refresh { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 6px); left: 50%; transform: translate(-50%, -60px); z-index: 70; padding: 6px 14px; border-radius: 999px; background: #232c58; color: #fff; font-size: 13px; font-weight: 800; transition: transform .2s; pointer-events: none; }
.pull-refresh.is-pulling { transition: none; }

@media (max-width: 379px) { .hl-row { font-size: 13px; gap: 4px; } .hl-toggle { font-size: 12px; } }
@media (max-width: 379px) { .mv-add { grid-template-columns: 1fr 1fr; } .mv-add select { grid-column: 1 / -1; } }
.photo-backup { display: grid; gap: 4px; }
.photo-backup-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.hb-list li { display: grid; grid-template-columns: 24px minmax(0, 1fr) 40px 40px auto; gap: 6px; }
.hb-rename { min-height: 40px; font-size: 15px; font-weight: 700; }
.search-mic { flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; font-size: 18px; padding: 0; }
.search-mic.is-listening, .scan-btn.is-listening { background: var(--danger) !important; color: #fff !important; animation: mx-aura 1s ease-in-out infinite; }
.kc-recipe-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kc-recipe-actions > :first-child { grid-column: 1 / -1; }
/* 月のふり返り・カレンダー・年 */
.hx-monthly { margin: 12px 0; display: grid; gap: 10px; }
.hx-month-head { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; text-align: center; }
.hx-month-head h2 { margin: 0; font-size: 18px; }
.hx-month-nav { min-height: 44px; border: 2px solid var(--line); border-radius: 50%; background: var(--card); color: var(--text); font: inherit; font-size: 20px; font-weight: 800; }
.hx-month-nav:disabled { opacity: .3; }
.hx-month-stats { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; font-weight: 700; }
.hx-month-stats span { padding: 4px 10px; border-radius: 999px; background: var(--card-2); }
.hx-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.hx-cal-w-head { text-align: center; font-size: 11px; font-weight: 800; color: var(--text-3); }
.hx-cal-day { position: relative; aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center; background: var(--card-2); color: var(--text); text-decoration: none; font-size: 13px; font-weight: 700; }
.hx-cal-day.st-near { background: color-mix(in srgb, #3aa676 35%, var(--card)); }
.hx-cal-day.st-under { background: color-mix(in srgb, #5b8def 30%, var(--card)); }
.hx-cal-day.st-over { background: color-mix(in srgb, #f0a43a 40%, var(--card)); }
.hx-cal-day.is-future { opacity: .35; }
.hx-cal-p { position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: #e0457b; display: inline-block; }
.hx-cal-w { position: absolute; bottom: 1px; right: 2px; font-size: 9px; }
.hx-cal-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; }
.hx-cal-legend .k { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.hx-cal-legend .k.near { background: #3aa676; } .hx-cal-legend .k.under { background: #5b8def; } .hx-cal-legend .k.over { background: #f0a43a; }
.hx-cal-legend .hx-cal-p { position: static; }
.hx-year { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; align-items: end; height: 70px; }
.hx-year-bar { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; border: 0; background: none; padding: 0; font: inherit; }
.hx-year-bar i { width: 70%; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--accent, #5b8def); display: block; }
.hx-year-bar.is-current i { background: var(--yellow); }
.hx-year-bar small { font-size: 10px; color: var(--text-3); font-weight: 700; }
/* 筋トレ：ドロップ・スーパーセット・ウォームアップ・プレート・インターバル */
.set-drop { margin-left: auto; min-height: 36px; padding: 0 10px; border-radius: 999px; border: 2px solid var(--line); background: var(--card); color: var(--text-3); font: inherit; font-size: 12px; font-weight: 800; }
.set-drop[aria-pressed="true"] { background: #232c58; color: var(--yellow); border-color: transparent; }
.ss-tag { padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, #8f7cf1 25%, var(--card)); font-size: 11px; font-weight: 800; }
.ss-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 6px 0; font-size: 13px; font-weight: 700; }
.warmup-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 8px; padding: 6px 10px; border-radius: 12px; background: color-mix(in srgb, var(--yellow) 18%, var(--card)); font-size: 13px; font-weight: 700; }
.prev-next-step { display: block; margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--success, #1d8a5b); }
.plate-side { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 16px; font-weight: 800; }
.plate { min-width: 44px; padding: 8px 10px; border-radius: 10px; background: #232c58; color: var(--yellow); text-align: center; }
.iv-inputs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.iv-display { margin: 14px 0; min-height: 140px; border-radius: 24px; display: grid; place-items: center; align-content: center; background: var(--card-2); font-size: 18px; font-weight: 800; text-align: center; }
.iv-display b { font-size: 64px; line-height: 1; }
.iv-display.is-work { background: color-mix(in srgb, #e0457b 25%, var(--card)); }
.iv-display.is-rest { background: color-mix(in srgb, #3aa676 25%, var(--card)); }
.iv-display.is-done { background: color-mix(in srgb, var(--yellow) 40%, var(--card)); }
/* ステージの背景（実績でもらえる） */
.mx-stage[data-stage="sunset"] { background: linear-gradient(180deg, #ff9a62 0%, #e0457b 55%, #5a2a6e 100%) !important; }
.mx-stage[data-stage="forest"] { background: linear-gradient(180deg, #2f6b4f 0%, #1d4a3a 60%, #13332a 100%) !important; }
.mx-stage[data-stage="sakura"] { background: linear-gradient(180deg, #f7b8d2 0%, #d97aa6 55%, #8a4a7a 100%) !important; }
.mx-stage[data-stage="galaxy"] { background: radial-gradient(circle at 30% 20%, #7b5cff 0%, #2a1a6e 45%, #0d0a2a 100%) !important; }
.gm-stages { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.gm-stage { min-height: 64px; border-radius: 14px; border: 3px solid transparent; color: #fff; font: inherit; font-size: 12px; font-weight: 800; text-shadow: 0 1px 2px rgba(0,0,0,.4); background: linear-gradient(180deg, #2b3576, #1a2050); }
.gm-stage[aria-pressed="true"] { border-color: var(--yellow); }
.gm-stage:disabled { opacity: .45; }
.gm-stage.st-sunset { background: linear-gradient(180deg, #ff9a62, #e0457b); }
.gm-stage.st-forest { background: linear-gradient(180deg, #2f6b4f, #13332a); }
.gm-stage.st-sakura { background: linear-gradient(180deg, #f7b8d2, #8a4a7a); }
.gm-stage.st-galaxy { background: radial-gradient(circle at 30% 20%, #7b5cff, #0d0a2a); }
.kc-paste-recipe { margin: 8px 0; }
.hd-expiry { margin-bottom: 12px; display: flex; align-items: center; gap: 10px; font-weight: 700; }
.hd-expiry span:nth-child(2) { flex: 1; }
.kc-store-toggle { margin: 0 0 6px; }
/* 文字が大きいときは、タブの文字を折り返して切れないようにする */
html[data-text-size] .seg > * { min-width: 0; white-space: normal; line-height: 1.2; overflow-wrap: anywhere; }
@media (max-width: 379px) { html[data-text-size="xlarge"] .seg button, html[data-text-size="xlarge"] .seg .seg-link { font-size: 12px; padding-left: 2px; padding-right: 2px; } }
.move-guide { margin-bottom: 10px; }
.move-guide summary { cursor: pointer; font-weight: 800; min-height: 40px; display: flex; align-items: center; }
.move-guide ol { margin: 6px 0; padding-left: 1.3em; display: grid; gap: 6px; font-size: 14px; }

/* ごほうび：ミッション・冒険・きせかえ・レベルアップ */
.rw-card { display: grid; gap: 8px; }
.rw-card .mx-card-head { display: flex; align-items: center; gap: 8px; }
.rw-card .mx-card-head h3 { flex: 1; }
.rw-points { padding: 4px 12px; border-radius: 999px; background: color-mix(in srgb, var(--yellow) 40%, var(--card)); color: var(--text); font-weight: 800; text-decoration: none; }
.rw-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rw-mission, .rw-disc { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 14px; background: var(--card-2); }
.rw-mission.is-got, .rw-disc.is-done { background: color-mix(in srgb, var(--success, #1d8a5b) 12%, var(--card)); }
.rw-emoji { font-size: 20px; text-align: center; }
.rw-title { color: var(--text); text-decoration: none; font-size: 14px; font-weight: 700; display: grid; }
.rw-title small { font-size: 11px; color: var(--text-3); font-weight: 700; }
.rw-mission small, .rw-disc > small { font-size: 12px; font-weight: 800; color: var(--text-3); }
.rw-claim { min-height: 40px; padding: 0 12px; border-radius: 999px; border: 0; background: var(--yellow); color: #3a2a00; font: inherit; font-size: 13px; font-weight: 800; animation: rw-pulse 1.6s ease-in-out infinite; }
.rw-bonus { width: 100%; min-height: 44px; }
.rw-go { font-size: 12px; font-weight: 800; color: var(--accent); text-decoration: none; white-space: nowrap; }
.rw-adventure summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; gap: 8px; font-weight: 800; }
.rw-badge { padding: 2px 8px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; }
@keyframes rw-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--yellow) 70%, transparent); } 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--yellow) 0%, transparent); } }
@media (prefers-reduced-motion: reduce) { .rw-claim { animation: none; } }
.rw-dress-head { display: flex; align-items: center; justify-content: space-between; }
.rw-dress-head b { padding: 4px 12px; border-radius: 999px; background: color-mix(in srgb, var(--yellow) 40%, var(--card)); }
.rw-slots { margin: 4px 0; }
.rw-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.rw-item { min-height: 76px; padding: 6px; border-radius: 16px; border: 3px solid var(--line); background: var(--card); color: var(--text); font: inherit; display: grid; justify-items: center; align-content: center; gap: 2px; }
.rw-item[aria-pressed="true"] { border-color: var(--yellow); background: color-mix(in srgb, var(--yellow) 20%, var(--card)); }
.rw-item.is-locked { opacity: .75; }
.rw-item.is-locked .rw-item-v { filter: grayscale(.6); }
.rw-item-v { font-size: 28px; line-height: 1.1; font-weight: 800; }
.rw-item small { font-size: 11px; font-weight: 700; color: var(--text-3); }
.rw-swatch { display: inline-block; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); }
.rw-swatch.c-pink { background: #ffc2d8; } .rw-swatch.c-mint { background: #b8f0d8; } .rw-swatch.c-lemon { background: #fff1a6; } .rw-swatch.c-sky { background: #bfe4ff; }
.rw-swatch.st-sunset { background: linear-gradient(#ff9a62, #e0457b); } .rw-swatch.st-forest { background: linear-gradient(#2f6b4f, #13332a); } .rw-swatch.st-sakura { background: linear-gradient(#f7b8d2, #8a4a7a); } .rw-swatch.st-galaxy { background: radial-gradient(#7b5cff, #0d0a2a); }
.rw-swatch.st-beach { background: linear-gradient(#7fd3ff 55%, #f5d78e 55%); } .rw-swatch.st-snow { background: linear-gradient(#cfe3ff, #ffffff); } .rw-swatch.st-city { background: linear-gradient(#1b1f4a, #3b2a6e); }
.mx-stage[data-stage="beach"] { background: linear-gradient(180deg, #7fd3ff 0%, #4fb6e8 58%, #f5d78e 58%, #e8c06a 100%) !important; }
.mx-stage[data-stage="snow"] { background: linear-gradient(180deg, #a9c8f0 0%, #dfeaff 60%, #ffffff 100%) !important; color: #232c58; }
.mx-stage[data-stage="city"] { background: linear-gradient(180deg, #0f1236 0%, #26215a 60%, #3b2a6e 100%) !important; }
.mx-buddy-face { position: absolute; top: 44%; left: 50%; transform: translate(-50%, -50%); font-size: 40px; line-height: 1; pointer-events: none; }
.mx-buddy-hand { position: absolute; bottom: 12px; right: -4px; font-size: 34px; line-height: 1; pointer-events: none; transform: rotate(12deg); }
.mx-stage .mx-buddy.is-wiggle { animation: mx-wiggle .9s ease-in-out 1, mx-float 3.6s ease-in-out .9s infinite; }
@keyframes mx-wiggle { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-8deg) translateY(-6px); } 45% { transform: rotate(7deg); } 70% { transform: rotate(-4deg); } }
.lv-overlay { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: rgba(16, 20, 50, .72); animation: lv-fade .25s ease-out; }
.lv-card { width: min(320px, calc(100vw - 48px)); padding: 24px 20px; border-radius: 28px; text-align: center; background: linear-gradient(180deg, #2b3576, #1a2050); color: #fff; box-shadow: 0 20px 60px rgba(0,0,0,.4); animation: lv-pop .5s cubic-bezier(.2, 1.4, .4, 1); }
.lv-small { margin: 0; font-size: 14px; font-weight: 800; letter-spacing: .2em; color: var(--yellow); }
.lv-big { margin: 4px 0; font-size: 56px; font-weight: 800; line-height: 1; }
.lv-buddy { animation: mx-hop .62s ease 2; }
.lv-text { margin: 8px 0; font-size: 15px; font-weight: 700; }
.lv-points { margin: 0 0 12px; font-size: 20px; font-weight: 800; color: var(--yellow); }
@keyframes lv-fade { from { opacity: 0; } }
@keyframes lv-pop { from { transform: scale(.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .lv-overlay, .lv-card, .lv-buddy { animation: none; } }
.mx-stage[data-stage="beach"] .mx-stat, .mx-stage[data-stage="snow"] .mx-stat, .mx-stage[data-stage="sakura"] .mx-stat { background: rgba(20, 28, 70, .32); color: #fff; }
.mx-stage[data-stage="snow"] .mx-stage-copy, .mx-stage[data-stage="snow"] .mx-xp-label, .mx-stage[data-stage="snow"] .mx-buddy-title { color: #232c58; }

/* ---- 筋トレ：まとめ・自己ベスト・記録・プログラム ---- */
.wx-more { padding-left: 0; padding-right: 0; }
.wm-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.wm-stats > div { background: var(--surface-2, rgba(0,0,0,.04)); border-radius: 14px; padding: 10px 4px; text-align: center; }
.wm-stats b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.wm-stats small { color: var(--muted); font-size: 12px; }
.wm-pr-note { font-weight: 700; color: var(--accent, #e07a2f); margin: 0 0 8px; animation: lv-pop .5s ease-out; }
.wm-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.wm-list li { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2, rgba(0,0,0,.04)); }
.wm-list li > span { font-size: 14px; }
.wm-list li > small { color: var(--muted); font-size: 12px; }
.wm-pr li { padding: 0; }
.wm-row { all: unset; box-sizing: border-box; display: grid; gap: 2px; width: 100%; padding: 10px 12px; min-height: 48px; cursor: pointer; }
.wm-row small { color: var(--muted); font-size: 12px; }
.wm-bars { display: flex; align-items: flex-end; gap: 4px; height: 90px; margin: 0 0 12px; padding: 6px; border-radius: 12px; background: var(--surface-2, rgba(0,0,0,.04)); }
.wm-bars span { flex: 1; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--accent, #e07a2f), color-mix(in srgb, var(--accent, #e07a2f) 55%, transparent)); transform-origin: bottom; animation: wm-grow .5s ease-out both; }
.wm-bars span:last-child { box-shadow: 0 0 0 2px var(--accent, #e07a2f) inset; }
@keyframes wm-grow { from { transform: scaleY(0); } }
.wm-program h3 { margin: 0 0 4px; }
@media (prefers-reduced-motion: reduce) { .wm-bars span, .wm-pr-note { animation: none; } }

/* ======================================================================
 * 部品の基準（D-106）：文字の役割・相棒のことば・手帳・＋記録
 * 色・大きさ・太さは上の :root のトークンだけを使う。新しい部品はここに足す。
 * ====================================================================== */
/* 丸ゴシックは「声」の部分だけ。太字にしない */
.mx-stage .mx-hero-title, .mx-bubble, .jn-day, .jn-buddy-say, .rs-label, .mx-level { font-family: var(--font-round); }
.mx-stage .mx-hero-title { font-weight: var(--fw-regular); font-size: 24px; letter-spacing: .01em; }
.mx-bubble, .mx-stage .mx-bubble { font-weight: var(--fw-regular); }
.mx-level { font-weight: var(--fw-regular); }
/* 本文・補足は普通の太さ。強調は見出しと数値だけ */
p, li, .small, .tiny, .muted, .mx-note, small { font-weight: var(--fw-regular); }
.unit { font-size: .62em; font-weight: var(--fw-medium); margin-left: 2px; color: var(--text-3); }

/* ── ホームのステージ：相棒とことばを横に並べ、記録の入口を最初の画面に入れる ── */
.mx-stage { padding: 12px 16px 26px; }
.mx-stage .mx-hero-sub { font-weight: var(--fw-regular); font-size: var(--fs-sub); }
.mx-stage-main { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; gap: 10px; margin: 6px 0 2px; text-align: left; }
.mx-stage-main .mx-stage-buddy { margin: 0; }
.mx-stage .mx-buddy { width: 108px; height: 108px; }
.mx-buddy-shadow { width: 70px; height: 9px; }
.mx-stage-talk { min-width: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.mx-stage .mx-bubble { margin: 0; position: relative; font-size: 16px; line-height: 1.5; padding: 10px 14px; border-radius: 16px; text-wrap: pretty; }
.mx-stage .mx-bubble::after { left: -6px; top: 50%; margin: -7px 0 0; transform: rotate(-90deg); }
.mx-buddy-title { color: #dfe3ff; font-size: var(--fs-caption); font-weight: var(--fw-regular); line-height: 1.5; display: flex; flex-direction: column; text-align: left; }
.mx-buddy-title > span { display: block; }
.mx-xp { margin: 10px 0 4px; height: 8px; }
.mx-stats { margin-top: 10px; }
.mx-stat { min-height: 54px; }
.mx-stat small { font-weight: var(--fw-regular); }
.mx-stat b, .mx-stat span { font-size: 20px; font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.mx-stage-link { font-weight: var(--fw-bold); }

/* ── ホームの「今日の手帳」 ── */
.jn-teaser { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; text-decoration: none; color: var(--text); margin-top: 12px; padding: 14px 16px; background: var(--paper); }
.jn-teaser-icon { font-size: 28px; line-height: 1; }
.jn-teaser-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.jn-teaser-copy small { color: var(--tone-journal); font-size: var(--fs-caption); font-weight: var(--fw-bold); letter-spacing: .04em; }
.jn-teaser-copy strong { font-size: var(--fs-body); font-weight: var(--fw-bold); line-height: 1.45; overflow-wrap: anywhere; }
.jn-teaser-sub { color: var(--text-3); font-size: var(--fs-sub); line-height: 1.5; }
.jn-teaser-sub:empty { display: none; }
.jn-teaser-go { color: var(--text-3); font-size: 22px; font-weight: var(--fw-regular); }

/* ── 手帳：1日1ページ ── */
.jn-sheet {
  position: relative; background: var(--paper); border-radius: 22px; padding: 18px 18px 16px;
  border: 1px solid var(--line); box-shadow: 0 1px 0 var(--line), 0 10px 28px rgba(35, 44, 88, .07);
}
.jn-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.jn-date { display: flex; align-items: center; gap: 12px; }
.jn-day { font-size: 46px; line-height: 1; color: var(--tone-journal); font-weight: var(--fw-regular); font-variant-numeric: tabular-nums; }
.jn-date-sub { display: flex; flex-direction: column; gap: 2px; }
.jn-date-sub b { font-size: var(--fs-section); font-weight: var(--fw-bold); }
.jn-date-sub small { font-size: var(--fs-caption); color: var(--text-3); }
.jn-buddy { width: 52px; height: 52px; flex: none; }
.jn-sheet input.jn-title, .jn-sheet textarea.jn-text {
  display: block; width: 100%; box-sizing: border-box; border: 0; background: transparent; color: var(--text);
  font-family: var(--font); padding: 0; border-radius: 0; outline: none;
}
.jn-sheet input.jn-title { font-size: 20px; font-weight: var(--fw-bold); line-height: 1.5; padding: 6px 0 8px; border-bottom: 1px solid var(--paper-line); }
.jn-title::placeholder, .jn-text::placeholder { color: color-mix(in srgb, var(--text-3) 70%, transparent); font-weight: var(--fw-regular); }
.jn-text-wrap { margin-top: 4px; }
.jn-text {
  font-size: 17px; font-weight: var(--fw-regular); line-height: 32px; min-height: 160px; resize: none; padding-top: 2px;
  background-attachment: local;
}
.jn-sheet[data-paper='lined'] .jn-text { background-image: repeating-linear-gradient(to bottom, transparent 0 31px, var(--paper-line) 31px 32px); }
.jn-sheet[data-paper='grid'] .jn-text { background-image: linear-gradient(var(--paper-line) 1px, transparent 1px), linear-gradient(90deg, var(--paper-line) 1px, transparent 1px); background-size: 16px 16px; background-position: 0 -1px; }
.jn-title:focus-visible, .jn-text:focus-visible { box-shadow: 0 2px 0 var(--accent); }
.jn-bar { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.jn-status { flex: 1 1 160px; font-size: var(--fs-sub); color: var(--text-3); min-height: 1.4em; }
.jn-status[data-state='dirty'] { color: var(--tone-journal); }
.jn-status[data-state='error'] { color: var(--danger, #c0392b); font-weight: var(--fw-bold); }
.jn-status[data-state='saved']::before { content: '✓ '; color: var(--tone-task); }
.jn-count { font-size: var(--fs-caption); color: var(--text-3); font-variant-numeric: tabular-nums; }
.jn-save { min-height: 44px; min-width: 88px; }
.jn-save:disabled { opacity: .45; }
.jn-photo { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--paper-line); display: grid; gap: 8px; }
.jn-label { margin: 0; font-size: var(--fs-caption); font-weight: var(--fw-bold); color: var(--tone-journal); letter-spacing: .04em; }
.jn-photo .photo-thumb { max-width: 100%; border-radius: 14px; display: block; }
.jn-section { margin-top: 22px; }
.jn-h2 { font-size: var(--fs-section); font-weight: var(--fw-bold); margin: 0 2px 10px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.jn-h2 small { font-size: var(--fs-caption); font-weight: var(--fw-regular); color: var(--text-3); }
.jn-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.jn-chip { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 8px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: var(--fs-sub); color: var(--text-2); }
.jn-chip b { font-size: 17px; font-weight: var(--fw-bold); color: var(--text); font-variant-numeric: tabular-nums; }
button.jn-chip { cursor: pointer; font: inherit; }
.jn-rec { background: var(--card); border-radius: 18px; padding: 12px 14px; margin-bottom: 10px; border: 1px solid var(--line); border-left: 4px solid var(--tone, var(--line)); }
.jn-rec.tone-meal { --tone: var(--tone-meal); } .jn-rec.tone-workout { --tone: var(--tone-workout); } .jn-rec.tone-mood { --tone: var(--tone-mood); }
.jn-rec.tone-task { --tone: var(--tone-task); } .jn-rec.tone-activity { --tone: var(--text-3); }
.jn-rec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.jn-rec-head h3 { margin: 0; font-size: var(--fs-body); font-weight: var(--fw-bold); }
.jn-edit { border: 0; background: none; color: var(--accent); font: inherit; font-size: var(--fs-sub); font-weight: var(--fw-bold); min-height: 44px; padding: 0 4px 0 12px; cursor: pointer; }
.jn-num { margin: 2px 0 6px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; }
.jn-num b { font-size: 26px; font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.jn-pfc { font-size: var(--fs-sub); color: var(--text-2); }
.jn-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.jn-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: baseline; font-size: var(--fs-body); line-height: 1.5; }
.jn-list li:not(:has(.jn-k)) { grid-template-columns: minmax(0, 1fr) auto; }
.jn-k { font-size: var(--fs-sub); color: var(--text-3); white-space: nowrap; }
.jn-v { overflow-wrap: anywhere; }
.jn-n { font-size: var(--fs-sub); color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.jn-list li.is-planned .jn-v, .jn-list li.is-planned .jn-n { color: var(--text-3); }
.jn-list.jn-tasks li { grid-template-columns: 24px minmax(0, 1fr) auto; }
.jn-list.jn-stack li { grid-template-columns: minmax(0, 1fr); gap: 0; }
.jn-list.jn-stack .jn-n { white-space: normal; }
.jn-check { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line); display: inline-grid; place-items: center; font-size: 13px; color: #fff; }
.jn-tasks li.is-done .jn-check { background: var(--tone-task); border-color: var(--tone-task); }
.jn-tasks li.is-done .jn-v { color: var(--text-3); text-decoration: line-through; }
.jn-moods { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.jn-moods li { display: grid; grid-template-columns: 48px 28px minmax(0, 1fr); align-items: center; gap: 6px; }
.jn-moods time { font-size: var(--fs-sub); color: var(--text-3); font-variant-numeric: tabular-nums; }
.jn-mood-emoji { font-size: 22px; }
.jn-moods small { display: block; color: var(--text-2); font-size: var(--fs-sub); }
.jn-note { margin: 8px 0 0; font-size: var(--fs-caption); color: var(--text-3); line-height: 1.6; }
.jn-empty { margin: 4px 0 0; color: var(--text-3); font-size: var(--fs-sub); line-height: 1.6; }
.jn-days { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.jn-day-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; width: 100%; text-align: left; align-items: start; border: 1px solid var(--line); background: var(--paper); border-radius: 16px; padding: 12px 14px; min-height: 56px; font: inherit; color: var(--text); cursor: pointer; }
.jn-day-date { font-size: var(--fs-sub); color: var(--tone-journal); font-weight: var(--fw-bold); }
.jn-day-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.jn-day-copy b { font-weight: var(--fw-bold); overflow-wrap: anywhere; }
.jn-day-copy small { color: var(--text-3); font-size: var(--fs-sub); overflow-wrap: anywhere; }
.jn-paper-seg { max-width: 320px; }

/* ── ＋記録のシート ── */
.rs-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 4px 0 8px; }
.rs-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 96px; padding: 12px 6px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 3px 0 var(--line); color: var(--text); font: inherit; cursor: pointer; text-align: center; }
.rs-item:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.rs-emoji { font-size: 30px; line-height: 1; }
.rs-label { font-size: 16px; font-weight: var(--fw-regular); }
.rs-hint { font-size: 11px; color: var(--text-3); line-height: 1.35; }
.rs-note { font-size: var(--fs-sub); color: var(--text-2); line-height: 1.6; margin: 6px 2px 0; }
@media (max-width: 340px) { .rs-grid { gap: 8px; } .rs-item { min-height: 88px; } .rs-hint { display: none; } }

/* ── 下のタブ：「＋」は画面ではなく操作（ボタン）。押したら開くことが分かる形 ── */
button.tab { font: inherit; cursor: pointer; }
.tab-plus[aria-current='page'] { background: none; }
@media (prefers-reduced-motion: reduce) { .rs-item:active { transform: none; } }

/* ── 各画面の上の帯：画面の名前と一言だけの小さな帯にする（入力を下へ押し出さない） ── */
.record-intro, .hx-hero { grid-template-columns: minmax(0, 1fr) 56px; min-height: 0; padding: 10px 14px; margin: 0 0 12px; border-radius: 18px; box-shadow: none; }
.record-intro strong, .hx-hero h2 { font-size: var(--fs-section); font-weight: var(--fw-bold); margin: 0; line-height: 1.4; }
.record-intro p, .hx-hero p { font-size: var(--fs-caption); line-height: 1.5; margin: 2px 0 0; font-weight: var(--fw-regular); }
.hx-hero small { font-size: var(--fs-caption); font-weight: var(--fw-bold); }
.record-buddy, .hx-hero-buddy { width: 56px; height: 56px; animation: none; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .25)); }
.profile-hero { padding: 12px 14px; gap: 10px; border-radius: 18px; box-shadow: none; }
.profile-mascot { width: 64px; height: 64px; animation: none; }
.profile-hero h2 { font-size: var(--fs-section); margin: 2px 0; }
.profile-hero p { font-size: var(--fs-caption); }
.page-guide { padding: 10px 12px; }
.page-guide img { width: 36px; height: 36px; }
.page-guide li { font-size: var(--fs-sub); line-height: 1.55; }
.hx-found-label { margin: 10px 2px 4px; font-size: var(--fs-caption); font-weight: var(--fw-bold); color: var(--tone-journal); }
.cal-day .dots i.cal-dot-journal, .cal-legend i.cal-dot-journal { background: var(--tone-journal); border-radius: 2px; }
.day-anytime { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: var(--fs-sub); color: var(--text-2); cursor: pointer; }
.day-anytime input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }

/* ── 手帳：本文の下の見出し・文章・チェック ── */
.jn-blocks { display: grid; gap: 6px; margin-top: 6px; }
.jn-blocks:empty { display: none; }
.jn-block { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 2px 0; border-bottom: 1px dashed var(--paper-line); }
.jn-block.is-check { grid-template-columns: 28px minmax(0, 1fr) auto; }
.jn-sheet .jn-block-input { border: 0; background: transparent; color: var(--text); font: inherit; font-size: var(--fs-body); line-height: 1.6; padding: 8px 0; width: 100%; box-sizing: border-box; border-radius: 0; resize: vertical; min-height: 40px; outline: none; }
.jn-sheet .jn-block-input.is-heading { font-size: var(--fs-section); font-weight: var(--fw-bold); }
.jn-block-input:focus-visible { box-shadow: 0 2px 0 var(--accent); }
.jn-block-check { width: 22px; height: 22px; accent-color: var(--tone-task); }
.jn-block.is-check:has(.jn-block-check:checked) .jn-block-input { color: var(--text-3); text-decoration: line-through; }
.jn-block-tools { display: flex; gap: 2px; }
.jn-block-btn { min-width: 36px; min-height: 44px; border: 0; background: none; color: var(--text-3); font: inherit; font-size: 15px; border-radius: 10px; cursor: pointer; }
.jn-block-btn:disabled { opacity: .3; }
.jn-block-btn:not(:disabled):active { background: var(--accent-soft); }
.jn-block-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.jn-add-btn { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px dashed var(--line); background: transparent; color: var(--text-2); font: inherit; font-size: var(--fs-sub); cursor: pointer; }
.jn-add-btn:active { background: var(--accent-soft); }

/* ── 手帳：過去の同じ日・週のふり返り・印刷 ── */
.jn-earlier .jn-day-date { display: flex; flex-direction: column; gap: 2px; }
.jn-earlier .jn-day-date small { font-weight: var(--fw-regular); color: var(--text-3); font-size: var(--fs-caption); }
.jn-week { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; }
.jn-week > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; margin: 0; list-style: none; }
.jn-week > summary::-webkit-details-marker { display: none; }
.jn-week > summary::after { content: '›'; margin-left: auto; color: var(--text-3); transform: rotate(90deg); transition: transform .15s; }
.jn-week[open] > summary::after { transform: rotate(-90deg); }
.jn-week-facts { margin: 4px 0 10px; font-size: var(--fs-sub); color: var(--text-2); }
.jn-week-field { display: grid; gap: 4px; margin-bottom: 10px; font-size: var(--fs-sub); color: var(--text-2); font-weight: var(--fw-bold); }
.jn-week-input { font-size: var(--fs-body); font-weight: var(--fw-regular); line-height: 1.6; resize: vertical; }
.jn-print-row { margin-top: 12px; }
.jn-print { display: none; }
@media print {
  html.is-printing body > *:not(.jn-print) { display: none !important; }
  html.is-printing .jn-print { display: block; color: #000; background: #fff; font-family: var(--font); font-size: 11pt; line-height: 1.8; padding: 0; }
  .jn-print h1 { font-size: 16pt; margin: 0 0 4pt; }
  .jn-print h2 { font-size: 13pt; margin: 0 0 8pt; }
  .jn-print h3 { font-size: 12pt; margin: 10pt 0 2pt; }
  .jn-print p { margin: 0 0 6pt; white-space: pre-wrap; }
  .jn-print img { max-width: 60%; max-height: 8cm; border-radius: 6pt; }
  .jn-print figcaption { font-size: 9pt; color: #444; }
  .jn-print .jn-rec { border: 1px solid #ccc; break-inside: avoid; }
}
.cal-day .dots i.cal-dot-plan, .cal-legend i.cal-dot-plan { background: transparent; box-shadow: inset 0 0 0 1.5px var(--tone-task); }

/* ── 相棒（参考画像に合わせた形：自分の雲の上にいるので、地面の影は出さない） ── */
.mx-stage-main { grid-template-columns: 124px minmax(0, 1fr); }
.mx-stage .mx-buddy { width: 120px; height: 120px; }
.mx-stage .mx-buddy-shadow { display: none; }
.mx-buddy-hand { bottom: 36px; right: -8px; }
.mx-buddy-hat { top: -10px; }

/* ── 道具のタイマー ── */
.tool-dock { position: fixed; left: max(12px, env(safe-area-inset-left)); bottom: calc(var(--tabbar-h, 64px) + env(safe-area-inset-bottom, 0px) + 14px); z-index: 55;
  min-height: 44px; padding: 0 16px; border-radius: 999px; border: 2px solid rgba(255,255,255,.2); background: #1d2550; color: #fff;
  font: inherit; font-size: 16px; font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; box-shadow: 0 8px 22px rgba(0,0,0,.25); cursor: pointer; }
.tool-dock.is-due { background: #d9534f; animation: tm-pulse 1s ease-in-out infinite; }
@keyframes tm-pulse { 50% { box-shadow: 0 0 0 8px rgba(217, 83, 79, .25), 0 8px 22px rgba(0,0,0,.25); } }
body:has(.sheet-backdrop) .tool-dock { display: none; }
.seg.tm-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.tm-tabs button { font-size: 14px; min-height: 44px; }
.tm-main { display: grid; gap: 12px; padding: 14px 0 8px; text-align: center; }
.tm-display { margin: 6px 0 0; font-size: 56px; font-weight: var(--fw-bold); letter-spacing: .02em; font-variant-numeric: tabular-nums; line-height: 1.1; color: var(--text); }
.tm-display.is-small { font-size: var(--fs-section); color: var(--text-3); font-weight: var(--fw-regular); }
.tm-sub { margin: 0; font-size: var(--fs-sub); color: var(--text-2); }
.tm-phase { margin: 0; font-size: var(--fs-section); font-weight: var(--fw-bold); color: var(--tone-meal); }
.tm-phase.is-break, .tm-phase.is-long { color: var(--tone-task); }
.tm-link { margin: 0; font-size: var(--fs-sub); color: var(--text-2); }
.tm-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.tm-row .btn { min-height: 48px; min-width: 96px; }
.tm-main-btn { min-width: 140px; font-size: 18px; }
.tm-chips { justify-content: center; }
.tm-custom-row { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: var(--fs-sub); color: var(--text-2); }
.tm-custom { width: 88px; text-align: center; }
.tm-field { display: grid; gap: 4px; text-align: left; font-size: var(--fs-sub); color: var(--text-2); }
.tm-note { margin: 4px 0 0; font-size: var(--fs-caption); line-height: 1.6; color: var(--text-3); text-align: left; }
.tm-record { text-align: left; background: var(--card-2); border-radius: 16px; padding: 12px; display: grid; gap: 8px; }
.tm-record-title { margin: 0; font-size: var(--fs-sub); font-weight: var(--fw-bold); }
.tm-record-fields { justify-content: stretch; flex-wrap: nowrap; }
.tm-record-fields > * { flex: 1 1 0; min-width: 0; }
.tm-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.mx-task-timer { flex: none; min-width: 44px; min-height: 44px; border: 0; border-radius: 12px; background: transparent; font-size: 20px; cursor: pointer; }
.mx-task-timer:active { background: var(--accent-soft); }
.set-sw { min-width: 52px; min-height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-size: 14px; font-variant-numeric: tabular-nums; cursor: pointer; }
.set-sw.is-running { background: var(--tone-workout); color: #fff; border-color: transparent; }
.kc-step-timer { margin-left: 8px; min-height: 44px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--accent); font: inherit; font-size: 14px; font-weight: var(--fw-bold); cursor: pointer; vertical-align: middle; }
.df-measure { justify-self: start; }
@media (prefers-reduced-motion: reduce) { .tool-dock.is-due { animation: none; } }

/* ── カレンダー：月・週・予定 ── */
.cal-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 10px; }
.cal-tabs button { min-height: 44px; }
.cal-note { margin: 10px 2px 0; font-size: var(--fs-caption); color: var(--text-3); line-height: 1.6; }
.wk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.wk-day-btn { display: grid; grid-template-columns: 48px minmax(0, 1fr) 16px; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.wk-day.is-today .wk-day-btn { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.wk-date { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.wk-date b { font-size: 22px; font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.wk-date small { font-size: var(--fs-caption); color: var(--text-3); }
.wk-day.is-sun .wk-date { color: #d0485a; } .wk-day.is-sat .wk-date { color: #3d6fd3; }
.wk-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.wk-journal { font-size: var(--fs-sub); font-weight: var(--fw-bold); color: var(--tone-journal); overflow-wrap: anywhere; }
.wk-tasks { display: flex; flex-direction: column; gap: 1px; }
.wk-task { font-size: var(--fs-sub); overflow-wrap: anywhere; }
.wk-task.is-done { color: var(--text-3); }
.wk-more, .wk-facts, .wk-empty { font-size: var(--fs-caption); color: var(--text-3); }
.wk-go { color: var(--text-3); }
.ag-add-wrap { margin-bottom: 12px; }
.ag-add-wrap > summary { min-height: 44px; display: flex; align-items: center; font-weight: var(--fw-bold); color: var(--accent); cursor: pointer; }
.ag-add { display: grid; gap: 8px; }
.ag-add-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px auto; gap: 8px; }
.ag-h { margin: 0 0 6px; font-size: var(--fs-body); font-weight: var(--fw-bold); display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.ag-h small { font-size: var(--fs-caption); font-weight: var(--fw-regular); color: var(--text-3); }
.ag-overdue { background: color-mix(in srgb, #f0a43a 12%, var(--card)); border-radius: 14px; padding: 10px 12px; margin-bottom: 12px; }
.ag-days { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ag-day-head { display: flex; align-items: baseline; gap: 8px; min-height: 40px; border: 0; background: none; padding: 0; font: inherit; color: var(--text); cursor: pointer; }
.ag-day-head b { font-size: var(--fs-body); font-weight: var(--fw-bold); }
.ag-day-head small { font-size: var(--fs-caption); color: var(--text-3); }
.ag-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ag-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 44px; padding: 2px 4px 2px 10px; border-radius: 12px; background: var(--card); border-left: 3px solid var(--tone-task); }
.ag-item.is-plan { border-left-color: var(--tone-workout); }
.ag-when { font-size: var(--fs-sub); color: var(--text-3); font-variant-numeric: tabular-nums; }
.ag-title { font-size: var(--fs-body); overflow-wrap: anywhere; }
.ag-actions { display: flex; gap: 4px; }
.ag-actions .btn { min-height: 40px; }

/* ── 相棒の絵（表情＋きせかえを重ねる。ui/buddy.ts）── */
.bd-fig { position: relative; display: inline-block; line-height: 0; vertical-align: middle; }
.bd-fig .bd-base { display: block; width: 100%; height: 100%; }
.bd-layers { position: absolute; inset: 0; pointer-events: none; }
.bd-layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.mx-stage .bd-fig.mx-buddy { display: block; }
.rw-preview { display: flex; align-items: center; gap: 12px; margin: 4px 0 10px; padding: 8px 12px; border-radius: 20px; background: linear-gradient(160deg, #2d3a8c, #4a5fd0); color: #fff; }
.rw-preview .bd-fig { width: 104px; height: 104px; flex: none; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .3)); }
.rw-preview p { margin: 0; font-size: var(--fs-caption); line-height: 1.6; color: #e6e9ff; }
.rw-preview p b { display: block; font-size: var(--fs-body); color: #fff; }
.lv-card .bd-fig { width: 120px; height: 120px; }

/* ── お祝い：画面いっぱいの紙吹雪（ui/fx.ts confettiRain）と、相棒のほめ言葉（ui/cheer.ts）── */
.fx-rain { position: fixed; inset: 0; z-index: 180; pointer-events: none; overflow: hidden; }
.fx-rain i { position: absolute; top: -24px; width: 9px; height: 14px; border-radius: 3px; opacity: 0; animation: fx-rain 2s cubic-bezier(.25, .6, .4, 1) forwards; }
.fx-rain i.is-round { width: 10px; height: 10px; border-radius: 50%; }
@keyframes fx-rain {
  0% { opacity: 1; transform: translate(0, 0) rotate(0); }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--drift), 105vh) rotate(var(--spin)); }
}
.ch-pop { position: fixed; z-index: 170; left: 12px; right: 12px; bottom: calc(96px + env(safe-area-inset-bottom)); display: flex; align-items: flex-end; gap: 6px; pointer-events: none; max-width: 520px; margin: 0 auto;
  animation: ch-in .55s cubic-bezier(.2, 1.5, .4, 1) both; }
.ch-pop.is-out { animation: ch-out .35s ease-in forwards; }
.ch-pop .bd-fig { width: 92px; height: 92px; flex: none; filter: drop-shadow(0 10px 12px rgba(20, 28, 80, .35)); animation: mx-hop .62s var(--ease) .25s 2; }
.ch-bubble { position: relative; margin-bottom: 30px; padding: 12px 16px; border-radius: 20px; background: #fff; color: #26306b; font-size: var(--fs-body); font-weight: var(--fw-bold); line-height: 1.5;
  box-shadow: 0 10px 30px rgba(30, 40, 110, .28); border: 2px solid #e6e9fb; }
.ch-bubble::before { content: ''; position: absolute; left: -9px; bottom: 16px; width: 16px; height: 16px; background: #fff; border-left: 2px solid #e6e9fb; border-bottom: 2px solid #e6e9fb; transform: rotate(45deg); }
.ch-pop.is-big .ch-bubble { background: linear-gradient(135deg, #fff7d6, #ffe3ef); font-size: var(--fs-section); }
.ch-pop.is-big .ch-bubble::before { background: #fff3db; }
@keyframes ch-in { from { opacity: 0; transform: translateY(70px) scale(.8); } }
@keyframes ch-out { to { opacity: 0; transform: translateY(40px) scale(.9); } }
@media (prefers-reduced-motion: reduce) { .ch-pop, .ch-pop .bd-fig, .ch-pop.is-out { animation: none; } }
.rw-preview .bd-fig.is-hop { animation: mx-hop .62s var(--ease) 1; }
/* 今日のクエスト達成の赤い星（ホームのいちばん上） */
.mx-quest-star { display: inline-grid; place-items: center; min-width: 44px; height: 44px; margin-left: auto; margin-right: 8px; padding: 0 10px; border: 0; border-radius: 22px; background: rgba(255, 255, 255, .14); color: #ff4d5e; font-size: 26px; line-height: 1; cursor: pointer;
  text-shadow: 0 0 10px rgba(255, 77, 94, .7); animation: mx-star-in .6s cubic-bezier(.2, 1.6, .4, 1); }
.mx-quest-star small { display: none; }
@keyframes mx-star-in { from { transform: scale(0) rotate(-120deg); } }
@media (prefers-reduced-motion: reduce) { .mx-quest-star { animation: none; } }
.rw-adv-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; margin-top: 8px; padding: 8px 12px; border-radius: 14px; background: #fff6dc; color: #7a4d00; font-size: var(--fs-caption); font-weight: var(--fw-bold); text-decoration: none; }
html[data-theme="dark"] .rw-adv-link { background: #3b3220; color: #ffd98a; }
.sl-latest { display: flex; align-items: center; gap: 12px; min-height: 56px; margin: 4px 0 12px; padding: 10px 14px; border-radius: 16px; background: color-mix(in srgb, #657ac9 12%, transparent); color: inherit; text-decoration: none; }
.sl-latest > span:nth-child(2) { display: flex; flex-direction: column; flex: 1; }
.sl-latest small { color: var(--text-3); font-size: var(--fs-caption); }
.sl-latest > span > b { font-size: var(--fs-section); font-weight: var(--fw-bold); }
.sl-latest > span[aria-hidden] { font-size: 26px; }

/* 下のタブを、見えている画面の下にとどめる（iPhone で固定がずれたときの補正。ui/viewportFix.ts） */
.tabbar, .tool-dock, .toast-host, .ch-pop { translate: 0 var(--bar-shift, 0px); }
/* キーボードが出ている間は下のタブを隠す */
html.kb-open .tabbar, html.kb-open .tool-dock { visibility: hidden; }

/* ── 並びと表示を変える（views/layoutEditor.ts）── */
.le-note { margin: 0 2px 10px; }
.le-row { display: grid; grid-template-columns: 28px 1fr auto auto auto; align-items: center; gap: 6px; }
.le-icon { display: inline-grid; place-items: center; color: var(--accent); }
.le-name { font-weight: var(--fw-bold); }
.le-lock { min-width: 56px; text-align: center; font-size: var(--fs-caption); color: var(--text-3); }
.le-h { margin: 16px 2px 6px; font-size: var(--fs-sub); font-weight: var(--fw-bold); color: var(--text-2); }
.le-add { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.le-add-btn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 52px; padding: 8px 12px; border: 1.5px dashed var(--sep); border-radius: 14px; background: var(--card); color: var(--text); text-align: left; cursor: pointer; }
.le-add-btn .icon { color: var(--accent); flex: none; }
.le-add-btn span { display: flex; flex-direction: column; min-width: 0; }
.le-add-btn small { color: var(--text-3); font-size: var(--fs-caption); }
.le-entry { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 18px 0 6px; }
.le-entry-btn { min-height: 44px; padding: 8px 14px; border: 1px solid var(--sep); border-radius: 999px; background: var(--card); color: var(--accent); font-size: var(--fs-sub); font-weight: var(--fw-bold); cursor: pointer; }
.profile-tabs-edit { width: 100%; border: 0; text-align: left; font: inherit; cursor: pointer; margin-top: 10px; }
.tabbar[data-count="6"] .tab { font-size: 9.5px; }
.tabbar[data-count="2"], .tabbar[data-count="3"] { max-width: 420px; }

/* ── 日記の型・スタンプ・ふり返り ── */
.jn-presets { display: flex; gap: 8px; overflow-x: auto; margin: 10px -4px 4px; padding: 2px 4px 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.jn-presets::-webkit-scrollbar { display: none; }
.jn-preset { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px; border: 1px solid var(--sep); border-radius: 999px; background: var(--card); color: var(--text); font-size: var(--fs-sub); font-weight: var(--fw-bold); cursor: pointer; white-space: nowrap; }
.jn-preset.is-default { border-color: var(--tone-journal); box-shadow: inset 0 0 0 1px var(--tone-journal); }
.jn-preset.is-manage { color: var(--accent); }
.jn-stamps { margin: 6px 0 4px; }
.jn-stamps > summary { min-height: 40px; display: flex; align-items: center; cursor: pointer; color: var(--text-2); font-size: var(--fs-sub); font-weight: var(--fw-bold); }
.jn-stamp-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.jn-stamp { min-width: 44px; min-height: 44px; border: 1px solid var(--sep); border-radius: 12px; background: var(--card); font-size: 22px; cursor: pointer; }
.jn-stamp.is-tag { font-size: var(--fs-sub); font-weight: var(--fw-bold); color: var(--accent); padding: 0 12px; }
.jn-h2-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.jn-preset-list { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 8px; }
.jn-preset-list li { display: grid; grid-template-columns: 34px 1fr auto auto; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--sep); border-radius: 14px; background: var(--card); }
.jn-preset-emoji-big { font-size: 24px; text-align: center; }
.jn-preset-copy { display: flex; flex-direction: column; min-width: 0; }
.jn-preset-copy small { color: var(--text-3); font-size: var(--fs-caption); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jn-preset-save { display: grid; grid-template-columns: 56px 1fr auto; gap: 8px; align-items: center; }
.jn-preset-save p { grid-column: 1 / -1; margin: 0; }
.jn-preset-emoji { text-align: center; }
.jl-kind { margin-bottom: 6px; }
.jl-nav { margin: 4px 0 10px; }
.jl-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.jl-stats > div { display: flex; flex-direction: column; align-items: center; padding: 10px 6px; border-radius: 14px; background: color-mix(in srgb, var(--tone-journal) 16%, var(--card)); }
.jl-stats small { color: var(--text-3); font-size: var(--fs-caption); }
.jl-stats b { font-size: var(--fs-section); font-weight: var(--fw-bold); }
.jl-sec { margin: 14px 0; }
.jl-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin: 0 0 8px; font-size: var(--fs-body); font-weight: var(--fw-bold); }
.jl-h small { color: var(--text-3); font-size: var(--fs-caption); font-weight: var(--fw-regular); }
.jl-words { display: flex; flex-wrap: wrap; gap: 6px; }
.jl-word { display: inline-flex; align-items: baseline; gap: 4px; min-height: 40px; padding: 6px 12px; border: 1px solid var(--sep); border-radius: 999px; background: var(--card); color: var(--text); font-size: calc(var(--fs-sub) * var(--w, 1)); font-weight: var(--fw-bold); cursor: pointer; }
.jl-word small { color: var(--text-3); font-size: var(--fs-caption); font-weight: var(--fw-regular); }
.jl-word[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.jl-word[aria-pressed="true"] small { color: #e8ebff; }
.jl-word.is-rising { border-color: color-mix(in srgb, #ff8a4c 50%, var(--sep)); }
.jl-word.is-tag { color: var(--accent); }
.jl-themes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.jl-themes li { display: grid; grid-template-columns: 9.5em 1fr 3em; align-items: center; gap: 8px; font-size: var(--fs-sub); }
.jl-themes i { display: block; height: 10px; border-radius: 6px; background: color-mix(in srgb, var(--text-3) 15%, transparent); overflow: hidden; }
.jl-themes i b { display: block; height: 100%; border-radius: 6px; background: var(--tone-journal); }
.jl-themes small { text-align: right; color: var(--text-3); }
.jl-clear { margin-left: auto; min-height: 36px; padding: 4px 10px; border: 1px solid var(--sep); border-radius: 999px; background: var(--card); color: var(--accent); font-size: var(--fs-caption); cursor: pointer; }

/* ── 使い方を選ぶ（views/usagePicker.ts）── */
.mx-hint-pick { display: inline-flex; align-items: center; min-height: 44px; margin-top: 6px; padding: 4px 0; border: 0; background: none; color: var(--accent); font-size: var(--fs-sub); font-weight: var(--fw-bold); cursor: pointer; }
.up-list { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 8px; }
.up-item { display: grid; grid-template-columns: 36px 1fr 28px; align-items: center; gap: 10px; width: 100%; min-height: 64px; padding: 10px 12px; border: 1.5px solid var(--sep); border-radius: 16px; background: var(--card); color: var(--text); text-align: left; cursor: pointer; }
.up-item[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.up-emoji { font-size: 26px; text-align: center; }
.up-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.up-copy small { color: var(--text-3); font-size: var(--fs-caption); line-height: 1.4; }
.up-check { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--sep); color: #fff; font-size: 14px; }
.up-item[aria-pressed="true"] .up-check { background: var(--accent); border-color: var(--accent); }
.up-actions { display: grid; gap: 8px; margin: 14px 0 6px; }
.up-preview { display: flex; justify-content: space-around; gap: 4px; margin: 10px 0; padding: 10px 6px; border-radius: 20px; background: var(--card); box-shadow: 0 0 0 1px var(--sep); }
.up-preview span { display: flex; flex-direction: column; align-items: center; min-width: 0; flex: 1; font-size: 20px; color: var(--accent); }
.up-preview small { font-size: 10px; color: var(--text-2); white-space: nowrap; }
.up-changes { margin: 8px 0; padding-left: 1.2em; display: grid; gap: 6px; font-size: var(--fs-sub); line-height: 1.6; }

/* ── 場所と器具（設定）── */
.place-tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.place-unset { margin: 8px 0; padding: 8px 12px; border-radius: 12px; background: color-mix(in srgb, #ffb84d 20%, var(--card)); font-size: var(--fs-sub); line-height: 1.6; }
.place-templates { display: flex; flex-wrap: wrap; gap: 6px; }
.place-new { padding-top: 4px; border-top: 1px dashed var(--sep); }

/* 相棒をホームに出さない設定（ui.home.v1）。あいさつ・数字・入口はそのまま */
.mx-stage[data-buddy="off"] .mx-stage-main { display: none; }
.mx-quick-item[hidden] { display: none; }

/* 浮いた下のタブの下の隙間：スクロール中の内容が透けて見えないよう、タブの下を背景色で埋める（画面の下端まで） */
.tabbar::after { content: ''; position: absolute; z-index: -1; left: -14px; right: -14px; top: calc(100% - 6px); height: 80px; background: var(--bg); pointer-events: none; }

/* 入力を開いている記録画面：絞り込みは横1列のチップ（縦に場所を取らない） */
.record-category-nav.rc-grid.is-compact { display: flex; gap: 8px; overflow-x: auto; margin: 0 -4px 12px; padding: 2px 4px 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.record-category-nav.rc-grid.is-compact::-webkit-scrollbar { display: none; }
.record-category-nav.is-compact .rc-tile { flex: none; flex-direction: row; min-height: 44px; padding: 6px 14px !important; gap: 6px; }
.record-category-nav.is-compact .rc-tile .rc-emoji { font-size: 18px; }

/* 筋トレ日の選択（やる／おやすみ／かるめ）：ひと回り小さく（ラベルの説明は残す）。選ぶ操作は変えない */
.wx-daytype-btn { min-height: 68px !important; padding: 6px 4px !important; gap: 0 !important; }
.wx-daytype-emoji { font-size: 22px; }
.wx-daytype-btn b { font-size: var(--fs-sub); font-weight: var(--fw-bold); }
.wx-daytype-q { font-size: var(--fs-body); font-weight: var(--fw-bold); }
.settings-find { margin: 4px 0 12px; }
.settings-group[hidden] { display: none; }

/* 初回ガイドは入力の場所をふさがず、必要なときだけ読む。 */
.page-guide-details { flex: 1; min-width: 0; }
.page-guide-details summary { min-height: 44px; display: flex; align-items: center; gap: var(--space-2); cursor: pointer; font-size: var(--fs-sub); font-weight: var(--fw-medium); }
.page-guide-details summary::before { content: '＋'; }
.page-guide-details[open] summary::before { content: '−'; }
.page-guide .mx-hint-close { min-width: 44px; min-height: 44px; }
.page-guide ul { font-weight: var(--fw-regular); }

/* 種目選択：記録に追加する前から確認済み動作図を表示する。 */
.picker-exercise-art { display: flex; width: 100%; gap: var(--space-2); margin-block: var(--space-2); }
.picker-art-frame { display: block; flex: 1; min-width: 0; position: relative; overflow: hidden; background: #fff; border-radius: var(--space-1); }
