/*
 * 計算ツール 5 本（複利・FIRE・ローン返済・配当・不労所得）だけで使う部品。
 * 共通の見た目は classic-tokens.css。ここでは色・余白をその変数から取る。
 */

/* 入力欄の下の「＝ 123万4,567円」（桁の読み違いを防ぐ） */
.fc-readout {
    margin: -6px 0 8px;
    min-height: 1.4em;
    font-size: var(--tu-fs-note);
    line-height: 1.4;
    color: var(--tu-text-muted);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* 入力に誤りがある間は、結果を薄くして「更新していない」ことを示す */
.tu-result.fc-stale > *:not(.fc-stale-note) { opacity: 0.45; }
.fc-stale-note {
    margin: 0 0 12px;
    padding: 8px 12px;
    font-size: var(--tu-fs-label);
    line-height: 1.6;
    color: var(--tu-danger-ink);
    background: var(--tu-danger-soft);
    border-radius: 6px;
}
.fc-stale-note[hidden] { display: none; }

/* 入力欄の誤り */
.tu-field__box input[aria-invalid="true"] { border-color: var(--tu-danger); box-shadow: 0 0 0 1px var(--tu-danger); }
.tu-inputs [data-tu="error"] { color: var(--tu-danger-ink); font-weight: 700; }

/* 計算の前提（結果の下の 1 行） */
.fc-basis {
    margin: 12px 0 0;
    font-size: var(--tu-fs-note);
    line-height: 1.6;
    color: var(--tu-text-muted);
}

/* 表（感度分析・年次推移など）。横にはみ出すときは枠の中だけスクロールし、キーボードでも動かせる */
.fc-table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.fc-table-wrap:focus-visible { outline: 3px solid var(--tu-accent); outline-offset: 2px; }
.fc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--tu-fs-label);
    font-variant-numeric: tabular-nums;
}
.fc-table caption {
    caption-side: top;
    padding: 0 0 6px;
    font-size: var(--tu-fs-note);
    line-height: 1.6;
    color: var(--tu-text-muted);
    text-align: left;
}
.fc-table th,
.fc-table td { padding: 6px 8px; text-align: right; border-bottom: 1px solid var(--tu-line); white-space: nowrap; }
.fc-table thead th { text-align: center; background: var(--tu-bg); }
.fc-table th[scope="row"] { text-align: left; font-weight: 400; }
/* 行見出しが文章の表（配当の受け取り方）だけ折り返す */
.fc-table--labels th[scope="row"] { white-space: normal; }
.fc-table tr.is-current th,
.fc-table tr.is-current td { font-weight: 700; background: var(--tu-accent-soft); }

/* 計算式と前提の箇条書き */
.fc-formula { margin: 0; padding-left: 1.2em; }
.fc-formula li { margin: 0 0 6px; }
.fc-formula code { font-family: inherit; font-weight: 700; white-space: normal; overflow-wrap: anywhere; background: none; padding: 0; }

/* 画面には出さず、読み上げにだけ渡す */
.fc-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* 何十桁もの金額（最大値の入力など）でも横にはみ出さないよう、必要なときだけ数字の途中で折り返す */
.tu-hook,
.tu-main__value,
.tu-sub dd,
.tu-verdict__text,
.tu-next__text { overflow-wrap: anywhere; }
/* 主数値の補足（税引き後の額など）は、1 行に入らないときだけ折り返す */
.tu-main__value small { max-width: 100%; white-space: normal; }
