/* =========================================================
   EA Portfolio Simulator v2  (/portfolio/)
   すべて .epx 配下にスコープする
   ========================================================= */

.epx {
  --o: #f97316;
  --o-dark: #e05f06;
  --o-soft: #fff4ea;
  --o-line: #f6d2ae;
  --g: #16a34a;
  --g-soft: #eef8f2;
  --g-line: #cde9d9;
  --r: #e0483f;
  --r-soft: #fdefee;
  --w: #e08c0b;
  --w-soft: #fdf6e8;
  --w-line: #f0dcb4;
  --b: #3b82f6;
  --ink: #1c2029;
  --ink2: #3f4653;
  --mute: #757d8a;
  --line: #eae6df;
  --line2: #f3efe9;
  --tint: #fbfaf8;
  --bg: #ffffff;
  --card-sh: 0 1px 1px rgba(28,32,41,.03), 0 6px 20px rgba(28,32,41,.035);
  --ease: cubic-bezier(.22,.61,.36,1);

  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px 64px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

.epx *, .epx *::before, .epx *::after { box-sizing: border-box; }
.epx h1, .epx h2, .epx h3 { margin: 0; line-height: 1.4; font-weight: 700; letter-spacing: .005em; }
.epx p { margin: 0; }
.epx ul { margin: 0; padding: 0; list-style: none; }
.epx button { font: inherit; color: inherit; cursor: pointer; }
/* ★サイト共通CSS(Astra)が `button:hover, button:focus` に background-color と color を当てる (0,1,1)。
   .epx の部品指定は (0,1,0) なので、クリック/ホバーのたびにテーマ色で塗り潰される
   （タブをクリックすると帯全体がオレンジになる）。ここで一度素に戻し、
   塗りを持つ部品は「6. hover / focus の復元」で (0,2,0) 以上を後に書いて上書きする。 */
.epx :where(button):hover,
.epx :where(button):focus {
  background-color: transparent;
  color: inherit;
}
.epx svg { display: block; fill: currentColor; }
.epx img { max-width: 100%; height: auto; }
/* 数字は等幅にして桁を揃える（比較する画面なので効く） */
.epx-kpi b, .epx-ea-metric b, .epx-mini-nums b, .epx-table td, .epx-monthly td,
.epx-corr td, .epx-fund b, .epx-sel-lot, .epx-field input, .epx-donut-legend span,
.epx-updated {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.epx :focus-visible { outline: 2px solid var(--o); outline-offset: 2px; border-radius: 6px; }
/* テーマ側が a に underline を !important で付けるので、UI部品だけ打ち消す（本文リンクは下線を残す） */
.epx-btn, .epx-cta-btn, .epx-ea-name, .epx-crumb a, .epx-ea-thumb, .epx-donut-legend a { text-decoration: none !important; }
.epx-crumb a:hover, .epx-ea-name:hover { text-decoration: underline !important; }
.epx-seo a, .epx-faq-a a { text-decoration: underline !important; }

.epx-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--card-sh);
  padding: 20px;
}
.epx-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.epx-card-head h2 {
  font-size: 16px; letter-spacing: .01em; position: relative; padding-left: 11px;
}
.epx-card-head h2::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 15px; border-radius: 2px; background: var(--o);
}
.epx-card-head--wide { justify-content: space-between; }
.epx-count {
  margin-left: auto; font-size: 11.5px; color: var(--mute);
  background: var(--tint); border: 1px solid var(--line2);
  border-radius: 999px; padding: 2px 10px; white-space: nowrap;
}
.epx-note { font-size: 11.5px; color: var(--mute); line-height: 1.55; margin: 0; }
.epx-num { text-align: right; }
.is-pos { color: var(--g); }
.is-neg { color: var(--r); }

/* ---------- toast ---------- */
.epx-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: #262b36; color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 13px; line-height: 1.6; text-align: left; z-index: 99999; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; max-width: min(480px, calc(100vw - 32px));
}
.epx-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.epx-toast--error { background: #b91c1c; }
.epx-toast--warn { background: #b45309; }

/* =========================================================
   1. HERO  （ポートフォリオ・オービット装飾）
   ========================================================= */
/* ヒーローだけ全幅にするためのラッパ。max-width と左右 padding を外すだけで
   画面幅ちょうどになる（親の .ast-container が全幅・padding 0 なので 100vw が要らない）。 */
/* ★クラスを2つ重ねて (0,2,0) にする。`.epx--full`(0,1,0) だと
   後方の `@media(max-width:720px){ .epx{padding:0 12px 40px} }` に負けて SP だけ全幅にならない。 */
.epx.epx--full { max-width: none; padding: 0; }

.epx-hero { position: relative; padding: 26px 0 34px; }
/* 白〜ごく薄い暖色。右側だけ温度を上げ、下端はサイトの白へ戻す */
.epx-hero::before {
  content: ""; position: absolute; z-index: 0; inset: 0;
  background:
    radial-gradient(104% 90% at 72% 42%, rgba(255,238,222,.62) 0%, rgba(255,248,241,.40) 42%, rgba(255,255,255,0) 74%),
    linear-gradient(180deg, #fffdfb 0%, #fffaf6 60%, #ffffff 100%);
  pointer-events: none;
}
.epx-hero-inner {
  position: relative; z-index: 1;
  /* 背景は全幅。中身は .epx と同じ 1240px + 20px にして、下のシミュレーターと左端を揃える */
  max-width: 1240px; margin-inline: auto; padding-inline: 20px;
  /* 左をわずかに広くする。均等（580px）だと h1 が 3 行に折れる（実測 h1 幅 580px / 44px 時） */
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: 40px; align-items: center;
}
.epx-crumb { font-size: 12px; color: var(--mute); display: flex; gap: 8px; margin-bottom: 18px; }
.epx-crumb a { color: var(--mute); text-decoration: none; }
.epx-crumb a:hover { color: var(--o); }

/* 小見出し（PORTFOLIO）＋短い下線 */
.epx-eyebrow {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 9px;
  font-size: 12px; font-weight: 700; color: var(--o-dark);
  letter-spacing: .2em; line-height: 1;
}
.epx-eyebrow::after { content: ""; width: 30px; height: 2px; border-radius: 2px; background: var(--o); }

.epx-h1 { font-size: clamp(28px, 3.2vw, 44px); margin: 20px 0 16px; letter-spacing: -.02em; line-height: 1.32; }
.epx-lead { color: var(--ink2); font-size: 15px; max-width: 27em; line-height: 1.9; }
.epx-hero-btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.epx-btn {
  display: inline-flex; align-items: center; gap: 9px; text-decoration: none;
  border-radius: 11px; padding: 13px 24px; font-size: 14.5px; font-weight: 700;
  border: 1px solid transparent; transition: background .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease), transform .12s var(--ease);
}
.epx-btn svg { width: 18px; height: 18px; flex: none; }
.epx-btn--primary { background: var(--o); color: #fff; box-shadow: 0 2px 6px rgba(224,95,6,.2), 0 8px 20px rgba(224,95,6,.16); }
.epx-btn--primary:hover { background: var(--o-dark); color: #fff; box-shadow: 0 3px 8px rgba(224,95,6,.24), 0 12px 26px rgba(224,95,6,.18); transform: translateY(-1px); }
.epx-btn--ghost { background: #fff; border-color: var(--o-line); color: var(--o-dark); }
/* ★色は hover/focus とも明示する。テーマ(Astra)の `a:hover` が色を持っていて、
   指定しないとゴーストボタンの文字だけリンク色（青）に変わる（実測 rgb(0,86,179)）。 */
.epx-btn--ghost:hover, .epx-btn--ghost:focus { border-color: var(--o); background: var(--o-soft); color: var(--o-dark); }
.epx-btn--ghost:hover { transform: translateY(-1px); }
.epx-btn--primary:focus { color: #fff; }
.epx-btn:active { transform: translateY(0); }

/* CTA 下の特徴。カードにせず薄い枠線のピルにする。
   ★セレクタに ul を含めること。`.epx ul{margin:0}` が (0,1,1) なので
   `.epx-hero-feats`(0,1,0) では margin-top が効かず CTA に貼り付く（実測 marginTop:0px）。 */
.epx ul.epx-hero-feats { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }
.epx-hero-feats li {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--ink2); line-height: 1.5;
  background: rgba(255,255,255,.76); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 14px;
}
.epx-hero-feats svg { width: 15px; height: 15px; color: var(--o); flex: none; }

/* ---------- 右：ポートフォリオ・オービット装飾 ---------- */
/* aspect-ratio で幅から高さを確定させるので、画像を待たずに高さが決まる＝CLS が出ない */
/* 2カラムのときはコンテンツ右端に寄せる（全幅の背景へ溶ける見え方にする） */
.epx-hero-orbit { position: relative; width: 100%; max-width: 545px; margin-inline: auto 0; aspect-ratio: 1 / 1; }
/* 背景装飾だけ右端に向けてフェードさせる（ノードはこの中に入れない） */
/* ★overflow:hidden は必須。中の `.epx-orbit-spin` は正方形なので、回転すると
   外接矩形が √2 倍に膨らんでページに横スクロールを作る（実測 1180px で 48px・回転角次第で
   出たり出なかったりするので、一度測って 0 でも安心できない）。 */
.epx-orbit-deco {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
  -webkit-mask-image: linear-gradient(100deg, #000 0%, #000 52%, rgba(0,0,0,.4) 82%, rgba(0,0,0,0) 100%);
          mask-image: linear-gradient(100deg, #000 0%, #000 52%, rgba(0,0,0,.4) 82%, rgba(0,0,0,0) 100%);
}
/* ごく薄いドットグリッド */
.epx-orbit-dots {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(163,148,128,.28) 1px, rgba(0,0,0,0) 1.2px);
  background-size: 21px 21px;
  -webkit-mask-image: radial-gradient(closest-side at 48% 50%, #000 30%, rgba(0,0,0,.38) 70%, rgba(0,0,0,0) 100%);
          mask-image: radial-gradient(closest-side at 48% 50%, #000 30%, rgba(0,0,0,.38) 70%, rgba(0,0,0,0) 100%);
}
/* ごく薄い右肩上がりの曲線 / 円形軌道（`.epx svg{display:block}` があるので位置は個別に指定する） */
.epx .epx-orbit-curve, .epx .epx-orbit-rings { position: absolute; inset: 0; width: 100%; height: 100%; }
.epx .epx-orbit-curve { opacity: .9; }
/* 中央の光（コアの外へ淡く広がる） */
.epx-orbit-glow {
  position: absolute; left: 50%; top: 50%; width: 80%; aspect-ratio: 1;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, rgba(255,185,122,.20) 0%, rgba(255,213,174,.09) 44%, rgba(255,255,255,0) 70%);
}
/* 半透明のガラス状の円形コア */
.epx-orbit-core {
  position: absolute; left: 50%; top: 50%; width: 41%; aspect-ratio: 1;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle at 50% 28%, rgba(255,255,255,.95) 0%, rgba(255,255,255,.56) 44%, rgba(255,249,243,.40) 100%);
  border: 1px solid rgba(255,255,255,.9);
  box-shadow:
    0 20px 44px rgba(193,141,88,.12),
    0 4px 14px rgba(193,141,88,.06),
    inset 0 1px 2px rgba(255,255,255,1),
    inset 0 -14px 30px rgba(255,236,220,.5);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
/* コア中心の淡いオレンジの光 */
.epx-orbit-core::after {
  content: ""; position: absolute; inset: 16%; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,163,78,.46) 0%, rgba(255,196,143,.23) 36%, rgba(255,230,211,.08) 64%, rgba(255,255,255,0) 78%);
  filter: blur(7px);
}
/* 軌道上の粒子。ごくゆっくり回る（prefers-reduced-motion では共通指定で止まる） */
.epx-orbit-spin { position: absolute; inset: 0; animation: epxOrbitSpin 96s linear infinite; }
@keyframes epxOrbitSpin { to { transform: rotate(360deg); } }
.epx-orbit-dot {
  position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%);
  width: var(--s, 5px); height: var(--s, 5px); border-radius: 50%;
  background: var(--c, var(--o)); opacity: var(--op, .68);
}
/* 軌道上のノード（白〜半透明・薄い枠線・ごく弱い影） */
.epx-orbit-node {
  position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%);
  width: clamp(56px, 17.5%, 94px); aspect-ratio: 1; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: rgba(255,255,255,.66);
  border: 1px solid rgba(255,255,255,.9);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.95),
    0 0 0 1px rgba(240,229,215,.78),
    0 6px 15px rgba(190,148,102,.11);
  -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
}
.epx-orbit-node i { font-style: normal; font-weight: 700; color: var(--o); font-size: clamp(13px, 1.4vw, 19px); line-height: 1.1; }
.epx-orbit-node b { font-weight: 600; color: #626976; letter-spacing: .02em; font-size: clamp(8.5px, .78vw, 10.5px); line-height: 1.2; }
.epx-orbit-cap {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  font-size: 10px; letter-spacing: .34em; text-indent: .34em;
  color: #c5b5a2; white-space: nowrap;
}

/* =========================================================
   2. MAIN GRID
   ========================================================= */
.epx-main { display: grid; grid-template-columns: 352px minmax(0, 1fr); gap: 20px; align-items: start; }
.epx-side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 16px; }
.epx-result { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* ---------- 左：検索・フィルタ ---------- */
.epx-search { position: relative; margin-bottom: 10px; }
.epx-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: #9aa1ad; fill: none; }
.epx-search input {
  width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--tint);
  padding: 0 12px 0 34px; font-size: 13.5px; color: var(--ink);
  transition: border-color .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease);
}
.epx-search input:focus { background: #fff; border-color: var(--o); outline: none; box-shadow: 0 0 0 3px rgba(249,115,22,.1); }

.epx-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.epx-chip {
  height: 30px; border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 0 13px; font-size: 12px; color: var(--ink2);
  transition: border-color .18s var(--ease), background .18s var(--ease), color .18s var(--ease);
}
.epx-chip:hover { border-color: #ddd6ca; background: var(--tint); }
.epx-chip.is-on { background: var(--o); border-color: var(--o); color: #fff; font-weight: 700; }
.epx-chip.is-on:hover { background: var(--o-dark); border-color: var(--o-dark); }

.epx-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.epx-select { display: block; }
.epx-select-cap { display: block; font-size: 10.5px; color: var(--mute); margin-bottom: 4px; letter-spacing: .02em; }
.epx-select select {
  width: 100%; height: 34px; border: 1px solid var(--line); border-radius: 9px; background: #fff;
  padding: 0 26px 0 10px; font-size: 12.5px; color: var(--ink);
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%236b7280' d='M5.5 7.5 10 12l4.5-4.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px center; background-size: 16px;
}
.epx-select select:focus { border-color: var(--o); outline: none; }

.epx-opts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 8px; }
.epx-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: #4b5261; cursor: pointer; }
.epx-check input { width: 15px; height: 15px; accent-color: var(--o); margin: 0; }
.epx-note--list { margin-bottom: 8px; }

/* ---------- 左：EA一覧 ---------- */
.epx-ea-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 560px; overflow-y: auto; overscroll-behavior: contain;
  padding: 2px 4px 2px 2px; margin-right: -4px;
}
.epx-ea-list::-webkit-scrollbar { width: 8px; }
.epx-ea-list::-webkit-scrollbar-thumb { background: #ddd7cd; border-radius: 4px; }

.epx-ea {
  position: relative;
  display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 11px;
  border: 1px solid var(--line); border-radius: 13px; padding: 11px;
  background: #fff; transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.epx-ea:hover { border-color: #ddd6ca; box-shadow: 0 2px 10px rgba(28,32,41,.05); }
.epx-ea.is-added { border-color: var(--o-line); background: #fffcf8; box-shadow: 0 0 0 1px var(--o-line) inset; }
.epx-ea[hidden] { display: none; }
.epx-ea-thumb { width: 44px; height: 44px; border-radius: 9px; overflow: hidden; background: #f4f1ec; display: block; }
.epx-ea-thumb img { width: 100%; height: 100%; object-fit: cover; }
.epx img.is-broken { opacity: 0; }
.epx-ea-body { min-width: 0; }
.epx-ea-name {
  display: block; font-size: 13.5px; font-weight: 700; color: var(--ink); text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 22px;
}
.epx-ea-name:hover { color: var(--o); }
.epx-ea-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 5px 0 8px; }
.epx-tag {
  font-size: 10px; color: var(--ink2); background: var(--tint); border: 1px solid var(--line2);
  border-radius: 5px; padding: 1px 6px; line-height: 1.6; letter-spacing: .01em;
}
.epx-tag--cat { background: var(--o-soft); border-color: var(--o-line); color: #b45309; }
.epx-ea-metrics {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px;
  border-top: 1px solid var(--line2); padding-top: 7px;
}
.epx-ea-metric { min-width: 0; }
.epx-ea-metric span { display: block; font-size: 9.5px; color: var(--mute); line-height: 1.4; letter-spacing: .02em; }
.epx-ea-metric b { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }

.epx-fav {
  position: absolute; top: 8px; right: 8px; width: 24px; height: 24px;
  background: none; border: 0; padding: 0; color: #c8cdd6; display: grid; place-items: center;
}
.epx-fav svg { width: 17px; height: 17px; fill: none; }
.epx-fav:hover { color: var(--w); }
.epx-fav[aria-pressed="true"] { color: var(--w); }
.epx-fav[aria-pressed="true"] svg { fill: var(--w); }

.epx-add {
  grid-column: 2; justify-self: end;
  display: inline-flex; align-items: center; gap: 5px; height: 30px;
  background: var(--o); color: #fff; border: 1px solid var(--o); border-radius: 9px;
  padding: 0 13px; font-size: 12px; font-weight: 700; margin-top: 9px;
  transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}
.epx-add svg { width: 14px; height: 14px; }
.epx-add:hover { background: var(--o-dark); border-color: var(--o-dark); }
.epx-ea.is-added .epx-add { background: #fff; color: var(--o); }
.epx-ea.is-added .epx-add svg { display: none; }
.epx-ea.is-added .epx-add::before {
  content: ""; width: 13px; height: 13px; flex: none; border-radius: 50%;
  background: var(--o); position: relative;
  -webkit-mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M8.2 14 4 9.8l1.3-1.3 2.9 2.9 6.5-6.5L16 6.2z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M8.2 14 4 9.8l1.3-1.3 2.9 2.9 6.5-6.5L16 6.2z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.epx-empty { text-align: center; color: var(--mute); font-size: 13px; padding: 24px 8px; }
.epx-more {
  width: 100%; margin-top: 10px; background: #fff; border: 1px dashed var(--line);
  border-radius: 10px; padding: 9px; font-size: 12.5px; color: #4b5261; font-weight: 600;
}
.epx-more:hover { border-color: var(--o); color: var(--o); background: #fffaf5; }
.epx-more[hidden] { display: none; }

/* ---------- 左：選択中 ---------- */
.epx-selected { display: flex; flex-direction: column; gap: 6px; min-height: 42px; }
.epx-sel-item {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) 62px 26px 24px;
  gap: 6px; align-items: center;
  border: 1px solid var(--line2); border-radius: 10px; padding: 6px 8px; background: #fcfbf9;
}
.epx-sel-item img { width: 28px; height: 28px; border-radius: 7px; object-fit: cover; background: #f0ece6; }
.epx-sel-name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.epx-sel-lot {
  width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 5px 6px;
  font-size: 12.5px; text-align: right; background: #fff; color: var(--ink);
}
.epx-sel-lot:focus { border-color: var(--o); outline: none; }
.epx-sel-unit { font-size: 11px; color: var(--mute); }
.epx-sel-del {
  width: 24px; height: 24px; border: 0; background: none; color: #9aa1ad;
  display: grid; place-items: center; border-radius: 6px; font-size: 16px; line-height: 1;
}
.epx-sel-del:hover { background: var(--r-soft); color: var(--r); }
.epx-sel-empty { font-size: 12px; color: var(--mute); text-align: center; padding: 10px 4px; }

.epx-fund {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 14px 0 10px; padding: 11px 13px; border-radius: 11px;
  background: var(--tint); border: 1px solid var(--line2);
  font-size: 12.5px; color: var(--ink2);
}
.epx-fund b { font-size: 15px; color: var(--ink); letter-spacing: -.01em; }
.epx-help {
  width: 15px; height: 15px; border-radius: 50%; border: 1px solid #c9cfd8; background: #fff;
  color: var(--mute); font-size: 10px; line-height: 1; padding: 0; margin-left: 3px;
  display: inline-grid; place-items: center; vertical-align: middle;
}
.epx-help:hover { border-color: var(--o); color: var(--o); }

.epx-alloc { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 12px; padding: 3px; background: var(--tint); border: 1px solid var(--line2); border-radius: 11px; }
.epx-alloc-btn {
  border: 1px solid transparent; background: none; border-radius: 8px; padding: 8px 4px;
  font-size: 11.5px; color: var(--mute); font-weight: 600; white-space: nowrap;
  transition: background .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease);
}
.epx-alloc-btn:hover { color: var(--ink2); }
.epx-alloc-btn.is-on { background: #fff; border-color: var(--line); color: var(--ink); box-shadow: 0 1px 2px rgba(28,32,41,.05); }

.epx-run {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--o); border: 0; color: #fff; border-radius: 11px; padding: 14px;
  font-size: 15px; font-weight: 700; letter-spacing: .01em;
  box-shadow: 0 2px 6px rgba(224,95,6,.22), 0 8px 20px rgba(224,95,6,.18);
  transition: background .18s var(--ease), box-shadow .18s var(--ease), transform .12s var(--ease);
}
.epx-run svg { width: 18px; height: 18px; }
.epx-run:hover { background: var(--o-dark); transform: translateY(-1px); box-shadow: 0 3px 8px rgba(224,95,6,.26), 0 12px 26px rgba(224,95,6,.2); }
.epx-run:active { transform: translateY(0); }
.epx-run:disabled { background: #ddd9d1; box-shadow: none; cursor: not-allowed; transform: none; }
.epx-run.is-busy svg { animation: epx-spin 1s linear infinite; }
@keyframes epx-spin { to { transform: rotate(360deg); } }
.epx-cart {
  width: 100%; margin-top: 8px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 9px; font-size: 12.5px; color: #4b5261; font-weight: 600;
}
.epx-cart:hover { border-color: var(--o); color: var(--o); }
.epx-cart:disabled { opacity: .5; cursor: not-allowed; }

/* =========================================================
   3. 右：分析結果
   ========================================================= */
.epx-updated { font-size: 11.5px; color: var(--mute); }
.epx-controls {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 12px 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line2); margin-bottom: 16px;
}
.epx-ranges { display: flex; flex-wrap: wrap; gap: 3px; padding: 3px; background: var(--tint); border: 1px solid var(--line2); border-radius: 11px; }
.epx-range {
  border: 1px solid transparent; background: none; border-radius: 8px; height: 30px;
  padding: 0 13px; font-size: 12px; color: var(--mute);
  transition: background .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease);
}
.epx-range:hover { color: var(--ink2); }
.epx-range.is-on { background: var(--o); border-color: var(--o); color: #fff; font-weight: 700; box-shadow: 0 1px 3px rgba(224,95,6,.25); }
.epx-fields { display: flex; flex-wrap: wrap; gap: 10px; }
.epx-field span { display: block; font-size: 10.5px; color: var(--mute); margin-bottom: 4px; letter-spacing: .02em; }
.epx-field input {
  border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; height: 36px;
  font-size: 12.5px; background: #fff; color: var(--ink); width: 140px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.epx-field input:focus { border-color: var(--o); outline: none; box-shadow: 0 0 0 3px rgba(249,115,22,.1); }
.epx-field-money { position: relative; display: block; }
.epx-field-money input { width: 140px; padding-right: 30px; text-align: right; }
.epx-field-money i { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 11.5px; color: var(--mute); }

/* KPI */
.epx-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; background: var(--line2); border: 1px solid var(--line2); border-radius: 13px; overflow: hidden; }
.epx-kpi {
  padding: 13px 8px 14px; text-align: center; background: #fff;
  min-height: 74px; display: flex; flex-direction: column; justify-content: center; gap: 4px;
}
.epx-kpi span { font-size: 10.5px; color: var(--mute); line-height: 1.35; letter-spacing: .02em; }
.epx-kpi b { font-size: 20px; line-height: 1.15; word-break: break-all; letter-spacing: -.02em; }

/* 診断バナー */
.epx-verdict {
  display: flex; gap: 13px; align-items: flex-start; margin-top: 14px;
  border: 1px solid var(--g-line); background: var(--g-soft); border-radius: 13px; padding: 14px 16px;
}
.epx-verdict.is-warn { border-color: var(--w-line); background: var(--w-soft); }
.epx-verdict.is-bad { border-color: #f2d5d3; background: var(--r-soft); }
.epx-verdict-icon { color: var(--g); flex: none; }
.epx-verdict.is-warn .epx-verdict-icon { color: var(--w); }
.epx-verdict.is-bad .epx-verdict-icon { color: var(--r); }
.epx-verdict-icon svg { width: 26px; height: 26px; fill: none; }
.epx-verdict-title { font-size: 14px; font-weight: 700; }
.epx-verdict-text { font-size: 12.5px; color: #4b5261; margin-top: 2px; }

/* タブ（下線式） */
.epx-tabs {
  display: flex; gap: 2px; margin: 20px 0 0; border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.epx-tabs::-webkit-scrollbar { display: none; }
.epx-tab {
  position: relative; border: 0; background: none; padding: 11px 15px;
  font-size: 13px; color: var(--mute); white-space: nowrap; letter-spacing: .01em;
  transition: color .18s var(--ease);
}
.epx-tab::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px;
  border-radius: 2px 2px 0 0; background: var(--o); opacity: 0; transform: scaleX(.4);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.epx-tab:hover { color: var(--ink2); }
.epx-tab.is-on { color: var(--ink); font-weight: 700; }
.epx-tab.is-on::after { opacity: 1; transform: scaleX(1); }
.epx-panel { padding-top: 18px; }
.epx-panel[hidden] { display: none; }
.epx-panel-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 8px; }
.epx-panel-head h3 { font-size: 14px; }
.epx-panel-note { font-size: 11.5px; color: var(--mute); }
.epx-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-left: auto; }
.epx-legend span { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: #4b5261; }
.epx-legend i { width: 10px; height: 10px; border-radius: 3px; display: block; }

.epx-chart { position: relative; height: 340px; }
.epx-chart canvas { width: 100% !important; height: 100% !important; }
.epx-chart-empty {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  color: var(--mute); font-size: 13px; padding: 18px 14px;
  background: linear-gradient(180deg, #fdfcfa 0%, #faf8f4 100%);
  border: 1px solid var(--line2); border-radius: 12px;
}
.epx-chart-empty[hidden] { display: none; }
/* 空状態のときは高さを内容に合わせる（canvas は隠す）。初期HTMLで is-blank を付けてCLSを出さない */
.epx-chart.is-blank { height: auto; }
.epx-chart.is-blank canvas { display: none; }
.epx-chart.is-blank .epx-chart-empty { position: static; }

/* 下段3カード */
.epx-mini-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.epx-mini-grid[hidden] { display: none; }
.epx-mini { border: 1px solid var(--line2); border-radius: 13px; padding: 14px; background: var(--tint); min-width: 0; }
.epx-mini h3 { font-size: 12.5px; margin-bottom: 10px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; letter-spacing: .02em; }
.epx-mini-sub { font-size: 10.5px; color: var(--mute); font-weight: 400; }
.epx-mini-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin-bottom: 10px; align-items: end; }
.epx-mini-nums > div { display: flex; flex-direction: column; gap: 2px; }
.epx-mini-nums span { display: block; font-size: 9.5px; color: var(--mute); line-height: 1.4; letter-spacing: .02em; min-height: 1.4em; }
.epx-mini-nums b { font-size: 15px; letter-spacing: -.02em; }
.epx-mini-chart { height: 132px; position: relative; }
.epx-mini-chart canvas { width: 100% !important; height: 100% !important; }
.epx-mini-chart--corr { height: auto; min-height: 132px; }
.epx-mini-legend { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--mute); margin-bottom: 4px; }
.epx-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.epx-dot--g { background: var(--g); }
.epx-dot--r { background: var(--r); margin-left: 8px; }

/* 相関ヒートマップ */
.epx-corr { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 2px; font-size: 10.5px; }
.epx-corr th, .epx-corr td { padding: 4px 3px; text-align: center; border-radius: 5px; }
.epx-corr th { color: var(--mute); font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.epx-corr thead th { font-size: 9.5px; }
.epx-corr th.epx-corr-row { text-align: left; width: 34%; }
.epx-mini-chart--corr .epx-corr { font-size: 9.5px; }
.epx-mini-chart--corr .epx-corr th, .epx-mini-chart--corr .epx-corr td { padding: 3px 1px; }
.epx-corr td { font-weight: 700; color: #2b3140; }
.epx-corr-empty { font-size: 12px; color: var(--mute); text-align: center; padding: 26px 6px; }
.epx-corr-scale { display: flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 10px; color: var(--mute); }
.epx-corr-scale i { flex: 1; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #ef4444, #f8f6f2); }
.epx-corr-scale i.epx-corr-scale-g { background: linear-gradient(90deg, #f8f6f2, #16a34a); }

/* 診断4カード */
.epx-diag { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.epx-diag-card {
  border: 1px solid var(--g-line); background: var(--g-soft); border-radius: 13px; padding: 13px;
  display: grid; grid-template-columns: 22px 1fr; gap: 5px 9px; align-items: start;
}
.epx-diag-card.is-warn { border-color: var(--w-line); background: var(--w-soft); }
.epx-diag-card.is-idle { border-color: var(--line2); background: var(--tint); }
.epx-diag-ic { width: 22px; height: 22px; grid-row: span 2; color: var(--g); }
.epx-diag-card.is-warn .epx-diag-ic { color: var(--w); }
.epx-diag-ic svg { width: 22px; height: 22px; fill: none; }
.epx-diag-title { font-size: 12.5px; font-weight: 700; }
.epx-diag-card.is-idle .epx-diag-title { color: var(--mute); }
.epx-diag-card p { grid-column: 2; font-size: 11.5px; color: #4b5261; line-height: 1.55; }
.epx-diag-card.is-idle p { color: #9aa1ad; }

/* 貢献度 */
.epx-contrib { display: grid; grid-template-columns: minmax(0, 1.95fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.epx-table-wrap { overflow-x: auto; }
.epx-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.epx-table th, .epx-table td { padding: 10px 5px; border-bottom: 1px solid var(--line2); text-align: left; white-space: nowrap; }
.epx-table th { font-size: 11px; color: var(--mute); font-weight: 600; letter-spacing: .02em; }
.epx-table tbody tr { transition: background .15s var(--ease); }
.epx-table tbody tr:hover:not(.epx-total-row) { background: var(--tint); }
.epx-table td:first-child, .epx-table th:first-child { white-space: normal; min-width: 118px; padding-left: 2px; }
.epx-table th:last-child, .epx-table td:last-child { width: 58px; padding-right: 2px; }
.epx-name-cell { display: flex; align-items: center; gap: 6px; }
.epx-name-cell i { flex: none; }
.epx-name-cell span { word-break: break-word; }
.epx-table tr.epx-total-row td { border-top: 2px solid var(--line); border-bottom: 0; font-weight: 700; background: #fcfbf9; }
.epx-td-empty { color: var(--mute); text-align: center !important; padding: 26px 8px !important; font-size: 12.5px; }
.epx-share { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.epx-share-bar { width: 44px; height: 6px; border-radius: 3px; background: #efeae2; overflow: hidden; flex: none; }
.epx-share-bar i { display: block; height: 100%; border-radius: 3px; }
.epx-row-act { display: flex; gap: 2px; justify-content: flex-end; }
.epx-row-btn { width: 26px; height: 26px; border: 0; background: none; color: #9aa1ad; border-radius: 6px; display: grid; place-items: center; }
.epx-row-btn svg { width: 15px; height: 15px; fill: none; }
.epx-row-btn:hover { background: #f4f1ec; color: var(--o); }
.epx-row-btn.epx-row-del:hover { background: var(--r-soft); color: var(--r); }

.epx-donut { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.epx-donut-chart { position: relative; width: 100%; max-width: 220px; height: 220px; }
.epx-donut-chart canvas { width: 100% !important; height: 100% !important; }
.epx-donut-label {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none; text-align: center; padding: 0 44px; line-height: 1.3; gap: 1px;
}
.epx-donut-label em { font-style: normal; font-size: 10.5px; color: var(--mute); letter-spacing: .02em; }
.epx-donut-label b { font-size: 17px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.epx-donut-label i { font-style: normal; font-size: 9.5px; color: #a4abb6; letter-spacing: .02em; }
.epx-donut-legend { display: flex; flex-direction: column; gap: 5px; width: 100%; }
.epx-donut-legend li { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.epx-donut-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.epx-donut-legend span:last-child { margin-left: auto; color: var(--mute); }

/* =========================================================
   4. 下部：結果の見方 / 基本 / FAQ / CTA / SEO
   ========================================================= */
.epx-learn { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 18px; margin-top: 20px; }
.epx-howto { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.epx-howto-card {
  border: 1px solid var(--line2); border-radius: 13px; padding: 14px; background: var(--tint);
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.epx-howto-card:hover { border-color: var(--line); background: #fff; }
.epx-howto-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 10px; }
.epx-howto-ic svg { width: 18px; height: 18px; fill: none; }
.epx-howto-ic--o { background: var(--o-soft); color: var(--o); }
.epx-howto-ic--r { background: var(--r-soft); color: var(--r); }
.epx-howto-ic--b { background: #eaf1fc; color: var(--b); }
.epx-howto-card h3 { font-size: 13px; margin-bottom: 6px; }
.epx-howto-card p { font-size: 11.5px; color: var(--ink2); line-height: 1.7; }

.epx-basics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.epx-basic {
  border: 1px solid var(--line2); border-radius: 13px; padding: 14px; background: var(--tint);
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.epx-basic:hover { border-color: var(--line); background: #fff; }
.epx-basic-ic { width: 32px; height: 32px; border-radius: 10px; background: #fff; border: 1px solid var(--line2); color: var(--mute); display: grid; place-items: center; margin-bottom: 10px; }
.epx-basic-ic svg { width: 18px; height: 18px; fill: none; }
.epx-basic h3 { font-size: 12.5px; margin-bottom: 6px; }
.epx-basic p { font-size: 11.5px; color: var(--ink2); line-height: 1.7; }

.epx-bottom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 18px; margin-top: 20px; align-items: stretch; }
.epx-faq details {
  border: 1px solid var(--line2); border-radius: 11px; margin-bottom: 8px; background: var(--tint);
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.epx-faq details[open] { background: #fff; border-color: var(--line); }
.epx-faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 15px; font-size: 13px; font-weight: 600; cursor: pointer; list-style: none;
}
.epx-faq summary::-webkit-details-marker { display: none; }
.epx-faq summary::marker { content: ""; }
.epx-faq summary::after { display: none !important; content: none !important; }
.epx-faq summary svg { width: 16px; height: 16px; color: #9aa1ad; flex: none; transition: transform .2s; }
.epx-faq details[open] summary svg { transform: rotate(90deg); color: var(--o); }
.epx-faq summary:hover { color: var(--o); }
.epx-faq-a { padding: 0 14px 13px; font-size: 12.5px; color: #4b5261; line-height: 1.75; }
.epx-faq-a a { color: var(--o); }

.epx-cta {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 20px; align-items: center;
  background: linear-gradient(118deg, #ef6b0c 0%, #f9843a 48%, #f97316 100%);
  border-radius: 18px; padding: 26px; color: #fff;
  box-shadow: 0 2px 8px rgba(224,95,6,.18), 0 14px 34px rgba(224,95,6,.16);
}
.epx-cta::before {
  content: ""; position: absolute; right: -60px; top: -70px; width: 240px; height: 240px;
  border-radius: 50%; background: rgba(255,255,255,.09); pointer-events: none;
}
.epx-cta > * { position: relative; }
.epx-cta-viz { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: center; }
.epx-cta-eas { display: flex; flex-direction: column; gap: 6px; }
.epx-cta-ea {
  background: rgba(255,255,255,.94); border-radius: 8px; padding: 5px 8px;
  display: grid; grid-template-columns: 34px 1fr; gap: 6px; align-items: center;
}
.epx-cta-ea span { font-size: 10px; color: #4b5261; font-weight: 700; }
.epx-cta-ea svg { width: 100%; height: 18px; }
.epx-cta-sum { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.4); border-radius: 10px; padding: 10px; }
.epx-cta-sum-t { font-size: 11px; font-weight: 700; margin-bottom: 4px; }
.epx-cta-sum svg { width: 100%; height: 46px; }
.epx-cta-text h2 { font-size: 22px; margin-bottom: 8px; }
.epx-cta-text p { font-size: 13px; opacity: .95; margin-bottom: 14px; }
.epx-cta-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.epx-cta-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; color: #d95a02 !important; text-decoration: none; font-weight: 700;
  border-radius: 10px; padding: 11px 20px; font-size: 13.5px; border: 1px solid #fff;
}
.epx-cta-btn:hover { background: #fff6ef; color: #b34700 !important; }
.epx-cta-btn--sec { background: transparent; color: #fff !important; border-color: rgba(255,255,255,.75); }
.epx-cta-btn--sec:hover { background: rgba(255,255,255,.14); color: #fff !important; }

.epx-seo { margin-top: 16px; }
.epx-seo h2 { font-size: 17px; margin: 14px 0 8px; }
.epx-seo h2:first-child { margin-top: 0; }
.epx-seo p { font-size: 13.5px; color: #4b5261; line-height: 1.85; margin-bottom: 10px; }
.epx-seo a { color: var(--o); }

/* =========================================================
   4.5 追加UI（空状態 / ローディング / 共有 / 折りたたみ / ツールチップ）
   ========================================================= */

/* スクリーンリーダー専用 */
.epx-sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ---------- 左：フィルタ折りたたみ ---------- */
.epx-filters {
  border: 1px solid var(--line2); border-radius: 11px; background: var(--tint); margin-bottom: 10px;
}
.epx-filters[open] { background: #fff; border-color: var(--line); }
.epx-filters-sum {
  display: grid; grid-template-columns: minmax(0, 1fr) 15px; gap: 3px 8px;
  align-items: center; padding: 9px 11px; cursor: pointer;
  list-style: none; font-size: 12.5px; font-weight: 600; color: var(--ink2);
}
.epx-filters-sum::-webkit-details-marker { display: none; }
.epx-filters-sum::marker { content: ""; }
.epx-filters summary::after { display: none !important; content: none !important; }
.epx-filters-sum:hover { color: var(--o); }
.epx-filters-cap { grid-column: 1; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.epx-filters-cap svg { width: 14px; height: 14px; fill: none; color: var(--mute); }
.epx-filters-sum:hover .epx-filters-cap svg { color: var(--o); }
.epx-filters-badges {
  grid-column: 1; display: flex; flex-wrap: wrap; gap: 4px; min-width: 0;
}
.epx-filters-badges:empty { display: none; }
.epx-filters-badges b {
  font-size: 10.5px; font-weight: 600; color: #b45309; background: var(--o-soft);
  border: 1px solid var(--o-line); border-radius: 999px; padding: 1px 8px; line-height: 1.6;
  max-width: 132px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.epx-filters-badges b.is-mute { color: var(--mute); background: #fff; border-color: var(--line2); }
.epx-filters-chev {
  grid-column: 2; grid-row: 1 / -1; align-self: center;
  width: 15px; height: 15px; flex: none; color: #9aa1ad; transition: transform .2s var(--ease);
}
.epx-filters[open] .epx-filters-chev { transform: rotate(180deg); }
.epx-filters-body { padding: 2px 11px 11px; }
.epx-filters-reset {
  margin-left: auto; border: 0; background: none; padding: 0; font-size: 11.5px;
  color: var(--mute); text-decoration: underline; text-underline-offset: 2px;
}
.epx-filters-reset:hover { color: var(--o); }
.epx-list-basis {
  display: flex; align-items: center; gap: 2px; font-size: 10.5px; color: var(--mute);
  margin: 0 0 7px; letter-spacing: .01em;
}

/* ---------- 左：カート＋共有 ---------- */
.epx-sub-btns { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 6px; margin-top: 8px; }
.epx-share {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 9px 8px;
  font-size: 12.5px; color: #4b5261; font-weight: 600; white-space: nowrap; min-width: 0;
}
.epx-share svg { width: 14px; height: 14px; fill: none; flex: none; }
.epx-share span { overflow: hidden; text-overflow: ellipsis; }
.epx-share:hover { border-color: var(--o); color: var(--o); }
.epx-share:disabled { opacity: .5; cursor: not-allowed; }
.epx-sub-btns .epx-cart { margin-top: 0; }

/* ---------- KPI：前期間比 ---------- */
.epx-kpi-delta {
  font-style: normal; font-size: 10.5px; line-height: 1.3; color: var(--mute);
  min-height: 1.3em; display: block; font-variant-numeric: tabular-nums;
}
.epx-kpi-delta.is-pos { color: var(--g); }
.epx-kpi-delta.is-neg { color: var(--r); }
.epx-kpi-note {
  display: flex; align-items: center; gap: 2px; font-size: 10.5px; color: var(--mute);
  margin: 7px 0 0; justify-content: flex-end;
}
.epx-kpi-note[hidden] { display: none; }

/* ---------- タブ帯：スクロール可能を示す ---------- */
.epx-tabs-wrap { position: relative; }
.epx-tabs-wrap::before, .epx-tabs-wrap::after {
  content: ""; position: absolute; top: 0; bottom: 1px; width: 46px; pointer-events: none;
  opacity: 0; transition: opacity .2s var(--ease); z-index: 1;
}
.epx-tabs-wrap::before { left: 0; background: linear-gradient(90deg, #fff 46%, rgba(255,255,255,0)); }
.epx-tabs-wrap::after { right: 0; background: linear-gradient(270deg, #fff 46%, rgba(255,255,255,0)); }
.epx-tabs-wrap.has-left::before { opacity: 1; }
.epx-tabs-wrap.has-right::after { opacity: 1; }
.epx-tabs-wrap.has-right .epx-tabs { -webkit-mask-image: none; }

/* ---------- 空状態 ---------- */
.epx-blank { width: 100%; max-width: 660px; }
.epx-blank-lead { font-size: 13px; color: var(--ink2); font-weight: 600; margin-bottom: 12px; }
.epx-blank-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.epx-blank-cards li {
  background: #fff; border: 1px solid var(--line2); border-radius: 11px; padding: 10px 11px 11px; text-align: left;
}
.epx-blank-viz { width: 100%; height: 34px; margin-bottom: 7px; }
.epx-blank-cards b { display: block; font-size: 12px; color: var(--ink); line-height: 1.4; }
.epx-blank-cards span { display: block; font-size: 10.5px; color: var(--mute); line-height: 1.5; margin-top: 3px; }
.epx-blank-note { font-size: 10.5px; color: #9aa1ad; margin: 10px 0 12px; line-height: 1.5; }
.epx-blank-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: #fff; border: 1px solid var(--o-line); color: #b45309; border-radius: 10px;
  padding: 10px 18px; font-size: 13px; font-weight: 700;
  transition: background .18s var(--ease), border-color .18s var(--ease), transform .12s var(--ease);
}
.epx-blank-btn svg { width: 15px; height: 15px; color: var(--o); }
.epx-blank-btn:hover { background: var(--o-soft); border-color: var(--o); transform: translateY(-1px); }
.epx-blank-btn:active { transform: translateY(0); }

/* ---------- ローディング：スケルトン ---------- */
@keyframes epx-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.epx-skel {
  background: linear-gradient(90deg, #f1ede7 25%, #f8f5f1 50%, #f1ede7 75%);
  background-size: 200% 100%; animation: epx-shimmer 1.3s linear infinite; border-radius: 6px;
}
.epx-result.is-loading .epx-kpi b,
.epx-result.is-loading .epx-kpi-delta,
.epx-result.is-loading .epx-mini-nums b,
.epx-result.is-loading .epx-donut-label b {
  color: transparent !important; border-radius: 6px;
  background: linear-gradient(90deg, #f1ede7 25%, #f8f5f1 50%, #f1ede7 75%);
  background-size: 200% 100%; animation: epx-shimmer 1.3s linear infinite;
}
.epx-result.is-loading .epx-kpi-delta { min-height: 1.3em; }
.epx-result.is-loading .epx-chart::after,
.epx-result.is-loading .epx-mini-chart::after,
.epx-result.is-loading .epx-table-wrap::after,
.epx-result.is-loading .epx-donut-chart::after {
  content: ""; position: absolute; inset: 0; border-radius: 12px; z-index: 2;
  background: linear-gradient(90deg, #f7f4f0 25%, #fcfaf7 50%, #f7f4f0 75%);
  background-size: 200% 100%; animation: epx-shimmer 1.3s linear infinite;
}
.epx-result.is-loading .epx-donut-chart::after { border-radius: 50%; }
.epx-result.is-loading .epx-table-wrap { position: relative; min-height: 120px; }
.epx-result.is-loading .epx-diag-card { opacity: .45; }
.epx-run.is-busy { background: var(--o-dark); }

/* ---------- Chart.js カスタムツールチップ ---------- */
.epx-tt {
  position: fixed; z-index: 99998; pointer-events: none; opacity: 0;
  background: #ffffff; border: 1px solid var(--line); border-radius: 11px;
  box-shadow: 0 2px 6px rgba(28,32,41,.06), 0 12px 30px rgba(28,32,41,.12);
  padding: 9px 11px; min-width: 132px; max-width: 268px;
  font-size: 11.5px; line-height: 1.55; color: var(--ink);
  transition: opacity .14s var(--ease); font-variant-numeric: tabular-nums;
}
.epx-tt.is-on { opacity: 1; }
.epx-tt-title {
  font-size: 10.5px; color: var(--mute); font-weight: 600; letter-spacing: .02em;
  padding-bottom: 5px; margin-bottom: 5px; border-bottom: 1px solid var(--line2);
}
.epx-tt-row { display: flex; align-items: center; gap: 7px; padding: 1.5px 0; }
.epx-tt-row i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.epx-tt-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink2); }
.epx-tt-row b { margin-left: auto; white-space: nowrap; font-weight: 700; }
.epx-tt-row.is-port { font-weight: 700; }
.epx-tt-row.is-port span { color: var(--ink); }
.epx-tt-row.is-total { border-top: 1px solid var(--line2); margin-top: 4px; padding-top: 5px; }

/* ---------- 月別成績テーブル ---------- */
.epx-monthly { width: 100%; border-collapse: separate; border-spacing: 2px; font-size: 11.5px; }
.epx-monthly th {
  font-size: 10px; color: var(--mute); font-weight: 600; letter-spacing: .02em;
  padding: 4px 3px; text-align: center; white-space: nowrap;
}
.epx-monthly td { padding: 6px 5px; text-align: right; border-radius: 6px; white-space: nowrap; color: #2b3140; }
.epx-monthly thead th:first-child, .epx-monthly tbody td:first-child {
  position: sticky; left: 0; background: #fff; z-index: 1; text-align: left; padding-left: 2px; padding-right: 8px;
}
.epx-monthly tbody td:first-child b { font-size: 12.5px; }
.epx-monthly td.is-none { color: #c9cdd5; text-align: center; background: #fbfaf8; }
.epx-monthly td.epx-monthly-sum { background: var(--tint); border: 1px solid var(--line2); font-weight: 700; }
.epx-monthly thead th.epx-monthly-sum-h { color: var(--ink2); }
.epx-heat-legend { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 10px; color: var(--mute); }
.epx-heat-legend[hidden] { display: none; }
.epx-heat-bar { width: 62px; height: 7px; border-radius: 4px; display: block; }
.epx-heat-bar--r { background: linear-gradient(90deg, rgba(239,68,68,.55), rgba(239,68,68,.08)); }
.epx-heat-bar--g { background: linear-gradient(90deg, rgba(22,163,74,.08), rgba(22,163,74,.55)); }
.epx-heat-legend em { font-style: normal; margin-left: auto; color: #a4abb6; }

/* ---------- 相関タブ ---------- */
.epx-corr-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.epx-corr-sum[hidden] { display: none; }
.epx-corr-sum > div {
  border: 1px solid var(--line2); background: var(--tint); border-radius: 11px; padding: 9px 11px; min-width: 0;
}
.epx-corr-sum span { display: block; font-size: 10px; color: var(--mute); letter-spacing: .02em; }
.epx-corr-sum b { display: block; font-size: 15px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.epx-corr-sum em {
  display: block; font-style: normal; font-size: 10.5px; color: var(--ink2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px;
}
#epx-corr-full .epx-corr { font-size: 11.5px; }
#epx-corr-full .epx-corr th.epx-corr-row {
  position: sticky; left: 0; background: #fff; z-index: 1; max-width: 160px;
}
#epx-corr-full .epx-corr td { padding: 7px 4px; }
.epx-corr td.is-self { background: #f4f1ec !important; color: #b0b6c0; }
.epx-corr-scale--wide { margin-top: 12px; max-width: 340px; }

/* =========================================================
   6. hover / focus の復元
   テーマの `button:hover, button:focus` を上で一度打ち消しているので、
   塗り・文字色を持つ部品はここで明示的に戻す（このブロックは必ず打ち消しより後に置く）。
   ========================================================= */
.epx-tab:hover, .epx-tab:focus { color: var(--ink2); }
.epx-tab.is-on, .epx-tab.is-on:hover, .epx-tab.is-on:focus { color: var(--ink); }
.epx-range:hover, .epx-range:focus { color: var(--ink2); }
.epx-range.is-on, .epx-range.is-on:hover, .epx-range.is-on:focus { background: var(--o); color: #fff; }
.epx-alloc-btn:hover, .epx-alloc-btn:focus { color: var(--ink2); }
.epx-alloc-btn.is-on, .epx-alloc-btn.is-on:hover, .epx-alloc-btn.is-on:focus { background: #fff; color: var(--ink); }
.epx-chip:hover, .epx-chip:focus { border-color: #ddd6ca; background: var(--tint); color: var(--ink2); }
.epx-chip.is-on, .epx-chip.is-on:focus { background: var(--o); border-color: var(--o); color: #fff; }
.epx-chip.is-on:hover { background: var(--o-dark); border-color: var(--o-dark); color: #fff; }
.epx-help:hover, .epx-help:focus { background: #fff; border-color: var(--o); color: var(--o); }
.epx-cart:hover, .epx-cart:focus { background: #fff; border-color: var(--o); color: var(--o); }
.epx-share:hover, .epx-share:focus { background: #fff; border-color: var(--o); color: var(--o); }
.epx-more:hover, .epx-more:focus { background: #fffaf5; border-color: var(--o); color: var(--o); }
.epx-blank-btn:hover, .epx-blank-btn:focus { background: var(--o-soft); border-color: var(--o); color: #b45309; }
.epx-run, .epx-run:focus { background: var(--o); color: #fff; }
.epx-run:hover { background: var(--o-dark); color: #fff; }
.epx-run:disabled, .epx-run:disabled:hover, .epx-run:disabled:focus { background: #ddd9d1; color: #fff; }
.epx-add, .epx-add:focus { background: var(--o); border-color: var(--o); color: #fff; }
.epx-add:hover { background: var(--o-dark); border-color: var(--o-dark); color: #fff; }
.epx-ea.is-added .epx-add, .epx-ea.is-added .epx-add:hover, .epx-ea.is-added .epx-add:focus { background: #fff; color: var(--o); }
.epx-sel-del:hover, .epx-sel-del:focus { background: var(--r-soft); color: var(--r); }
.epx-row-btn:hover, .epx-row-btn:focus { background: #f4f1ec; color: var(--o); }
.epx-row-btn.epx-row-del:hover, .epx-row-btn.epx-row-del:focus { background: var(--r-soft); color: var(--r); }
.epx-fav:hover, .epx-fav:focus, .epx-fav[aria-pressed="true"] { color: var(--w); }
.epx-filters-reset:hover, .epx-filters-reset:focus { color: var(--o); }
/* クリックで出るブラウザ既定のフォーカスリングは消し、キーボード操作時だけ出す */
.epx button:focus:not(:focus-visible) { outline: none; }

/* =========================================================
   5. レスポンシブ
   ========================================================= */
@media (max-width: 1180px) {
  .epx-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* タブレット以下は上下配置。HTML の順（テキスト → オービット）がそのまま表示順になる */
@media (max-width: 1024px) {
  .epx-hero-inner { grid-template-columns: 1fr; gap: 26px; }
  /* 1カラムでは中央へ戻す（2カラム時の右寄せのままだと右に貼り付く） */
  .epx-hero-orbit { max-width: 400px; margin-inline: auto; }
  .epx-main { grid-template-columns: 1fr; }
  .epx-side { position: static; }
  .epx-ea-list { max-height: 420px; }
  .epx-learn, .epx-bottom { grid-template-columns: 1fr; }
  .epx-diag { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .epx-basics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .epx-mini-grid { grid-template-columns: 1fr; }
  .epx-mini-chart { height: 180px; }
  .epx-contrib { grid-template-columns: 1fr; }
  .epx-donut { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 20px; }
  .epx-donut-legend { width: auto; min-width: 200px; }
}

@media (max-width: 720px) {
  .epx { padding: 0 12px 40px; font-size: 14px; }
  .epx-card { padding: 14px; border-radius: 12px; }
  .epx-hero { padding: 12px 0 20px; }
  /* 下のシミュレーター（.epx の padding 12px）と左端を揃える */
  .epx-hero-inner { padding-inline: 12px; }
  /* ★26px 固定だと 360px 幅で h1 が 3 行に折れる（実測。390px では 2 行なので狭い実機だけ壊れる）。
     幅に追従させて 360〜430px を通して 2 行に収める */
  .epx-h1 { font-size: clamp(22px, 6.6vw, 26px); margin: 16px 0 14px; }
  .epx-lead { font-size: 13.5px; line-height: 1.8; }
  .epx-hero-btns { flex-direction: column; gap: 10px; margin-top: 22px; }
  .epx-hero-btns .epx-btn { width: 100%; justify-content: center; }
  .epx ul.epx-hero-feats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
  .epx-hero-feats li { padding: 7px 10px; font-size: 11.5px; }
  /* オービットはノードを3つに減らし、細かい粒子とキャプションは省く */
  .epx-hero-orbit { max-width: 280px; margin-top: 2px; }
  .epx-orbit-node { width: clamp(52px, 22%, 74px); }
  .epx-orbit-node[data-n="4"], .epx-orbit-node[data-n="5"] { display: none; }
  .epx-orbit-node[data-n="1"] { --x: 47%; --y: 12%; }
  .epx-orbit-node[data-n="2"] { --x: 84%; --y: 66%; }
  .epx-orbit-node[data-n="3"] { --x: 16%; --y: 66%; }
  .epx-orbit-node b { font-size: 9.5px; }
  .epx-orbit-node i { font-size: 15px; }
  .epx-orbit-spin, .epx-orbit-cap { display: none; }
  .epx-selects { grid-template-columns: 1fr 1fr; }
  .epx-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .epx-kpi b { font-size: 17px; }
  .epx-chart { height: 260px; }
  .epx-diag { grid-template-columns: 1fr; }
  .epx-howto { grid-template-columns: 1fr; }
  .epx-basics { grid-template-columns: 1fr; }
  .epx-controls { gap: 10px; }
  .epx-fields { width: 100%; }
  .epx-field { flex: 1 1 140px; }
  .epx-field input, .epx-field-money input { width: 100%; }
  .epx-field--cap { flex: 0 1 190px; }
  .epx-cta { grid-template-columns: 1fr; padding: 18px; }
  .epx-cta-text h2 { font-size: 19px; }
  .epx-cta-btns .epx-cta-btn { flex: 1 1 auto; }
  .epx-tab { padding: 11px 12px; font-size: 12.5px; }
  .epx-table { font-size: 12px; }
  /* 幅が足りないので操作列と構成比バーは省く（削除・ロット編集は左パネルにある） */
  .epx-table th:last-child, .epx-table td:last-child { display: none; }
  .epx-share-bar { display: none; }
  .epx-table td:first-child, .epx-table th:first-child { min-width: 104px; }
  .epx-ea-list { max-height: none; overflow: visible; }
  .epx-blank-cards { grid-template-columns: 1fr; gap: 8px; }
  .epx-blank-viz { height: 30px; }
  .epx-blank-lead { font-size: 12.5px; }
  .epx-corr-sum { grid-template-columns: 1fr; }
  .epx-sub-btns { grid-template-columns: 1fr; }
  .epx-tabs-wrap::before, .epx-tabs-wrap::after { width: 36px; }
  .epx-filters-badges b { max-width: 92px; font-size: 10px; }
  .epx-donut-label b { font-size: 15px; }
  .epx-monthly { font-size: 11px; }
  .epx-monthly td { padding: 5px 4px; }
}

@media (max-width: 400px) {
  .epx-selects { grid-template-columns: 1fr; }
  .epx-sel-item { grid-template-columns: 24px minmax(0, 1fr) 56px 22px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .epx *, .epx *::before, .epx *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
