/* 申告書と精算書をモチーフにした画面。
   墨・罫(申告書の水色がかった灰)・朱(差し引き額と判子)・藍(操作)の4色に絞る。 */
:root {
  --desk: #eceef0;
  --paper: #ffffff;
  --ink: #23272c;
  --ink-soft: #5a636c;
  --rule: #b4c0cb;
  --rule-soft: #dde3e8;
  --band: #eef2f5;
  --shu: #b8322c;
  --ai: #22446a;
  --ai-ink: #ffffff;
  --mincho: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --gothic: "BIZ UDPGothic", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --desk: #181b1f;
    --paper: #22262b;
    --ink: #e6e8ea;
    --ink-soft: #a3acb5;
    --rule: #4a5662;
    --rule-soft: #333b44;
    --band: #2a3037;
    --shu: #e26a61;
    --ai: #8fb3db;
    --ai-ink: #14202d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --desk: #181b1f; --paper: #22262b; --ink: #e6e8ea; --ink-soft: #a3acb5;
  --rule: #4a5662; --rule-soft: #333b44; --band: #2a3037; --shu: #e26a61;
  --ai: #8fb3db; --ai-ink: #14202d; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font-family: var(--gothic);
  font-size: 16px;
  line-height: 1.75;
}
a { color: var(--ai); text-underline-offset: 3px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* サイト名の帯 */
.masthead { border-bottom: 1px solid var(--rule); background: var(--paper); }
.masthead-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 52px; }
.masthead a { color: var(--ink); text-decoration: none; font-size: 0.9rem; }
.masthead a:hover { text-decoration: underline; }
.masthead .site-name { font-family: var(--mincho); font-weight: 800; font-size: 1.05rem; letter-spacing: 0.06em; }

/* 見出し */
.hero { padding: 48px 0 36px; }
.hero h1 {
  margin: 0 0 16px;
  font-family: var(--mincho);
  font-weight: 800;
  font-size: clamp(1.75rem, 5vw, 2.9rem);
  line-height: 1.4;
  letter-spacing: 0.02em;
  font-feature-settings: "palt";
}
.lead { margin: 0; max-width: 36em; color: var(--ink-soft); }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: 32px;
  align-items: start;
  padding-bottom: 56px;
}
@media (max-width: 920px) { .layout { grid-template-columns: minmax(0, 1fr); } }

/* 記入欄: 申告書のように「項目名の欄+記入欄」を罫線で区切る */
.sheet {
  background: var(--paper);
  border: 1px solid var(--rule);
}
.block + .block { border-top: 1px solid var(--rule); }
.block-title {
  margin: 0;
  padding: 10px 16px;
  background: var(--band);
  border-bottom: 1px solid var(--rule);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.block-note { margin: 0; padding: 12px 16px 0; font-size: 0.85rem; color: var(--ink-soft); }

.row {
  display: grid;
  grid-template-columns: 12.5em minmax(0, 1fr);
  border-bottom: 1px solid var(--rule-soft);
}
.row:last-child { border-bottom: 0; }
.row-label {
  grid-row: span 2;
  padding: 14px 16px;
  border-right: 1px solid var(--rule-soft);
  font-size: 0.92rem;
  font-weight: 700;
}
.row-input { display: flex; align-items: center; gap: 8px; padding: 10px 16px 4px; }
.row-hint { padding: 0 16px 12px; font-size: 0.8rem; color: var(--ink-soft); }
.row:not(:has(.row-hint)) .row-input { grid-row: span 2; padding-bottom: 10px; }
@media (max-width: 560px) {
  .row { grid-template-columns: minmax(0, 1fr); }
  .row-label { grid-row: auto; border-right: 0; padding: 12px 16px 0; }
  .row:not(:has(.row-hint)) .row-input { grid-row: auto; }
}

input, select {
  width: 100%;
  max-width: 16em;
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  padding: 6px 2px;
}
input[type="number"] { text-align: right; font-variant-numeric: tabular-nums; max-width: 9em; }
input:focus-visible, select:focus-visible { outline: 2px solid var(--ai); outline-offset: 2px; }
.unit { color: var(--ink-soft); font-size: 0.9rem; white-space: nowrap; }

/* 空き家特例の質問 */
.question {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 16px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule-soft);
}
.question:last-child { border-bottom: 0; }
.q-text { margin: 0; font-size: 0.92rem; }
@media (max-width: 560px) { .question { grid-template-columns: minmax(0, 1fr); } }
.choices { display: flex; border: 1px solid var(--rule); }
.choices label { position: relative; }
.choices label + label { border-left: 1px solid var(--rule); }
.choices input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choices span { display: block; padding: 5px 12px; font-size: 0.85rem; cursor: pointer; min-width: 3.6em; text-align: center; }
.choices input:checked + span { background: var(--ink); color: var(--paper); }
.choices input:focus-visible + span { outline: 2px solid var(--ai); outline-offset: 1px; }

/* 精算書 */
.statement { position: sticky; top: 16px; }
@media (max-width: 920px) { .statement { position: static; } }
.paper {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 24px 24px 20px;
}
.statement-title {
  margin: 0;
  font-family: var(--mincho);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.12em;
}
.statement-method { margin: 2px 0 16px; font-size: 0.82rem; color: var(--ink-soft); min-height: 3em; padding-right: 100px; }

.ledger { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.ledger th { text-align: left; font-weight: 400; padding: 7px 0; border-bottom: 1px dotted var(--rule); }
.ledger td {
  text-align: right;
  padding: 7px 0;
  border-bottom: 1px dotted var(--rule);
  font-family: var(--mincho);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ledger tr.minus td { color: var(--shu); }
.ledger tr.zero { color: var(--ink-soft); }
.ledger tr.zero td { color: var(--ink-soft); font-weight: 500; }

.grand {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-top: 14px;
  padding: 10px 0 8px;
  border-bottom: 4px double var(--ink);
}
.grand-label { font-weight: 700; }
.grand-value {
  font-family: var(--mincho);
  font-weight: 800;
  font-size: clamp(2rem, 6vw, 2.6rem);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.ledger-notes { margin-top: 10px; font-size: 0.76rem; color: var(--ink-soft); }
.ledger-notes p { margin: 2px 0; }

.sub-title { margin: 22px 0 6px; font-size: 0.88rem; font-weight: 700; }
.methods { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.methods th, .methods td { padding: 7px 0; border-top: 1px solid var(--rule-soft); vertical-align: baseline; }
.methods th { text-align: left; font-weight: 400; }
.methods td { text-align: right; font-family: var(--mincho); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.methods .state { display: block; font-family: var(--gothic); font-size: 0.74rem; color: var(--ink-soft); }
.methods tr.is-best th { font-weight: 700; }
.methods tr.is-ng { color: var(--ink-soft); }
.methods tr.is-ng td { text-decoration: line-through; text-decoration-color: var(--ink-soft); font-weight: 500; }

/* 判子: この画面で唯一の装飾 */
.seal {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border: 3px solid var(--shu);
  border-radius: 50%;
  color: var(--shu);
  font-family: var(--mincho);
  font-weight: 800;
  font-size: 0.9rem;
  line-height: 1.2;
  text-align: center;
  transform: rotate(-8deg);
  opacity: 0.9;
  box-shadow: inset 0 0 0 2px var(--paper), inset 0 0 0 3px var(--shu);
}
.seal.is-pressed { animation: press 260ms cubic-bezier(.2, .9, .3, 1.2); }
.seal.is-pending { border-style: dashed; box-shadow: none; opacity: 0.75; }
@keyframes press {
  from { transform: rotate(-8deg) scale(1.35); opacity: 0; }
  to { transform: rotate(-8deg) scale(1); opacity: 0.9; }
}
@media (prefers-reduced-motion: reduce) { .seal.is-pressed { animation: none; } }

.akiya-detail { margin-top: 18px; font-size: 0.84rem; }
.akiya-detail:empty { display: none; }
.akiya-detail p { margin: 0 0 4px; }
.akiya-detail ul { margin: 0; padding: 0; list-style: none; }
.akiya-detail li { position: relative; padding: 3px 0 3px 1.4em; }
.akiya-detail li::before { position: absolute; left: 0; font-weight: 700; }
.akiya-detail li.ng::before { content: "✕"; color: var(--shu); }
.akiya-detail li.unknown::before { content: "?"; color: var(--ink-soft); }

/* 査定への案内 */
.cta { margin-top: 16px; }
.cta-text { margin: 0 0 10px; font-size: 0.85rem; color: var(--ink-soft); }
.pr { margin-left: 6px; font-size: 0.72rem; border: 1px solid var(--rule); padding: 0 4px; white-space: nowrap; }
.cta-button {
  display: block;
  text-align: center;
  text-decoration: none;
  background: var(--ai);
  color: var(--ai-ink);
  font-weight: 700;
  padding: 14px 16px;
  border-radius: 3px;
}
.cta-button:focus-visible { outline: 2px solid var(--ai); outline-offset: 3px; }
.cta-button[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }

/* お問い合わせフォーム: 計算ツールと同じ記入欄の罫線を使う */
.contact-form .row-label { display: block; }
.contact-form .optional { margin-left: 8px; font-size: 0.74rem; font-weight: 400; color: var(--ink-soft); }
textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 8px 10px;
  resize: vertical;
}
textarea:focus-visible { outline: 2px solid var(--ai); outline-offset: 2px; }
.contact-form .row-input:has(textarea) { padding-bottom: 12px; }
.contact-form [aria-invalid="true"] { border-color: var(--shu); }
.field-error { color: var(--shu); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { border-top: 1px solid var(--rule); padding: 16px; display: grid; gap: 12px; justify-items: start; }
.form-foot .cta-button { border: 0; font: inherit; font-weight: 700; cursor: pointer; min-width: 12em; }
.form-foot .cta-button:disabled { opacity: 0.55; cursor: progress; }
.form-status { margin: 0; font-size: 0.88rem; }
.form-status:empty { display: none; }
.contact-note { margin-top: 24px; }

.disclaimer { margin: 14px 0 0; font-size: 0.76rem; color: var(--ink-soft); }

.mobile-bar { display: none; }
@media (max-width: 920px) {
  .mobile-bar {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 10;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: var(--paper);
    color: var(--ink);
    border-top: 4px double var(--ink);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.88rem;
  }
  .mobile-bar.is-hidden { display: none; }
  .mobile-bar strong { font-family: var(--mincho); font-weight: 800; font-size: 1.45rem; font-variant-numeric: tabular-nums; }
  .site-footer { padding-bottom: 96px; }
}

.site-footer { border-top: 1px solid var(--rule); padding: 20px 0 40px; color: var(--ink-soft); font-size: 0.8rem; }
.site-footer p { margin: 0 0 6px; max-width: 60em; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0 0 10px; padding: 0; list-style: none; }

/* 読み物のページ(解説・運営者情報・プライバシーポリシー) */
.doc { max-width: 720px; margin: 0 auto; padding: 48px 16px 64px; }
.doc-head { margin-bottom: 32px; }
.doc h1 {
  margin: 0 0 12px;
  font-family: var(--mincho);
  font-weight: 800;
  font-size: clamp(1.6rem, 4.5vw, 2.2rem);
  line-height: 1.45;
  font-feature-settings: "palt";
}
.doc-meta { margin: 0; color: var(--ink-soft); font-size: 0.85rem; }
.doc-body { background: var(--paper); border: 1px solid var(--rule); padding: 28px clamp(16px, 4vw, 40px) 32px; }
.doc-body > :first-child { margin-top: 0; }
.doc h2 {
  margin: 40px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mincho);
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1.5;
}
.doc h3 { margin: 28px 0 8px; font-size: 1.02rem; }
.doc p, .doc li { max-width: 38em; }
.doc ul, .doc ol { padding-left: 1.4em; }
.doc li { margin: 4px 0; }
.doc table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.92rem; }
.doc th, .doc td { border: 1px solid var(--rule); padding: 8px 12px; text-align: left; vertical-align: top; }
.doc thead th { background: var(--band); }
.doc td.num { text-align: right; font-family: var(--mincho); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.doc .aside { border-left: 3px solid var(--rule); padding: 4px 0 4px 14px; color: var(--ink-soft); font-size: 0.9rem; }
.doc .placeholder { background: var(--band); outline: 1px dashed var(--shu); padding: 0 4px; }
.doc .to-tool {
  display: inline-block;
  margin-top: 8px;
  background: var(--ai);
  color: var(--ai-ink);
  text-decoration: none;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 3px;
}
.doc .sources { margin-top: 40px; font-size: 0.85rem; color: var(--ink-soft); }
.guide-list { list-style: none; padding: 0; margin: 0; }
.guide-list li { max-width: none; margin: 0; border-bottom: 1px solid var(--rule-soft); padding: 16px 0; }
.guide-list li:first-child { padding-top: 0; }
.guide-list a { font-family: var(--mincho); font-weight: 700; font-size: 1.1rem; }
.guide-list p { margin: 4px 0 0; color: var(--ink-soft); font-size: 0.9rem; }
