/* ===== 共通レイアウト・ベーススタイル ===== */

.back-fab{
  position:fixed; left:16px; top:16px; z-index:1000;
  width:40px; height:40px; border-radius:999px;
  display:flex; align-items:center; justify-content:center;
  background:#ffffffcc; backdrop-filter:saturate(1.2) blur(4px);
  border:1px solid #e4e4e4; color:#333; text-decoration:none;
  box-shadow:0 4px 14px rgba(0,0,0,.08);
  transition:transform .1s, background .2s;
}
.back-fab:hover{ background:#fff; }
.back-fab:active{ transform:scale(.97); }
.back-fab:focus-visible{ outline:3px solid #66ccff; }

:root { --max: 480px; }

body{
  font-family: system-ui,-apple-system,Segoe UI,Roboto,
    "Hiragino Kaku Gothic ProN","Meiryo",sans-serif;
  margin: 24px;
  background:#f7f7f7;
  color:#222;
}

.wrap{
  max-width: var(--max);
  margin: 0 auto;
}

/* タイトル */

h1{
  font-size: 20px;
  margin:0 0 12px;
  text-align:center;
}

/* ===== 入力エリア ===== */

fieldset{
  border:1px solid #ddd;
  border-radius:12px;
  padding:16px;
  margin:12px 0;
  background:#fff;
}

legend{
  padding:0 6px;
  font-size:13px;
  color:#555;
}

label{
  font-size:14px;
  color:#333;
  display:block;
  margin-bottom:8px;
}

input[type="date"]{
  width:100%;
  font-size:18px;
  padding:10px;
  border:1px solid #ccc;
  border-radius:10px;
  box-sizing:border-box;
  margin-top:4px;
  background:#fff;
}

.note{
  font-size:12px;
  color:#666;
  margin-top:4px;
}

/* ボタン */

button{
  display:block;
  width:100%;
  margin-top:12px;
  padding:10px 14px;
  font-size:15px;
  font-weight:500;
  cursor:pointer;
  border-radius:999px;
  border:1px solid #2f6feb;
  background:#2f6feb;
  color:#fff;
  box-shadow:0 3px 10px rgba(0,0,0,.08);
  transition:background .15s, transform .1s, box-shadow .15s;
}

button:hover{
  background:#245adb;
  box-shadow:0 4px 14px rgba(0,0,0,.12);
}

button:active{
  transform:scale(.98);
  box-shadow:0 2px 6px rgba(0,0,0,.08);
}

button:focus-visible{
  outline:3px solid #66ccff;
  outline-offset:2px;
}

/* ===== 結果表示 ===== */

#result{
  margin-top:8px;
  display:flex;
  flex-direction:column;
  gap:12px;
}

/* 1つ1つのカード（期間まとめ・記念日など） */

.result-card{
  border:1px solid #e4e4e4;
  border-radius:12px;
  padding:12px;
  background:#fff;
}

.result-title{
  font-size:14px;
  font-weight:600;
  margin:0 0 6px;
}

.result-body p{
  margin: 2px 0;
  line-height: 1.4;   
}

.sumline{
  font-variant-numeric: tabular-nums;
}

.muted{
  color:#666;
}

/* 記念日リスト */

.milestones{
  list-style:none;
  padding-left:0;
  margin:4px 0 0;
}

.milestones li{
  font-size:13px;
  line-height:1.5;
  padding:4px 0;
  border-top:1px dashed #eee;
}

.milestones li:first-child{
  border-top:none;
}

/* ステータスタグ（「今日」「あと◯日」など） */

.badge{
  display:inline-block;
  padding:2px 8px;
  margin-left:4px;
  border-radius:999px;
  font-size:11px;
  line-height:1.6;
  background:#eef6ff;
  color:#245adb;
}

.badge--past{
  background:#f3f3f3;
  color:#666;
}

.badge--today{
  background:#ffe9aa;
  color:#a66900;
}

/* フッター */

.footer{
  font-size:12px;
  color:#666;
  margin-top:16px;
  text-align:center;
}

/* ===== モバイル調整 ===== */

@media (max-width: 480px){
  body{
    margin:16px;
  }
}
