/* =====================================================================
   BTA Training App - スタイル（白ベース × ネイビー）
   モバイルファースト / ライトテーマ
   ブランドカラー：ネイビー #14124f（添付ロゴ準拠）
   ===================================================================== */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #eef1f8;
  --line: #e3e7f0;
  --line-2: #d6dbe8;
  --text: #15163a;        /* ネイビー寄りのインク */
  --muted: #6c7488;
  --muted-2: #9aa1b4;
  --navy: #14124f;        /* ブランドネイビー */
  --navy-2: #232180;      /* 明るめネイビー */
  --navy-soft: #ececf7;   /* ネイビーの淡色背景 */
  --navy-softer: #f3f3fb;
  --accent: var(--navy);
  --rir: #b97400;         /* 余力指標（アンバー系・白地で可読） */
  --rir-bg: #fff3df;
  --rir-line: #f4d9a8;
  --rpe: #1f63d6;         /* 主観強度（ブルー） */
  --rpe-bg: #e7f0ff;
  --rpe-line: #bcd3f7;
  --good: #18a06b;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 8px 24px rgba(20, 18, 79, 0.10);
  --shadow-sm: 0 3px 10px rgba(20, 18, 79, 0.06);
  --tab-h: 64px;
  --max: 520px;
  --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1100px 480px at 50% -260px, #e7e9fb 0%, transparent 62%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.01em;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.app { max-width: var(--max); margin: 0 auto; padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 12px); position: relative; }

/* ---------- ヘッダー ---------- */
.appbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 12px) 18px 12px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo, .brand .logo-img {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; object-fit: cover;
  background: var(--navy); color: #fff; font-weight: 900; font-size: 14px;
  box-shadow: var(--shadow-sm); letter-spacing: -0.5px; font-style: italic;
}
.brand .title { font-weight: 800; font-size: 17px; letter-spacing: 0.04em; color: var(--navy); }
.brand .title small { display: block; font-size: 10px; color: var(--muted); font-weight: 700; letter-spacing: 0.16em; }
.appbar .ghost-btn {
  width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface); color: var(--navy); display: grid; place-items: center; font-size: 17px;
  box-shadow: var(--shadow-sm);
}

/* ---------- 週ナビ ---------- */
.weeknav { padding: 16px 16px 4px; }
.weeknav .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.weeknav .wlabel { text-align: center; line-height: 1.3; }
.weeknav .wlabel .m { font-size: 13px; color: var(--muted); font-weight: 700; }
.weeknav .wlabel .w { font-size: 18px; font-weight: 800; color: var(--navy); }
.weeknav .wlabel .prog { font-size: 11px; color: var(--navy-2); font-weight: 800; letter-spacing: 0.06em; }
.nav-arrow {
  width: 40px; height: 40px; flex: 0 0 auto; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--navy); font-size: 18px; display: grid; place-items: center;
  box-shadow: var(--shadow-sm);
}
.nav-arrow:active { background: var(--surface-2); }

.daystrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.daychip {
  position: relative; border: 1px solid var(--line); background: var(--surface);
  border-radius: 12px; padding: 8px 2px 9px; text-align: center; cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.08s ease, border-color 0.15s ease, background 0.15s ease;
}
.daychip:active { transform: scale(0.96); }
.daychip .dow { font-size: 10px; color: var(--muted); font-weight: 700; }
.daychip .dnum { font-size: 16px; font-weight: 800; margin-top: 2px; color: var(--text); }
.daychip .dot { width: 5px; height: 5px; border-radius: 50%; margin: 4px auto 0; background: transparent; }
.daychip.has .dot { background: var(--navy); }
.daychip.mob .dot { background: var(--rpe); }
.daychip.today { border-color: var(--navy); }
.daychip.today .dow { color: var(--navy); }
.daychip.sel { background: var(--navy); border-color: var(--navy); box-shadow: 0 8px 18px rgba(20,18,79,0.30); }
.daychip.sel .dow, .daychip.sel .dnum { color: #fff; }
.daychip.sel .dot { background: rgba(255,255,255,0.9); }

/* DAY 1〜N タブ（構造化メニューの日切替）。daystripを流用し均等割り */
.daystrip:has(.daytab) { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.daytab {
  flex: 1 1 0; min-width: 64px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 12px; padding: 8px 4px 9px; text-align: center; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: transform 0.08s ease, border-color 0.15s ease, background 0.15s ease;
}
.daytab:active { transform: scale(0.96); }
.daytab .dt-d { font-size: 10px; color: var(--muted); font-weight: 800; letter-spacing: 0.08em; }
.daytab .dt-n { font-size: 19px; font-weight: 900; margin-top: 1px; color: var(--text); line-height: 1.1; }
.daytab.sel { background: var(--navy); border-color: var(--navy); box-shadow: 0 8px 18px rgba(20,18,79,0.30); }
.daytab.sel .dt-d, .daytab.sel .dt-n { color: #fff; }

/* ---------- カテゴリ選択 ---------- */
.catbar { padding: 14px 16px 6px; }
.catbar label { display: block; font-size: 11px; color: var(--muted); font-weight: 800; letter-spacing: 0.1em; margin-bottom: 7px; }

/* ログイン状態バー */
.loginbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px;
  padding: 9px 11px; margin-bottom: 11px;
  background: var(--navy-softer); border: 1px solid var(--line); border-radius: 12px;
  font-size: 12px;
}
.loginbar .lb-user { font-weight: 800; color: var(--navy); }
.loginbar .lb-note { color: var(--muted); flex: 1 1 auto; min-width: 120px; }
.loginbar .lb-link {
  flex: 0 0 auto; text-decoration: none; font-weight: 800; font-size: 12px;
  color: var(--navy); padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface);
}
.loginbar .lb-link.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.select-wrap { position: relative; }
.select-wrap::after {
  content: "▾"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  color: var(--navy); font-size: 14px; pointer-events: none;
}
select.cat, input.cat {
  width: 100%; appearance: none; -webkit-appearance: none;
  background: var(--surface);
  border: 1.5px solid var(--line-2); color: var(--text);
  font-size: 16px; font-weight: 700; font-family: var(--font);
  padding: 14px 44px 14px 16px; border-radius: 14px; box-shadow: var(--shadow-sm);
}
select.cat:focus, input.cat:focus { outline: none; border-color: var(--navy); }
input.cat::placeholder { color: var(--muted-2); font-weight: 600; }

/* ---------- セクション見出し / Dayカード ---------- */
.content { padding: 8px 16px 10px; }

.sample-note {
  display: flex; gap: 8px; align-items: center;
  background: var(--rpe-bg); border: 1px solid var(--rpe-line);
  color: #1a4fa0; font-size: 12px; font-weight: 700; padding: 9px 12px; border-radius: 11px; margin-bottom: 12px;
}

.day-head { display: flex; align-items: flex-start; gap: 12px; margin: 6px 2px 14px; }
.day-badge {
  flex: 0 0 auto; width: 54px; height: 54px; border-radius: 14px;
  background: var(--navy); display: grid; place-items: center; text-align: center;
  box-shadow: var(--shadow-sm);
}
.day-badge .d { font-size: 9px; color: rgba(255,255,255,0.7); font-weight: 800; letter-spacing: 0.12em; }
.day-badge .n { font-size: 22px; font-weight: 900; line-height: 1; color: #fff; }
.day-head .meta { flex: 1; min-width: 0; }
.day-head .theme { font-size: 17px; font-weight: 800; line-height: 1.35; color: var(--navy); }
.day-head .sub { font-size: 12px; color: var(--muted); margin-top: 3px; font-weight: 700; }

/* ペアリンググループ */
.group { margin-bottom: 12px; }
.group-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 800; color: var(--navy-2);
  letter-spacing: 0.1em; margin: 0 2px 7px; text-transform: uppercase;
}
.group-label::before { content: ""; width: 14px; height: 2px; background: var(--navy-2); border-radius: 2px; }

/* 種目カード */
.ex-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 13px; margin-bottom: 9px; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: transform 0.08s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.ex-card:active { transform: scale(0.985); border-color: var(--navy); }
.ex-pair {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 11px;
  background: var(--navy-soft); color: var(--navy);
  display: grid; place-items: center; font-weight: 900; font-size: 13px;
}
.ex-main { flex: 1; min-width: 0; }
.ex-name { font-size: 15px; font-weight: 800; line-height: 1.3; color: var(--text); }
.ex-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.stat {
  font-size: 11px; font-weight: 700; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 3px 8px; border-radius: 7px;
}
.stat b { color: var(--text); font-weight: 800; }
.badge-int { font-size: 10.5px; font-weight: 800; padding: 3px 8px; border-radius: 7px; }
.badge-int.rir { background: var(--rir-bg); color: var(--rir); border: 1px solid var(--rir-line); }
.badge-int.rpe { background: var(--rpe-bg); color: var(--rpe); border: 1px solid var(--rpe-line); }
.badge-int.other { background: var(--navy-soft); color: var(--navy); border: 1px solid var(--line-2); }
.ex-note { font-size: 11px; color: var(--navy-2); margin-top: 6px; font-weight: 700; }
.ex-chev { flex: 0 0 auto; color: var(--muted-2); font-size: 18px; }

/* 休養・モビリティ・外部リンクのカード */
.rest-card, .ext-card {
  text-align: center; padding: 34px 20px; border-radius: var(--radius);
  border: 1px dashed var(--line-2); background: var(--surface);
}
.rest-card .ico { font-size: 30px; }
.rest-card .t { font-weight: 800; font-size: 16px; margin-top: 6px; color: var(--navy); }
.rest-card .s { color: var(--muted); font-size: 13px; margin-top: 4px; }
.ext-card { border-style: solid; border-color: var(--line); background: var(--navy-softer); box-shadow: var(--shadow-sm); }
.btn-ext {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 14px;
  background: var(--navy); color: #fff;
  font-weight: 800; font-size: 14px; padding: 12px 20px; border-radius: 12px;
  box-shadow: 0 8px 18px rgba(20,18,79,0.28);
}

/* RIR/RPE凡例 */
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 4px 4px 16px; font-size: 11px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend .l-rir { background: var(--rir); }
.legend .l-rpe { background: var(--rpe); }

/* ---------- ボトムタブ ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: rgba(255,255,255,0.94); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 0 9px; color: var(--muted-2); font-size: 10.5px; font-weight: 700;
}
.tabbar a .ti { font-size: 20px; }
.tabbar a.active { color: var(--navy); }

/* ---------- 種目解説ページ ---------- */
.detail-hero {
  position: relative; padding: calc(env(safe-area-inset-top) + 8px) 18px 22px;
  background: var(--navy);
  color: #fff;
}
.detail-hero .back-btn { color: rgba(255,255,255,0.8); }
.back-btn {
  display: inline-flex; align-items: center; gap: 6px; color: var(--muted);
  font-size: 13px; font-weight: 700; margin-bottom: 16px; padding: 6px 0;
}
.detail-hero .area-tag {
  display: inline-block; font-size: 11px; font-weight: 800; color: #fff;
  background: rgba(255,255,255,0.16); padding: 4px 11px; border-radius: 20px; letter-spacing: 0.05em;
}
.detail-hero h1 { font-size: 25px; font-weight: 900; margin: 12px 0 8px; line-height: 1.25; color: #fff; }
.detail-hero .summary { color: rgba(255,255,255,0.82); font-size: 14px; line-height: 1.7; }
.detail-hero .equip { margin-top: 12px; font-size: 12px; color: rgba(255,255,255,0.62); font-weight: 700; }

.video-ph {
  margin: 16px; aspect-ratio: 16/9; border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--line); display: grid; place-items: center; text-align: center; color: var(--muted);
}
.video-ph .play { width: 56px; height: 56px; border-radius: 50%; background: var(--navy); display: grid; place-items: center; color: #fff; font-size: 22px; box-shadow: var(--shadow); }
.video-ph .cap { font-size: 12px; margin-top: 10px; font-weight: 700; }

/* YouTube埋め込み */
.video-embed { margin: 16px; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #000; }
.video-embed iframe { width: 100%; height: 100%; border: 0; display: block; }

/* WP本文（今週のメニュー本文・種目解説本文） */
.wp-content { font-size: 15px; line-height: 1.8; color: var(--text); word-break: break-word; }
.wp-content p { margin: 0 0 14px; }
.wp-content h2, .wp-content h3, .wp-content h4 { color: var(--navy); font-weight: 800; margin: 22px 0 10px; line-height: 1.4; }
.wp-content h2 { font-size: 18px; } .wp-content h3 { font-size: 16px; } .wp-content h4 { font-size: 15px; }
.wp-content ul, .wp-content ol { margin: 0 0 14px; padding-left: 1.3em; }
.wp-content li { margin-bottom: 6px; }
.wp-content a { color: var(--rpe); }
.wp-content img { max-width: 100%; height: auto; border-radius: 12px; }
.wp-content iframe { max-width: 100%; border-radius: 12px; }
.wp-content table { width: 100%; border-collapse: collapse; margin: 0 0 14px; font-size: 14px; }
.wp-content th, .wp-content td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.wp-content th { background: var(--navy-soft); color: var(--navy); font-weight: 800; }
.wp-content blockquote { border-left: 3px solid var(--navy); margin: 0 0 14px; padding: 4px 0 4px 14px; color: var(--muted); }
.wp-body .wp-content { padding: 12px 0 4px; }

/* 本文中の種目名リンク（種目辞典へ） */
.ex-link {
  color: var(--navy); font-weight: 700; text-decoration: none;
  border-bottom: 2px solid var(--navy-soft); padding-bottom: 1px;
}
.ex-link::after { content: "›"; font-size: 0.85em; margin-left: 1px; opacity: 0.7; }
.ex-link:active { opacity: 0.6; }

.detail-body { padding: 4px 16px 20px; }
.sec { margin-bottom: 22px; }
.sec h2 { font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 8px; margin: 18px 0 11px; color: var(--navy); }
.sec h2::before { content: ""; width: 4px; height: 16px; background: var(--navy); border-radius: 3px; }
.sec ol, .sec ul { margin: 0; padding-left: 0; list-style: none; counter-reset: step; }
.sec ol li {
  counter-increment: step; position: relative; padding: 11px 12px 11px 44px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 11px; margin-bottom: 8px; font-size: 14px; line-height: 1.55; box-shadow: var(--shadow-sm);
}
.sec ol li::before {
  content: counter(step); position: absolute; left: 11px; top: 11px;
  width: 22px; height: 22px; border-radius: 7px; background: var(--navy-soft); color: var(--navy);
  font-weight: 900; font-size: 12px; display: grid; place-items: center;
}
.sec ul li {
  position: relative; padding: 9px 12px 9px 30px; font-size: 14px; line-height: 1.55;
  border-bottom: 1px solid var(--line);
}
.sec ul li::before { content: ""; position: absolute; left: 10px; top: 16px; width: 7px; height: 7px; border-radius: 2px; background: var(--good); }
.sec.ng ul li::before { background: #d64545; transform: rotate(45deg); border-radius: 1px; }

.callout {
  background: var(--rir-bg); border: 1px solid var(--rir-line); color: #7a5200;
  border-radius: 12px; padding: 13px 14px; font-size: 13px; line-height: 1.6;
}
.callout b { color: var(--rir); }

/* ---------- 座学ページ ---------- */
.zg-hero { padding: calc(env(safe-area-inset-top) + 20px) 18px 18px; }
.zg-hero h1 { font-size: 24px; font-weight: 900; margin: 4px 0 6px; color: var(--navy); }
.zg-hero p { color: var(--muted); font-size: 14px; line-height: 1.7; }
.zg-card {
  display: flex; gap: 14px; align-items: center; margin: 0 16px 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm);
}
.zg-card .ic { width: 46px; height: 46px; flex: 0 0 auto; border-radius: 12px; background: var(--navy-soft); display: grid; place-items: center; font-size: 22px; }
.zg-card .tx { flex: 1; }
.zg-card .tx .t { font-weight: 800; font-size: 15px; color: var(--navy); }
.zg-card .tx .s { color: var(--muted); font-size: 12px; margin-top: 3px; line-height: 1.5; }
.zg-card .chev { color: var(--muted-2); font-size: 18px; }

/* ---------- 汎用 ---------- */
.hint { text-align: center; color: var(--muted-2); font-size: 11px; padding: 18px 16px 6px; line-height: 1.6; }
.fade { animation: fade 0.25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* アイキャッチ画像 */
.eyecatch { padding: 4px 16px 0; }
.eyecatch img {
  display: block; width: 100%; height: 168px; object-fit: cover;
  border-radius: 14px; border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(20,18,79,.10);
}
/* コーチのコメント */
.coach {
  margin: 12px 16px 0; padding: 13px 15px;
  background: var(--navy-softer); border: 1px solid var(--line);
  border-left: 4px solid var(--navy); border-radius: 12px;
}
.coach-head { font-size: 12px; font-weight: 800; color: var(--navy); letter-spacing: .04em; display: flex; align-items: center; gap: 6px; }
.coach-head .coach-ic { font-size: 13px; }
.coach-body { font-size: 14px; line-height: 1.7; color: var(--text); margin-top: 6px; white-space: pre-wrap; }
.coach-by { font-size: 11.5px; color: var(--muted); font-weight: 700; text-align: right; margin-top: 6px; }
