/* 退職金 × iDeCo/DC 受け取り順序シミュレーター
   黄色背景・丸みのある太いフォント・シンプルでポップなデザイン。
   文字は少なく、大きく、迷わず読めることを優先する。 */
:root {
  --ink: #26221a;
  --muted: #6b6353;
  --bg: #ffd93d;
  --card: #ffffff;
  --accent: #ff5a3c;
  --accent-ink: #ffffff;
  --best-bg: #c9f2d4;
  --best-line: #2e9e5b;
  --warn-bg: #fff6da;
}
* { box-sizing: border-box; }
html { font-size: 19px; }
body {
  margin: 0;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(38, 34, 26, 0.055) 1.5px, transparent 1.5px),
    linear-gradient(90deg, rgba(38, 34, 26, 0.055) 1.5px, transparent 1.5px);
  background-size: 28px 28px;
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-weight: 500;
  line-height: 1.65;
}
.icon {
  width: 1.12em; height: 1.12em;
  vertical-align: -0.2em;
  margin-right: 0.18em;
  fill: none; stroke: currentColor;
  stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round;
  flex: none;
}
.summary .big::before {
  content: "";
  display: inline-block;
  width: 1.15em; height: 1.15em;
  vertical-align: -0.22em;
  margin-right: 0.22em;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff5a3c' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 4h10v5a5 5 0 0 1-10 0V4z'/%3E%3Cpath d='M7 5H4a3 3 0 0 0 3 4M17 5h3a3 3 0 0 1-3 4'/%3E%3Cpath d='M12 14v3M8.5 20h7M12 17v3'/%3E%3C/svg%3E");
}
main { max-width: 880px; margin: 0 auto; padding: 20px 16px 40px; }
h1 {
  font-size: 2rem; font-weight: 800; line-height: 1.35;
  margin: 14px 0 8px; letter-spacing: 0.01em;
}
h2 {
  font-size: 1.45rem; font-weight: 800; margin: 40px 0 14px;
  background: var(--ink); color: #fff;
  display: block; padding: 8px 16px; border-radius: 0;
  box-shadow: 5px 5px 0 rgba(38, 34, 26, 0.35);
}
h3 { font-size: 1.15rem; font-weight: 800; margin: 22px 0 8px; }
p, li { font-size: 1rem; }
.lead { font-size: 1.12rem; font-weight: 700; margin-top: 0; }
.disclaimer {
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 0.92rem;
  margin: 18px 0;
}
fieldset {
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 6px 6px 0 rgba(38, 34, 26, 0.9);
  margin: 0 0 22px;
  padding: 18px 18px 8px;
  min-width: 0;
}
legend {
  font-weight: 800; font-size: 1.12rem;
  background: var(--card);
  border: 3px solid var(--ink); border-radius: 999px;
  padding: 2px 14px;
}
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 800; margin-bottom: 5px; }
.field .hint { font-weight: 500; color: var(--muted); font-size: 0.86rem; display: block; }
input[type="month"], input[type="number"], select {
  font: inherit;
  font-size: 1.08rem; font-weight: 700;
  padding: 11px 12px;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  width: 100%;
  max-width: 320px;
  background: #fffdf5;
}
.dc-period {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: end;
  border-top: 2px dashed #d8d2c2; padding-top: 14px; margin-bottom: 14px;
}
.dc-period .field { margin-bottom: 0; }
.dc-period input[type="month"] { max-width: 185px; }
.dc-period select { max-width: 155px; }
button {
  font: inherit;
  font-size: 1rem; font-weight: 800;
  padding: 12px 22px;
  border-radius: 999px;
  border: 3px solid var(--ink);
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}
button.sub { background: var(--card); color: var(--ink); padding: 8px 16px; font-size: 0.92rem; }
button.danger { border-color: #b03a3a; color: #b03a3a; background: var(--card); padding: 8px 14px; font-size: 0.9rem; }
.calc-button {
  width: 100%; padding: 18px;
  font-size: 1.35rem; font-weight: 800;
  box-shadow: 5px 5px 0 rgba(38, 34, 26, 0.9);
}
.calc-button:active { transform: translate(2px, 2px); box-shadow: 3px 3px 0 rgba(38, 34, 26, 0.9); }
.error {
  border: 3px solid #b03a3a; background: #fdeeee; border-radius: 14px;
  padding: 12px 16px; margin: 14px 0; font-weight: 700;
}
.summary {
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 6px 6px 0 rgba(38, 34, 26, 0.9);
  padding: 16px 20px;
  margin: 22px 0;
}
.summary .big { font-size: 1.45rem; font-weight: 800; }
.table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  background: var(--card);
  border: 3px solid var(--ink); border-radius: 16px;
  padding: 6px 10px;
  margin: 12px 0 20px;
}
table { border-collapse: collapse; width: 100%; }
th, td { padding: 9px 10px; text-align: right; font-size: 0.98rem; border-bottom: 2px solid #eee5c8; }
th { text-align: center; font-weight: 800; }
td:first-child, th:first-child { text-align: center; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #fff8d6; }
tr.best { background: var(--best-bg); font-weight: 800; }
tr.selected { outline: 3px solid var(--accent); outline-offset: -3px; }
.badge {
  display: inline-block; font-size: 0.76rem; font-weight: 800;
  border: 2px solid var(--ink); background: var(--bg);
  border-radius: 999px; padding: 0 8px; margin-left: 6px; white-space: nowrap;
}
.badge.best-badge { border-color: var(--best-line); background: var(--best-bg); }
.detail-card {
  background: var(--card);
  border: 3px solid var(--ink); border-radius: 16px;
  padding: 8px 18px 14px; margin-bottom: 18px;
}
.detail-card .table-wrap { border: none; padding: 0; margin: 6px 0; }
.detail-card table td:first-child { text-align: left; }
.detail-card table td { text-align: right; }
ul.compact { padding-left: 1.25em; }
ul.compact li { margin-bottom: 8px; font-size: 1.02rem; }
.source-list { padding-left: 1.2em; }
.source-list li { margin-bottom: 8px; word-break: break-all; font-size: 0.92rem; }
details {
  background: var(--card);
  border: 3px solid var(--ink); border-radius: 16px;
  padding: 12px 18px; margin: 0 0 18px;
}
details summary { font-weight: 800; font-size: 1.08rem; cursor: pointer; }
details .table-wrap { border: none; padding: 0; }
footer { margin-top: 44px; }
.small { font-size: 0.88rem; color: var(--muted); }
footer .small { color: var(--ink); }

/* サイト共通: ヘッダー・ナビ・パンくず・ツールカード・フッター */
.site-header {
  max-width: 880px; margin: 0 auto;
  padding: 16px 16px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.logo {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 1.5rem; font-weight: 800; color: var(--ink); text-decoration: none;
  letter-spacing: -0.02em;
}
.logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px;
  background: var(--card); border: 3px solid var(--ink); border-radius: 50%;
  box-shadow: 3px 3px 0 rgba(38, 34, 26, 0.9), inset 0 0 0 3.5px var(--bg);
  font-size: 1.25rem;
}
.logo-mark .icon { margin: 0; }
.site-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.site-nav a {
  background: var(--card); color: var(--ink); text-decoration: none;
  font-weight: 800; font-size: 0.92rem;
  border: 3px solid var(--ink); border-radius: 999px; padding: 4px 14px;
}
.crumb { font-size: 0.9rem; font-weight: 700; margin: 6px 0 0; }
.crumb a { color: var(--ink); }
.hero { text-align: center; font-size: 2.3rem; margin-top: 26px; }
.lead.center { text-align: center; }
.tool-cards { display: grid; gap: 18px; margin: 6px 0 8px; }
.tool-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 8px;
  background: var(--card); color: var(--ink); text-decoration: none;
  border: 3px solid var(--ink); border-radius: 16px;
  box-shadow: 6px 6px 0 rgba(38, 34, 26, 0.9);
  padding: 24px 20px 20px;
}
a.tool-card:active { transform: translate(2px, 2px); box-shadow: 4px 4px 0 rgba(38, 34, 26, 0.9); }
.tool-card.soon { opacity: 0.78; box-shadow: 6px 6px 0 rgba(38, 34, 26, 0.45); }
.tool-card-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 80px; height: 80px; flex: none;
  background: var(--bg); border: 3.5px solid var(--ink); border-radius: 50%;
  box-shadow: inset 0 0 0 6px #fff, 3px 3px 0 rgba(38, 34, 26, 0.9);
  font-size: 2.05rem;
}
.tool-card.soon .tool-card-icon { background: #e8e2d2; }
.tool-card-icon .icon { margin: 0; }
.tool-card-body { display: block; }
.tool-card-title { display: block; font-weight: 800; font-size: 1.18rem; line-height: 1.45; }
.tool-card-text { display: block; margin-top: 5px; font-size: 0.96rem; }
.tool-card-go {
  display: inline-block; margin-top: 12px;
  font-weight: 800; color: #fff; background: var(--accent);
  border: 3px solid var(--ink); border-radius: 999px; padding: 6px 20px;
  box-shadow: 3px 3px 0 rgba(38, 34, 26, 0.9);
}
.hero-badge {
  width: 96px; height: 96px; margin: 26px auto 4px;
  display: flex; align-items: center; justify-content: center;
  background: var(--card); border: 3.5px solid var(--ink); border-radius: 50%;
  box-shadow: 5px 5px 0 rgba(38, 34, 26, 0.9), inset 0 0 0 6px var(--bg);
  font-size: 2.7rem;
}
.hero-badge .icon { margin: 0; }
.h2-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.55em; height: 1.55em;
  background: #fff; color: var(--ink); border-radius: 50%;
  vertical-align: -0.42em; margin-right: 0.32em;
}
.h2-icon .icon { margin: 0; width: 0.92em; height: 0.92em; }
.legend-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2em; height: 2em;
  background: var(--bg); border: 3px solid var(--ink); border-radius: 50%;
  box-shadow: inset 0 0 0 3px #fff;
  vertical-align: -0.62em; margin-right: 0.3em;
  font-size: 0.92em;
}
.legend-icon .icon { margin: 0; }
.sum-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.8em; height: 1.8em;
  background: var(--bg); border: 2.5px solid var(--ink); border-radius: 50%;
  box-shadow: inset 0 0 0 2.5px #fff;
  vertical-align: -0.52em; margin-right: 0.3em;
  font-size: 0.95em;
}
.sum-icon .icon { margin: 0; }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.7em; height: 1.7em;
  background: #fff; color: var(--ink); border-radius: 50%;
  vertical-align: -0.5em; margin-right: 0.25em;
}
.btn-icon .icon { margin: 0; width: 0.95em; height: 0.95em; }
.badge.soon-badge { background: #e8e2d2; }
.foot-nav { font-weight: 700; font-size: 0.92rem; margin: 10px 0 2px; }
.foot-nav a { color: var(--ink); }

/* スマホ: 見出しは字詰めしてセンター揃え。枠のはみ出しを防ぐ */
@media (max-width: 640px) {
  html { font-size: 17.5px; }
  main { padding: 14px 10px 32px; }
  h1 {
    font-size: 1.62rem;
    letter-spacing: -0.03em;
    text-align: center;
    line-height: 1.3;
  }
  .lead { text-align: center; font-size: 1.02rem; }
  h2 { display: block; text-align: center; letter-spacing: -0.02em; }
  fieldset, .summary, .detail-card, .table-wrap, details { box-shadow: 4px 4px 0 rgba(38, 34, 26, 0.9); }
  fieldset { padding: 14px 12px 4px; }
  .dc-period { flex-direction: column; align-items: stretch; }
  .dc-period input[type="month"], .dc-period select { max-width: none; }
  input[type="month"], input[type="number"], select { max-width: none; }
  .summary .big { font-size: 1.22rem; }
}
.h1-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.9em; height: 1.9em;
  background: var(--card); border: 3.5px solid var(--ink); border-radius: 50%;
  box-shadow: inset 0 0 0 4px var(--bg), 3px 3px 0 rgba(38, 34, 26, 0.9);
  vertical-align: -0.55em; margin-right: 0.15em;
  font-size: 0.62em;
}
.h1-icon .icon { margin: 0; width: 1.5em; height: 1.5em; }
