/* このページで使う色をまとめています。 */
:root {
  --navy: #183153;
  --green: #16a085;
  --green-dark: #117a68;
  --mint: #e9f8f4;
  --orange: #ff8a4c;
  --ink: #243447;
  --muted: #687386;
  --line: #dfe7ed;
  --white: #ffffff;
  --background: #f4f7f8;
  --shadow: 0 16px 42px rgba(24, 49, 83, 0.10);
}

/* 余白を含めて幅を計算するようにします。 */
* { box-sizing: border-box; }

/* ページ全体の文字と背景を設定します。 */
body {
  margin: 0;
  color: var(--ink);
  background: var(--background);
  font-family: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  line-height: 1.7;
}

/* 入力欄とボタンの文字を本文とそろえます。 */
button, input { font: inherit; }

/* 内容が横に広がりすぎないようにします。 */
.container {
  width: min(980px, calc(100% - 32px));
  margin-inline: auto;
}

/* 上部の濃い青色の帯です。 */
.site-header {
  color: var(--white);
  background: var(--navy);
}

/* ヘッダーの中身を横並びにします。 */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
}

/* サイト名のリンクを白色にします。 */
.brand {
  color: var(--white);
  font-weight: 800;
  text-decoration: none;
}

/* 無料表示を丸い枠で囲みます。 */
.header-note {
  padding: 4px 12px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px;
  font-size: .8rem;
}

/* 最初の説明部分に余白を付けます。 */
.hero {
  padding: 64px 0 34px;
  text-align: center;
}

/* 見出し上の小さな案内文です。 */
.eyebrow {
  margin: 0 0 8px;
  color: var(--green-dark);
  font-weight: 800;
  letter-spacing: .1em;
}

/* 大見出しの大きさを画面幅に合わせます。 */
h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1.2;
}

/* 説明文の上下の余白を整えます。 */
.hero p:last-child { margin: 14px 0 0; color: var(--muted); }

/* 入力と結果を2列のカードにします。 */
.calculator-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--white);
  box-shadow: var(--shadow);
}

/* 入力側と結果側に同じ余白を付けます。 */
.input-area, .result-area { padding: 34px; }

/* 結果側を薄い緑色にします。 */
.result-area { background: var(--mint); }

/* 小見出しの余白と色を設定します。 */
h2 { margin: 0 0 24px; color: var(--navy); font-size: 1.25rem; }

/* 見出しの数字を丸く表示します。 */
h2 span {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-right: 8px;
  border-radius: 50%;
  color: var(--white);
  background: var(--green);
}

/* 入力欄の名前を太字にします。 */
label { display: block; margin: 18px 0 7px; font-weight: 700; }

/* 円や人を入力欄の横に並べます。 */
.input-with-unit {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

/* 数字の入力欄から外側の枠を消します。 */
.input-with-unit input {
  width: 100%;
  min-width: 0;
  padding: 14px 0;
  border: 0;
  outline: 0;
  background: transparent;
}

/* 計算ボタンを目立たせます。 */
.calculate-button {
  width: 100%;
  margin-top: 26px;
  padding: 15px;
  border: 0;
  border-radius: 12px;
  color: var(--white);
  background: var(--green);
  font-weight: 800;
  cursor: pointer;
}

/* ボタンにマウスを重ねた時だけ色を濃くします。 */
.calculate-button:hover { background: var(--green-dark); }

/* 結果の説明を小さく表示します。 */
.result-label { margin: 34px 0 0; color: var(--muted); }

/* 1人あたりの金額を大きく表示します。 */
.main-result {
  display: block;
  margin: 2px 0 26px;
  color: var(--navy);
  font-size: clamp(2.5rem, 7vw, 4rem);
  font-weight: 900;
  line-height: 1.2;
}

/* 内訳の名前と金額を左右に分けます。 */
.result-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(24,49,83,.12);
}

/* 差額の説明を囲みます。 */
.difference-message {
  margin: 22px 0 0;
  padding: 13px 15px;
  border-radius: 10px;
  background: var(--white);
}

/* 使い方を白いカードにします。 */
.guide-card {
  margin: 28px 0 54px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
}

/* 使い方の見出し下の余白を小さくします。 */
.guide-card h2 { margin-bottom: 10px; }

/* ページ下部を中央寄せにします。 */
.site-footer {
  padding: 22px 16px;
  color: var(--muted);
  background: var(--white);
  text-align: center;
}

/* ページ下部の案内リンクを横並びにします。 */
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-bottom: 8px; }

/* ページ下部のリンクを本文になじむ色にします。 */
.footer-links a { color: inherit; }

/* スマートフォンでは入力と結果を縦並びにします。 */
@media (max-width: 720px) {
  .hero { padding-top: 44px; }
  .calculator-card { grid-template-columns: 1fr; }
  .input-area, .result-area { padding: 26px 22px; }
}
