/* ============================================================================
   styles.css — 手取り計算の見た目
   ダークモードは使わず、常にライトテーマで表示します。
   ========================================================================== */

/* --- ベース --- */
body { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }

  /* 常にライトテーマで表示する（配色はこの1ブロックだけで決まる） */
  :root {
    color-scheme: light;
    --bg: #F6F7F9;
    --paper: #FFFFFF;
    --ink: #1F2328;
    --ink-2: #5F6570;
    --ink-3: #8A9099;
    --line: #E3E6EA;
    --line-soft: #EEF0F3;
    --field: #FFFFFF;
    --accent: #2D6AE0;
    --accent-hover: #1F57C4;
    --accent-ink: #FFFFFF;
    --ring: rgba(45,106,224,.18);
    --net: #2D6AE0;
    --social: #0C8F72;
    --tax: #BE6B14;
    /* ふるさと納税の内訳（所得税／住民税 基本分／住民税 特例分／自己負担） */
    --fs-it: #BE6B14;
    --fs-rb: #2D6AE0;
    --fs-rs: #7AA4EE;
    --fs-self: #AAB0B9;
    --card-shadow: 0 1px 2px rgba(31,35,40,.04), 0 1px 3px rgba(31,35,40,.06);
    --lift: 0 1px 2px rgba(31,35,40,.06), 0 8px 20px -10px rgba(31,35,40,.18);
    --sans: "Roboto", "Noto Sans JP", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
  }
  * { box-sizing: border-box; }

  body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    padding-inline: 20px;
    padding-block: clamp(40px, 9vw, 88px);
  }

  .wrap {
    max-width: 620px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 28px;
  }

  /* ---------- header ---------- */
  .masthead { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
  .masthead h1 {
    margin: 0;
    font-size: clamp(30px, 8vw, 40px);
    font-weight: 500;
    letter-spacing: -.01em;
    line-height: 1.2;
  }
  .masthead .sub { margin: 0; color: var(--ink-2); font-size: 15px; text-wrap: balance; }
  .badge {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--ink-2);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px 12px;
  }

  /* ---------- input card ---------- */
  .card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--card-shadow);
    padding: clamp(20px, 5vw, 32px);
    display: flex;
    flex-direction: column;
    gap: 22px;
  }

  .f { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
  .f > label { font-size: 13px; font-weight: 500; color: var(--ink-2); }

  .inputbox {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 62px;
    padding: 0 18px;
    background: var(--field);
    border: 1px solid var(--line);
    border-radius: 14px;
    transition: border-color .15s, box-shadow .15s;
  }
  .inputbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
  .inputbox input {
    flex: 1;
    min-width: 0;
    font-family: var(--sans);
    font-size: 30px;
    font-weight: 400;
    letter-spacing: -.01em;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
    background: none;
    border: none;
    padding: 0;
    -moz-appearance: textfield;
  }
  .inputbox input:focus { outline: none; }
  .inputbox input::-webkit-outer-spin-button,
  .inputbox input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
  .inputbox .suffix { font-size: 15px; color: var(--ink-2); flex: none; }

  .grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

  .sel { position: relative; }
  .sel::after {
    content: "";
    position: absolute;
    right: 15px; top: 50%;
    width: 7px; height: 7px;
    border-right: 1.5px solid var(--ink-3);
    border-bottom: 1.5px solid var(--ink-3);
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
  }
  .sel select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 46px;
    padding: 0 34px 0 14px;
    font-family: var(--sans);
    /* 16px未満にするとiOS Safariがタップ時に画面を勝手に拡大するため下げない */
    font-size: 16px;
    color: var(--ink);
    background: var(--field);
    border: 1px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
  }
  .sel select:hover { border-color: var(--ink-3); }
  .sel select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }

  .calc {
    align-self: center;
    height: 54px;
    min-width: 200px;
    padding: 0 40px;
    font-family: var(--sans);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: .02em;
    color: var(--accent-ink);
    background: var(--accent);
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color .15s, box-shadow .2s, transform .12s;
  }
  .calc:hover { background: var(--accent-hover); box-shadow: var(--lift); }
  .calc:active { transform: translateY(1px); }
  .calc:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

  /* ---------- results ---------- */
  .results { display: flex; flex-direction: column; gap: 28px; }
  .results.reveal { animation: rise .38s cubic-bezier(.22,.61,.36,1) both; }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

  .result-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--card-shadow);
    padding: clamp(24px, 5vw, 36px) clamp(18px, 4vw, 32px);
    display: flex;
    flex-direction: column;
    gap: 28px;
  }

  .hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; }
  .hero .cap { font-size: 13px; font-weight: 500; color: var(--ink-2); }
  .hero .big {
    font-size: clamp(46px, 14vw, 68px);
    font-weight: 300;
    line-height: 1.1;
    letter-spacing: -.025em;
    font-variant-numeric: tabular-nums;
  }
  .hero .big .yen { font-size: .34em; font-weight: 400; color: var(--ink-2); margin-left: 6px; letter-spacing: 0; }
  .hero .meta { font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; margin-top: 6px; }
  .hero .meta b { font-weight: 500; color: var(--ink); }

  /* breakdown bar + legend */
  .viz { display: flex; flex-direction: column; gap: 14px; }
  .bar { display: flex; gap: 3px; height: 12px; }
  .seg {
    min-width: 3px;
    border-radius: 999px;
    transition: flex-grow .5s cubic-bezier(.22,.61,.36,1);
  }
  .seg[data-k="net"] { background: var(--net); }
  .seg[data-k="social"] { background: var(--social); }
  .seg[data-k="tax"] { background: var(--tax); }
  .seg[data-k="it"] { background: var(--fs-it); }
  .seg[data-k="rb"] { background: var(--fs-rb); }
  .seg[data-k="rs"] { background: var(--fs-rs); }
  .seg[data-k="self"] { background: var(--fs-self); }

  .legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: center; }
  .legend li { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink-2); }
  .legend b { font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
  .dot { width: 9px; height: 9px; border-radius: 999px; flex: none; }
  .dot[data-k="net"] { background: var(--net); }
  .dot[data-k="social"] { background: var(--social); }
  .dot[data-k="tax"] { background: var(--tax); }
  .dot[data-k="it"] { background: var(--fs-it); }
  .dot[data-k="rb"] { background: var(--fs-rb); }
  .dot[data-k="rs"] { background: var(--fs-rs); }
  .dot[data-k="self"] { background: var(--fs-self); }

  /* detail table */
  .table-scroll { overflow-x: auto; }
  table.detail { width: 100%; border-collapse: collapse; font-size: 14.5px; }
  table.detail th, table.detail td { padding: 11px 8px; text-align: right; white-space: nowrap; }
  table.detail thead th {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--ink-3);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
  }
  table.detail thead th:first-child { text-align: left; }
  table.detail th[scope="row"] { text-align: left; font-weight: 400; }
  table.detail th:first-child, table.detail td:first-child { padding-left: 2px; }
  table.detail th:last-child, table.detail td:last-child { padding-right: 2px; }
  table.detail td { font-variant-numeric: tabular-nums; }
  table.detail td.yearly { color: var(--ink-2); }
  table.detail tr.group th[scope="row"] { font-weight: 500; }
  table.detail tr.group > * { border-top: 1px solid var(--line-soft); }
  table.detail tr.sub th[scope="row"] { padding-left: 18px; color: var(--ink-2); font-size: 13.5px; }
  table.detail tr.sub td { color: var(--ink-2); font-size: 13.5px; }
  table.detail tr.sub > * { padding-block: 8px; }
  table.detail tr.total > * { border-top: 1.5px solid var(--line); padding-top: 14px; }
  table.detail tr.total th[scope="row"] { font-weight: 700; }
  table.detail tr.total td { font-weight: 500; font-size: 16px; }
  .chip { display: inline-block; width: 8px; height: 8px; border-radius: 999px; margin-right: 8px; vertical-align: 1px; }
  .chip[data-k="none"] { background: transparent; }
  .chip[data-k="net"] { background: var(--net); }
  .chip[data-k="social"] { background: var(--social); }
  .chip[data-k="tax"] { background: var(--tax); }
  .chip[data-k="it"] { background: var(--fs-it); }
  .chip[data-k="rb"] { background: var(--fs-rb); }
  .chip[data-k="rs"] { background: var(--fs-rs); }
  .chip[data-k="self"] { background: var(--fs-self); }

  /* ---------- notes ---------- */
  details.notes {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 4px 22px;
  }
  details.notes summary {
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-2);
    padding: 14px 0;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 9px;
  }
  details.notes summary::-webkit-details-marker { display: none; }
  details.notes summary::before {
    content: "";
    width: 7px; height: 7px;
    border-right: 1.5px solid var(--ink-3);
    border-bottom: 1.5px solid var(--ink-3);
    transform: rotate(-45deg);
    transition: transform .2s;
    flex: none;
  }
  details.notes[open] summary::before { transform: rotate(45deg); }
  details.notes summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
  .notes-body { padding: 4px 0 20px; display: flex; flex-direction: column; gap: 16px; }
  .notes-body h3 { margin: 0 0 4px; font-size: 12px; font-weight: 500; color: var(--ink-3); }
  .notes-body ul { margin: 0; padding-left: 1.2em; font-size: 13px; color: var(--ink-2); line-height: 1.8; }
  .notes-body a { color: var(--accent); text-underline-offset: 2px; }
  .applied { font-size: 13px; color: var(--ink-2); margin: 0; font-variant-numeric: tabular-nums; }
  .srclist { list-style: none !important; margin: 0; padding: 0 !important; display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
  .updated { font-size: 12px; color: var(--ink-3); margin: 8px 0 0; }
  .disclaimer { font-size: 12.5px; color: var(--ink-3); text-align: center; margin: 0; line-height: 1.7; }

  @media (max-width: 520px) {
    .calc { align-self: stretch; }
    table.detail { font-size: 13.5px; }
    table.detail th, table.detail td { padding: 10px 4px; }
  }

  @media (prefers-reduced-motion: reduce) {
    *, .results.reveal { animation-duration: .001s !important; transition-duration: .001s !important; }
  }

/* ---------- footer ---------- */
.foot { text-align: center; }
.foot p {
  margin: 0;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.7;
}

/* ボタンの見た目をリンクにも使う（404ページ） */
a.calc { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.center { text-align: center; margin: 0; }

/* ============================================================================
   ふるさと納税ページ（/furusato/）で足りないぶん
   ========================================================================== */

/* パンくず */
.crumbs {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-3);
  margin-bottom: -12px;
}
.crumbs a { color: var(--ink-2); text-decoration: none; text-underline-offset: 2px; }
.crumbs a:hover { text-decoration: underline; }

/* トップページの結果の下に出す、ふるさと納税への入口 */
.cta {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--card-shadow);
  padding: clamp(22px, 5vw, 30px);
  text-align: center;
}
.cta-cap { margin: 0; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.cta-big {
  margin: 2px 0 0;
  font-size: clamp(32px, 9vw, 44px);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.cta-big .yen { font-size: .4em; font-weight: 400; color: var(--ink-2); margin-left: 5px; letter-spacing: 0; }
.cta-big .cta-tail { font-size: .4em; font-weight: 400; color: var(--ink-2); margin-left: 8px; letter-spacing: 0; }
.cta-note { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-3); line-height: 1.7; }
.cta-act { margin: 20px 0 0; }

/* カード内の見出し */
.sec-head { display: flex; flex-direction: column; gap: 4px; }
.sec-head h2 { margin: 0; font-size: 17px; font-weight: 500; letter-spacing: -.01em; }
.sec-head p { margin: 0; font-size: 13px; color: var(--ink-2); }

/* 寄付額のスライダー */
.slider { display: flex; flex-direction: column; gap: 10px; }
.slider-value { text-align: center; font-variant-numeric: tabular-nums; }
.slider-value span:first-child { font-size: clamp(28px, 8vw, 36px); font-weight: 300; letter-spacing: -.02em; }
.slider-value .unit { font-size: 14px; color: var(--ink-2); margin-left: 6px; }
.slider-ends { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 28px;
  margin: 0;
  background: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
}
input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px; height: 26px;
  margin-top: -10px;
  border-radius: 999px;
  background: var(--accent);
  border: 3px solid var(--paper);
  box-shadow: var(--lift);
}
input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 999px;
  background: var(--accent);
  border: 3px solid var(--paper);
  box-shadow: var(--lift);
}
input[type="range"]:focus { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--ring); }
input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--ring); }

/* 上限を超えたときの注意書き */
.warn {
  margin: 0;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.7;
  color: #8A4B08;
  background: #FDF4E7;
  border: 1px solid #F0DCBC;
  border-radius: 12px;
}

/* ワンストップ特例の判定 */
.judge {
  margin: 0;
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.75;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-2);
}
.judge[data-ok="yes"] { color: #0A6B55; background: #EAF6F2; border-color: #C6E6DC; }
.judge[data-ok="no"] { color: #8A4B08; background: #FDF4E7; border-color: #F0DCBC; }

/* 年収別の早見表 */
table.detail.quick th, table.detail.quick td { padding: 9px 10px; font-size: 13.5px; }
table.detail.quick thead th { white-space: nowrap; }
table.detail.quick th[scope="row"] { font-weight: 500; }
table.detail.quick tbody tr > * { border-top: 1px solid var(--line-soft); }
table.detail.quick tbody tr.here > * { background: #EEF3FD; }
table.detail.quick tbody tr.here th[scope="row"] { font-weight: 700; color: var(--accent); }

/* 控えめなページ間リンク */
.quiet-link { font-size: 14px; color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
.quiet-link:hover { text-decoration: underline; }

@media (max-width: 520px) {
  table.detail.quick th, table.detail.quick td { padding: 8px 6px; font-size: 12.5px; }
}

/* ============================================================================
   文章ページ（/about/・/privacy/）とフッターナビ
   ========================================================================== */

.prose { line-height: 1.85; color: var(--ink); }
.prose h2 {
  margin: 30px 0 10px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .01em;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
}
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose p { margin: 0 0 12px; font-size: 14.5px; }
.prose ul { margin: 0 0 14px; padding-left: 1.2em; font-size: 14.5px; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--accent); text-underline-offset: 3px; }
.prose .tiny { font-size: 12.5px; color: var(--ink-3); line-height: 1.7; }
.prose .contact { font-size: 16px; font-weight: 500; margin: 14px 0; }
.prose .updated { margin-top: 26px; font-size: 12.5px; color: var(--ink-3); }

table.infotable { width: 100%; border-collapse: collapse; margin: 0 0 14px; font-size: 14.5px; }
table.infotable th,
table.infotable td { padding: 11px 4px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-soft); }
table.infotable th { width: 7.5em; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
@media (max-width: 460px) {
  table.infotable th { width: 6em; font-size: 13.5px; }
  table.infotable td { font-size: 13.5px; }
}

.footnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  margin: 0 0 10px;
}
.footnav a {
  font-size: 12.5px;
  color: var(--ink-2);
  text-decoration: none;
  text-underline-offset: 3px;
}
.footnav a:hover { color: var(--accent); text-decoration: underline; }
