:root {
  --bg: #0f172a;
  --card: #1e293b;
  --card2: #263449;
  --text: #f1f5f9;
  --sub: #94a3b8;
  --accent: #f59e0b;
  --accent2: #fbbf24;
  --fig-body: #f1f5fb;
  --fig-far: #64748b;
  --fig-prop: #f59e0b;
  --fig-steel: #94a3b8;
  --fig-floor: #475569;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}
.app-head {
  position: sticky; top: 0; z-index: 10;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: rgba(15, 23, 42, 0.92); backdrop-filter: blur(8px);
  font-weight: 700; font-size: 17px; border-bottom: 1px solid #1e293b;
}
main { padding: 14px 14px 24px; max-width: 560px; margin: 0 auto; }

.tab-page { display: none; }
.tab-page.active { display: block; animation: fadein 0.18s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

.card {
  background: var(--card); border-radius: 14px; padding: 14px; margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ---- フォーム ---- */
.form-title { font-weight: 700; font-size: 16px; margin-bottom: 12px; }
form label { display: block; font-size: 13px; color: var(--sub); margin-bottom: 10px; }
input[type="number"], select, textarea {
  width: 100%; margin-top: 4px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid #334155; background: var(--card2); color: var(--text); font-size: 16px;
}
textarea { resize: none; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.level-row { font-size: 13px; color: var(--sub); margin-bottom: 12px; }
.pills { display: flex; gap: 8px; margin-top: 6px; }
.pill input { display: none; }
.pill span {
  display: block; padding: 8px 14px; border-radius: 99px; background: var(--card2);
  border: 1px solid #334155; color: var(--sub); font-size: 14px;
}
.pill input:checked + span { background: var(--accent); color: #0f172a; font-weight: 700; border-color: var(--accent); }
.disclaimer { font-size: 11px; color: #64748b; margin-top: 10px; line-height: 1.5; }

.btn {
  display: block; width: 100%; padding: 12px; border-radius: 12px; border: none;
  font-size: 15px; font-weight: 700; cursor: pointer; margin-top: 4px;
}
.btn.primary { background: var(--accent); color: #0f172a; }
.btn.primary:active { background: var(--accent2); }
.btn.ghost { background: transparent; border: 1px solid #334155; color: var(--sub); }
.btn.big { padding: 14px; font-size: 16px; margin-bottom: 10px; }

/* ---- メニュー ---- */
.menu-title { font-weight: 700; font-size: 16px; }
.menu-sub { color: var(--sub); font-size: 13px; margin: 4px 0 8px; }
.menu-note { font-size: 12.5px; color: #cbd5e1; background: var(--card2); border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; line-height: 1.5; }
.ex-card { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.ex-card:active { background: var(--card2); }
.thumb { width: 84px; height: 68px; flex: none; background: #0b1120; border-radius: 10px; }
.ex-info { flex: 1; min-width: 0; }
.tag { font-size: 10.5px; background: #334155; color: #cbd5e1; padding: 2px 8px; border-radius: 99px; }
.ex-name { font-weight: 700; font-size: 15px; margin: 2px 0; }
.ex-rx { font-size: 13px; color: var(--accent2); }
.ex-muscle { font-size: 11.5px; color: var(--sub); margin-top: 2px; }
.chev { color: #475569; font-size: 12px; }
.empty { text-align: center; color: var(--sub); padding: 48px 16px; line-height: 2; }

/* ---- 実施記録 ---- */
.set-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.set-row input[type="number"] { width: 72px; margin-top: 0; padding: 8px; text-align: center; }
.chk { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--sub); flex: none; margin: 0; }
.chk input { width: 20px; height: 20px; accent-color: var(--accent); }
.unit { font-size: 12px; color: var(--sub); }

/* ---- 記録 ---- */
.chart { width: 100%; margin-top: 8px; }
.ct { font-size: 9px; fill: var(--sub); }
.stat-row { display: flex; justify-content: space-around; text-align: center; }
.stat-row b { font-size: 22px; color: var(--accent2); display: block; }
.stat-row span { font-size: 11px; color: var(--sub); }
.sess-head { display: flex; justify-content: space-between; align-items: center; }
.sess-sub { color: var(--sub); font-size: 12px; }
.del { background: none; border: none; font-size: 15px; cursor: pointer; opacity: 0.7; }
.sess-body { display: none; margin-top: 8px; border-top: 1px solid #334155; padding-top: 8px; }
.session.open .sess-body { display: block; }
.sess-ex { font-size: 13px; color: #cbd5e1; margin-bottom: 4px; }
.sess-memo { font-size: 12.5px; color: var(--sub); margin-top: 6px; }

/* ---- 図鑑 ---- */
.zukan-cat { font-weight: 700; font-size: 14px; color: var(--accent2); margin: 14px 2px 8px; }
.zukan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.z-card { text-align: center; font-size: 12.5px; font-weight: 600; cursor: pointer; margin: 0; }
.z-card svg { width: 100%; height: 92px; background: #0b1120; border-radius: 10px; margin-bottom: 6px; }

/* ---- モーダル ---- */
#modal {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.65); z-index: 50;
  display: none; align-items: flex-end; justify-content: center;
}
#modal.show { display: flex; }
.modal-card {
  background: var(--card); width: 100%; max-width: 560px; border-radius: 20px 20px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); position: relative;
  max-height: 88vh; overflow-y: auto; animation: up 0.22s ease;
}
@keyframes up { from { transform: translateY(40px); opacity: 0.5; } }
#modal-close {
  position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 99px;
  border: none; background: var(--card2); color: var(--sub); font-size: 14px; cursor: pointer;
}
.modal-title { font-size: 18px; font-weight: 800; }
.modal-sub { font-size: 12.5px; color: var(--sub); margin: 4px 0 10px; }
#modal-svg { width: 100%; height: 220px; background: #0b1120; border-radius: 14px; }
.points { margin-top: 12px; }
.point {
  display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 10px;
  font-size: 13.5px; line-height: 1.5; color: #cbd5e1; transition: background 0.3s;
}
.point.hot { background: rgba(245, 158, 11, 0.14); color: #fff; }
.pnum {
  flex: none; width: 20px; height: 20px; border-radius: 99px; background: var(--card2);
  color: var(--accent2); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.point.hot .pnum { background: var(--accent); color: #0f172a; }

/* ---- ナビ・トースト ---- */
.tab-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: flex; background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(10px);
  border-top: 1px solid #1e293b; padding-bottom: env(safe-area-inset-bottom);
}
.nav-btn {
  flex: 1; background: none; border: none; color: var(--sub); font-size: 10.5px;
  padding: 8px 0 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.nav-btn span { font-size: 20px; }
.nav-btn.active { color: var(--accent2); }
#toast {
  position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%) translateY(8px);
  background: #f1f5f9; color: #0f172a; font-weight: 700; font-size: 14px;
  padding: 10px 20px; border-radius: 99px; opacity: 0; pointer-events: none; transition: 0.25s; z-index: 60;
}
#toast.show { opacity: 1; transform: translateX(-50%); }

/* ==== mynote 上書き・追加（落ち着いた青緑） ==== */
:root {
  --accent: #38bdf8;
  --accent2: #7dd3fc;
}
.notice { border: 1px solid var(--accent); font-size: 13.5px; color: #e0f2fe; line-height: 1.6; }
.big-stats b { font-size: 20px; }
.progress { height: 12px; background: var(--card2); border-radius: 99px; overflow: hidden; margin: 8px 0 6px; }
.progress-in { height: 100%; background: linear-gradient(90deg, var(--accent), #34d399); border-radius: 99px; transition: width .4s; }
.btn.sos { background: linear-gradient(135deg, #0ea5e9, #38bdf8); color: #06283d; font-size: 18px; padding: 20px; border-radius: 16px; }
.tips .menu-note { font-size: 13.5px; }
.breath-wrap { display: flex; flex-direction: column; align-items: center; padding: 24px 0; }
.breath-circle { width: 90px; height: 90px; border-radius: 99px; background: radial-gradient(circle, #38bdf8, #0ea5e9); transition: transform 4s ease-in-out; transform: scale(1); }
.breath-circle.grow { transform: scale(1.6); }
.breath-circle.hold { transform: scale(1.6); transition-duration: 0.3s; }
.breath-circle.shrink { transform: scale(1); transition-duration: 8s; }
.breath-label { margin-top: 22px; font-size: 15px; color: var(--accent2); font-weight: 700; }
.timer-big { text-align: center; font-size: 44px; font-weight: 800; color: var(--accent2); padding: 12px 0; font-variant-numeric: tabular-nums; }
.alt-item { font-size: 14px; color: #dbeafe; padding: 5px 0; line-height: 1.5; }
.alt-item a { color: var(--accent2); }
.money-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; color: var(--sub); }
.money-row b { color: #fca5a5; font-size: 16px; }
.ev-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid #273449; font-size: 13.5px; }
.ev-date { color: var(--sub); flex: none; font-size: 12px; width: 84px; }
.ev-body { flex: 1; }
.mini-del { background: none; border: none; color: #475569; cursor: pointer; font-size: 11px; }
.btn.small { width: auto; padding: 8px 18px; margin: 0; }
.set-row input[type=text], .set-row input[type=tel] { flex: 1; width: auto; margin-top: 0; }
a.btn { text-align: center; text-decoration: none; display: block; }
