﻿* {
  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: #ede9fe; color: #3730a3;
  border: 1px solid #c4b5fd;
  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.88rem;
  color: #666;
  font-family: inherit;
  transition: all 0.2s;
}

.tab:hover {
  background: #f0f0ff;
  color: #3730a3;
}

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

.tab-content {
  display: none;
}

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

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

/* 入力行 */
.input-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 1.25rem;
}

.input-group {
  flex: 1;
}

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

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

.input-group input[type=time]:focus {
  outline: none;
  border-color: #3730a3;
}

.btn-now {
  padding: 0.65rem 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  color: #555;
  font-size: 0.88rem;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-now:hover {
  border-color: #3730a3;
  color: #3730a3;
}

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

.btn:hover {
  background: #2d2780;
}

/* 結果ヘッダーカード */
.result-header-card {
  background: linear-gradient(135deg, #0d0d2e 0%, #1a1a5e 50%, #0a1628 100%);
  border-radius: 16px;
  padding: 1.75rem 1.5rem;
  margin-bottom: 1rem;
  text-align: center;
  color: #fff;
}

.result-subtitle {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 0.3rem;
  letter-spacing: 0.05em;
}

.result-label {
  font-size: 1.3rem;
  font-weight: bold;
  color: #c5cae9;
  margin-bottom: 0.5rem;
}

.result-note {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
}

/* サイクルカードグリッド */
.cycles-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.cycle-card {
  background: #fff;
  border-radius: 12px;
  border: 2px solid #e0e0e0;
  padding: 1rem 0.75rem;
  text-align: center;
  transition: transform 0.1s, box-shadow 0.2s;
}

.cycle-card.recommend {
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.cycle-card:hover {
  transform: translateY(-2px);
}

.cycle-emoji {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.cycle-count {
  font-size: 0.75rem;
  color: #999;
  margin-bottom: 0.3rem;
}

.cycle-time {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 0.2rem;
  line-height: 1.2;
}

.cycle-duration {
  font-size: 0.75rem;
  color: #888;
  margin-bottom: 0.3rem;
}

.cycle-rating {
  font-size: 0.78rem;
  font-weight: bold;
}

.cycle-badge {
  display: inline-block;
  background: #3730a3;
  color: #fff;
  font-size: 0.68rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  margin-top: 0.4rem;
  font-weight: bold;
}

/* Amazonおすすめ */
.amazon-card h2 {
  margin-bottom: 0.25rem;
}

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

.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: #3730a3;
}

.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: #3730a3; }
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; }

  .tabs { gap: 0.4rem; }
  .tab { font-size: 0.8rem; padding: 0.5rem 0.7rem; }

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

  .cycle-time { font-size: 1.25rem; }

  .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: #3730a3; margin-bottom: .35rem; }
.faq-a { font-size: .85rem; color: #555; line-height: 1.75; }

/* ━━━ 入眠時間スライダー ━━━ */
.onset-row {
  margin-bottom: 1.1rem;
  padding: .75rem 1rem;
  background: #f5f3ff;
  border-radius: 8px;
  border: 1px solid #ede9fe;
}
.onset-label {
  display: block;
  font-size: .85rem;
  color: #555;
  margin-bottom: .4rem;
}
.onset-label strong { color: #3730a3; font-size: 1rem; }
.onset-range {
  width: 100%;
  accent-color: #3730a3;
  margin-bottom: .2rem;
}
.onset-hints {
  display: flex;
  justify-content: space-between;
  font-size: .72rem;
  color: #aaa;
}

/* ━━━ 昼寝モード（nap-mode）グリッド ━━━ */
.cycles-grid.nap-mode {
  grid-template-columns: repeat(3, 1fr);
}
.nap-warn-bar {
  grid-column: 1 / -1;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  font-size: .82rem;
  font-weight: 600;
  padding: .6rem 1rem;
  border-radius: 8px;
  text-align: center;
}
.nap-warn-bar.nap-warn-late {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

/* ━━━ 目覚め時刻早見表 ━━━ */
.table-wrap { overflow-x: auto; }
.table-note-top { font-size: .8rem; color: #aaa; margin-bottom: .65rem; }
.table-note     { font-size: .75rem; color: #bbb; margin-top: .5rem; }

.sleep-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .83rem;
  min-width: 460px;
}
.sleep-table th {
  background: #3730a3;
  color: #fff;
  padding: .5rem .65rem;
  text-align: center;
  font-weight: 700;
  font-size: .75rem;
  white-space: nowrap;
  line-height: 1.4;
}
.th-sub { font-size: .68rem; font-weight: 400; opacity: .8; }
.sleep-table td {
  padding: .42rem .65rem;
  border-bottom: 1px solid #f0f0f0;
  text-align: center;
  color: #444;
}
.sleep-table tr:hover td { background: #f5f3ff; }
.time-val { font-weight: 700; color: #3730a3; }
.hl-row td { background: #ede9fe !important; font-weight: 600; }

/* ━━━ 活用シーン ━━━ */
.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 #e8edf5; border-radius: 10px;
  text-decoration: none; color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.related-tool-item:hover { border-color: #3730a3; box-shadow: 0 2px 8px rgba(55,48,163,.1); }
.related-tool-icon { font-size: 1.6rem; flex-shrink: 0; }
.related-tool-item strong { display: block; font-size: .88rem; font-weight: 700; color: #3730a3; 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; }
  .cycles-grid.nap-mode { grid-template-columns: 1fr; }
}
