﻿* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
button { touch-action: manipulation; }


body {
  font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.7;
  overflow-x: hidden;
}

header {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 1rem 0;
}

.header-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.logo {
  font-size: 1.2rem;
  font-weight: bold;
  color: #1a73e8;
  text-decoration: none;
}

main {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

/* ヒーロー */
.hero {
  text-align: center;
  padding: 2.5rem 0 1.5rem;
}

.hero-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.hero-badges {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: .5rem; margin-top: .75rem;
}
.badge {
  display: inline-block;
  background: #fdf0f5; color: #d4548a;
  border: 1px solid #f9c4db;
  border-radius: 999px;
  font-size: .78rem; font-weight: 600;
  padding: .2rem .75rem;
}

h1 {
  font-size: 1.9rem;
  font-weight: bold;
  margin-bottom: 0.6rem;
}

h2 {
  font-size: 1.05rem;
  font-weight: bold;
  margin-bottom: 0.75rem;
}

.description {
  color: #666;
  font-size: 0.95rem;
  line-height: 1.8;
}

/* カード共通 */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  border: 1px solid #e0e0e0;
}

/* タブ */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.tab {
  padding: 0.55rem 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  color: #666;
  font-family: inherit;
  transition: all 0.2s;
}

.tab:hover {
  background: #fdf0f5;
  color: #d4548a;
}

.tab.active {
  background: #d4548a;
  color: #fff;
  border-color: #d4548a;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.tab-note {
  font-size: 0.875rem;
  color: #888;
  margin-bottom: 1rem;
  line-height: 1.7;
}

/* 入力 */
.input-group {
  margin-bottom: 1.2rem;
}

.input-group label {
  display: block;
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 0.4rem;
}

.input-group input[type=date] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 0.65rem 0.9rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  color: #333;
  background: #fff;
  font-family: inherit;
  transition: border-color 0.2s;
}

.input-group input[type=date]:focus {
  outline: none;
  border-color: #d4548a;
}

/* ボタン */
.btn {
  display: inline-block;
  padding: 0.7rem 2rem;
  background: #d4548a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
}

.btn:hover {
  background: #b8406f;
}

/* エラー */
.error-card {
  background: #fff0f0;
  border: 1px solid #ffcdd2;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  color: #c62828;
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

/* メイン結果カード */
.result-hero-card {
  background: linear-gradient(135deg, #f8bbd9 0%, #fce4ec 50%, #ffd6ea 100%);
  border-radius: 16px;
  padding: 1.75rem 1.5rem;
  margin-bottom: 1.25rem;
  text-align: center;
  border: 1px solid #f48fb1;
}

.result-hero-label {
  font-size: 0.82rem;
  color: #ad1457;
  font-weight: bold;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}

.result-due-date {
  font-size: 1.7rem;
  font-weight: bold;
  color: #880e4f;
  margin-bottom: 1.25rem;
  line-height: 1.3;
}

.result-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.result-metric {
  background: rgba(255,255,255,0.7);
  border-radius: 10px;
  padding: 0.85rem 0.5rem;
}

.result-metric-label {
  font-size: 0.75rem;
  color: #ad1457;
  margin-bottom: 0.3rem;
}

.result-metric-value {
  font-size: 1.15rem;
  font-weight: bold;
  color: #880e4f;
}

.trimester-badge {
  display: inline-block;
  padding: 0.3rem 1.2rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: bold;
  background: rgba(255,255,255,0.8);
  color: #880e4f;
  border: 1px solid rgba(173,20,87,0.3);
}

/* マイルストーンテーブル */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 360px;
}

.info-table th {
  text-align: left;
  padding: 0.55rem 0.75rem;
  color: #999;
  font-weight: normal;
  font-size: 0.8rem;
  border-bottom: 2px solid #f0f0f0;
}

.info-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #f5f5f5;
}

.info-table tr.past td {
  color: #bbb;
}

.info-table tr.highlight td {
  font-weight: bold;
  color: #d4548a;
  background: #fff0f5;
}

.info-table tr:last-child td {
  border-bottom: none;
}

.past-badge {
  font-size: 0.78rem;
  color: #bbb;
  background: #f5f5f5;
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
}

.upcoming-badge {
  font-size: 0.78rem;
  color: #d4548a;
  background: #fff0f5;
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
}

/* Amazonおすすめ */
.amazon-card {
  background: #fff;
}

.amazon-note {
  font-size: 0.82rem;
  color: #999;
  margin-bottom: 1rem;
  margin-top: -0.3rem;
}

.amazon-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.amazon-item {
  display: block;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s;
}

.amazon-item:hover {
  border-color: #FF9900;
  box-shadow: 0 2px 8px rgba(255,153,0,0.15);
  transform: translateY(-1px);
}

.amazon-item-icon {
  font-size: 1.8rem;
  margin-bottom: 0.4rem;
}

.amazon-item-name {
  font-size: 0.9rem;
  font-weight: bold;
  margin-bottom: 0.25rem;
  color: #333;
}

.amazon-item-desc {
  font-size: 0.78rem;
  color: #888;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.amazon-item-link {
  font-size: 0.8rem;
  color: #FF9900;
  font-weight: bold;
}

/* 説明カード */
.explanation-item {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f0f0f0;
}

.explanation-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.explanation-item h3 {
  font-size: 0.9rem;
  font-weight: bold;
  margin-bottom: 0.3rem;
  color: #d4548a;
}

.explanation-item p {
  font-size: 0.875rem;
  color: #666;
  line-height: 1.7;
}

.hidden { display: none; }

footer {
  text-align: center;
  padding: 2rem;
  color: #999;
  font-size: 0.875rem;
}

footer a {
  color: #999;
  text-decoration: none;
  margin: 0 0.5rem;
}

footer a:hover { color: #d4548a; }
footer p { margin-bottom: 0.3rem; }

/* ─── Tips grid (rank-tracker 統一パターン) ──────── */
.tips-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.tip-item { display: flex; gap: .65rem; }
.tip-icon { font-size: 1.4rem; flex-shrink: 0; }
.tip-text strong { display: block; font-weight: 700; margin-bottom: .15rem; font-size: .88rem; }
.tip-text p { font-size: .8rem; color: #78716c; line-height: 1.55; }

@media (max-width: 600px) {
  h1 { font-size: 1.5rem; }

  .result-due-date { font-size: 1.35rem; }

  .result-metrics {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }

  .result-metric-value { font-size: 0.95rem; }
  .result-metric-label { font-size: 0.7rem; }

  .amazon-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .tips-grid { grid-template-columns: 1fr; }
}

.amazon-notice {
  font-size: 0.72rem;
  color: #bbb;
  margin-top: 0.2rem;
}

/* ━━━ FAQ ━━━ */
.faq-list { display: flex; flex-direction: column; }
.faq-item { padding: .9rem 0; border-bottom: 1px solid #f0f0f0; }
.faq-item:last-child { border-bottom: none; padding-bottom: 0; }
.faq-q { font-size: .9rem; font-weight: 700; color: #d4548a; margin-bottom: .35rem; }
.faq-a { font-size: .85rem; color: #555; line-height: 1.75; }

/* ━━━ 妊娠月数早見表 ━━━ */
.table-note-top { font-size: .8rem; color: #aaa; margin-bottom: .65rem; }
.table-note     { font-size: .75rem; color: #bbb; margin-top: .5rem; }

.preg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .83rem;
  min-width: 480px;
}
.preg-table th {
  background: #d4548a;
  color: #fff;
  padding: .5rem .75rem;
  text-align: left;
  font-weight: 700;
  font-size: .78rem;
  white-space: nowrap;
}
.preg-table td {
  padding: .45rem .75rem;
  border-bottom: 1px solid #f0f0f0;
  color: #444;
  vertical-align: middle;
}
.preg-table tr:hover td { background: #fdf0f5; }
.hl-row td { background: #fce4ec !important; font-weight: 600; }

.stage-badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  padding: .12rem .55rem;
  border-radius: 999px;
  white-space: nowrap;
}
.stage-early { background: #fce4ec; color: #c2185b; }
.stage-mid   { background: #e8f5e9; color: #2e7d32; }
.stage-late  { background: #e3f2fd; color: #1565c0; }
.stage-birth { background: #fff3e0; color: #e65100; }

/* ━━━ 活用シーン ━━━ */
.scene-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .9rem; }
.scene-item { display: flex; gap: .65rem; align-items: flex-start; }
.scene-icon { font-size: 1.5rem; flex-shrink: 0; }
.scene-body strong { display: block; font-size: .88rem; font-weight: 700; margin-bottom: .15rem; color: #333; }
.scene-body p { font-size: .8rem; color: #666; line-height: 1.55; margin: 0; }

/* ━━━ 関連ツール ━━━ */
.related-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; }
.related-tool-item {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .85rem 1rem;
  border: 1.5px solid #f5e0ea; border-radius: 10px;
  text-decoration: none; color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.related-tool-item:hover { border-color: #d4548a; box-shadow: 0 2px 8px rgba(212,84,138,.1); }
.related-tool-icon { font-size: 1.6rem; flex-shrink: 0; }
.related-tool-item strong { display: block; font-size: .88rem; font-weight: 700; color: #d4548a; margin-bottom: .2rem; }
.related-tool-item p { font-size: .76rem; color: #888; line-height: 1.5; margin: 0; }

@media (max-width: 560px) {
  .scene-grid { grid-template-columns: 1fr; }
}
