/* ============================================================
   anime-match.css — サブスク組み合わせ診断ページ（/anime/match/）
   自己完結（archive/landing CSS に依存しない）。配色はサイト共通の
   ブランド変数にフォールバック付きで揃える。
   ============================================================ */

.anime-match {
  --am-primary:      var(--brand-primary,       #0ea5e9);
  --am-primary-dark: var(--brand-primary-dark,  #0369a1);
  --am-primary-bg:   var(--brand-primary-bg,    #f0f9ff);
  --am-primary-soft: var(--brand-primary-soft,  #e0f2fe);
  --am-border:       #e5e7eb;
  --am-ink:          #1f2937;
  --am-ink-mute:     #6b7280;
  --am-gold:         #f5b301;
  --am-danger:       #b45309;

  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px 64px;
  color: var(--am-ink);
}

/* ── ヘッダー帯 ───────────────────────────────────────
   archive-anime.php と同じ見た目を anime-archive.css 非依存で再現する
   （/anime/match/ では anime-archive.css は読み込まれないため）。 */
.anime-match-header {
  background: #fff;
  border-bottom: 1px solid var(--am-border);
}
.anime-match-header .anime-archive-header__inner {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: .85rem 16px;
  box-sizing: border-box;
}
.anime-match-header .anime-breadcrumbs {
  font-size: .78rem;
  color: var(--am-ink-mute);
  margin-bottom: .25rem;
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
}
.anime-match-header .anime-breadcrumbs a {
  color: var(--am-primary-dark);
  text-decoration: none;
}
.anime-match-header .anime-breadcrumbs a:hover { text-decoration: underline; }
.anime-match-header .anime-breadcrumbs__sep     { color: #9ca3af; }
.anime-match-header .anime-breadcrumbs__current { color: #111827; font-weight: 600; }

.anime-match-header .anime-archive-title {
  margin: 0;
  border-left: 4px solid var(--am-primary);
  padding-left: .55rem;
  color: var(--am-ink);
  font-weight: 800;
}
.anime-match-header .anime-match-title { font-size: 1.75rem; line-height: 1.4; }
@media (max-width: 599px) {
  .anime-match-header .anime-match-title { font-size: 1.35rem; }
}

.anime-match__lead {
  margin: 16px 0 24px;
  background: var(--am-primary-bg);
  border: 1px solid var(--am-primary-soft);
  border-radius: 12px;
  padding: 16px 20px;
  line-height: 1.7;
}
.anime-match__lead strong { color: var(--am-primary-dark); }

.anime-match__notice {
  margin: 12px 0 0;
  padding: 10px 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  font-size: .82rem;
  line-height: 1.7;
  color: #92400e;
}
.anime-match__notice strong { color: #b45309; }

.anime-match__section-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 12px;
  padding-left: 10px;
  border-left: 4px solid var(--am-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.anime-match__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6em;
  height: 1.6em;
  padding: 0 .4em;
  border-radius: 999px;
  background: var(--am-primary);
  color: #fff;
  font-size: .85rem;
}

/* ── レイアウト: 検索 / リスト 2カラム ───────────── */
.anime-match__layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 767px) {
  .anime-match__layout { grid-template-columns: 1fr; gap: 28px; }
}

.anime-match__search,
.anime-match__list {
  background: #fff;
  border: 1px solid var(--am-border);
  border-radius: 12px;
  padding: 16px;
}

/* ── 検索 ─────────────────────────────────────────── */
.anime-match-search__label { display: block; font-size: .9rem; color: var(--am-ink-mute); margin-bottom: 6px; }
.anime-match-search__row { display: flex; gap: 8px; }
.anime-match-search__input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--am-border);
  border-radius: 8px;
  font-size: 1rem;
}
.anime-match-search__input:focus {
  outline: none;
  border-color: var(--am-primary);
  box-shadow: 0 0 0 3px var(--am-primary-soft);
}
.anime-match-search__btn,
.anime-match__primary {
  background: var(--am-primary);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
}
.anime-match-search__btn:hover,
.anime-match__primary:hover:not(:disabled) { background: var(--am-primary-dark); }

.anime-match-search__hint { color: var(--am-ink-mute); font-size: .9rem; margin: 12px 0 0; }

.anime-match-results { list-style: none; margin: 12px 0 0; padding: 0; }
.anime-match-results__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--am-border);
}
.anime-match-results__info { display: flex; flex-direction: column; min-width: 0; }
.anime-match-results__title { font-weight: 600; }
.anime-match-results__meta { font-size: .8rem; color: var(--am-ink-mute); }
.anime-match-results__add {
  flex: none;
  background: #fff;
  color: var(--am-primary-dark);
  border: 1px solid var(--am-primary);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.anime-match-results__add:hover { background: var(--am-primary-bg); }
.anime-match-results__add.is-added,
.anime-match-results__add:disabled {
  color: var(--am-ink-mute);
  border-color: var(--am-border);
  background: #f3f4f6;
  cursor: default;
}

/* ── 視聴したいリスト ─────────────────────────────── */
.anime-match__list-note { font-size: .8rem; color: var(--am-ink-mute); margin: 0 0 12px; }
.anime-match-list { list-style: none; margin: 0; padding: 0; }
.anime-match-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--am-border);
}
.anime-match-list__info { display: flex; flex-direction: column; min-width: 0; }
.anime-match-list__title { font-weight: 600; }
.anime-match-list__meta { font-size: .8rem; color: var(--am-ink-mute); }
.anime-match-list__remove {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--am-border);
  background: #fff;
  color: var(--am-ink-mute);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.anime-match-list__remove:hover { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }

.anime-match-list__empty { color: var(--am-ink-mute); font-size: .9rem; padding: 8px 4px; }

.anime-match-list__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.anime-match__primary:disabled { background: #cbd5e1; cursor: not-allowed; }
.anime-match__clear {
  background: #fff;
  color: var(--am-ink-mute);
  border: 1px solid var(--am-border);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
}
.anime-match__clear:hover { background: #f9fafb; }

/* ── 結果 ─────────────────────────────────────────── */
.anime-match__result { margin-top: 32px; }
.anime-match__loading,
.anime-match__error { color: var(--am-ink-mute); padding: 12px 0; }
.anime-match__error { color: var(--am-danger); }

.anime-match-summary { font-size: 1rem; margin: 0 0 4px; }
.anime-match-freshness { font-size: .8rem; color: var(--am-ink-mute); margin: 0 0 16px; }
.anime-match-freshness time { font-variant-numeric: tabular-nums; }

.anime-match-single {
  background: linear-gradient(135deg, #047857 0%, #10b981 100%);
  color: #fff;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 20px;
}
.anime-match-single__lead { font-size: 1.1rem; font-weight: 800; margin: 0 0 12px; }

.anime-match-plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 8px;
}
@media (max-width: 767px) { .anime-match-plans { grid-template-columns: 1fr; } }
.anime-match-plans__note { grid-column: 1 / -1; color: var(--am-ink-mute); font-size: .85rem; margin: 0; }

.anime-match-plan {
  border: 1px solid var(--am-border);
  border-radius: 12px;
  padding: 16px;
  background: #fff;
}
.anime-match-plan.is-highlight {
  border-color: var(--am-primary);
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.15);
}
.anime-match-plan__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.anime-match-plan__title { font-weight: 700; }
.anime-match-plan__count { font-size: .8rem; color: var(--am-ink-mute); }

.anime-match-plan__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.anime-match-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--am-primary-bg);
  border: 1px solid var(--am-primary-soft);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: .9rem;
}
.anime-match-chip__link { color: var(--am-primary-dark); font-weight: 700; text-decoration: none; }
.anime-match-chip__link:hover { text-decoration: underline; }
.anime-match-chip__label { font-weight: 700; }
.anime-match-chip__cost { color: var(--am-ink-mute); font-size: .8rem; }
.anime-match-single .anime-match-chip {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.35);
}
.anime-match-single .anime-match-chip__link,
.anime-match-single .anime-match-chip__label,
.anime-match-single .anime-match-chip__cost { color: #fff; }

.anime-match-plan__foot { margin-top: 14px; }
.anime-match-plan__total { font-weight: 800; font-size: 1.05rem; color: var(--am-primary-dark); }
.anime-match-plan__total--unknown { font-weight: 600; font-size: .85rem; color: var(--am-ink-mute); }

/* ── 見放題で見れない作品（別枠） ─────────────────── */
.anime-match-uncovered {
  margin-top: 24px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  border-radius: 12px;
  padding: 16px 18px;
}
.anime-match-uncovered__title { font-size: 1rem; font-weight: 700; margin: 0 0 12px; color: var(--am-danger); }
.anime-match-uncovered__list { list-style: none; margin: 0; padding: 0; }
.anime-match-uncovered__item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  padding: 8px 0;
  border-bottom: 1px dashed #fde68a;
}
.anime-match-uncovered__item:last-child { border-bottom: 0; }
.anime-match-uncovered__name { font-weight: 600; color: var(--am-ink); text-decoration: none; }
a.anime-match-uncovered__name:hover { text-decoration: underline; color: var(--am-primary-dark); }
.anime-match-uncovered__note { font-size: .85rem; color: var(--am-danger); }
.anime-match-uncovered__note--none { color: var(--am-ink-mute); }

.anime-match__disclaimer { margin-top: 20px; font-size: .8rem; color: var(--am-ink-mute); line-height: 1.7; }

/* ── 使い方ステップ ───────────────────────────────── */
.anime-match__howto { margin-top: 36px; }
.anime-match-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 767px) { .anime-match-steps { grid-template-columns: 1fr; } }
.anime-match-steps__item {
  display: flex;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--am-border);
  border-radius: 12px;
  padding: 16px;
}
.anime-match-steps__num {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--am-primary);
  color: #fff;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.anime-match-steps__item strong { display: block; margin-bottom: 4px; }
.anime-match-steps__item p { margin: 0; font-size: .88rem; color: var(--am-ink-mute); line-height: 1.6; }

/* ── 料金早見表 ───────────────────────────────────── */
.anime-match__pricing { margin-top: 32px; }
.anime-match-pricing {
  border: 1px solid var(--am-border);
  border-radius: 12px;
  background: #fff;
}
.anime-match-pricing__summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  font-weight: 700;
}
.anime-match-pricing__summary::-webkit-details-marker { display: none; }
.anime-match-pricing__hint { font-size: .8rem; color: var(--am-ink-mute); font-weight: 400; }
.anime-match-pricing__body { padding: 0 16px 16px; }
.anime-match-pricing__table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.anime-match-pricing__table th,
.anime-match-pricing__table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--am-border);
}
.anime-match-pricing__table th { background: var(--am-primary-bg); color: var(--am-primary-dark); }
.anime-match-pricing__table td:last-child { font-variant-numeric: tabular-nums; font-weight: 700; }
.anime-match-pricing__note { margin: 10px 0 0; font-size: .78rem; color: var(--am-ink-mute); }

/* ── FAQ ──────────────────────────────────────────── */
.anime-match__faq { margin-top: 32px; }
.anime-match-faq__item {
  border: 1px solid var(--am-border);
  border-radius: 10px;
  background: #fff;
  margin-bottom: 10px;
}
.anime-match-faq__q {
  cursor: pointer;
  list-style: none;
  padding: 14px 16px;
  font-weight: 700;
  position: relative;
}
.anime-match-faq__q::-webkit-details-marker { display: none; }
.anime-match-faq__q::after {
  content: '＋';
  position: absolute;
  right: 16px;
  color: var(--am-primary);
}
.anime-match-faq__item[open] .anime-match-faq__q::after { content: '−'; }
.anime-match-faq__a {
  padding: 0 16px 16px;
  font-size: .9rem;
  line-height: 1.8;
  color: var(--am-ink);
}

/* ── SEO 本文（診断で分かること / 組み合わせ重要 / サービス特徴） ── */
.anime-match__seo { margin-top: 32px; line-height: 1.8; }
.anime-match__seo p { margin: 0 0 12px; }
.anime-match-know-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.anime-match-know-list li {
  position: relative;
  padding: 12px 14px 12px 40px;
  background: var(--am-primary-bg);
  border: 1px solid var(--am-primary-soft);
  border-radius: 10px;
}
.anime-match-know-list li::before {
  content: '✓';
  position: absolute;
  left: 14px;
  top: 12px;
  color: var(--am-primary-dark);
  font-weight: 800;
}
.anime-match-know-list strong { color: var(--am-primary-dark); }

.anime-match-svc-list { margin: 0; }
.anime-match-svc-list dt {
  font-weight: 700;
  color: var(--am-ink);
  margin-top: 12px;
  padding-left: 10px;
  border-left: 3px solid var(--am-primary-soft);
}
.anime-match-svc-list dt:first-child { margin-top: 0; }
.anime-match-svc-list dd {
  margin: 2px 0 0;
  padding-left: 10px;
  font-size: .9rem;
  color: var(--am-ink-mute);
  line-height: 1.7;
}
.anime-match-svc-note { margin: 14px 0 0; font-size: .8rem; color: var(--am-ink-mute); }

.anime-match-pricing__updated { margin: 0 0 10px; font-size: .82rem; color: var(--am-ink-mute); }
.anime-match-pricing__updated time { font-variant-numeric: tabular-nums; }
ul.anime-match-pricing__note {
  margin: 12px 0 0;
  padding-left: 1.1em;
  font-size: .78rem;
  color: var(--am-ink-mute);
  line-height: 1.7;
}

/* ── 関連リンク ───────────────────────────────────── */
.anime-match__related { margin-top: 32px; }
.anime-match-related-list { list-style: none; margin: 0; padding: 0; }
.anime-match-related-list li { margin-bottom: 8px; }
.anime-match-related-list a {
  color: var(--am-primary-dark);
  font-weight: 700;
  text-decoration: none;
}
.anime-match-related-list a:hover { text-decoration: underline; }
