/* スマホでの記録を最優先にしたスタイル。
   トレーニング中に片手で操作するため、ボタンは大きく、1画面の情報は少なくする。
   基本は1カラム、操作は下部タブ。PCでは中央に寄せて幅を制限する。 */

:root {
  /* 黒を基調にした、すりガラスの見た目（2026-11-13〜）。
     面（--surface）は半透明の白で、奥の光がぼんやり透ける */
  --bg: #0b0b0c;
  --surface: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.13);
  --text: #f2f2ee;
  --muted: #a6a6ae;
  --faint: #8a8a93;

  /* 文字の白。バッジなどの「主役ではない強調」に使う */
  --primary: #f2f2ee;
  --primary-dark: #ffffff;
  --primary-soft: rgba(255, 255, 255, 0.1);

  /* 差し色は1色だけ（ライム）。上に乗る文字は黒（--on-accent） */
  --accent: #d7ff3d;
  --accent-dark: #d7ff3d;
  --accent-soft: rgba(215, 255, 61, 0.12);
  --on-accent: #0b0b0c;

  --up: #d7ff3d;        /* 重量が上がるとき */
  --up-soft: rgba(215, 255, 61, 0.14);
  --keep: #f2f2ee;      /* 重量を維持するとき */
  --keep-soft: rgba(255, 255, 255, 0.1);
  --down: #f0b35a;      /* 重量を下げるとき */
  --down-soft: rgba(240, 179, 90, 0.14);
  --danger: #ff7a85;
  --danger-soft: rgba(255, 122, 133, 0.14);

  --radius: 20px;
  --shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  --glass-blur: blur(22px) saturate(160%);

  /* 数字用の細い書体。iPhone・Mac では標準の書体（SF）の細字になる */
  --num-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Helvetica Neue", "Hiragino Sans", "Noto Sans JP", sans-serif;

  /* 下部タブの高さ（iPhoneのホームバー分を足す）。タブは画面から浮かせるので、そのぶんの余白も含む */
  --tabbar-h: calc(92px + env(safe-area-inset-bottom, 0px));
}

* { box-sizing: border-box; }

/* hidden 属性を必ず効かせる。
   .btn-primary { display:inline-flex } のような指定があると、
   ブラウザ標準の [hidden]{display:none} が打ち消されて消えなくなるため。 */
[hidden] { display: none !important; }

button,
summary {
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: var(--tabbar-h);
}

.sprite { display: none; }

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* ===== ヘッダー ===== */

.header {
  background: var(--primary);
  color: #fff;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px 14px;
}

.header-inner {
  max-width: 560px;
  margin: 0 auto;
}

.header h1 {
  margin: 0;
  font-size: 17px;
  letter-spacing: 0.08em;
}

.header-sub {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.72);
}

/* ===== 全体の枠 ===== */

.container {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}

.card-title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 7px;
}

.card-title .icon { color: var(--muted); }

.section-note {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: var(--muted);
}

.empty {
  margin: 0;
  padding: 18px 0;
  text-align: center;
  color: var(--faint);
  font-size: 13px;
}

/* ===== 今日 ===== */

/* 記録する日の選択。過去の日をさかのぼって入れるときに使う */
.date-picker {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.date-field { flex: 1; margin-bottom: 0; }

.btn-back-today {
  padding: 11px 14px;
  font-size: 13px;
  white-space: nowrap;
}

.past-note {
  margin: 10px 0 0;
  padding: 9px 11px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-radius: 10px;
}

/* 記録の途中の内容があるときの案内。見落とさないよう、枠をオレンジにする */
.draft-card { border: 2px solid var(--accent); }
.draft-card .card-title .icon { color: var(--accent); }
.draft-card .section-note { font-size: 14px; color: var(--text); }
.draft-card .btn-ghost { margin-top: 6px; }

.today-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.today-date {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.today-menu {
  font-size: 13px;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--primary-soft);
  color: var(--primary);
}

.badge-place { background: var(--accent-soft); color: var(--accent-dark); }
.badge-rest { background: var(--keep-soft); color: var(--keep); }

/* 今日の種目一覧 */

.plan-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.plan-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.plan-item:first-child { border-top: none; }

.plan-name {
  font-size: 15px;
  font-weight: 500;
}

.plan-detail {
  font-size: 12.5px;
  color: var(--muted);
}

.plan-weight {
  font-size: 19px;
  font-weight: 500;
  white-space: nowrap;
}

.plan-weight span {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 2px;
}

/* ===== 体重 ===== */

.weight-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.weight-row .field { flex: 1; }

.weight-summary {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.stat {
  flex: 1;
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
}

.stat-value {
  display: block;
  font-size: 18px;
  font-weight: 500;
}

.stat-value small {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 1px;
}

/* ===== 入力 ===== */

.field {
  display: block;
  margin-bottom: 12px;
}

.field > span {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 5px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px;
  font-size: 16px; /* 16px未満だとスマホで自動拡大されるため下げない */
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  appearance: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field-inline {
  display: flex;
  gap: 10px;
}

.field-inline .field { flex: 1; }

.form-error {
  margin: 0 0 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--danger);
  background: var(--danger-soft);
  border-radius: 10px;
}

/* ===== 種目のひな形（選んで追加） ===== */

.preset-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 1件ぶん。左を押すと入力欄に入り、「くわしく」で説明と動画が開く */
.preset-item {
  border: 1px solid var(--border);
  border-radius: 11px;
  overflow: hidden;
  background: var(--surface);
}

.preset-row {
  display: flex;
  align-items: stretch;
}

.preset-main {
  display: block;
  flex: 1;
  min-width: 0;
  padding: 12px 13px;
  text-align: left;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: transparent;
  border: none;
  cursor: pointer;
}

/* 説明を開くボタン。押し間違いを避けるため、登録する側とは分けてある */
.preset-more {
  flex: none;
  padding: 0 13px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
}

.preset-more:active { background: var(--bg); }

.preset-extra {
  padding: 11px 13px 0;
  border-top: 1px solid var(--border);
}

.preset-main:active { background: var(--accent-soft); }

.preset-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.preset-name {
  font-weight: 500;
  line-height: 1.4;
}

/* 「まず入れるならこれ」の目印 */
.preset-basic {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.preset-detail {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}

/* どんな動きか */
.preset-how {
  margin-top: 7px;
  font-size: 13px;
  line-height: 1.55;
}

/* 気をつける点 */
.preset-tip {
  margin-top: 3px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--accent-dark);
}

.preset-tip::before {
  content: '注意：';
  font-weight: 500;
}

/* 種目の刻みと上限は「使える器具」の設定を使う、という案内 */
.gear-follow {
  margin-bottom: 12px;
  padding: 10px 12px 2px;
  background: var(--bg);
  border-radius: 10px;
}

.gear-follow-text {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
}

.gear-follow-note {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* スマホで押しやすい高さ（44px以上）にそろえる */
.gear-follow .gear-own {
  margin-left: -10px;
  padding: 12px 10px;
  color: var(--accent-dark);
}

.gear-back {
  margin: -4px 0 12px;
  padding: 12px 10px;
}

/* 種目の登録：ウォーミングアップを入れるかのチェック。行のどこを押しても切り替わる */
.check-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.check-line input { flex: none; width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); }
.check-line small { display: block; font-size: 12.5px; font-weight: 400; color: var(--muted); }

/* 入力欄の下に添える、小さな案内 */
.field-hint {
  margin: -6px 0 12px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
}

/* 記録の控え：書き出す中身と、前回書き出した日 */
.export-note {
  margin: 0 0 12px;
  padding: 9px 11px;
  font-size: 14px;
  background: var(--primary-soft);
  border-radius: 10px;
}

/* 過去の記録を直しているときの案内 */
.note-past {
  padding: 9px 11px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-radius: 10px;
}

/* 動画の検索を開くリンク */
.video-link {
  display: inline-block;
  /* スマホで押しやすい高さ（44px以上）になるようにしている */
  padding: 12px 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}

.video-link::after { content: ' ↗'; }

/* ひな形の一覧では、行の下に区切って置く */
.preset-video {
  display: block;
  margin-top: 9px;
  padding: 12px 13px;
  margin-left: -13px;
  margin-right: -13px;
  border-top: 1px solid var(--border);
}

.preset-video:active { background: var(--bg); }

/* すでに登録してあるひな形 */
.preset-done {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: var(--keep-soft);
  color: var(--keep);
}

.preset-item.is-registered { opacity: 0.62; }
.preset-item.is-registered .preset-main:active { background: transparent; }

/* 記録した種目を、直す／取り消す。
   .btn-ghost などがあとに出てくるので、打ち消されないよう親を含めて指定する */
.next-actions {
  display: flex;
  flex-wrap: wrap; /* 「メモを書く」を足してボタンが3つになったので、狭い画面では折り返す */
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

/* 記録の結果の欄の中で、メモだけを書く */
.memo-editor { margin-top: 10px; }
.memo-editor .ex-memo { margin-top: 0; }

.next-item .next-edit {
  /* スマホで押しやすい高さ（44px以上）にそろえる */
  padding: 12px 16px;
  font-size: 13px;
}

.next-item .next-undo {
  padding: 12px 4px;
  font-size: 13px;
}

/* 予定と関係なく種目を選ぶ入口 */
.btn-free { margin-top: 8px; }

/* 種目を選ぶ一覧 */
/* 場所 → 部位 の絞り込み */

.picker-filter {
  margin-bottom: 12px;
}

.picker-filter-label {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  /* スマホで押しやすい高さ（44px以上）にそろえる */
  padding: 13px 15px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.2;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
}

.chip.is-on {
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-color: var(--accent);
}

.chip-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--faint);
}

.chip.is-on .chip-count { color: var(--accent-dark); }

.picker-group {
  margin-bottom: 14px;
}

.picker-group-title {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

/* 行全体を押せるようにする */
.picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}

.picker-row.is-on {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.picker-row input { flex: none; width: 20px; height: 20px; }

.picker-name { font-weight: 500; font-size: 14px; }
.picker-detail { margin-top: 2px; font-size: 12px; color: var(--muted); }

/* 選んだ種目。絞り込みで画面から消えても、ここに残る */

.picker-chosen {
  margin: 4px 0 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.picker-chosen-label {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.chosen-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
}

.chosen-name { font-size: 14px; font-weight: 500; }
.chosen-where { font-size: 12px; color: var(--muted); }

.picker-chosen .chosen-remove {
  flex: none;
  /* スマホで押しやすい高さ（44px以上）にそろえる */
  padding: 12px 14px;
}

/* 一覧にない種目を、自分で登録する入口 */
.btn-manual { margin-top: 12px; }

/* ルームランナーの入力欄（時間・時速・傾斜・カロリー） */
.cardio-fields {
  margin-top: 10px;
}

.cardio-fields .field-inline { margin-bottom: 4px; }
.cardio-fields .section-note { margin: 6px 0 0; }

/* トレーニング中に、セットを1つ足す */
.card .set-add {
  margin-top: 6px;
  padding: 12px 0;
}

/* ===== ボタン ===== */

.btn-primary,
.btn-secondary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 13px 18px;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  border-radius: 11px;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:active { background: var(--accent-dark); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  padding: 8px 10px;
  font-size: 13px;
}

.btn-block { width: 100%; }

.btn-danger { color: var(--danger); }

button:disabled { opacity: 0.5; cursor: default; }

/* ===== 下部タブ ===== */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--tabbar-h);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  z-index: 20;
}

.tabbar button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
}

.tabbar button.active { color: var(--accent); }

/* ===== 通知 ===== */

.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + 14px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  background: var(--primary);
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 999px;
  box-shadow: var(--shadow);
  z-index: 30;
}

/* ===== ログイン ===== */

.login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 40;
}

.login-box {
  width: 100%;
  max-width: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 22px;
  text-align: center;
}

.login-icon {
  display: inline-flex;
  padding: 12px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: 10px;
}

.login-box h1 { margin: 0; font-size: 17px; letter-spacing: 0.08em; }
.login-sub { margin: 4px 0 18px; font-size: 13px; color: var(--muted); }
.login-box .field { text-align: left; }

/* ===== 週の予定 ===== */

.routine-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-top: 1px solid var(--border);
}

.routine-row:first-child { border-top: none; }

.routine-day {
  width: 2.2em;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  flex: none;
}

.routine-row select {
  flex: 1;
  min-width: 0;
  padding: 9px 10px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  appearance: none;
}

.routine-row.is-rest { opacity: 0.55; }

/* その日にやる種目（曜日ごと） */
.routine-block {
  border-top: 1px solid var(--border);
}

.routine-block:first-child { border-top: none; }

.routine-block .routine-row { border-top: none; }

.routine-menu { margin: 0 0 8px 2.7em; }

@media (max-width: 480px) {
  .routine-menu { margin-left: 0; }
}

.routine-menu-head {
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  padding: 2px 0 6px;
}

.routine-menu-body .field { margin-bottom: 8px; }

.routine-items {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}

.routine-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 5px 0;
  border-top: 1px dashed var(--border);
}

.routine-item:first-child { border-top: none; }

.routine-item-no {
  width: 1.4em;
  flex: none;
  font-weight: 500;
  text-align: center;
}

.routine-item-name {
  /* 名前は1行ぶん使い、セット数とボタンは次の行に回す（スマホ幅で名前が縦に折れないように） */
  flex: 1 1 calc(100% - 2.2em);
  min-width: 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.routine-item-name small { font-size: 12px; opacity: 0.7; }

.routine-item-sets,
.routine-add {
  padding: 7px 6px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.routine-item-sets { flex: none; margin-left: 1.9em; margin-right: auto; }

.routine-add { width: 100%; margin-bottom: 6px; }

.routine-item-btn {
  flex: none;
  min-width: 34px;
  padding: 6px 0;
  border-color: var(--border);
}
.routine-item-btn:disabled { opacity: 0.3; }

/* ===== 登録した種目の一覧 ===== */

/* ===== カードごと折りたたむ（使える器具） ===== */

.fold-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}

.fold-card-head::-webkit-details-marker { display: none; }

/* 見出しは閉じているときも出るので、下の余白は開いたときだけでよい */
.fold-card-head .card-title { margin: 0; }

.fold-card-head .card-title::before {
  content: '▸';
  display: inline-block;
  color: var(--faint);
}

.fold-card[open] > .fold-card-head .card-title::before { content: '▾'; }

.fold-card[open] > .fold-card-head { margin-bottom: 12px; }

/* 閉じているときに、何を設定してあるかを1行で出す */
.fold-card-summary {
  flex: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--faint);
}

/* ===== 登録した種目の折りたたみ ===== */

.fold-place { margin-bottom: 10px; }

.fold-place-head,
.fold-part-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}

/* 三角の標準マークは消して、自前の印を出す */
.fold-place-head::-webkit-details-marker,
.fold-part-head::-webkit-details-marker { display: none; }

.fold-place-head {
  padding: 12px 12px;
  border-radius: 10px;
  background: var(--bg);
  font-size: 14px;
  font-weight: 500;
}

.fold-part-head {
  padding: 11px 12px 11px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.fold-place-title::before,
.fold-part-title::before {
  content: '▸';
  display: inline-block;
  margin-right: 7px;
  color: var(--faint);
}

.fold-place[open] > .fold-place-head .fold-place-title::before,
.fold-part[open] > .fold-part-head .fold-part-title::before {
  content: '▾';
}

.fold-place-count,
.fold-part-count {
  flex: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--faint);
}

.fold-part { margin: 0 0 2px; }
.fold-part .ex-item:last-child { margin-bottom: 8px; }

.group-title {
  margin: 14px 0 2px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.group-title:first-child { margin-top: 0; }

.ex-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid var(--border);
}

.ex-main { min-width: 0; }

.ex-name {
  font-size: 15px;
  font-weight: 500;
}

.ex-detail {
  font-size: 12.5px;
  color: var(--muted);
}

.row-actions {
  display: flex;
  gap: 2px;
  flex: none;
}

.note-maxed {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 500;
  color: var(--down);
}

/* ===== トレーニング中の入力 ===== */

.ex-block { margin-bottom: 14px; }

/* 種目名の下に目標を置く。
   横に並べると、目標の文が折り返さないぶん、長い種目名が1〜3文字ずつ縦に押しつぶされていた */
.ex-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin-bottom: 4px;
}

.ex-head .ex-name { font-size: 16px; }

/* 種目名の下に置いたので、折り返してよい（ウォーミングアップの重さが入ると1行に収まらないため） */
.ex-target {
  font-size: 12.5px;
  color: var(--muted);
}

/* 右端はトレーナーの補助の印。押しやすいよう44pxを取る。
   回数は2〜3桁しか入らないので細くし、「0回（限界）」が入るよう余力を広くとる */
.set-labels,
.set-row {
  display: grid;
  grid-template-columns: 1.4em 1.2fr 1fr 2.3fr 44px;
  gap: 6px;
  align-items: center;
}

.set-labels {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  margin: 8px 0 2px;
  align-items: end;
}

/* 「重量」「(kg/1個)」のように、見出しを決めた位置で2行に分ける */
.set-labels span { white-space: pre-line; line-height: 1.35; }

.set-row { margin-bottom: 7px; }

/* ウォーミングアップの行。番号の代わりに「W」をオレンジで出し、本番の行と見分けられるようにする */
.set-row.is-warmup .set-no,
.ex-prev-row.is-warmup .ex-prev-no { color: var(--accent-dark); font-weight: 500; }
.set-row.is-warmup input,
.set-row.is-warmup select { background: var(--accent-soft); }
.ex-prev-row.is-warmup { color: var(--muted); }
.set-rir-none { text-align: center; color: var(--faint); font-weight: 500; }

.set-no {
  font-size: 13px;
  font-weight: 500;
  color: var(--faint);
  text-align: center;
}

.set-row input,
.set-row select {
  width: 100%;
  min-width: 0;
  padding: 11px 6px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  appearance: none;
  text-align: center;
}

.set-row select { text-align: left; }

.set-row input:focus,
.set-row select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* 余力が0回に固定されているとき（補助が入ったセット） */
.set-row select:disabled {
  color: var(--muted);
  background: var(--bg);
}

/* 補助の印。行の右端に置き、マス全体を押せるようにする */
.set-assist-label { text-align: center; }

.set-assist-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  cursor: pointer;
}

/* .set-row input の見た目（幅100%・標準の見た目を消す）を、チェックボックスでは打ち消す */
.set-row .set-assist-toggle input {
  width: 22px;
  height: 22px;
  padding: 0;
  appearance: auto;
  accent-color: var(--accent);
}

/* 印を付けたときだけ出る「補助された回数」。行の幅いっぱいに使う */
.set-assist-line {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-radius: 9px;
}

.set-row .set-assist-line input { width: 64px; }

.set-assist-note {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
}

/* ===== 記録のあとに出す「次回の重量」 ===== */

.next-item {
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.next-item:first-child { border-top: none; }

.next-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.next-name { font-size: 15px; font-weight: 500; }

.next-value {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
}

.next-tag {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
}

.tag-up { background: var(--up-soft); color: var(--up); }
.tag-keep { background: var(--keep-soft); color: var(--keep); }
.tag-down { background: var(--down-soft); color: var(--down); }
.tag-reps { background: var(--accent-soft); color: var(--accent-dark); }
.tag-maxed { background: var(--danger-soft); color: var(--danger); }

.next-reason {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.next-sets {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--faint);
}

/* 種目ごとのメモ。書いたとおりの改行で出す。
   記録の結果・履歴・記録画面の「前に書いたメモ」で使う */
.next-memo {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ex-last-memo { margin: 6px 0 2px; }

/* 前回の記録と、何種目目か（記録画面の種目名の下）。
   先にやった種目の疲れで数字が落ちても、自分で見比べて分かるように */
.ex-context {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0 2px;
}

.ex-order {
  margin: 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--accent-dark);
}

/* 前回の記録。これを超えるのが目標なので、灰色の小さい文字にせず、囲みの中に大きく濃く出す */
.ex-prev-box {
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.ex-prev {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

/* 有酸素の前回（1行） */
.ex-prev-sets {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

/* 筋トレの前回。番号付きで縦に並べ、番号の幅と見た目は下の入力欄（.set-no）とそろえる */
.ex-prev-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ex-prev-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.ex-prev-no {
  flex: none;
  width: 1.4em;
  font-size: 13px;
  color: var(--faint);
  text-align: center;
}

.ex-prev-row small {
  margin-left: 4px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--accent-dark);
}

.ex-memo { margin: 12px 0 0; }
.ex-memo textarea { resize: vertical; }

.session-block { padding: 12px 0; border-top: 1px solid var(--border); }
.session-block:first-child { border-top: none; }

.session-date {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 2px;
}

/* ===== 器具の設定 ===== */

.kind-block {
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.kind-block.is-on {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* チェックボックスの行。行のどこを押しても切り替わる */
.kind-head {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
}

.kind-head input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  flex: none;
}

.kind-body {
  background: var(--surface);
  border-radius: 9px;
  padding: 10px 10px 2px;
  margin-top: 9px;
}

.kind-body .field { margin-bottom: 8px; }

.kind-hint {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
}


/* =====================================================================
   新しい見た目（2026-11-13）：黒のマットな地 ＋ すりガラス ＋ 細い書体
   色は上の :root で入れ替えてある。ここは、色の入れ替えだけでは足りないところ
   ===================================================================== */

html { color-scheme: dark; background: var(--bg); }

body {
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.02em;
}

/* 奥でぼんやり光る2つの光。ガラスの面ごしに透けて見える */
body::before,
body::after {
  content: '';
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(40px);
}

body::before {
  left: -110px;
  top: -120px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 68%);
  opacity: 0.24;
}

body::after {
  right: -150px;
  top: 46vh;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #5b6cff 0%, transparent 68%);
  opacity: 0.2;
}

/* ---- ヘッダー：帯をやめて、小さな文字だけにする ---- */
.header { background: transparent; padding-bottom: 0; }
.header h1 { font-size: 11px; font-weight: 500; letter-spacing: 0.22em; color: var(--muted); }
.header-sub { display: none; }

/* ---- カード：すりガラス ---- */
.card,
.login-box {
  border: none;
  background: var(--surface);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow);
}

.card-title { font-size: 12px; letter-spacing: 0.12em; color: var(--muted); }
.card-title-side { margin-left: auto; letter-spacing: 0.02em; font-weight: 400; }

/* カードの中の「一段くぼんだ面」は、黒ではなく少し明るい半透明にする */
.stat,
.gear-follow,
.fold-place-head,
.ex-prev-box,
.kind-body { background: rgba(255, 255, 255, 0.05); }
.ex-prev-box { border-color: transparent; }
.preset-more:active,
.preset-video:active { background: rgba(255, 255, 255, 0.08); }
.login-screen { background: var(--bg); }

/* ---- 入力欄 ---- */
.field input,
.field select,
.field textarea,
.set-row input,
.set-row select,
.routine-row select,
.routine-item-sets,
.routine-add {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border);
  color: var(--text);
}

.set-row input { font-family: var(--num-font); font-size: 20px; font-weight: 300; }
.set-row select { font-size: 14px; }

/* いま打っている行だけ、差し色のふちにする */
.set-row:focus-within input,
.set-row:focus-within select { border-color: rgba(215, 255, 61, 0.55); background: rgba(255, 255, 255, 0.1); }
.set-row:focus-within .set-no { color: var(--accent); }

/* ウォーミングアップの行は目立たせない（本番より控えめに。2026-11-13 八木さん） */
.set-row.is-warmup .set-no,
.ex-prev-row.is-warmup .ex-prev-no { color: var(--muted); font-weight: 400; }
.set-row.is-warmup input,
.set-row.is-warmup select { background: rgba(255, 255, 255, 0.04); color: var(--muted); }
.set-rir-none { color: transparent; }

/* ---- ボタン ---- */
.btn-primary,
.btn-secondary { border-radius: 999px; font-weight: 500; }

.btn-primary {
  color: var(--on-accent);
  min-height: 56px;
  font-size: 16px;
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.55), inset 0 -10px 18px -10px rgba(0, 0, 0, 0.25), 0 14px 34px -16px var(--accent);
}

.btn-primary:active { background: #c3ea2e; }

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.kind-head input,
.check-line input,
.set-row .set-assist-toggle input { accent-color: var(--accent); }

/* ---- 今日の画面 ---- */
.card-today { padding-top: 20px; }

.hero-date { display: flex; align-items: baseline; gap: 10px; line-height: 1; }
.hero-num { font-family: var(--num-font); font-size: 64px; font-weight: 200; letter-spacing: -0.02em; }
.hero-dow { font-family: var(--num-font); font-size: 24px; font-weight: 300; color: var(--accent); }
.today-head { align-items: flex-end; margin-bottom: 16px; }
.today-menu { margin-top: 8px; font-size: 18px; font-weight: 500; color: var(--text); }
#workout-title { font-family: var(--num-font); font-weight: 300; }
#screen-workout .today-menu { font-size: 13px; font-weight: 400; color: var(--muted); margin-top: 2px; }

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 14px;
}

.week-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-height: 56px;
  padding: 7px 0 10px;
  font-family: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid transparent;
  border-radius: 12px;
  cursor: pointer;
}

.week-dow { font-size: 11px; color: var(--muted); }
.week-part { font-size: 14px; font-weight: 500; }
.week-day.is-rest { background: transparent; border: 1.5px dashed var(--border); }
.week-day.is-rest .week-part { color: var(--muted); font-weight: 400; }
.week-day.is-selected { border: 1.5px solid var(--accent); }
.week-day.is-selected .week-dow { color: var(--accent); }
.week-day:disabled { opacity: 0.55; cursor: default; }

/* 記録が済んだ日の印 */
.week-dot { position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; }
.week-day.is-done .week-dot { background: var(--accent); }

.plan-item { padding: 13px 0; }
.plan-name { font-weight: 500; }
.plan-weight { font-family: var(--num-font); font-size: 38px; font-weight: 300; line-height: 1; }
.plan-weight span { font-size: 12px; font-weight: 500; margin-left: 4px; }
#history-weights .plan-weight { font-size: 24px; }

.card-today .date-picker { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.card-today .btn-primary { margin-top: 6px; }

/* ---- 記録のあと ---- */
.done-hero { margin: 4px 0 14px; }
.done-count { font-family: var(--num-font); font-size: 52px; font-weight: 200; line-height: 1.05; letter-spacing: 0.02em; }
.done-word { font-size: 15px; color: var(--muted); }
.done-word.is-complete { font-family: var(--num-font); font-size: 44px; font-weight: 200; line-height: 1.1; letter-spacing: 0.05em; color: var(--accent); }
.done-sub { margin: 8px 0 0; font-size: 13px; color: var(--muted); }

.next-name { font-weight: 500; }
.next-value { font-family: var(--num-font); font-weight: 400; }
.next-tag { font-family: inherit; font-weight: 500; }
.tag-up { background: var(--accent); color: var(--on-accent); }

/* 種目名が長いときは、名前を1行、次回の数字を次の行に分ける */
.next-head { flex-wrap: wrap; row-gap: 4px; }
.next-value { margin-left: auto; }
.next-item { padding: 14px 0; }

/* 直す・メモ・取り消すは、結果の数字より目立たせない */
.next-item .next-edit { padding: 9px 14px; font-size: 12px; background: transparent; box-shadow: inset 0 0 0 1px var(--border); color: var(--muted); }
.next-item .next-undo { padding: 9px 4px; font-size: 12px; }
.next-actions { margin-top: 8px; gap: 8px; }

/* 予定を全部終えた日は、上の一覧をたたむ */
.card-today.is-complete .plan-list { display: none; }

/* 重量が上がった種目。1つめは差し色の面にして主役に、2つめからは枠だけにする */
.next-big { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 4px; font-family: var(--num-font); font-weight: 300; line-height: 1; }
.next-big-from { font-size: 28px; opacity: 0.55; }
.next-big-arrow { font-size: 22px; opacity: 0.8; }
.next-big-to { font-size: 60px; font-weight: 200; }
.next-big-unit { font-size: 17px; }

.next-item.is-up {
  margin: 8px 0;
  padding: 16px 18px;
  border-top: none;
  border-radius: 22px;
  box-shadow: inset 0 0 0 1px var(--accent);
}
.next-item.is-up .next-big { color: var(--accent); }
.next-item.is-up .next-big-to { font-size: 44px; }
.next-item.is-up .next-value > span:not(.next-tag) { display: none; }
.next-item.is-up + .next-item { border-top: none; }

.next-item.is-up:not(.is-up ~ .is-up) {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.6), inset 0 -16px 28px -16px rgba(0, 0, 0, 0.22), 0 20px 44px -22px var(--accent);
}
.next-item.is-up:not(.is-up ~ .is-up) .next-big { color: var(--on-accent); }
.next-item.is-up:not(.is-up ~ .is-up) .next-big-to { font-size: 60px; }
.next-item.is-up:not(.is-up ~ .is-up) .next-tag { background: transparent; color: var(--on-accent); border: 1.5px solid var(--on-accent); }
.next-item.is-up:not(.is-up ~ .is-up) .next-reason,
.next-item.is-up:not(.is-up ~ .is-up) .next-sets,
.next-item.is-up:not(.is-up ~ .is-up) .next-memo { color: rgba(11, 11, 12, 0.78); }
.next-item.is-up:not(.is-up ~ .is-up) .next-edit { color: rgba(11, 11, 12, 0.8); box-shadow: inset 0 0 0 1px rgba(11, 11, 12, 0.28); }
.next-item.is-up:not(.is-up ~ .is-up) .btn-ghost { color: rgba(11, 11, 12, 0.78); }

/* 前回の記録は、控えめな太さで */
.ex-prev-row, .ex-prev-row b, .ex-prev-row strong { font-weight: 400; }
#done-graph { margin: 12px 0 4px; }

/* ---- 伸びのグラフ ---- */
.chip-scroll {
  display: flex;
  gap: 6px;
  margin: 0 -16px 14px;
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chip-scroll::-webkit-scrollbar { display: none; }
.chip-scroll .chip { flex: none; }
.chip { font-weight: 500; background: transparent; }
.chip.is-on { color: var(--on-accent); background: var(--text); border-color: var(--text); }
.chip.is-on .chip-count { color: var(--on-accent); }

.progress-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.progress-from { font-size: 12px; color: var(--muted); }
.progress-diff { font-family: var(--num-font); font-size: 64px; font-weight: 200; line-height: 1; }
.progress-diff.is-up { color: var(--accent); }
.progress-diff small { margin-left: 6px; font-size: 16px; font-weight: 400; color: var(--text); }
.progress-hero-side { text-align: right; padding-bottom: 6px; }
.progress-range { font-family: var(--num-font); font-size: 20px; font-weight: 300; }
.progress-unit { font-size: 12px; color: var(--muted); }

.progress-chart { margin: 0 -6px; }
.chart { display: block; width: 100%; height: auto; }
.chart-grid { stroke: rgba(255, 255, 255, 0.1); stroke-width: 1; }
.chart-axis,
.chart-date,
.chart-reps { fill: var(--muted); font-family: var(--num-font); font-size: 11px; }
.chart-reps { fill: var(--text); }
.chart-date.is-last { fill: var(--text); }
.chart-ref { stroke: rgba(255, 255, 255, 0.5); stroke-width: 1.2; stroke-dasharray: 4 5; }
.chart-ref-label { fill: var(--muted); font-size: 10.5px; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart-dot { fill: #17181a; stroke: var(--accent); stroke-width: 2; }
.chart-dot.is-last { fill: var(--accent); stroke: none; }
.chart-value { fill: var(--text); font-family: var(--num-font); font-size: 15px; font-weight: 500; }
#progress-note { margin: 6px 0 0; }

.progress-row { padding: 10px 0; }
.progress-row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.progress-row-name { font-size: 14px; font-weight: 500; min-width: 0; }
.progress-row-nums { flex: none; font-family: var(--num-font); font-size: 14px; font-weight: 300; color: var(--muted); }
.progress-row-diff { display: inline-block; min-width: 2.6em; text-align: right; color: var(--muted); }
.progress-row-diff.is-up { color: var(--accent); }
.progress-track { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); }
.progress-bar { height: 6px; border-radius: 3px; background: var(--muted); }
.progress-bar.is-up { background: var(--accent); }

/* ---- 下のメニュー：画面から浮いた、丸いガラスの帯 ---- */
.tabbar {
  left: 16px;
  right: 16px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  max-width: 528px;
  margin: 0 auto;
  height: 64px;
  padding-bottom: 0;
  border: none;
  border-radius: 32px;
  background: rgba(30, 30, 33, 0.55);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 18px 40px -18px rgba(0, 0, 0, 0.8);
}

.tabbar button { color: var(--muted); font-weight: 500; }
.tabbar .icon,
.icon { stroke-width: 1.5; }

.toast {
  background: rgba(40, 40, 44, 0.8);
  color: var(--text);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* 伸びの一覧を、場所（自宅・ジム）ごとに分ける見出し */
.progress-place {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 0 2px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}
.progress-place:first-child { margin-top: 4px; }
.progress-place-name { font-size: 13px; font-weight: 500; color: var(--text); letter-spacing: 0.08em; }
.chip .chip-place { margin-left: 6px; font-size: 10.5px; opacity: 0.65; }

/* ===== コーチ（AIトレーナーに相談する画面） ===== */

.coach-lead { margin: 2px 0 12px; font-size: 15px; }
.coach-points { margin: 0 0 14px; padding-left: 1.2em; font-size: 13.5px; color: var(--muted); }
.coach-points li { margin-bottom: 4px; }
.coach-plan-note { display: flex; gap: 8px; align-items: flex-start; }
.coach-plan-note .icon { width: 16px; height: 16px; margin-top: 3px; color: var(--accent); }

/* 相談の例。押すと、そのまま送る */
.coach-suggest { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.coach-suggest button {
  padding: 13px 15px;
  font: inherit;
  font-size: 14px;
  text-align: left;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
}

.coach-thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }

.coach-msg {
  max-width: 88%;
  padding: 11px 14px;
  font-size: 14.5px;
  line-height: 1.7;
  border-radius: 18px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
/* 自分の発言は右・差し色、AIの返事は左・ガラス */
.coach-msg.is-user { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 6px; }
.coach-msg.is-coach {
  align-self: flex-start;
  background: var(--surface);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-bottom-left-radius: 6px;
}
.coach-msg.is-error { align-self: flex-start; color: var(--danger); background: var(--danger-soft); }

/* 返事を待っている間の、3つの点 */
.coach-wait { display: inline-flex; gap: 5px; align-items: center; height: 1.7em; }
.coach-wait i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: coach-wait 1.2s infinite ease-in-out; }
.coach-wait i:nth-child(2) { animation-delay: 0.15s; }
.coach-wait i:nth-child(3) { animation-delay: 0.3s; }
@keyframes coach-wait { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .coach-wait i { animation: none; opacity: 0.6; } }

/* メニューの変更案。登録するまでは保存されないことが分かるように、枠を差し色にする */
.coach-proposal {
  align-self: stretch;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--accent);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
.coach-proposal.is-closed { border-color: var(--border); }
.proposal-kicker { margin: 0 0 6px; font-size: 11.5px; letter-spacing: 0.12em; color: var(--accent); }
.coach-proposal.is-closed .proposal-kicker { color: var(--muted); }
.proposal-summary { margin: 0 0 12px; font-size: 14.5px; }
.proposal-block { padding: 12px 0; border-top: 1px solid var(--border); }
.proposal-head { margin: 0 0 6px; font-size: 14px; font-weight: 500; }
.proposal-detail { margin: 0; font-size: 13px; color: var(--muted); }
.proposal-diff { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.proposal-col-label { margin: 0 0 4px; font-size: 11.5px; color: var(--faint); }
.proposal-col-title { margin: 0 0 4px; font-size: 13px; }
.proposal-lines { margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.proposal-col.is-after .proposal-col-label { color: var(--accent); }
.proposal-col.is-after .proposal-lines { color: var(--text); }
.proposal-change { font-size: 13.5px; }
.proposal-change .arrow { margin: 0 6px; color: var(--faint); }
.proposal-change .after { color: var(--accent); }
.coach-proposal .field { margin: 10px 0 0; }
.proposal-actions { display: flex; flex-direction: column; gap: 4px; padding-top: 14px; border-top: 1px solid var(--border); }
.proposal-done { margin: 0; padding-top: 12px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.proposal-done .icon { width: 16px; height: 16px; }
.proposal-done.is-applied { color: var(--accent); }

/* 入力欄は、下のメニューのすぐ上に留める（会話が長くなっても、いつでも書けるように） */
.coach-composer {
  position: sticky;
  bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  z-index: 10;
  padding: 10px;
  border-radius: 24px;
  background: rgba(30, 30, 33, 0.72);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow);
}
.coach-input { display: flex; align-items: flex-end; gap: 8px; }
.coach-input textarea {
  flex: 1;
  min-height: 44px;
  max-height: 160px;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px; /* 16px未満だとスマホで自動拡大されるため下げない */
  line-height: 1.5;
  color: var(--text);
  background: transparent;
  border: none;
  resize: none;
}
.coach-input textarea:focus { outline: none; }
.coach-composer:focus-within { box-shadow: var(--shadow), 0 0 0 1px var(--accent); }
.coach-send {
  flex: none;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--on-accent);
  background: var(--accent);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}
.coach-meta { display: flex; align-items: center; justify-content: space-between; min-height: 30px; padding: 2px 6px 0 12px; font-size: 11.5px; color: var(--faint); }
/* 「3セット」の途中で折り返さない（幅が足りないときだけ、途中で折る） */
.proposal-lines li { word-break: keep-all; overflow-wrap: anywhere; }
/* 変更前と変更後は、横に並べると種目名が細かく折り返すので、縦に重ねる */
.proposal-diff { grid-template-columns: 1fr; gap: 10px; }
.proposal-col:not(.is-after) .proposal-lines { font-size: 12.5px; }

/* ===== あなたについて（3つの段） ===== */
.about-steps { display: flex; gap: 6px; margin: 4px 0 16px; padding: 0; list-style: none; counter-reset: about-step; }
.about-steps li { flex: 1; counter-increment: about-step; }
.about-steps button {
  width: 100%; padding: 10px 4px 9px; font: inherit; font-size: 12px; color: var(--faint);
  background: transparent; border: 0; border-top: 2px solid var(--border); cursor: pointer; text-align: left;
}
.about-steps button::before { content: counter(about-step) '. '; }
.about-steps li.is-done button { color: var(--muted); border-top-color: var(--muted); }
.about-steps li.is-current button { color: var(--text); border-top-color: var(--accent); }
.about-step .field > .chips { margin-top: 2px; }
.chips-stack { flex-direction: column; align-items: stretch; }
.chips-stack .chip { justify-content: flex-start; text-align: left; border-radius: 14px; }
.chips-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.chips-week .chip { justify-content: center; padding-left: 0; padding-right: 0; }
.about-alert {
  margin: -4px 0 14px; padding: 10px 12px; font-size: 13px; line-height: 1.6;
  color: var(--danger); background: var(--danger-soft); border-radius: 12px;
}
.about-nav { display: flex; gap: 8px; justify-content: space-between; margin-top: 6px; }
.about-nav button { flex: 1; }
.about-nav #about-back[hidden] + #about-next { flex: 1; }
.about-finish { margin-top: 6px; }

/* ===== 今日の画面：初めての人の入口 ===== */
.coach-cta { border-color: var(--accent); }
.coach-cta .card-title .icon { color: var(--accent); }

/* ===== 変更案：足す種目と、はじめの重さ ===== */
.proposal-weight-note { margin-bottom: 10px; line-height: 1.6; }
.proposal-new { margin: 0; padding: 0; list-style: none; }
.proposal-new-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--border); }
.proposal-new-row:first-child { border-top: 0; padding-top: 2px; }
.proposal-new-main { flex: 1; min-width: 0; }
.proposal-new-name { margin: 0 0 2px; font-size: 14px; }
.proposal-weight { display: flex; align-items: center; gap: 6px; flex: none; font-size: 11.5px; color: var(--muted); }
.proposal-weight input { width: 72px; padding: 9px 8px; font-size: 16px; text-align: right; }
.proposal-how { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.proposal-how summary { cursor: pointer; color: var(--faint); }
.proposal-how p { margin: 4px 0 0; line-height: 1.6; }
.proposal-tip { color: var(--text); }
.proposal-done .btn-block { margin-top: 10px; }
.proposal-done { flex-direction: column; align-items: stretch; }
.proposal-done p { margin: 0; display: flex; gap: 6px; align-items: center; }
.coach-wait-note { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
