h1 {
    text-align: center;
    background-color: #ffeb3b; /* 背景色 */
    padding: 10px;
    border-radius: 8px;
}
body {
    margin: 0;
    padding: 0;
    font-family: sans-serif;
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    min-height: 100vh;
    background: #f0f0f0;
}
/* ナビゲーション */
.navbar {
  background: beige;
  padding: 12px 0;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.navbar a {
  margin: 0 20px;
  text-decoration: none;
  font-size: 16px;
  color: #333;
  font-weight: bold;
  transition: color 0.3s, border-bottom 0.3s;
  padding-bottom: 5px;
}
.navbar a:hover {
  color: #0073e6;
  border-bottom: 2px solid #0073e6;
}

main {
    background: #fff;
    padding: 16px 350px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
fieldset {
    margin-bottom: 16px;
    padding: 10px;
    border-radius: 8px;
}
legend {
    font-weight: bold;
}
svg {
    border: 1px solid #ccc;
    margin-top: 20px;
    width: 100%;
    height: 600px;
}
button#generateBtn {
    display: block;          /* ブロック要素にして中央寄せ */
    margin: 20px auto;       /* 上下マージン + 左右自動で中央 */
    padding: 20px 40px;      /* ボタンの余白 */
    background-color: #4caf50; /* 緑色の背景 */
    color: white;             /* 文字色 */
    border: none;             /* 枠線なし */
    border-radius: 8px;       /* 角丸 */
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}
button#generateBtn:hover {
    background-color: #45a049; /* ホバー時の色 */
}

/* スマホ対応 */
@media (max-width: 768px) {
  body {
    grid-template-columns: 1fr;
  }
  main {
    padding: 5px 10px;
    order: 0;
  }
  .navbar {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .navbar a {
    margin: 8px 0;
    font-size: 18px;
  }
}

@media print {
  fieldset, nav, #printBtn {
    display: none;
  }
  #familyTree {
    width: 100%;
    height: auto;
  }
}