/* ポイントサイト案件比較ツールのデザイン。色・フォントはブログ（WordPressテーマ SWELL）の設定に合わせている */
:root {
  --bg: #fdfdfd;
  --card: #ffffff;
  --text: #212121;
  --sub: #6b7280;
  --line: #e6e6e6;
  --main: #4ecdc4;          /* SWELL --color_main */
  --main-dark: #3b9a93;     /* SWELL --color_main_dark */
  --main-thin: #effbfa;
  --red: #e63946;           /* 強調（ブログのボタン色） */
  --link: #3554a3;          /* SWELL --color_link */
  --up: #e63946;
  --down: #3554a3;
  --gold: #d4a017;
  --radius: 4px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans JP", sans-serif;
  line-height: 1.7;
  letter-spacing: .02em;
}
a { color: var(--link); }

/* ヘッダー（ブログと同じ構成） */
.site-header { background: #fdfdfd; border-bottom: 1px solid #eee; }
.site-header__inner { max-width: 1200px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; }
.site-header__logo img { height: 52px; width: auto; display: block; }
.site-nav { margin-left: auto; display: flex; gap: 20px; font-size: .88rem; }
.site-nav a { color: #333; text-decoration: none; }
.site-nav a:hover { color: var(--main-dark); }
@media (max-width: 600px) {
  .site-header__logo img { height: 40px; }
  .site-nav { gap: 12px; font-size: .78rem; }
  .site-nav .pc-only { display: none; }
}
.breadcrumb { max-width: 880px; margin: 0 auto; padding: 10px 16px 0; font-size: 11px; color: #666; }
.breadcrumb a { color: #666; text-decoration: none; }
.breadcrumb span[hidden] { display: none; }
.breadcrumb span + span::before { content: "›"; margin: 0 .6em; }

.wrap { max-width: 880px; margin: 0 auto; padding: 16px; }
.page-title { font-size: 1.45rem; margin: 16px 0 4px; line-height: 1.5; }
.page-intro { margin: 0 0 4px; font-size: .9rem; color: #444; }
.page-lead { margin: 0; color: var(--sub); font-size: .85rem; }
.page-pr { margin: 6px 0 0; font-size: .75rem; color: var(--sub); }

.picker { margin: 20px 0; }
.picker label { display: block; font-size: .85rem; font-weight: 700; margin-bottom: 8px; padding-left: .6em; border-left: 3px solid var(--main); }
/* 案件名の検索 */
.search-wrap { position: relative; max-width: 360px; margin-bottom: 12px; }
#case-search {
  width: 100%; font-family: inherit; font-size: 16px; color: var(--text); background: #fff;
  border: 1px solid #cfd8d7; border-radius: 6px; padding: 7px 12px; -webkit-appearance: none; appearance: none;
}
#case-search::placeholder { font-size: 13px; color: #b8bfc4; }
#case-search:focus { outline: none; border-color: var(--main); box-shadow: 0 0 0 3px var(--main-thin); }
#search-results {
  position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px 0; list-style: none;
  background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
  max-height: 320px; overflow-y: auto;
}
#search-results li { padding: 7px 12px; font-size: .88rem; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
#search-results li[aria-selected="true"], #search-results li:hover { background: var(--main-thin); }
#search-results li.empty { color: var(--sub); cursor: default; background: none; }
#search-results .cat { color: var(--sub); font-size: .72rem; white-space: nowrap; }
@media (max-width: 600px) { .search-wrap { max-width: none; } }
/* PC：分類タブ＋選んだ分類の案件ボタンだけを表示 */
.cat-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 2px solid var(--main); margin-bottom: 10px; }
.cat-tab {
  border: 1px solid var(--line); border-bottom: 0; background: #f5f5f5; color: var(--sub);
  border-radius: 6px 6px 0 0; padding: 6px 8px; font-size: .8rem; font-weight: 700; cursor: pointer; font-family: inherit; white-space: nowrap;
}
.cat-tab[aria-selected="true"] { background: var(--main); border-color: var(--main); color: #fff; }
.chip-group[hidden] { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.select-wrap { display: none; position: relative; }
.select-wrap::after { content: ""; position: absolute; right: 14px; top: 50%; width: 8px; height: 8px; margin-top: -6px; border-right: 2px solid var(--main-dark); border-bottom: 2px solid var(--main-dark); transform: rotate(45deg); pointer-events: none; }
#case-select {
  width: 100%; appearance: none; -webkit-appearance: none; font-family: inherit; font-size: 1rem; font-weight: 700; color: var(--text);
  background: #fff; border: 2px solid var(--main); border-radius: 8px; padding: 10px 40px 10px 12px;
}
@media (max-width: 600px) {
  .select-wrap { display: block; }
  #chips { display: none; }
}
.chip {
  border: 1px solid var(--main); background: #fff; color: var(--main-dark);
  border-radius: 40px; padding: 3px 11px; font-size: .8rem; cursor: pointer; font-family: inherit; line-height: 1.6;
}
.chip:hover { background: var(--main-thin); }
/* 選択中も文字の太さは変えない（太字にすると幅が変わり、ボタンの並びがずれるため） */
.chip[aria-pressed="true"] { background: var(--main); border-color: var(--main); color: #fff; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 0 16px; margin-bottom: 24px; }
.card > *:not(h2) { margin-left: 16px; margin-right: 16px; }
/* 見出しはブログ記事の h2 と同じ帯デザイン */
/* トップ（案件一覧） */
#overview[hidden], #detail[hidden] { display: none; }
.back { margin: 0 0 10px; font-size: .85rem; }
.back a { text-decoration: none; }
.ov-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.ov > a.ov-row:last-of-type { border-bottom: 0; }
.ov-more-link { font-size: .85rem; text-decoration: none; }
.ov-more-link:hover { text-decoration: underline; }
a.ov-row:hover { background: var(--main-thin); }
.ov-head { font-size: .75rem; font-weight: 700; color: var(--sub); padding: 6px 4px; border-bottom: 2px solid var(--main); }
.ov-name { flex: 1; min-width: 0; font-weight: 700; color: var(--link); }
.ov-head .ov-name { color: var(--sub); }
/* 列の幅は rem で決める（見出しは文字が小さいので、em だと行と幅がずれて位置が合わなくなる） */
.ov-site { flex: 0 0 9.7rem; font-size: .88rem; }
.ov-yen { flex: 0 0 9.5rem; text-align: right; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ov-head .ov-site, .ov-head .ov-yen { font-size: .75rem; font-weight: 700; }
.ov-none { font-weight: 400; color: var(--sub); font-size: .85rem; }
@media (max-width: 520px) {
  .ov-row { flex-wrap: wrap; gap: 2px 8px; }
  .ov-name { flex-basis: 100%; }
  .ov-site { flex: 1; color: #555; }
  .ov-yen { flex: 0 0 auto; }
  .ov-yen .badge { display: inline-block; margin: 0 0 0 4px; }
  .ov-yen .diff { display: inline; margin-left: 6px; }
  /* スマホでは案件名が1行目に来るので、見出しは「案件」と「還元額・還元率」にする（「いちばんお得」は出さない） */
  .ov-head { flex-wrap: nowrap; }
  .ov-head .ov-name { flex: 1; flex-basis: auto; }
  .ov-head .ov-site { display: none; }
}
.card h2 { background: var(--main); color: #fff; font-size: 1.1rem; margin: 0 0 12px; padding: .7em 1em; border-radius: var(--radius) var(--radius) 0 0; line-height: 1.5; }
.card h2#case-name { font-size: 1.5rem; padding: .7em .9em; }
@media (max-width: 520px) { .card h2#case-name { font-size: 1.25rem; } }
.meta { color: var(--sub); font-size: .8rem; }
.case-note { font-size: .75rem; color: #555; background: #fff8e6; border-left: 3px solid #f0b429; padding: 6px 10px; margin-top: 8px; margin-bottom: 0; }
.case-note[hidden] { display: none; }
.case-note .note-extra { display: block; margin-top: .7em; }
.case-note a { color: var(--link); }

.top[hidden], table[hidden], .card[hidden], .meta[hidden] { display: none; }
.top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px;
  background: var(--main-thin); border: 2px solid var(--main); border-radius: 8px; padding: 12px 14px;
}
.top .label { display: inline-block; font-size: .72rem; color: #fff; background: var(--main); border-radius: 3px; padding: 0 .6em; font-weight: 700; }
.top .site { font-size: 1.15rem; font-weight: 700; margin-top: 2px; }
/* 「いちばんお得」ラベルの下の行に、サイト名と「お得な始め方」ボタンを横並びで表示 */
.top .top-site { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.top .yen { margin-left: auto; font-size: 1.6rem; font-weight: 700; color: var(--red); white-space: nowrap; }

table { width: calc(100% - 32px); border-collapse: collapse; margin-top: 12px; font-size: .92rem; }
th { text-align: left; font-size: .75rem; color: var(--sub); font-weight: 700; padding: 6px 4px; border-bottom: 2px solid var(--main); }
td { padding: 10px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.rank { width: 2.8em; text-align: center; font-weight: 700; color: var(--sub); white-space: nowrap; }
.rank.r1 { color: var(--gold); }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.yen-cell { font-weight: 700; }
.breakdown { display: block; font-size: .66rem; font-weight: 400; color: var(--sub); white-space: nowrap; }
.top .yen .breakdown { text-align: right; font-size: .7rem; }
.diff { font-size: .72rem; display: block; white-space: nowrap; }
.zero-note { color: var(--sub); }
.diff.up { color: var(--up); }
.diff.down { color: var(--down); }
.badge { display: inline-block; font-size: .65rem; font-weight: 700; color: #fff; background: var(--red); border-radius: 3px; padding: 0 5px; margin-left: 4px; vertical-align: 1px; }
.none td { color: var(--sub); }
.site-link { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.max { color: var(--sub); font-size: .8rem; }
.max-date { display: block; font-size: .68rem; color: #999; line-height: 1.3; }
.site-name { font-weight: 700; }
.maint-note { font-size: .68rem; color: #8a6d1a; background: #fff3cd; border-radius: 3px; padding: 1px 6px; white-space: nowrap; margin-left: -6px; cursor: help; }
.multi-btn {
  font-family: inherit; font-size: .7rem; color: var(--main-dark); background: var(--main-thin); border: 1px solid #b8e8e4;
  border-radius: 4px; padding: 2px 8px; margin-left: -6px; cursor: pointer; white-space: nowrap;
}
.multi-btn .caret { margin-left: 3px; display: inline-block; transition: transform .15s; }
.multi-btn[aria-expanded="true"] .caret { transform: rotate(180deg); }
.variants-row td { padding: 0 4px 12px; border-bottom: 1px solid var(--line); }
.variants { background: #f7fbfb; border: 1px solid #d9efed; border-radius: 6px; padding: 10px 14px; }
.top .variants { flex-basis: 100%; background: #fff; }
.variants-title { font-size: .72rem; color: var(--sub); margin-bottom: 4px; }
.variants ul { list-style: none; margin: 0; padding: 0; }
.variants li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: .85rem; border-top: 1px dashed #dfe9e8; }
.variants li:first-child { border-top: 0; }
.variants a { color: var(--link); }
.variants .v-yen { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.multi-note { font-size: .7rem; font-weight: 400; color: var(--sub); white-space: nowrap; margin-left: -8px; cursor: help; }
.site-line { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
/* 「始め方」ボタン：サイト名（広告へ）と押し分けやすいよう、枠付きで高さを確保 */
.start-btn {
  display: inline-flex; align-items: center; white-space: nowrap;
  font-size: .8rem; font-weight: 400; color: var(--main-dark); text-decoration: none;
  border: 1px solid var(--main); border-radius: 40px; padding: 5px 16px; min-height: 34px; background: #fff;
}
.start-btn:hover { background: var(--main-thin); }
.sp-note { display: block; font-size: .7rem; color: var(--up); margin-top: 2px; }
/* PC：表が横に間延びしないよう列幅を決める */
@media (min-width: 521px) {
  table { table-layout: fixed; }
  th.rank, td.rank { width: 3.5em; }
  #ranking td:nth-child(2), thead th:nth-child(2) { width: 34%; }
  th.col-max, td.col-max { width: 16%; }
  th.col-start, td.col-start { width: 18%; }
}
/* 「お得な始め方」：PCは右端の列、スマホはサイト名の横 */
.start-inline { display: none; }
th.col-start, td.col-start { text-align: center; white-space: nowrap; padding-left: 12px; }
@media (max-width: 520px) {
  .start-btn { font-size: .64rem; padding: 2px 8px; min-height: 24px; }
  .col-max, .col-start { display: none; }
  .start-inline { display: inline-flex; }
  table { font-size: .88rem; table-layout: fixed; }
  th.rank, td.rank { width: 2.8em; }
  .page-title { font-size: 1.25rem; }
  th.num, td.num { width: 8.5em; }
  .yen-cell { white-space: normal; }
  .yen-cell .badge { display: table; margin: 2px 0 0 auto; }
  .top .yen { font-size: 1.3rem; }
  .top .label { white-space: nowrap; }
  .breakdown span { display: block; }
  .pc-inline { display: none; }
}

.chart-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-bottom: 6px; }
.ranges { display: flex; }
.ranges button {
  border: 1px solid var(--main); background: #fff; color: var(--main-dark); font-family: inherit; font-size: .75rem;
  padding: 2px 12px; cursor: pointer; margin-left: -1px;
}
.ranges button:first-child { border-radius: 4px 0 0 4px; margin-left: 0; }
.ranges button:last-child { border-radius: 0 4px 4px 0; }
.ranges button[aria-pressed="true"] { background: var(--main); color: #fff; }
.ranges button:disabled { border-color: var(--line); color: #c4c4c4; background: #fafafa; cursor: not-allowed; }
.chart-box { position: relative; height: 280px; }
.toggle { margin-top: 8px; font-size: .8rem; }
.toggle button { border: 0; background: none; color: var(--link); cursor: pointer; padding: 0; font-size: .8rem; font-family: inherit; }

.note { font-size: .8rem; color: #444; }
.note ul { padding-left: 1.2em; margin: 6px 16px 0; }
.note code { background: #f1f3f5; border-radius: 3px; padding: 0 4px; font-size: .95em; }
.article-link {
  display: block; width: fit-content; min-width: 280px; max-width: calc(100% - 32px); margin: 16px auto 0 !important; padding: .8em 2.5em; text-align: center;
  background: var(--main); color: #fff; font-weight: 700; text-decoration: none; border-radius: 40px;
  box-shadow: 0 2px 4px rgba(0,0,0,.12);
}
.article-link:hover { background: var(--main-dark); }
.article-link[hidden] { display: none; }

/* フッター（ブログと同じ黒帯） */
.site-footer { background: #000; color: #ddd; text-align: center; padding: 24px 16px; margin-top: 32px; font-size: .8rem; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-bottom: 10px; }
.site-footer a { color: #ddd; text-decoration: none; }
