/* 売却の確認帳 — 石灰色の紙面に濃緑の見出し罫。書類を机上で照合する編集面。影・グラデーション・カードの壁は使わない */
:root {
  --accent: #2F5B45;        /* 濃緑: リンク罫・見出し罫・主要ボタン */
  --accent-dark: #173D2A;   /* 文字リンク・フォーカス輪郭 */
  --accent-soft: #E7EEE7;   /* 選択済み・説明帯 */
  --paper: #FCFCF8;
  --surface: #F2F3EC;
  --ink: #18251D;
  --ink-soft: #3D4A42;
  --line: #C9CEC4;
  --line-strong: #8E978C;
  --note: #884A28;          /* 錆茶: 要確認・公式で確かめる印（優劣や危険の色にはしない） */
  --note-bg: #F5E8DE;
  --radius: 2px;
  --radius-control: 4px;
  --container: 1120px;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", Meiryo, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink);
  background: var(--paper);
  overflow-wrap: anywhere;
}
img, svg { max-width: 100%; }

:focus-visible { outline: 3px solid var(--accent-dark); outline-offset: 2px; }

a { color: var(--accent-dark); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3 { line-height: 1.45; letter-spacing: 0; font-weight: 700; color: var(--ink); }
h1 { font-size: 2rem; margin: 0 0 16px; }
h2 { font-size: 1.375rem; margin: 48px 0 16px; padding-top: 14px; border-top: 2px solid var(--accent); }
h3 { font-size: 1.0625rem; margin: 28px 0 8px; }
p { margin: 0 0 16px; }
ul, ol { padding-left: 1.4em; margin: 0 0 16px; }
li { margin-bottom: 6px; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 32px; }
.page { max-width: 784px; margin: 0 auto; padding: 24px 32px 72px; }
.page-mid { max-width: 984px; margin: 0 auto; padding: 24px 32px 72px; }
.page-wide { max-width: var(--container); margin: 0 auto; padding: 24px 32px 72px; }

.skip-link { position: absolute; left: 8px; top: -60px; background: var(--ink); color: var(--paper); padding: 8px 16px; z-index: 100; }
.skip-link:focus { top: 8px; }

/* ===== Header ===== */
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--accent); text-decoration: none; min-height: 44px; }
.logo-mark { width: 30px; height: 30px; flex: none; }
.logo-text { font-weight: 700; font-size: 1.125rem; color: var(--ink); }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--ink); text-decoration: none; border-bottom: 3px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--line-strong); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--accent); font-weight: 600; }
.nav-toggle { display: none; }

@media (max-width: 760px) {
  .header-inner { min-height: 56px; }
  .js .nav-toggle {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; min-width: 44px; padding: 0 10px;
    background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius-control); color: var(--ink); font: inherit; cursor: pointer;
  }
  .nav-toggle-bars { display: inline-flex; flex-direction: column; gap: 4px; }
  .nav-toggle-bars span { display: block; width: 18px; height: 2px; background: var(--ink); }
  .js .site-nav { display: none; width: 100%; flex-direction: column; padding: 0 0 8px; border-top: 1px solid var(--line); }
  .js .site-nav.open { display: flex; }
  .site-nav a { border-bottom: 1px solid var(--line); border-left: 4px solid transparent; }
  .site-nav a[aria-current="page"] { border-bottom-color: var(--line); border-left-color: var(--accent); }
}

/* ===== Breadcrumb ===== */
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 12px 0 0; margin: 0; font-size: .875rem; }
.breadcrumb li { margin: 0; display: inline-flex; align-items: center; }
.breadcrumb li + li::before { content: "/"; margin-right: 6px; color: var(--ink-soft); }
.breadcrumb a { display: inline-flex; align-items: center; min-height: 44px; }

/* ===== 共通部品 ===== */
.eyebrow { font-size: .875rem; font-weight: 600; color: var(--accent); margin: 8px 0 6px; }
.lead { font-size: 1.0625rem; color: var(--ink); }
.page-dates { font-size: .8125rem; line-height: 1.65; color: var(--ink-soft); }
.page-dates a { display: inline-block; }

.scope-band { background: var(--surface); border-left: 4px solid var(--accent); padding: 16px 20px; margin: 16px 0 24px; }
.scope-band p:last-child { margin-bottom: 0; }

.note-mark { display: inline-block; font-size: .75rem; font-weight: 600; color: var(--note); background: var(--note-bg); padding: 0 6px; border-radius: var(--radius); margin-right: 6px; vertical-align: 1px; }

.source-note { border-top: 1px solid var(--line); margin: 12px 0 28px; padding-top: 8px; font-size: .8125rem; line-height: 1.65; }
.source-note-title { font-weight: 600; margin: 0 0 4px; color: var(--ink-soft); }
.source-note ul { list-style: none; padding: 0; margin: 0; }
.source-note li { margin: 0 0 6px; }
.source-note a { display: inline; }
.source-meta { display: block; color: var(--ink-soft); }

/* 番号・問い・行き先の罫線行（カードではなく1本の表のように積む） */
.ruled-rows { list-style: none; padding: 0; margin: 16px 0 24px; border-top: 1px solid var(--line-strong); }
.ruled-rows li { margin: 0; border-bottom: 1px solid var(--line); }
.ruled-rows a.row-link { display: grid; grid-template-columns: 48px 1fr auto; gap: 16px; align-items: baseline; padding: 16px 4px; min-height: 64px; color: var(--ink); text-decoration: none; }
.ruled-rows a.row-link:hover .row-q { text-decoration: underline; text-decoration-color: var(--accent); }
.row-no { font-weight: 700; color: var(--accent); font-size: 1rem; }
.row-q { font-weight: 600; display: block; }
.row-sub { display: block; font-size: .875rem; color: var(--ink-soft); font-weight: 400; }
.row-to { font-size: .875rem; color: var(--accent-dark); text-decoration: underline; text-decoration-color: var(--accent); white-space: nowrap; }

.text-links { list-style: none; padding: 0; margin: 12px 0 24px; }
.text-links li { margin: 0; border-bottom: 1px solid var(--line); }
.text-links a { display: flex; align-items: center; min-height: 48px; padding: 6px 0; }

.steps-list { list-style: none; counter-reset: s; padding: 0; margin: 12px 0 24px; }
.steps-list li { counter-increment: s; position: relative; padding: 12px 0 12px 44px; border-bottom: 1px solid var(--line); margin: 0; }
.steps-list li::before { content: counter(s); position: absolute; left: 0; top: 12px; width: 28px; height: 28px; border: 2px solid var(--accent); color: var(--accent); font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: .875rem; line-height: 1; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 20px; border-radius: var(--radius-control); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; border: 2px solid var(--accent); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-secondary { background: #fff; color: var(--accent-dark); }
.btn:disabled { cursor: not-allowed; opacity: .55; }

/* ===== Home ===== */
.home-top { display: grid; grid-template-columns: minmax(0, 730px) 320px; gap: 32px; padding-top: 32px; }
.home-top h1 { font-size: 2.125rem; }
.aside-scope { border: 1px solid var(--line); border-top: 4px solid var(--accent); background: #fff; padding: 20px 22px; align-self: start; margin-top: 8px; }
.aside-scope h2 { margin: 0 0 8px; padding: 0; border: 0; font-size: 1rem; }
.aside-scope ul { margin: 0 0 12px; }
.aside-scope p { font-size: .875rem; margin: 0; }
.two-flows { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.two-flows h3 { margin-top: 8px; }

/* ===== Tables ===== */
.table-note { font-size: .875rem; color: var(--ink-soft); margin: 0 0 8px; }
.scroll-hint { display: none; font-size: .875rem; color: var(--note); margin: 0 0 8px; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); background: #fff; margin: 0 0 12px; }
.table-scroll:focus-visible { outline: 3px solid var(--accent-dark); outline-offset: 2px; }
table { border-collapse: collapse; width: 100%; font-size: .875rem; line-height: 1.55; }
caption { text-align: left; font-weight: 600; padding: 8px 0; font-size: .9375rem; }
th, td { border-bottom: 1px solid var(--line); padding: 12px 14px; text-align: left; vertical-align: top; }
thead th { background: var(--surface); font-weight: 600; border-bottom: 2px solid var(--accent); }
tbody th { font-weight: 600; }
.compare-table { min-width: 1040px; }
.compare-table tbody th { position: sticky; left: 0; background: #fff; box-shadow: 1px 0 0 var(--line); min-width: 140px; }
.methods-table { min-width: 900px; }
.methods-table tbody th { position: sticky; left: 0; background: #fff; box-shadow: 1px 0 0 var(--line); min-width: 150px; }
.compare-table td a, .methods-table td a { display: inline-block; padding: 4px 0; }

.fact-table { background: #fff; border: 1px solid var(--line); margin: 8px 0 12px; }
.fact-table caption { padding: 8px 14px; }
.fact-table tbody th { width: 22%; background: var(--surface); }
.fact-source { width: 28%; font-size: .8125rem; }
.fact-source a { display: block; margin-bottom: 6px; }

.info-table { background: #fff; border: 1px solid var(--line); margin: 8px 0 20px; }
.info-table th { width: 30%; background: var(--surface); }

/* ===== Service pages ===== */
.kind-line { border-left: 4px solid var(--accent); padding: 4px 0 4px 14px; margin: 8px 0 20px; font-weight: 600; }
.question-list { list-style: none; padding: 0; margin: 12px 0 20px; border-top: 1px solid var(--line-strong); }
.question-list li { margin: 0; padding: 12px 0 12px 32px; border-bottom: 1px solid var(--line); position: relative; }
.question-list li::before { content: "問"; position: absolute; left: 0; top: 13px; font-size: .75rem; font-weight: 700; color: var(--note); background: var(--note-bg); padding: 0 5px; line-height: 1.6; }
.constraint-list li { margin-bottom: 10px; }
.official-box { border: 1px solid var(--line-strong); background: #fff; padding: 20px 24px; margin: 32px 0 16px; }
.official-box p { margin: 0 0 12px; }
.official-box .official-move { font-size: .875rem; color: var(--ink-soft); }
.summary-block { background: var(--surface); border-left: 4px solid var(--accent); padding: 16px 20px; margin: 0 0 16px; }
.summary-block p { margin: 0; }

/* ===== Appraisal / 3 numbers ===== */
.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 2px solid var(--accent); border-bottom: 1px solid var(--line); }
.split-2 > section { padding: 16px 24px 16px 0; }
.split-2 > section + section { padding: 16px 0 16px 24px; border-left: 1px solid var(--line); }
.split-2 h2 { margin: 0 0 12px; padding: 0; border: 0; font-size: 1.125rem; }
.split-2 dl { margin: 0; }
.split-2 dt { font-size: .8125rem; font-weight: 600; color: var(--ink-soft); margin-top: 10px; }
.split-2 dd { margin: 0; }
.term-band { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); background: #fff; margin: 16px 0; }
.term-band > div { padding: 16px 18px; }
.term-band > div + div { border-left: 1px solid var(--line); }
.term-band h3 { margin: 0 0 6px; font-size: 1rem; color: var(--accent-dark); }
.term-band p { font-size: .9375rem; margin: 0; }

/* ===== Articles ===== */
.article-list { list-style: none; padding: 0; margin: 8px 0 24px; border-top: 1px solid var(--line-strong); }
.article-list li { margin: 0; border-bottom: 1px solid var(--line); }
.article-list a { display: block; padding: 14px 4px; min-height: 72px; color: var(--ink); text-decoration: none; }
.article-list a:hover .al-title { text-decoration: underline; text-decoration-color: var(--accent); }
.al-type { display: inline-block; font-size: .75rem; font-weight: 600; color: var(--accent); border: 1px solid var(--accent); padding: 0 6px; margin-bottom: 4px; }
.al-title { display: block; font-weight: 700; }
.al-q { display: block; font-size: .875rem; color: var(--ink-soft); }
.al-date { display: block; font-size: .75rem; color: var(--ink-soft); }

.article-body table { background: #fff; border: 1px solid var(--line); margin: 12px 0 20px; }
.article-body .table-scroll table { margin: 0; border: 0; }
@media (max-width: 480px) { .article-body th, .article-body td { padding: 8px 8px; } }
.article-body td:empty::after { content: "\00a0"; display: inline-block; min-width: 2em; min-height: 1.6em; }
.article-body blockquote { margin: 16px 0; padding: 12px 18px; background: var(--surface); border-left: 4px solid var(--accent); }
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body h2 + p { margin-top: 0; }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { cursor: pointer; font-weight: 600; min-height: 48px; display: flex; align-items: center; padding: 8px 0; }
.faq-list details p { margin: 0 0 14px; }

/* ===== Tool ===== */
.tool-layout { display: grid; grid-template-columns: minmax(0, 620px) 260px; gap: 32px; align-items: start; }
.tool-form { display: none; }
.js .tool-form { display: block; }
.tool-form fieldset { border: 0; border-top: 2px solid var(--accent); margin: 0 0 20px; padding: 10px 0 0; }
.tool-form legend { font-weight: 700; padding: 0 8px 0 0; font-size: 1.0625rem; }
.check-row { display: flex; align-items: flex-start; gap: 12px; min-height: 48px; padding: 10px 8px; border-bottom: 1px solid var(--line); cursor: pointer; border-left: 4px solid transparent; }
.check-row input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.check-row:has(input:checked) { background: var(--accent-soft); border-left-color: var(--accent); }
.tool-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 24px; }
.tool-toc { border: 1px solid var(--line); background: #fff; padding: 16px 18px; position: sticky; top: 16px; font-size: .875rem; }
.tool-toc h2 { margin: 0 0 8px; padding: 0; border: 0; font-size: .9375rem; }
.tool-toc ol { margin: 0; padding-left: 1.2em; }
.tool-toc a { display: inline-block; padding: 6px 0; }
.memo { border: 1px solid var(--line-strong); background: #fff; padding: 20px 24px; margin: 8px 0 24px; }
.memo[data-status="idle"] { background: var(--surface); }
.memo h2 { margin: 0 0 10px; padding: 0; border: 0; font-size: 1.1875rem; }
.memo-notice { color: var(--note); font-weight: 600; }
.memo-notice:empty { display: none; }
.memo-group { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 12px; }
.memo-group h3 { margin: 0 0 6px; font-size: 1rem; }
.memo-group.is-unselected p { color: var(--ink-soft); margin: 0; }
.memo-item { margin: 8px 0 12px; }
.memo-item p { margin: 0 0 4px; }
.memo-item .memo-q { font-weight: 600; }
.memo-item ul { margin: 2px 0 0; font-size: .875rem; }
.memo-meta, .print-meta { font-size: .8125rem; color: var(--ink-soft); border-top: 1px solid var(--line); padding-top: 10px; margin-top: 16px; }
.print-meta { display: none; }
.static-questions h3 { margin-top: 20px; }
.static-q { list-style: none; padding: 0; margin: 0 0 16px; }
.static-q li { border-bottom: 1px solid var(--line); padding: 10px 0; margin: 0; }
.static-q .sq-label { display: block; font-size: .8125rem; color: var(--ink-soft); }
.static-q .sq-q { display: block; font-weight: 600; }
.static-q .sq-links { display: block; font-size: .8125rem; }
.nojs-note { background: var(--note-bg); border-left: 4px solid var(--note); padding: 12px 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ===== Footer ===== */
.site-footer { border-top: 2px solid var(--accent); background: var(--surface); padding: 32px 0 24px; font-size: .875rem; margin-top: 24px; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer-name { font-weight: 700; margin-bottom: 4px; }
.footer-desc { color: var(--ink-soft); }
.footer-nav { display: flex; flex-direction: column; }
.footer-nav-title { font-weight: 600; margin: 0 0 4px; }
.footer-nav a { display: flex; align-items: center; min-height: 44px; }
.footer-notice { color: var(--ink-soft); margin: 12px 0 0; }
.footer-copy { color: var(--ink-soft); margin: 12px 0 0; }

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .home-top, .tool-layout { grid-template-columns: 1fr; }
  .tool-toc { position: static; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .container, .page, .page-mid, .page-wide { padding-left: 16px; padding-right: 16px; }
  .page, .page-mid, .page-wide { padding-top: 16px; padding-bottom: 48px; }
  h1, .home-top h1 { font-size: 1.75rem; }
  h2 { font-size: 1.3125rem; margin-top: 32px; }
  .two-flows, .split-2, .term-band { grid-template-columns: 1fr; }
  .split-2 > section, .split-2 > section + section { padding: 16px 0; border-left: 0; }
  .split-2 > section + section { border-top: 1px solid var(--line); }
  .term-band > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .ruled-rows a.row-link { grid-template-columns: 32px 1fr; gap: 8px; }
  .row-to { grid-column: 2; white-space: normal; }
  .scroll-hint { display: block; }
  .fact-table, .fact-table tbody, .fact-table tr, .fact-table th, .fact-table td { display: block; width: auto; }
  .fact-table thead { display: none; }
  .fact-table tr { border-bottom: 2px solid var(--line); }
  .fact-table th, .fact-table td { border-bottom: 0; padding: 8px 14px; }
  .fact-table tbody th { padding-top: 12px; }
  .fact-source::before { content: "出典"; display: block; font-weight: 600; color: var(--ink-soft); }
  .info-table th, .info-table td { display: block; width: auto; }
  .official-box { padding: 16px; }
  .official-box .btn { width: 100%; text-align: center; }
  .memo { padding: 16px; }
}
@media (max-width: 480px) {
  .footer-top { grid-template-columns: 1fr; }
}

/* ===== Print (A4) ===== */
@media print {
  @page { size: A4; margin: 14mm 12mm; }
  body { background: #fff; font-size: 10.5pt; line-height: 1.6; }
  .site-header, .site-footer, .breadcrumb, .skip-link, .tool-form, .tool-actions, .tool-toc, .no-print, .nav-toggle { display: none !important; }
  .page, .page-mid, .page-wide { max-width: none; padding: 0; }
  .tool-layout { display: block; }
  a { color: #000; text-decoration: none; }
  .memo { border: 1px solid #999; page-break-inside: auto; }
  .memo[data-status="idle"] { display: none; }
  body.has-memo .static-questions { display: none; }
  .memo-group, .static-q li { break-inside: avoid; }
  .print-meta { display: block; }
  .memo-item a[href^="http"]::after, .static-q a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; overflow-wrap: anywhere; }
  h2 { border-top-color: #000; }
}
.compare-table tbody th a, .compare-table td a { display: block; padding: 6px 0; }
.compare-table td p { margin: 0 0 8px; }
.compare-table td ul { margin: 0; padding-left: 1.1em; }
.boundary-rows { list-style: none; padding: 0; margin: 16px 0 24px; border-top: 2px solid var(--accent); }
.boundary-rows li { margin: 0; padding: 12px 4px; border-bottom: 1px solid var(--line); font-weight: 600; }
@media (max-width: 760px) {
  .info-table thead { display: none; }
  .info-table caption { display: block; }
  .info-table tr { display: block; border-bottom: 2px solid var(--line); }
  .info-table th, .info-table td { border-bottom: 0; padding: 8px 14px; }
  .info-table td[data-label]::before { content: attr(data-label); display: block; font-size: .75rem; font-weight: 600; color: var(--ink-soft); }
}
