/* ============================================================
   効率的フロンティアとリスク（money/efficient-frontier.html）だけの見た目
   共通は ../assets/css/ek.css（v2 層）と money.css。色は分野の変数（--accent など）だけを使う
   ============================================================ */

/* 資産の表 */
table.ef-assets { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.ef-assets th { font-size: 12.5px; font-weight: 700; color: var(--ink-2); text-align: left; padding: 0 4px 4px; line-height: 1.4; }
table.ef-assets th small { display: block; font-weight: 400; color: var(--muted); }
table.ef-assets th:first-child { width: 38%; }
table.ef-assets td { padding: 3px 4px; }
html[data-ui="v2"] table.ef-assets input, html[data-ui="v2"] .ef-pair input {
  width: 100%; min-width: 0; box-sizing: border-box; height: 40px; padding: 0 8px; font-size: 15px; font-variant-numeric: tabular-nums;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r);
}
html[data-ui="v2"] table.ef-assets input:focus, html[data-ui="v2"] .ef-pair input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
html[data-ui="v2"] table.ef-assets input.bad, html[data-ui="v2"] .ef-pair input.bad { border-color: var(--s2, #B4442C); border-width: 2px; }
@media (max-width: 560px) { html[data-ui="v2"] table.ef-assets input, html[data-ui="v2"] .ef-pair input { font-size: 16px; } }

/* 相関・自分の配分の欄 */
.ef-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px 10px; }
.ef-pair { min-width: 0; }
.ef-pair label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 3px; line-height: 1.4; overflow-wrap: anywhere; }
.ef-pair .input-unit { display: flex; }
.ef-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ef-btns button { font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; min-height: 36px; }
.ef-btns button:hover { border-color: var(--accent); }
html[data-ui="v2"] select#nAssets { height: 40px; padding: 0 10px; font-size: 15px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--ink); }

/* 「入れた条件での計算結果」 */
.ef-caution { margin: 0 0 12px; padding: 8px 12px; border-left: 4px solid var(--accent); background: var(--accent-soft); font-size: 13.5px; font-weight: 700; color: var(--ink); line-height: 1.6; }

.ef-h3 { font-size: 15px; margin: 22px 0 8px; color: var(--ink); }
table.ef-cmp th, table.ef-cmp td { text-align: left; }
table.ef-cmp th.n, table.ef-cmp td.n { text-align: right; }
table.ef-cmp tr.sep td, table.ef-rc tr.sep td { border-top: 2px solid var(--line-strong); }
table.ef-mat caption { caption-side: top; text-align: left; font-size: 13px; font-weight: 700; color: var(--ink-2); padding: 6px 0; }
table.ef-mat { font-size: 12.5px; }

/* 図 */
.mo-chart .ef-vx { stroke-dasharray: 2 4; }
.mo-chart .ef-ineff { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 5 4; opacity: .75; }
.mo-chart .ef-ref { fill: none; stroke: color-mix(in srgb, var(--ink) 30%, var(--surface)); stroke-width: 1.5; stroke-dasharray: 3 3; }
.mo-chart .ef-cml { stroke: var(--tint-warn-ink, #8A4B00); stroke-width: 2; }
.mo-chart .ef-rf { fill: var(--tint-warn-ink, #8A4B00); }
.mo-chart .ef-asset { fill: var(--ink-2); }
.mo-chart .ef-lbl { fill: var(--ink); font-size: 12px; font-weight: 700; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.mo-chart .ef-gmv { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; }
.mo-chart .ef-tan { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.mo-chart .ef-rp { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.mo-chart .ef-own { fill: none; stroke: var(--tint-warn-ink, #8A4B00); stroke-width: 2.5; }
.ef-legend i.ef-li-ineff { border-top: 2px dashed var(--accent); }
.ef-legend i.ef-li-ref { border-top: 1.5px dashed color-mix(in srgb, var(--ink) 30%, var(--surface)); }
.ef-legend i.ef-li-cml { border-top: 2px solid var(--tint-warn-ink, #8A4B00); }
.ef-k { display: inline-block; width: 11px; height: 11px; box-sizing: border-box; line-height: 11px; text-align: center; font-size: 13px; font-weight: 700; }
.ef-k-asset { border-radius: 50%; background: var(--ink-2); width: 9px; height: 9px; }
.ef-k-gmv { border: 2.5px solid var(--accent); background: var(--surface); }
.ef-k-tan { border-radius: 50%; background: var(--accent); }
.ef-k-rp { width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 11px solid var(--ink); }
.ef-k-own { color: var(--tint-warn-ink, #8A4B00); width: auto; height: auto; }
.ef-k-rf { border-radius: 50%; background: var(--tint-warn-ink, #8A4B00); width: 8px; height: 8px; }

/* リスク寄与 */
.ef-seg { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.ef-seg label { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; padding: 5px 10px; border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; min-height: 32px; }
.ef-seg label:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.ef-seg input { accent-color: var(--accent); margin: 0; }
.ef-bars { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.ef-bars li { display: grid; grid-template-columns: 6.5em 1fr; gap: 8px; align-items: center; font-size: 13px; }
.ef-bars .nm { font-weight: 700; overflow-wrap: anywhere; }
.ef-bars .bars { display: grid; grid-template-columns: 1fr; gap: 2px; min-width: 0; }
.ef-bars .b { display: block; height: 10px; border-radius: 3px; min-width: 1px; }
.ef-bars .b.w { background: color-mix(in srgb, var(--ink) 25%, var(--surface)); }
.ef-bars .b.r { background: var(--accent); }
.ef-bars .b.neg { background: repeating-linear-gradient(45deg, var(--tint-warn-ink, #8A4B00) 0 3px, transparent 3px 6px); }
.ef-bars .v { font-size: 12px; color: var(--ink-2); line-height: 1.3; }
@media (max-width: 400px) { .ef-bars li { grid-template-columns: 1fr; gap: 2px; } }

/* 本文の式が長いとき */
.article code, .callout code { overflow-wrap: anywhere; word-break: break-all; }
