/* 相続税ガイド／相続税の詳しい計算 共通の見た目
   261107 04:5x ／ ミッション「ma bk pub 相続税の詳しいガイドと詳細計算ページの追加」／ 発信者: mask（亀山）
   色は _toolkit.css の変数（--surface 等）に合わせ、図の色だけ --sg-* を足す。ダーク対応済み。 */
:root {
  --sg-c1: #2f6fed; --sg-c2: #12a37f; --sg-c3: #f59f00; --sg-c4: #d6336c; --sg-c5: #7048e8; --sg-c6: #868e96;
  --sg-c1s: #e7f0ff; --sg-c2s: #dff6ee; --sg-c3s: #fff3d6; --sg-c4s: #fde4ee; --sg-c5s: #ece6ff; --sg-c6s: #eceef0;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sg-c1: #6c9bff; --sg-c2: #3ccfa3; --sg-c3: #ffc047; --sg-c4: #ff7aa8; --sg-c5: #a58bff; --sg-c6: #a1a6ac;
    --sg-c1s: #14213d; --sg-c2s: #10302a; --sg-c3s: #3a2e10; --sg-c4s: #3a1626; --sg-c5s: #261d48; --sg-c6s: #26282b;
  }
}
:root[data-theme="dark"] {
  --sg-c1: #6c9bff; --sg-c2: #3ccfa3; --sg-c3: #ffc047; --sg-c4: #ff7aa8; --sg-c5: #a58bff; --sg-c6: #a1a6ac;
  --sg-c1s: #14213d; --sg-c2s: #10302a; --sg-c3s: #3a2e10; --sg-c4s: #3a1626; --sg-c5s: #261d48; --sg-c6s: #26282b;
}

.sg-wrap { max-width: 860px; margin: 0 auto; }
.sg-wrap h2.sg-h { font-size: 20px; margin: 0 0 6px; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.sg-wrap h2.sg-h .sg-ico { flex: none; width: 38px; height: 38px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; background: var(--sg-c1s); }
.sg-wrap h3 { font-size: 15.5px; margin: 20px 0 8px; }
.sg-wrap p { margin: 0 0 12px; font-size: 14px; }
.sg-lead { color: var(--ink-soft); font-size: 14px; margin: 0 0 16px; }
.sg-sec { scroll-margin-top: 70px; }

/* ヒーロー */
.sg-hero { background: linear-gradient(135deg, var(--sg-c1s), var(--sg-c2s)); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px 24px; }
.sg-hero h1 { margin: 0 0 8px; font-size: 26px; line-height: 1.3; letter-spacing: -.02em; }
.sg-hero p { margin: 0 0 14px; color: var(--ink-soft); font-size: 14.5px; }
.sg-hero-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.sg-btn { display: inline-flex; align-items: center; gap: 6px; padding: 11px 18px; border-radius: 999px; font-size: 14.5px; font-weight: 700; text-decoration: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font-family: inherit; }
.sg-btn.sg-primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.sg-btn:hover { filter: brightness(.96); }
.sg-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 16px; }
.sg-fact { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; }
.sg-fact b { display: block; font-size: 20px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.sg-fact span { font-size: 12px; color: var(--ink-soft); }

/* ページ内メニュー */
.sg-toc { position: sticky; top: 0; z-index: 5; display: flex; gap: 6px; overflow-x: auto; padding: 8px 2px; margin: 14px 0; background: var(--bg); -webkit-overflow-scrolling: touch; }
.sg-toc a { flex: none; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.sg-toc a:hover { color: var(--accent-ink); border-color: var(--accent); }

/* 流れ図（ステップ） */
.sg-flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0; }
.sg-step { position: relative; background: var(--surface-dim); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 12px; text-align: center; }
.sg-step .sg-n { position: absolute; top: -9px; left: -6px; width: 24px; height: 24px; line-height: 24px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 800; }
.sg-step .sg-e { font-size: 30px; line-height: 1.2; }
.sg-step b { display: block; font-size: 13.5px; margin: 4px 0 2px; }
.sg-step span { display: block; font-size: 12px; color: var(--ink-soft); }
.sg-step:not(:last-child)::after { content: "▶"; position: absolute; right: -11px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--ink-faint); z-index: 1; }
@media (max-width: 640px) { .sg-flow { grid-template-columns: repeat(2, 1fr); } .sg-step:nth-child(2)::after { content: "▼"; right: auto; left: 50%; top: auto; bottom: -14px; transform: translateX(-50%); } .sg-step:nth-child(2)::before { display: none; } }

/* カードの並び */
.sg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 12px 0; }
.sg-cardlet { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; background: var(--surface); }
.sg-cardlet .sg-e { font-size: 26px; }
.sg-cardlet b { display: block; font-size: 14.5px; margin: 4px 0; }
.sg-cardlet p { font-size: 13px; color: var(--ink-soft); margin: 0; }
.sg-cardlet.c1 { background: var(--sg-c1s); } .sg-cardlet.c2 { background: var(--sg-c2s); } .sg-cardlet.c3 { background: var(--sg-c3s); }
.sg-cardlet.c4 { background: var(--sg-c4s); } .sg-cardlet.c5 { background: var(--sg-c5s); } .sg-cardlet.c6 { background: var(--sg-c6s); }
.sg-tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: middle; background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft); }

/* 注意・ポイント枠 */
.sg-point, .sg-warn { display: flex; gap: 10px; border-radius: var(--r-md); padding: 12px 14px; font-size: 13.5px; margin: 12px 0; }
.sg-point { background: var(--sg-c2s); border: 1px solid var(--sg-c2); }
.sg-warn { background: var(--sg-c3s); border: 1px solid var(--sg-c3); }
.sg-point .sg-e, .sg-warn .sg-e { flex: none; font-size: 20px; line-height: 1.3; }
.sg-point div, .sg-warn div { min-width: 0; }

/* 図（SVG・棒グラフ）*/
.sg-fig { margin: 14px 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); padding: 12px; overflow: hidden; }
.sg-fig svg { display: block; width: 100%; height: auto; }
.sg-fig figcaption, .sg-cap { font-size: 12px; color: var(--ink-soft); margin-top: 6px; text-align: center; }
.sg-fig text { fill: var(--ink); font-family: inherit; }
.sg-fig .t-soft { fill: var(--ink-soft); }
.sg-fig .t-w { fill: #fff; }
.sg-bars { display: grid; gap: 8px; margin: 10px 0; }
.sg-bar { display: grid; grid-template-columns: 112px 1fr 92px; gap: 8px; align-items: center; font-size: 13px; }
.sg-bar .sg-track { height: 22px; background: var(--surface-dim); border-radius: 6px; overflow: hidden; }
.sg-bar .sg-fill { height: 100%; border-radius: 6px; background: var(--sg-c1); min-width: 2px; transition: width .4s; }
.sg-bar .sg-v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 12.5px; }
@media (max-width: 480px) { .sg-bar { grid-template-columns: 84px 1fr 78px; font-size: 12px; } }
.sg-stack { display: flex; height: 34px; border-radius: 8px; overflow: hidden; margin: 6px 0 4px; border: 1px solid var(--line); }
.sg-stack > div { display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; }
.sg-stack-row { margin: 12px 0; }
.sg-stack-row > b { font-size: 13px; }

/* 表 */
.sg-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.sg-tbl th, .sg-tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.sg-tbl th { background: var(--surface-dim); font-size: 12px; color: var(--ink-soft); }
.sg-tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sg-tbl tr.sg-hl td { background: var(--sg-c3s); font-weight: 700; }
.sg-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* 時系列（タイムライン）*/
.sg-tl { list-style: none; margin: 14px 0; padding: 0 0 0 20px; border-left: 3px solid var(--sg-c1); }
.sg-tl li { position: relative; padding: 0 0 16px 14px; font-size: 13.5px; }
.sg-tl li::before { content: ""; position: absolute; left: -29px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--sg-c1); }
.sg-tl li.sg-key::before { border-color: var(--accent); background: var(--accent); }
.sg-tl b { display: block; font-size: 14px; }
.sg-tl .sg-when { display: inline-block; font-size: 11.5px; font-weight: 800; padding: 1px 8px; border-radius: 999px; background: var(--sg-c1s); color: var(--sg-c1); margin-right: 6px; }
.sg-tl li.sg-key .sg-when { background: var(--accent-soft); color: var(--accent-ink); }

/* Q&A */
.sg-qa details { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); margin-bottom: 8px; }
.sg-qa summary { cursor: pointer; padding: 12px 14px; font-weight: 700; font-size: 14px; list-style: none; display: flex; gap: 8px; }
.sg-qa summary::-webkit-details-marker { display: none; }
.sg-qa summary::before { content: "Q"; flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--sg-c1); color: #fff; font-size: 12px; text-align: center; line-height: 22px; }
.sg-qa details > div { padding: 0 14px 12px 44px; font-size: 13.5px; color: var(--ink-soft); }

/* 計算機 */
.sg-calc .sg-steps { display: flex; gap: 6px; margin: 4px 0 16px; flex-wrap: wrap; }
.sg-calc .sg-steps a { flex: 1 1 120px; text-align: center; text-decoration: none; padding: 8px 6px; border-radius: 10px; background: var(--surface-dim); border: 1px solid var(--line); font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.sg-fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 14px; }
.sg-fgrid .tk-field { margin-bottom: 0; }
.sg-fgrid .tk-input, .sg-fgrid .tk-select { width: 100%; }
.sg-sect-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; margin: 22px 0 10px; }
.sg-sect-title .sg-num { width: 26px; height: 26px; line-height: 26px; text-align: center; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 13px; }
.sg-presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 4px; }
.sg-presets button { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit; }
.sg-presets button:hover { border-color: var(--accent); color: var(--accent-ink); }
.sg-range { width: 100%; accent-color: var(--accent); }
.sg-ranget { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-soft); }
.sg-resultbox { margin-top: 18px; border: 2px solid var(--accent); border-radius: var(--r-lg); padding: 18px; background: var(--surface); }
.sg-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 6px 0 12px; }
.sg-kpi { border-radius: var(--r-md); padding: 12px 14px; background: var(--surface-dim); border: 1px solid var(--line); }
.sg-kpi span { font-size: 12px; color: var(--ink-soft); display: block; }
.sg-kpi b { font-size: 21px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.sg-kpi.main { background: var(--accent-soft); border-color: var(--accent); }
.sg-kpi.main b { color: var(--accent-ink); font-size: 26px; }
.sg-verdict { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: var(--r-md); margin: 10px 0; font-size: 14px; font-weight: 700; }
.sg-verdict.ok { background: var(--sg-c2s); border: 1px solid var(--sg-c2); }
.sg-verdict.ng { background: var(--sg-c3s); border: 1px solid var(--sg-c3); }
.sg-verdict .sg-e { font-size: 24px; }
.sg-note-s { font-size: 12px; color: var(--ink-faint); }
.sg-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-soft); margin-top: 6px; justify-content: center; }
.sg-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.sg-rel { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.sg-rel a { display: block; text-decoration: none; border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; background: var(--surface); }
.sg-rel a:hover { border-color: var(--accent); }
.sg-rel a b { display: block; font-size: 15px; margin: 2px 0; }
.sg-rel a span { font-size: 12.5px; color: var(--ink-soft); }
.sg-rel .sg-e { font-size: 26px; }
.sg-banner { display: flex; gap: 12px; align-items: center; border: 1px solid var(--sg-c1); background: var(--sg-c1s); border-radius: var(--r-lg); padding: 14px 16px; margin: 0 0 16px; text-decoration: none; }
.sg-banner .sg-e { font-size: 28px; }
.sg-banner b { display: block; font-size: 15px; }
.sg-banner span { font-size: 12.5px; color: var(--ink-soft); }
@media print { .sg-toc, .sg-presets, .sg-hero-cta { display: none; } }
