/* 人生のお金シミュレーターだけの見た目（共通は assets/css/common.css） */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
/* PC：左に入力、右に判定とグラフを固定 */
.col-in { grid-column: 1; grid-row: 1; }
.col-out { grid-column: 2; grid-row: 1; align-self: stretch; }
.col-out > #result { position: sticky; top: 12px; z-index: 2; max-height: calc(100vh - 24px); overflow-y: auto; }
.pin { display: none; }
.num { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; margin-right: 8px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .85rem; vertical-align: 1px; }
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .col-in, .col-out { grid-column: 1; grid-row: auto; }
  .col-out > #result { position: static; }
  /* スマホ：上に「判定1行＋最低限のグラフ」を固定（入力するとき）。開くと③を全画面（見るとき） */
  .pin { display: block; position: sticky; top: 0; z-index: 6; margin: 0 -16px 12px; padding: 6px 16px 2px; background: var(--card); border-bottom: 1px solid var(--line); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
  .pin-row { display: flex; align-items: center; gap: 6px; font-size: .84rem; line-height: 1.4; }
  .pin-text { flex: 1; min-width: 0; }
  .pin-text .bad { color: var(--warn); font-weight: bold; }
  .pin-open { flex: none; border: 1px solid var(--accent); background: #fff; border-radius: 999px; font: inherit; font-size: .75rem; padding: 1px 10px; cursor: pointer; color: var(--accent); }
  .pin-chart { display: block; width: 100%; height: 104px; margin-top: 2px; }
  .pin-chart text { font-size: 10.5px; fill: var(--sub); font-family: inherit; }
  /* 押すと、上の固定がその場で下に伸びて③が出る（もう一度押すとたたむ） */
  .pin #result { display: none; margin: 6px -16px 0; padding: 8px 12px 10px; border: 0; border-radius: 0; }
  .pin #result > h2 { display: none; }
  .pin.open { max-height: 100vh; overflow-y: auto; overscroll-behavior: contain; cursor: default; }
  .pin.open #result { display: block; }
  .pin.open .pin-chart { display: none; }
  .pin-row { cursor: pointer; }
  .pin-chart { cursor: pointer; }
  .pin .pin-fold { display: block; width: 100%; margin-top: 8px; border: 1px solid var(--line); background: #fff; border-radius: 999px; font: inherit; font-size: .82rem; padding: 4px; cursor: pointer; color: var(--sub); }
  #result .verdicts li { padding: 6px 10px; font-size: .88rem; }
  #result .legend { font-size: .76rem; }
  #result .chart-wrap { padding: 8px; }
}
.pin-fold { display: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
h2 { font-size: 1.05rem; margin: 0 0 12px; }
.q { margin-bottom: 18px; }
.q:last-child { margin-bottom: 0; }
.q-label { font-weight: bold; font-size: .95rem; margin-bottom: 6px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opts label { cursor: pointer; }
.opts input { position: absolute; opacity: 0; pointer-events: none; }
.opts span { display: inline-block; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: .9rem; }
.opts.small span { padding: 4px 11px; font-size: .84rem; }
.opts input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.opts .own-in { display: flex; align-items: center; gap: 4px; font-size: .84rem; }
.opts .own-in input { position: static; opacity: 1; pointer-events: auto; width: 4.2em; padding: 3px 6px; }
.opts input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.age { display: flex; align-items: center; gap: 10px; }
.age input[type=range] { flex: 1; max-width: 320px; accent-color: var(--accent); }
.hidden { display: none !important; }
.note { color: var(--sub); font-size: .82rem; }
input[type=number] { padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; font: inherit; text-align: right; }
input.mine { border-color: var(--warn); background: #fdf3ee; }
/* 根拠の1行 */
.ev { margin-top: 6px; font-size: .84rem; color: var(--accent); }
.ev b { font-size: .98rem; }
.ev .src { color: var(--sub); font-size: .78rem; }
.ev .mine-tag { color: var(--warn); font-weight: bold; }
/* くわしく（3段目） */
details.more, details.fold { margin-top: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fafcfd; }
details.more > summary, details.fold > summary { cursor: pointer; padding: 6px 10px; font-size: .84rem; color: var(--accent); list-style: none; }
details.more > summary::-webkit-details-marker, details.fold > summary::-webkit-details-marker { display: none; }
details.more > summary::before, details.fold > summary::before { content: "▶ "; font-size: .7rem; }
details.more[open] > summary::before, details.fold[open] > summary::before { content: "▼ "; }
.more-body { padding: 4px 10px 10px; }
.more-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: .86rem; }
.more-row:last-of-type { border-bottom: 0; }
.more-row .lbl { flex: 1; }
.more-row .lbl .note { display: block; font-size: .75rem; }
.more-row input { width: 5.5em; }
.more-row.now { background: #fff6dc; border-radius: 6px; padding-left: 6px; padding-right: 6px; }
.more-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 8px; font-size: .78rem; color: var(--sub); }
.reset { font: inherit; font-size: .78rem; color: var(--warn); background: none; border: 1px solid var(--warn); border-radius: 999px; padding: 2px 10px; cursor: pointer; }
/* 子ども */
.kid { padding: 8px 10px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 10px; font-size: .9rem; }
.kid-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.kid .kn { font-weight: bold; min-width: 3.2em; }
.kid-head input { width: 4em; }
.kid select { max-width: 100%; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff; }
.fam-row { display: flex; align-items: center; gap: 8px 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.fam-row:last-of-type { border-bottom: 0; }
.fam-l { font-size: .9rem; min-width: 5.5em; }
/* 今の家計 */
.pl-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.pl-row input { width: 5.5em; }
.pl-row > span:last-child { white-space: nowrap; }
details.more.lf-more { margin: 0 0 6px; }
.lf-h2 { font-size: .8rem; color: var(--sub); margin: 2px 0 4px; }
.lf-kid { font-size: .84rem; font-weight: bold; margin: 6px 0 2px; display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; }
.lf-kid .lf-col { font-size: .74rem; font-weight: normal; color: var(--sub); white-space: nowrap; padding-right: 4px; } .lf-more summary { font-size: .8rem; }
.lf-tab { width: 100%; border-collapse: collapse; font-size: .84rem; }
.lf-tab td { padding: 3px 4px; border-bottom: 1px dotted var(--line); }
.lf-tab td:first-child { white-space: nowrap; color: var(--sub); width: 1%; }
.lf-tab .lf-v { text-align: right; white-space: nowrap; font-weight: bold; }
.lump-tab { width: 100%; border-collapse: collapse; font-size: .86rem; margin-top: 4px; }
.lump-tab th { font-size: .78rem; color: var(--sub); font-weight: normal; text-align: left; padding: 2px 4px; }
.lump-tab td { padding: 6px 4px; border-bottom: 1px dashed var(--line); vertical-align: top; }
.lump-tab td:first-child { padding-top: 10px; }
.lump-tab td input { width: 5.2em; }
.lump-tab .yomi { display: block; font-size: .74rem; color: var(--sub); margin-top: 2px; }
.lump-tab .yomi:empty { display: none; }
.est { font-size: .88rem; margin-top: 4px; }
.est input { width: 5.2em; } .est-tag { font-size: .74rem; color: var(--sub); }
.est input.mine { border-color: var(--accent); }
.avg { display: block; font-size: .74rem; color: var(--sub); font-weight: normal; margin-top: 2px; }
.avg:empty { display: none; }
.lump-tab select { font: inherit; font-size: .86rem; padding: 4px 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; max-width: 100%; }
.lump-tab select:disabled { opacity: .4; }
#lumpTab td:first-child, #whoTab td:first-child, #famTab td:first-child { white-space: nowrap; }
#famTab { margin: 4px 0 6px; }
@media (max-width: 560px) { .lump-tab select { font-size: .8rem; padding: 3px 2px; } }
.evcard { border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.evcard .q-label { font-size: 1rem; }
.when { font-size: .78rem; font-weight: bold; color: var(--sub); margin: 10px 0 4px; padding-left: 6px; border-left: 3px solid var(--line); }
.evcard .when:first-of-type { margin-top: 4px; }
.kcalc { margin: 6px 0; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; max-width: 26em; }
.kc-row { display: flex; align-items: baseline; gap: 6px; padding: 3px 0; }
.kc-s { width: 1em; color: var(--sub); font-weight: bold; }
.kc-l { flex: 1; font-size: .86rem; }
.kc-sub { display: block; font-size: .74rem; color: var(--sub); line-height: 1.5; }
.kc-v { white-space: nowrap; font-size: 1rem; }
.kc-row.in .kc-v { color: var(--accent); }
.kc-row.tot { border-top: 1px solid var(--ink, #333); margin-top: 2px; padding-top: 5px; }
.kc-row.tot .kc-v { font-size: 1.1rem; }
.kc-row.mfirst { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 6px; }
.kflow { font-size: .86rem; line-height: 1.9; }
.kf-h { font-size: .76rem; color: var(--sub); line-height: 1.5; }
.kf-i { white-space: nowrap; }
.kf-a { color: var(--sub); margin: 0 6px; }
.kflow .up, #lifeFlow .up { color: var(--warn); } .kflow .down, #lifeFlow .down { color: var(--accent); }
.kflow .up, .kflow .down { font-size: .8rem; }
#lifeFlow { font-size: .78rem; color: var(--sub); }
.more-row .why { color: var(--coin-ink); }
.kt { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 8px; padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: .86rem; }
.kt.now { background: #fff6dc; border-radius: 6px; padding-left: 6px; padding-right: 6px; }
.kt-h { font-size: .74rem; font-weight: bold; color: var(--sub); padding-bottom: 2px; }
.kt-e { text-align: right; white-space: nowrap; }
.kt-e input { width: 4.6em; margin-right: 2px; }
.kt-m { grid-column: 1 / -1; font-size: .72rem; color: var(--sub); line-height: 1.5; }
.kt-m .free { color: var(--accent-dark); } .kt-m .why { color: var(--coin-ink); }
@media (max-width: 560px) { .kt { grid-template-columns: 1fr auto; gap: 0 4px; font-size: .8rem; } .kt-e input { width: 4.4em; padding: 3px 4px; } }
.more-row .free { color: var(--accent-dark); }
.kid-sel { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 6px 0 2px; }
.fk-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 0 6px 12px; border-bottom: 1px dashed var(--line); font-size: .88rem; }
.fk-n { font-weight: bold; min-width: 3em; }
.fk-row input { width: 3.4em; }
.fk-row select { font: inherit; font-size: .84rem; padding: 4px 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; max-width: 100%; }
.est .note { font-size: .74rem; color: var(--sub); }
.lump-tab.single .p2col { display: none; }
.lump-tab .s { display: none; }
@media (max-width: 560px) { .lump-tab .l { display: none; } .lump-tab .s { display: inline; } .lump-tab td:first-child { width: 4.6em; } }
.pl-row.sum { border-bottom: 1px solid var(--line); background: var(--bg); padding-left: 6px; padding-right: 6px; }
#whoTab td { vertical-align: top; } #whoTab td:first-child { padding-top: 10px; }
#whoTab tr:last-child td { border-bottom: 0; }
.pl-row input.mine { border-color: var(--warn); background: #fdf3ee; }
/* ②：支出のうち（③のテーマの額）と、そのほかの生活費 */
.split { font-size: .9rem; }
.split .sp-r { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.split .sp-r b { font-weight: normal; white-space: nowrap; padding-right: 2.2em; }
.split .sp-t { font-size: .76rem; color: var(--sub); }
.sp-head { font-size: .9rem; font-weight: bold; margin-top: 10px; padding-bottom: 2px; border-bottom: 1px solid var(--line); }
.sp-n { display: block; font-size: .74rem; color: var(--sub); }
#spendOut b, #incOut b { font-size: 1.05rem; }
.pl-row select, .fam-row select { font: inherit; font-size: .86rem; padding: 4px 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; max-width: 100%; }
.fam-row .yr { width: 3.4em; }
/* 結果 */
.save { background: var(--accent-soft); border-color: #c9dcee; }
.verdicts { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.verdicts li { display: flex; gap: 8px; align-items: baseline; padding: 8px 12px; background: #fff; border-radius: 10px; font-size: .92rem; }
.verdicts li.bad b { color: var(--warn); }
.verdicts i { flex: none; display: inline-block; width: 18px; height: 0; border-top: 3px solid var(--accent); transform: translateY(-4px); }
.verdicts i.risk { border-top: 3px dashed var(--warn); }
.verdicts i.none { border-top-color: transparent; }
.verdicts i.pair { height: 6px; border-bottom: 3px dashed var(--warn); transform: translateY(-2px); }
.verdicts .sub { display: block; color: var(--sub); font-size: .8rem; }
.chart-wrap { background: #fff; border-radius: 10px; padding: 12px; }
/* PC：「広げる」で1列に（上に④、下に入力）。④が画面から出たら、上に小さいグラフを固定（スマホの固定と同じもの）（2026-11-30） */
.chart-tools { display: flex; justify-content: flex-end; margin: -4px 0 2px; }
.wide-btn { border: 1px solid var(--accent); background: #fff; color: var(--accent); border-radius: 999px; font: inherit; font-size: .78rem; padding: 1px 12px; cursor: pointer; }
.wide-btn[aria-pressed="true"] { background: var(--accent); color: #fff; }
@media (max-width: 900px) { .chart-tools { display: none; } }
@media (min-width: 901px) {
  body.bs-wide .layout { grid-template-columns: minmax(0, 1fr); }
  body.bs-wide .col-out { grid-column: 1; grid-row: 1; }
  body.bs-wide .col-in { grid-column: 1; grid-row: 2; }
  body.bs-wide .col-out > #result { position: static; max-height: none; overflow: visible; }
  body.bs-wide .pin.show { display: block; position: sticky; top: 0; z-index: 6; margin: 0 0 12px; padding: 6px 16px 2px; background: var(--card); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 12px 12px; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
  body.bs-wide .pin-row { display: flex; align-items: center; gap: 6px; font-size: .84rem; line-height: 1.4; cursor: pointer; }
  body.bs-wide .pin-text { flex: 1; min-width: 0; }
  body.bs-wide .pin-text .bad { color: var(--warn); font-weight: bold; }
  body.bs-wide .pin-open { flex: none; border: 1px solid var(--accent); background: #fff; border-radius: 999px; font-size: .75rem; padding: 1px 10px; color: var(--accent); }
  body.bs-wide .pin-chart { display: block; width: 100%; height: 104px; margin-top: 2px; cursor: pointer; }
  body.bs-wide .pin-chart text { font-size: 10.5px; fill: var(--sub); font-family: inherit; }
}
#chart { width: 100%; height: auto; display: block; }
#chart text { font-size: 12px; fill: var(--sub); font-family: inherit; }
#chart text.who { font-size: 10px; }
#chart text.who-v { font-size: 11px; opacity: .85; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .8rem; color: var(--sub); margin-top: 4px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.legend i.dash { width: 14px; height: 0; border-radius: 0; border-top: 2px dashed var(--warn); opacity: .7; }   /* グラフの点線（備え）と同じ色 */
/* ④ その年の1行（PC でかざす）と、時期ごとの流れ。スマホは1年分が約4pxでねらえないので出さない（年ごとの表で見る）（2026-12-02） */
.pick { background: #fff; border-radius: 10px; padding: 6px 12px; margin-top: 6px; font-size: .84rem; min-height: 2.4em; }
@media (max-width: 900px) { .pick, .pc-only { display: none; } }
.pick .s { color: var(--sub); }
.pick .neg { color: var(--warn); font-weight: bold; }
.flowblk { margin-top: 8px; background: #fff; border-radius: 10px; padding: 8px 12px; font-size: .86rem; }
.flowblk .fb-h { font-weight: bold; padding-bottom: 4px; }
.fl-row { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; border-top: 1px dashed var(--line); }
.fl-dot { flex: none; width: 10px; height: 10px; border-radius: 3px; transform: translateY(1px); }
.fl-n { flex: none; white-space: nowrap; }
.fl-n small { color: var(--sub); font-size: .76rem; margin-left: 4px; }
.fl-why { flex: 1; min-width: 0; color: var(--sub); font-size: .78rem; line-height: 1.4; }
.fl-v { flex: none; font-weight: bold; white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
.fl-v .neg { color: var(--warn); }
#chart .evl { font-size: 11px; font-weight: bold; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
#chart .bandl { font-size: 11px; font-weight: bold; }
.risk-mini { margin-top: 8px; background: #fff; border-radius: 10px; padding: 8px 12px; font-size: .86rem; }
.risk-mini .rm-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-weight: bold; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.risk-mini .rm-head span { font-weight: normal; }
.risk-mini .rm-head b { color: var(--warn); }
.risk-mini ul { list-style: none; margin: 0; padding: 0; }
.risk-mini li { display: flex; align-items: baseline; gap: 8px; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.risk-mini li:last-child { border-bottom: 0; }
.risk-mini .rn { flex: none; width: 5.5em; }
.risk-mini .rt { flex: 1; min-width: 0; color: var(--sub); font-size: .8rem; }
.risk-mini .ra { flex: none; font-weight: bold; color: var(--warn); white-space: nowrap; }
.risk-mini li { flex-wrap: wrap; }
.risk-mini .rm-note { flex-basis: 100%; color: var(--sub); font-size: .74rem; line-height: 1.5; }
.srcs { font-size: .8rem; color: var(--sub); }
.srcs ul { padding-left: 1.2em; margin: 6px 0 0; }

/* 開発版で足したもの */
.fl-dot { background: var(--line); }
.fl-dot.c-edu { background: var(--c-edu); opacity: .55; }
.fl-dot.c-safe { background: var(--c-safe); opacity: .55; }
.legend i.dash { border-top-color: var(--warn); opacity: 1; }
.legend i.c-house { background: var(--c-house); }
.legend i.c-edu { background: var(--c-edu); }
.legend i.c-car { background: var(--c-car); }
.legend i.c-safe { background: var(--c-safe); }
.legend i.ring { background: #fff; border: 2px solid var(--warn); }
.pin-sub { color: var(--sub); }
.neg.nb { font-weight: normal; }
/* 前回の入力（ブラウザに残した数字）を使う・消す */
.prev-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-size: .85rem; }
.prev-bar span { flex: 1; min-width: 12em; color: var(--sub); }
.prev-bar button { border: 1px solid var(--accent); background: #fff; color: var(--accent); border-radius: 999px; font: inherit; font-size: .8rem; padding: 3px 12px; cursor: pointer; }
.prev-bar button.sub { border-color: var(--line); color: var(--sub); }
.print-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 12px; }
.print-bar button { border: 1px solid var(--accent); background: #fff; color: var(--accent); border-radius: 999px; font: inherit; font-size: .85rem; padding: 4px 14px; cursor: pointer; }
.print-bar .note { font-size: .74rem; color: var(--sub); }

/* 印刷・PDF：④の結果を先に、その後に①〜③の入れた数字（「くわしく」の中も）。ボタン・広告は出さない */
/* ④の年ごとの表（js/view/year-table.js）。年齢が横の表（2026-12-02） */
.year-tbl { margin-top: 8px; }
.check-box { padding: 0 8px 8px; }
.check-box > .note { font-size: .76rem; color: var(--sub); margin: 0 0 6px; }
/* 年齢ボタン（その年代の列へ動く） */
.yt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
.yt-to { font-size: .74rem; color: var(--sub); }
.yt-bar button { font: inherit; font-size: .8rem; min-width: 2.8em; min-height: 30px; border: 1px solid var(--accent); color: var(--accent); background: #fff; border-radius: 8px; cursor: pointer; font-variant-numeric: tabular-nums; }
.yt-bar .yt-full { margin-left: auto; background: var(--accent); color: #fff; padding: 0 10px; }
.yt-bar .yt-full, .yt-bar .yt-close { display: none; }
.yt-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.check-box table { border-collapse: separate; border-spacing: 0; font-size: .78rem; white-space: nowrap; }
.check-box th, .check-box td { padding: 3px 6px; text-align: right; border-bottom: 1px solid var(--line); background: #fff; font-variant-numeric: tabular-nums; }
.check-box th:first-child { position: sticky; left: 0; z-index: 2; text-align: left; font-weight: normal; border-right: 1px solid var(--line); }
.check-box thead th { background: var(--accent); color: #fff; }
.check-box tr.ev td { color: var(--accent); font-size: .7rem; white-space: normal; min-width: 4.5em; vertical-align: top; text-align: left; }
.check-box tr.top > * { border-top: 2px solid var(--line); }
.check-box tr.tot > *, .check-box tr.bal > * { font-weight: bold; }
.check-box tr.bal td { color: var(--accent); }
.check-box tr.sub > * { color: var(--sub); font-size: .74rem; font-weight: normal; }
.check-box tr.kid > * { font-size: .7rem; }
.check-box tr.kid-age > * { background: var(--accent-soft); color: var(--accent); font-weight: normal; font-size: .74rem; }   /* 年齢の下の、子どもの年齢の行 */
.check-box .neg { color: var(--warn); }
.yt-tg { font: inherit; font-weight: bold; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; }
.check-box .on { background: #d9e9f7; }
.check-box thead th.on { background: #02508a; }
.check-box tr.kid-age > .on { background: #d9e9f7; }
.yt-s { display: none; }   /* 短い名前はスマホだけ */
.yt-print { display: none; }
/* PC：表に高さの上限。年齢の行（と子どもの年齢の行）を上に、項目名の列を左に固定 */
@media (min-width: 901px) {
  .yt-scroll { overflow: auto; max-height: calc(100vh - 140px); }
  .check-box thead th, .check-box thead td { position: sticky; top: 0; z-index: 3; }
  .check-box thead th:first-child { z-index: 4; }
}
/* スマホ：短い名前、字と間をつめる、高さの上限なし。「全画面」で表だけを画面いっぱいに */
@media (max-width: 900px) {
  .yt-l { display: none; } .yt-s { display: inline; }
  .check-box { padding: 0 0 8px; }
  .yt-scroll { border-left: 0; border-right: 0; border-radius: 0; }
  .check-box table { font-size: .74rem; }
  .check-box th, .check-box td { padding: 2px 5px; }
  .check-box tr.ev td { min-width: 3.2em; font-size: .64rem; line-height: 1.25; }
  .yt-bar .yt-full { display: inline-block; }
  .check-box.yt-fs { position: fixed; inset: 0; z-index: 100; background: #fff; display: flex; flex-direction: column; padding: calc(8px + env(safe-area-inset-top, 0px)) 0 env(safe-area-inset-bottom, 0px); }
  .check-box.yt-fs > .note { display: none; }
  .check-box.yt-fs .yt-bar { padding: 0 8px; }
  .check-box.yt-fs .yt-full { display: none; }
  .check-box.yt-fs .yt-close { display: inline-block; margin-left: auto; padding: 0 10px; }
  .check-box.yt-fs .yt-scroll { flex: 1; min-height: 0; overflow: auto; }
  .check-box.yt-fs thead th, .check-box.yt-fs thead td { position: sticky; top: 0; z-index: 3; }
  .check-box.yt-fs thead th:first-child { z-index: 4; }
}
html.yt-lock, html.yt-lock body { overflow: hidden; }
/* 印刷：画面の表は出さず、15年ずつに分けた表（内わけは全部開く）を縦に並べる */
@media print {
  .yt-bar, .yt-scroll { display: none !important; }
  .yt-print { display: block; }
  .yt-pblk { margin-bottom: 8px; break-inside: avoid; }
  .yt-print table { font-size: 8pt; }
  .yt-print th, .yt-print td { padding: 1px 4px; position: static !important; }
  .yt-print .yt-l { display: inline !important; } .yt-print .yt-s { display: none !important; }
}

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; }
  .site-head, .site-foot, .tabs, .lead, .ad, .pin, .prev-bar, .print-bar, .pin-fold, .srcs { display: none !important; }
  details > summary { list-style: none; font-weight: bold; }   /* 「くわしく」は開いて出す（main.js の beforeprint） */
  details > summary::-webkit-details-marker { display: none; }
  .col-out > #result { position: static; max-height: none; overflow: visible; }
  .card { break-inside: auto; border-color: #ccc; padding: 12px; margin-bottom: 10px; }   /* 囲みは途中で分ける（分けないと丸ごと次のページへ送られ、前のページが空く） */
  #result .chart-wrap, #result > h2 { break-inside: avoid; }
  #result > h2 { break-after: avoid; }
  /* 「家」「車」「子ども」などの囲みは途中で分ける（分けないと、くわしくを開いて長くなった囲みが丸ごと次のページへ送られ、空白が増える）。
     そのかわり、一つひとつの行と見出しは分けない */
  .q, .kid { break-inside: auto; }
  .pl-row, .fl-row, .fam-row, .more-row, .kt, .kc-row, .kflow, .opts, .ev, .lump-tab tr, .verdicts li { break-inside: avoid; }
  .card > h2, .q-label, .when, .sp-head, .kid-head, details > summary { break-after: avoid; break-inside: avoid; }
  .col-out { margin-bottom: 10px; }
  .layout { display: flex; flex-direction: column; }
  .col-out { order: -1; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
#buyCash .warn-b { color: var(--warn); font-weight: bold; }
.pin-text .nw { white-space: nowrap; }
.lump-tab .l { white-space: nowrap; }

/* 欄まわりの小さな形（もとは index.php に style="…" でじかに書いていたもの） */
input[type=number].w-age { width: 3.6em; }   /* 年齢の欄 */
input[type=number].w-pct { width: 4em; }     /* 利回りの欄 */
.note.card-lead { margin: -4px 0 8px; }      /* カードの見出しのすぐ下の説明 */
.pl-row.row-flat { border-bottom: 0; padding-bottom: 0; }   /* 下に説明の行が続く行 */
.pl-row.no-line { border-bottom: 0; }
.sub-line { margin: 0; padding: 2px 0 6px; border-bottom: 1px dashed var(--line); }   /* 上の行の説明 */
.sub-line.indent { padding-left: 1em; }
.note.tiny { font-size: .74rem; }
.ev.flat { margin: 0; padding: 2px 0; }
.note.ks-src { padding-top: 4px; }
.gen-h { font-size: .9rem; margin-top: 6px; }
.fold-body { padding: 0 10px 6px; }
.age.end { flex: 1; justify-content: flex-end; }
.age.end input[type=range] { max-width: 180px; }
.srcs h2 { font-size: .95rem; }
/* すき間 */
.m-sm { margin: 2px 0 4px; }
.m-up { margin: -2px 0 6px; }
.m-mid { margin: 4px 0 8px; }
.m-b4 { margin: 0 0 4px; }
.m-b6 { margin: 0 0 6px; }

/* 「積み立てはどこ？」の説明（index.php の #tsumiHelp） */
.help-q { border: 1px solid var(--accent); background: #fff; color: var(--accent); border-radius: 999px; font: inherit; font-size: .74rem; font-weight: normal; padding: 0 9px; cursor: pointer; white-space: nowrap; vertical-align: 1px; }
.help-q:hover { background: var(--accent-soft); }
.help-dlg { width: min(600px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); overflow-y: auto; }
.help-dlg::backdrop { background: rgba(20, 30, 40, .45); }
.help-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.help-head h2 { margin: 0; font-size: 1.15rem; }
.help-x { flex: none; width: 32px; height: 32px; border: 1px solid var(--line); background: #fff; border-radius: 50%; font-size: 1.1rem; line-height: 1; cursor: pointer; color: var(--sub); }
.help-dlg h3 { font-size: 1rem; margin: 18px 0 6px; }
.help-fig { margin: 10px 0 0; }
.help-fig svg { display: block; width: 100%; max-width: 420px; height: auto; margin: 0 auto; color: var(--ink); }
.help-fig figcaption { margin-top: 8px; }
.help-fig .band-a { fill: var(--bg); }
.help-fig .band-line { stroke: var(--line); }
.help-fig .zone { font-family: var(--f-head); font-size: 12px; fill: var(--sub); }
.help-fig .box { fill: var(--card); stroke: var(--line); stroke-width: 1.2; }
.help-fig .box-muted { fill: #eef1f4; stroke: var(--line); stroke-width: 1.2; }
.help-fig .box-pot { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.6; }
.help-fig .t { font-size: 12px; fill: currentColor; }
.help-fig .t-b { font-size: 12.5px; font-weight: 700; fill: currentColor; }
.help-fig .t-sub { font-size: 11px; fill: var(--sub); }
.help-fig .tag { font-size: 11px; font-weight: 700; fill: var(--accent); }
.help-fig .pot-h { font-family: var(--f-head); font-size: 14px; fill: var(--accent); }
.help-fig .flow { stroke: var(--sub); stroke-width: 1.4; fill: none; }
.help-fig .to-pot { stroke: var(--accent); stroke-width: 1.6; fill: none; }
.help-fig .to-pot-dash { stroke: var(--accent); stroke-width: 1.4; fill: none; stroke-dasharray: 4 3; }
.help-fig .head-sub { fill: var(--sub); }
.help-fig .head-acc { fill: var(--accent); }
.help-tab { width: 100%; border-collapse: collapse; font-size: .88rem; }
.help-tab th, .help-tab td { text-align: left; padding: 7px 4px; border-bottom: 1px dashed var(--line); vertical-align: top; }
.help-tab th { font-size: .78rem; color: var(--sub); font-weight: normal; border-bottom: 1px solid var(--line); }
.help-tab td.where { white-space: nowrap; font-weight: 700; color: var(--accent); }
.help-tab td.where.none { color: var(--sub); }
.help-why { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; font-size: .9rem; }
.help-why b { font-family: var(--f-num); }
.help-close { display: block; margin: 16px auto 0; border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: 999px; font: inherit; padding: 6px 28px; cursor: pointer; }
@media print { .help-q, .help-dlg { display: none !important; } }
/* 保険を1本ずつ：ふやす・けすのボタン */
.ins-add, .ins-del { border: 1px solid var(--accent); background: #fff; color: var(--accent); border-radius: 999px; font: inherit; cursor: pointer; white-space: nowrap; }
.ins-add { font-size: .8rem; padding: 3px 12px; }
.ins-del { border-color: var(--line); color: var(--sub); font-size: .72rem; padding: 0 8px; vertical-align: 1px; }
.ins-add:hover, .ins-del:hover { background: var(--accent-soft); }
@media print { .ins-add, .ins-del { display: none !important; } }
