/* ALW-01 追加CSS。節ごとに担当が分かれる(summary=範囲1 / ads=範囲4 / child=範囲3)。 */

/* summary */
.sum-card.sav .label { color: #2563eb; }
.sum-card.sav .num { color: #2563eb; }
.saving-hint { margin: 6px 0 0; font-size: 12px; line-height: 1.6; color: #2563eb; }
/* 集計カードは5枚(収入・つかった・ためた・のこり・貯金目標)。広い画面だけ5列にする(狭い画面は index.html の 2列/1列を使う) */
@media (min-width: 1081px) { .summary { grid-template-columns: repeat(5, 1fr); gap: 14px; } }

/* ads */
.ads-block { max-width: 760px; margin: 28px auto 8px; padding: 18px 16px 22px; border-top: 1px solid #cbd5e1; background: #f8fafc; color: #1e293b; }
.ads-block h2 { margin: 0 0 8px; font-size: 16px; line-height: 1.5; color: #1e293b; }
.ads-lead { margin: 0 0 14px; font-size: 14px; line-height: 1.7; }
.ads-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ads-list li { padding: 14px; background: #fff; border: 1px solid #cbd5e1; border-radius: 10px; }
.ads-name { margin: 0 0 6px; font-size: 15px; font-weight: 700; line-height: 1.5; }
.ads-desc { margin: 0 0 10px; font-size: 14px; line-height: 1.7; color: #334155; }
.ad-pr { display: inline-block; margin-right: 8px; padding: 2px 8px; border: 1px solid #475569; border-radius: 4px; background: #fff; color: #1e293b; font-size: 14px; font-weight: 700; line-height: 1.4; vertical-align: middle; }
.ads-btn { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; min-height: 48px; padding: 10px 18px; border-radius: 10px; background: #1e40af; color: #fff; font-size: 14px; font-weight: 700; line-height: 1.4; text-decoration: none; text-align: center; }
.ads-btn:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }
@media (max-width: 480px) { .ads-btn { display: flex; width: 100%; } }

/* child */
/* --- ふりがな: 読みは <rt data-r> の属性から描く。textContent・コピー・共有に読みを混ぜない --- */
ruby { ruby-position: over; }
rt { font-size: .65em; line-height: 1.1; font-weight: 500; letter-spacing: 0; }
rt::before { content: attr(data-r); }
[data-child-area] { line-height: 1.9; }
[data-child-area] .num, [data-child-area] .gnum { line-height: 1.3; }

/* --- 画像を使わない特長チップ(絵文字) --- */
.dic { text-shadow: none; }

/* --- 押しやすさ: タップ対象は 44x44px 以上 --- */
button, select, summary, textarea, .btn,
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]) { min-height: 44px; }
.input { min-height: 44px; padding-top: 0; padding-bottom: 0; }
.input input, .input select { min-height: 44px; }
#goal-amount { min-height: 44px; width: 140px; }
.btn, .arr, .rtabs button, .seg button { min-width: 44px; }
.btn-sm { padding-top: 10px; padding-bottom: 10px; }
.month-pick { flex-wrap: wrap; }
.month-pick select { padding: 6px 10px; }
.month-pick .arr { padding: 6px 14px; }
.rtabs button { padding: 8px 16px; }
.rec-actions { gap: 8px; }
.icon-btn { width: 44px; height: 44px; }
.icon-btn img { width: 20px; height: 20px; }
a.brand, li > a, a[href*="px.a8.net"], .breadcrumb a, .footer-col a, .foot-note a, .nav a, .app-bottom-nav a, a[style*="display:inline-block"] { min-height: 44px; min-width: 44px; }
.breadcrumb a, .footer-col a, .foot-note a, li > a, a[style*="display:inline-block"] { display: inline-flex !important; align-items: center; }
.footer-col a { display: flex !important; padding: 8px 0; }
.foot-note a { padding: 0 6px; }
.breadcrumb ol { gap: 0; }
a[href="#main-content"]:focus { clip: auto !important; width: auto !important; height: auto !important; min-height: 44px; display: inline-flex; align-items: center; font-size: 14px !important; }
.help { width: 24px; height: 24px; font-size: 14px; }

/* --- 文字の大きさ: 本文・操作は 14px 以上(注記 .note・出典 .source は 13px まで) --- */
.sum-card .sub, .goal-mini, .bar-row, .rtabs button, .rec-table th, .rec-table td, .rec-table .date, .cat-tag, .legend,
.chart-total, .tip-box .tip-title, .tip-box p, .learn-card p, .footer-social .small, .foot-note, #pwa-banner, .breadcrumb ol,
.app-bottom-nav a, .saving-hint, .goal-card .gtitle, .advice-bubble { font-size: 14px; }
.sum-card .num small { font-size: 16px; }
.goal-mini b { font-size: 22px; }
.help { font-size: 14px; }
.mobile-quick-nav a div { font-size: 14px !important; }
[style*="font-size:9"], [style*="font-size:10"], [style*="font-size:11"], [style*="font-size:12"], [style*="font-size:13"],
[style*="font-size:.6"], [style*="font-size:.7"], [style*="font-size:.8"], [style*="font-size:0."] { font-size: 14px !important; }
.note, .source { font-size: 13px !important; }

/* --- 画面の下: 下ナビ・同意バナーに最後の本文が隠れない --- */
@media (max-width: 860px) { body { padding-bottom: 72px; } }
body:has(#consent-banner-v2) { padding-bottom: 170px; }

/* --- 移動先の見出しが固定ヘッダーに隠れない --- */
#top, #record-form, #charts-section, #records-section, #learn-section, #how-it-works, #main-content { scroll-margin-top: 88px; }

/* --- 拡大(150%相当)でも横にあふれない --- */
.field > .input, .field > label { min-width: 0; }
.card, .sum-card, .chart-card, .learn-card, .d-card { min-width: 0; }
.sum-card .num, .rec-table td, .tip-box p, #advice-lead, #advice-detail, #excluded-note, .legend .ln, .memo-col { overflow-wrap: anywhere; }
.rec-table { min-width: 0; }
@media (max-width: 420px) {
  .site-header .wrap { gap: 8px; }
  .header-actions { min-width: 0; gap: 8px; }
  #profile-select { max-width: min(150px, calc(100vw - 200px)); }
}
.btn { white-space: normal; text-align: center; line-height: 1.35; max-width: 100%; }
.brand { white-space: normal; }
.goal-card .row { flex-wrap: wrap; gap: 12px 18px; }
.goal-card .row > div { min-width: 0; flex: 1 1 140px; }
.advice-bubble { min-width: 0; }
@media (max-width: 560px) {
  .footer-grid, .summary, .charts, .learn-grid, .d-steps { grid-template-columns: minmax(0, 1fr); }
  .d-grid { grid-template-columns: minmax(0, 1fr); }
}
#goal-amount { flex: 1 1 80px; min-width: 0; width: auto; max-width: 160px; }
[style*="grid-template-columns:1fr 1fr"] { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; }
@media (max-width: 560px) { [style*="grid-template-columns:1fr 1fr"] { grid-template-columns: minmax(0, 1fr) !important; } }
[style*="word-break:keep-all"] { word-break: normal !important; overflow-wrap: anywhere; }
canvas { max-width: 100%; }
.donut-wrap { flex-wrap: wrap; }
.legend { min-width: 0; flex: 1 1 140px; }
.legend .lrow { min-width: 0; flex-wrap: wrap; }
/* のこりが負でも赤字・警告色にしない(貯金したぶんも引くので、収入の記録が足りないだけで負になる)。index.html の script が付ける赤を上書きする */
#sum-balance { color: var(--green-deep) !important; }

/* 出典リンクは押しやすい高さ(44px)にする(S4の表のリンク) */
.src-link { display: inline-flex; align-items: center; min-height: 44px; }
