/* kakuni-lab.com（2026-10-11 作り直し。決まりは ~/.claude/skills/kakuni-design/SKILL.md）
   紙と紺の読み物。写真は白黒に紺を重ね、見出しは明朝500、札とボタンは等幅。
   強い色は --signal（山吹）だけで、計算機の「いちばん安い」と記事の強調にだけ使う */

:root {
  --paper: #f1f0ec;
  --paper-2: #e8e6df;
  --surface: #fbfaf7;
  --navy: #102440;
  --navy-2: #1c3557;
  --tint: #a9b8cb;
  --ink: #16202c;
  --muted: #5f6670;
  --line: #d9d6cd;
  --black: #0b0d10;
  --blue: #2f6aa3;
  --signal: #e9a92c;
  --signal-soft: #f6e7c4;
  --bar: #102440;
  --track: #e2dfd6;
  --ok: #1f6b3b;
  --err: #b3261e;
  --on-dark: #f4f3ef;
  --measure: 44rem;
  --serif: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", serif;
  --sans: "BIZ UDPGothic", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1722;
    --paper-2: #141e2b;
    --surface: #182333;
    --navy: #c9d6e6;
    --navy-2: #2a3a50;
    --tint: #33465f;
    --ink: #e7e9ec;
    --muted: #9ea7b2;
    --line: #2a3646;
    --blue: #8dbbe8;
    --signal-soft: #3a2f17;
    --bar: #8fb3da;
    --track: #263243;
  }
}

:root[data-theme="dark"] {
  --paper: #0f1722;
  --paper-2: #141e2b;
  --surface: #182333;
  --navy: #c9d6e6;
  --navy-2: #2a3a50;
  --tint: #33465f;
  --ink: #e7e9ec;
  --muted: #9ea7b2;
  --line: #2a3646;
  --blue: #8dbbe8;
  --signal-soft: #3a2f17;
  --bar: #8fb3da;
  --track: #263243;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.9;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.01em;
  color: var(--navy);
}

a {
  color: var(--blue);
  text-underline-offset: 0.22em;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

img {
  max-width: 100%;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 16px;
}

/* 画面の端まで広げる区画（中央に寄せた本文の中から） */
.bleed {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* ---- 等幅の札・注記 ---- */

.tag {
  display: inline-block;
  padding: 3px 8px;
  background: #fbfaf7;
  color: #0b0d10;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1.5;
}

.tag--dark {
  background: transparent;
  color: var(--on-dark);
  border: 1px solid rgba(244, 243, 239, 0.4);
}

.mono-note {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  line-height: 1.7;
}

/* ---- ヘッダー ---- */

.site-header {
  background: var(--black);
  color: var(--on-dark);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 20px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand {
  color: var(--on-dark);
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  font-size: 0.82rem;
}

.site-header nav a {
  color: rgba(244, 243, 239, 0.82);
  text-decoration: none;
}

.site-header nav a:hover {
  color: #fff;
  text-decoration: underline;
}

main.wrap {
  padding-bottom: 88px;
}

/* ---- 写真の見出し帯（白黒＋紺＋細い格子） ---- */

.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: var(--tint);
  display: flex;
  align-items: flex-end;
}

.hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.08) brightness(0.95);
  mix-blend-mode: multiply;
  animation: photo-in 1s ease-out both;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(11, 20, 34, 0.15) 0%, rgba(11, 20, 34, 0.35) 50%, rgba(11, 20, 34, 0.86) 100%),
    repeating-linear-gradient(90deg, rgba(11, 20, 34, 0.55) 0 1px, transparent 1px 104px),
    repeating-linear-gradient(0deg, rgba(11, 20, 34, 0.55) 0 1px, transparent 1px 104px);
}

.hero--band::after {
  background:
    linear-gradient(180deg, rgba(11, 20, 34, 0.45) 0%, rgba(11, 20, 34, 0.7) 50%, rgba(11, 20, 34, 0.92) 100%),
    repeating-linear-gradient(90deg, rgba(11, 20, 34, 0.4) 0 1px, transparent 1px 104px),
    repeating-linear-gradient(0deg, rgba(11, 20, 34, 0.4) 0 1px, transparent 1px 104px);
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
}

.hero--full {
  min-height: min(86vh, 760px);
}

.hero--full .hero-inner {
  padding-top: 110px;
  padding-bottom: 56px;
}

.hero--band {
  min-height: 280px;
}

.hero--band .hero-inner {
  padding-top: 76px;
  padding-bottom: 34px;
}

.hero h1 {
  margin: 0 0 12px;
  color: #fff;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  line-height: 1.42;
  text-wrap: balance;
}

.hero--full h1 {
  font-size: clamp(1.95rem, 7.4vw, 4rem);
  line-height: 1.22;
  letter-spacing: -0.01em;
  margin-bottom: 26px;
}

.hero-lead {
  margin: 0 0 12px;
  max-width: 36em;
  color: rgba(255, 255, 255, 0.9);
}

.hero .crumbs,
.hero .article-meta {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.8rem;
  margin: 0 0 6px;
}

.hero .crumbs a {
  color: rgba(255, 255, 255, 0.92);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin: 0;
}

.photo-credit {
  position: absolute;
  z-index: 1;
  right: 8px;
  top: 6px;
  padding: 1px 6px;
  font-family: var(--mono);
  font-size: 0.6rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(0, 0, 0, 0.35);
  text-decoration: none;
}

.photo-credit:hover {
  color: #fff;
  text-decoration: underline;
}

@keyframes photo-in {
  from {
    opacity: 0;
    transform: scale(1.03);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-photo {
    animation: none;
  }
}

/* ---- ボタン（枠線と ↗） ---- */

.button {
  display: inline-flex;
  align-items: stretch;
  padding: 9px 0 9px 14px;
  border: 1px solid var(--navy);
  color: var(--navy);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.5;
}

.button .arrow {
  display: inline-flex;
  align-items: center;
  margin: -9px 0 -9px 14px;
  padding: 0 10px;
  border-left: 1px solid currentColor;
  font-family: var(--mono);
  font-weight: 400;
}

.button:hover {
  background: var(--navy);
  color: var(--paper);
}

.button--light {
  border-color: rgba(255, 255, 255, 0.8);
  color: #fff;
}

.button--light:hover {
  background: #fff;
  color: #0b0d10;
}

/* ---- トップ ---- */

main h2 {
  margin: 72px 0 16px;
  font-size: 1.6rem;
}

.home main > section > p {
  color: var(--muted);
}

.statement {
  padding: 64px 0 56px;
}

.home main > .statement > p {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.25rem, 3.4vw, 1.7rem);
  line-height: 1.7;
  color: var(--navy);
  text-align: center;
  text-wrap: balance;
}

/* 紺の数字の帯 */
.data-band {
  background:
    repeating-linear-gradient(90deg, rgba(244, 243, 239, 0.06) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(0deg, rgba(244, 243, 239, 0.06) 0 1px, transparent 1px 64px),
    #102440;
  color: var(--on-dark);
  padding: 64px 0 56px;
}

.data-band h2 {
  margin: 14px 0 28px;
  color: var(--on-dark);
  font-size: 1.6rem;
}

.stats {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 24px;
}

.stats li {
  border-top: 1px solid rgba(244, 243, 239, 0.25);
  padding-top: 12px;
}

.stat-value {
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.4rem, 7vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stat-unit {
  margin-left: 6px;
  font-family: var(--sans);
  font-size: 0.9rem;
  letter-spacing: 0;
}

.stat-label {
  display: block;
  margin-top: 6px;
  font-size: 0.82rem;
  color: rgba(244, 243, 239, 0.75);
}

.home main .data-band .mono-note {
  margin: 0;
  color: rgba(244, 243, 239, 0.55);
}

/* 計算機の案内（写真と文の2列） */
.feature-tool {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface);
}

.feature-photo {
  position: relative;
  display: block;
  min-height: 340px;
  background: var(--tint);
  overflow: hidden;
}

.feature-photo img,
.topics img,
.category-banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.08);
  mix-blend-mode: multiply;
}

.feature-photo .tag,
.topics .tag,
.category-banner .tag {
  position: absolute;
  z-index: 2;
  top: 14px;
  left: 14px;
}

.feature-text {
  padding: 40px clamp(20px, 5vw, 56px);
  max-width: 34rem;
}

.feature-text h2 {
  margin: 0 0 14px;
  font-size: 1.5rem;
}

.feature-text h2 a {
  color: inherit;
  text-decoration: none;
}

.feature-text h2 a:hover {
  text-decoration: underline;
}

.feature-text p {
  color: var(--ink);
}

.feature-example {
  font-weight: 700;
}

.more {
  margin: 18px 0 0;
}

.note {
  color: var(--muted);
  font-size: 0.9rem;
}

/* テーマ: 写真のカード */
.topics {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 18px;
}

.topics a {
  display: block;
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--tint);
  color: #fff;
  text-decoration: none;
}

.topics a::after,
.category-banner::after,
.feature-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 20, 34, 0) 35%, rgba(11, 20, 34, 0.82) 100%);
}

.topic-text {
  position: absolute;
  z-index: 2;
  left: 16px;
  right: 16px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topic-name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.3rem;
  line-height: 1.35;
}

.topic-count {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.8);
}

.topics a:hover .topic-name {
  text-decoration: underline;
}

.topic-lead {
  margin: 10px 0 0;
  font-size: 0.86rem;
  line-height: 1.7;
  color: var(--muted);
}

/* 公開しているツール */
.tools {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--navy);
}

.tools li {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.tools a {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 12px;
  text-decoration: none;
}

.tool-name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--navy);
}

.tools a:hover .tool-name {
  text-decoration: underline;
}

.tool-url {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.tools p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ---- 記事の一覧 ---- */

.category {
  margin-top: 48px;
}

.category-banner {
  display: block;
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 5;
  min-height: 130px;
  margin: 0 0 12px;
  background: var(--tint);
  color: #fff;
  text-decoration: none;
}

.category-banner-text {
  position: absolute;
  z-index: 2;
  left: 18px;
  bottom: 14px;
}

.category-banner h2 {
  margin: 0;
  color: #fff;
  font-size: 1.5rem;
}

.category-count {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.8);
}

.category-lead {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.article-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.article-item a {
  display: block;
  padding: 18px 2px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}

.article-item a:hover .article-title {
  text-decoration: underline;
}

.article-title {
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--navy);
}

.article-desc {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.75;
}

/* ---- 集計して分かったこと ---- */

.findings {
  list-style: none;
  margin: 0 0 1.4em;
  padding: 0;
  border-top: 1px solid var(--navy);
}

.findings li {
  margin: 0;
  padding: 13px 2px;
  border-bottom: 1px solid var(--line);
}

.findings a {
  color: var(--ink);
  text-decoration: none;
}

.findings a::before {
  content: "→";
  margin-right: 10px;
  font-family: var(--mono);
  color: var(--muted);
}

.findings a:hover {
  color: var(--blue);
  text-decoration: underline;
}

.home main h3 {
  margin: 28px 0 8px;
  font-size: 1.08rem;
}

.home main h3 a {
  color: inherit;
  text-decoration: none;
}

.home main h3 a:hover {
  text-decoration: underline;
}

.prose .findings {
  padding-left: 0;
}

/* ---- 記事 ---- */

.article {
  padding-top: 36px;
}

.article-meta {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 0.85rem;
}

.prose h2 {
  margin: 60px 0 16px;
  padding-top: 18px;
  border-top: 1px solid var(--navy);
  font-size: 1.5rem;
}

.prose h3 {
  margin: 36px 0 8px;
  font-size: 1.15rem;
}

.prose p {
  margin: 0 0 1.15em;
}

.prose ul,
.prose ol {
  margin: 0 0 1.15em;
  padding-left: 1.4em;
}

.prose li {
  margin: 0.3em 0;
}

.prose strong {
  background: linear-gradient(transparent 64%, var(--signal-soft) 64%);
}

.prose blockquote {
  margin: 0 0 1.4em;
  padding: 14px 18px;
  border-left: 2px solid var(--navy);
  background: var(--surface);
  color: var(--ink);
}

.prose blockquote p {
  margin: 0;
}

/* 表: 数字の列は右寄せ（Markdownの ---: で指定） */
.table-wrap {
  margin: 0 0 1.4em;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  background: var(--surface);
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  /* 日本語を1文字ずつ折り返さず、空白と句読点でだけ折り返す。入りきらない表は横にスクロールする */
  word-break: keep-all;
  overflow-wrap: normal;
}

thead th {
  border-bottom: 1px solid var(--navy);
  font-weight: 700;
  white-space: nowrap;
  color: var(--navy);
}

tbody th {
  font-weight: 700;
}

td.right,
th.right {
  text-align: right;
  white-space: nowrap;
}

td.center,
th.center {
  text-align: center;
}

/* 横棒グラフ（```bars ブロック） */
.bars {
  margin: 0 0 1.6em;
  padding: 18px 18px 14px;
  background: var(--surface);
  border-top: 1px solid var(--navy);
}

.bars figcaption {
  margin: 0 0 12px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--navy);
}

/* 列の幅を全行でそろえる（行ごとにgridにすると、数値の長さで棒の基準がずれる） */
.bars ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: auto minmax(3em, 1fr) auto;
  align-items: center;
  gap: 7px 10px;
  font-size: 0.86rem;
  line-height: 1.4;
}

.bars li {
  display: contents;
}

.bar-label {
  max-width: 11em;
}

.bar-track {
  height: 10px;
  background: var(--track);
}

.bar-fill {
  display: block;
  height: 100%;
  background: var(--bar);
}

.bar-value {
  min-width: 4em;
  text-align: right;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

/* 都道府県のタイル地図（```tilemap） */
.tilemap {
  margin: 0 0 1.6em;
  padding: 18px 18px 14px;
  background: var(--surface);
  border-top: 1px solid var(--navy);
}

.tilemap figcaption {
  margin: 0 0 10px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--navy);
}

.tilemap svg {
  display: block;
  width: 100%;
  max-width: 520px;
  height: auto;
  margin: 0 auto;
  font-family: var(--sans);
}

.tilemap-legend {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 0.82rem;
  line-height: 1.6;
}

.tilemap-legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.swatch {
  display: inline-block;
  flex: none;
  width: 14px;
  height: 14px;
}

.tilemap-note {
  margin: 8px 0 0 !important;
  font-size: 0.78rem;
  color: var(--muted);
}

.sources,
.author {
  margin-top: 48px;
  padding: 18px 20px;
  background: var(--surface);
  font-size: 0.86rem;
  line-height: 1.8;
}

.sources h2,
.related h2 {
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  font-size: 1.05rem;
}

.sources ul {
  margin: 0;
  padding-left: 1.2em;
}

.author {
  margin-top: 12px;
  border-left: 2px solid var(--navy);
}

.author p {
  margin: 0;
}

.related {
  margin-top: 48px;
}

/* ---- お問い合わせ ---- */

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
  padding: 22px;
  background: var(--surface);
}

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.9rem;
  font-weight: 700;
}

.contact-form label em {
  font-style: normal;
  font-weight: 400;
  color: var(--muted);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  font: inherit;
  font-weight: 400;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
}

.contact-form textarea {
  resize: vertical;
}

.contact-form button {
  align-self: flex-start;
  font: inherit;
  font-weight: 700;
  padding: 10px 26px;
  border: 1px solid #102440;
  border-radius: 0;
  background: #102440;
  color: #f4f3ef;
  cursor: pointer;
}

.contact-form button:disabled {
  opacity: 0.6;
  cursor: default;
}

.form-status {
  margin: 0;
  font-size: 0.88rem;
}

.form-status.error {
  color: var(--err);
}

.form-status.done {
  color: var(--ok);
}

/* ---- フッター（Trove 型: 下にサイト名を巨大な明朝で薄く敷く） ---- */

.site-footer {
  background: var(--paper-2);
  color: var(--ink);
  overflow: hidden;
  padding-top: 64px;
}

.footer-lead {
  margin: 0 0 32px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.5rem, 4.6vw, 2.2rem);
  line-height: 1.35;
  color: var(--navy);
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.footer-cols nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.86rem;
}

.footer-head {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.footer-cols a {
  color: var(--ink);
  text-decoration: none;
}

.footer-cols a:hover {
  text-decoration: underline;
}

.footer-note {
  margin: 36px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--muted);
}

.footer-note a {
  color: inherit;
}

.footer-mark {
  margin: 8px 0 -0.24em;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(4rem, 19vw, 17rem);
  line-height: 1;
  letter-spacing: -0.03em;
  text-align: center;
  white-space: nowrap;
  color: color-mix(in srgb, var(--paper-2) 82%, var(--navy));
  user-select: none;
}

/* ---- 海外発送の計算機（/tools/overseas-shipping/） ---- */

body.tool-page .wrap {
  max-width: 62rem;
}

.tool > .prose,
.tool > .sources {
  max-width: 50rem;
}

.tool-page .article {
  padding-top: 0;
}

.calc-form {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
  margin: -44px 0 28px;
  padding: 24px;
  background: var(--surface);
  border-top: 2px solid var(--navy);
  box-shadow: 0 16px 40px rgba(11, 20, 34, 0.14);
}

.calc-form label,
.calc-form fieldset {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.88rem;
  font-weight: 700;
  margin: 0;
}

.calc-form fieldset {
  border: 0;
  padding: 0;
  grid-column: 1 / -1;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px 18px;
}

.calc-form legend {
  padding: 0;
  margin-bottom: 4px;
  width: 100%;
}

.calc-form label.inline {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}

.calc-form > label.inline {
  grid-column: 1 / -1;
}

.calc-form select,
.calc-form input[type="number"] {
  font: inherit;
  font-weight: 400;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  width: 100%;
  min-width: 0;
}

.calc-form input[type="radio"],
.calc-form input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #102440;
}

.with-unit {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
}

.calc-help {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.calc-summary {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.2rem;
  color: var(--navy);
}

.calc-table .sub,
.rate-table .sub {
  display: block;
  font-size: 0.76rem;
  color: var(--muted);
}

.calc-table .sub {
  white-space: normal;
}

.rate-table .sub {
  white-space: nowrap;
}

.calc-table td.total {
  font-weight: 700;
  font-size: 1.05rem;
}

.calc-table tbody th {
  border-bottom: 1px solid var(--line);
  white-space: normal;
}

.calc-table tr.best th,
.calc-table tr.best td {
  background: var(--signal-soft);
}

.calc-table tr.best th {
  box-shadow: inset 3px 0 0 var(--signal);
}

.calc-table .tag {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 7px;
  background: var(--signal);
  color: #1b1405;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0;
}

.calc-table tr.off th,
.calc-table tr.off td {
  color: var(--muted);
}

.calc-result h3 {
  margin: 22px 0 6px;
  font-size: 1.1rem;
}

.calc-rules {
  margin: 0 0 28px;
  padding-left: 1.3em;
  font-size: 0.92rem;
}

.calc-rules li {
  margin: 0.25em 0;
}

@media (min-width: 641px) {
  .calc-table td:nth-child(5),
  .calc-table td:nth-child(6) {
    white-space: nowrap;
  }

  .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ---- スマホ ---- */

@media (max-width: 640px) {
  .hero--full {
    min-height: 82vh;
  }

  .hero--band {
    min-height: 240px;
  }

  .tool-page .hero--band .hero-inner {
    padding-bottom: 52px;
  }

  .feature-tool {
    grid-template-columns: 1fr;
  }

  .feature-photo {
    min-height: 220px;
  }

  .topics {
    grid-template-columns: 1fr;
  }

  .topics a {
    aspect-ratio: 16 / 10;
  }

  .category-banner {
    aspect-ratio: 16 / 7;
  }

  .footer-cols {
    grid-template-columns: 1fr 1fr;
  }

  .calc-form {
    grid-template-columns: 1fr;
    padding: 16px;
    margin-top: -28px;
  }

  /* 結果の表は、スマホでは送り方ごとのカードにする */
  .calc-table thead {
    display: none;
  }

  .calc-table,
  .calc-table tbody,
  .calc-table tr,
  .calc-table th,
  .calc-table td {
    display: block;
    width: 100%;
  }

  .calc-table {
    background: transparent;
  }

  .calc-table tr {
    margin: 0 0 12px;
    background: var(--surface);
    border-top: 1px solid var(--navy);
  }

  .calc-table th {
    border-bottom: 1px solid var(--line);
    white-space: normal;
    font-family: var(--serif);
    font-weight: 500;
    font-size: 1.05rem;
  }

  .calc-table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 0;
    padding: 6px 12px;
    text-align: right;
  }

  .calc-table td::before {
    content: attr(data-label);
    flex: none;
    text-align: left;
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 400;
  }

  .calc-table td .val {
    text-align: right;
  }

  .calc-table tr.off td {
    text-align: left;
  }
}
