:root {
  --diff-bg: #eaf2fc; --diff-mark: #ffe08a;
  --s0: #0b63c4; --s1: #b4520a; --s2: #1a7f37; --s3: #7a3fb4;
  --s0l: #7fb0e3; --s1l: #e0a878; --s2l: #86c79b; --s3l: #b79ada;
  --tip-bg: rgba(255, 255, 255, .86);
  --bg: #fff; --fg: #1a1a1a; --muted: #666; --line: #e3e3e3; --panel: #f6f7f8;
  --accent: #0b63c4; --good: #1a7f37; --good-bg: #eaf6ee; --warn: #b4520a; --warn-bg: #fff4e8;
  --chip: #eef1f4; --chip-on: #0b63c4; --chip-on-fg: #fff;
  --gold: #a67c00; --plat: #5a5f6a; --black: #222;
}
@media (prefers-color-scheme: dark) {
  :root {
    --diff-bg: #1c2a3a; --diff-mark: #6b5510;
    --s0: #6cb0ff; --s1: #f0a35a; --s2: #5fcf7e; --s3: #c39bf0;
    --s0l: #3f6d9e; --s1l: #96663a; --s2l: #3d8050; --s3l: #7a5f96;
    --tip-bg: rgba(18, 20, 22, .86);
    --bg: #121416; --fg: #e8e8e8; --muted: #a0a4aa; --line: #2b2f34; --panel: #1b1e22;
    --accent: #6cb0ff; --good: #5fcf7e; --good-bg: #17281c; --warn: #f0a35a; --warn-bg: #2e2216;
    --chip: #262a2f; --chip-on: #6cb0ff; --chip-on-fg: #0b0c0e;
    --gold: #e3b53a; --plat: #b5bac4; --black: #ddd;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif; }
a { color: var(--accent); }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
small { color: var(--muted); font-size: .85em; }
b { font-weight: 600; }

header.site { border-bottom: 1px solid var(--line); }
/* 「どこで使う」が増えて 5 項目になり、幅が足りないと各要素が内部で折り返していた
   （ロゴが「クレカ年間収／支」に割れる）。ロゴとナビは折り返さず、
   余りを引き受けるのはタグラインだけにして、入らなければ省略記号で切る。 */
header.site .wrap { display: flex; align-items: center; gap: 16px; height: 56px; }
/* ページの h1（24px）よりロゴが小さいとサイト名が負けるので、ほぼ同じ大きさにする。
   太さ 700 とわずかな字間で、h1 と並んでもロゴのほうが強く見える。 */
.logo { font-weight: 700; font-size: 23px; text-decoration: none; color: var(--fg); letter-spacing: .02em;
        display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; flex: 0 0 auto; }
/* ロゴマークは favicon と同じ図案。カードの絵は viewBox の上下に余白があり
   （縦 32 のうち 19 しか使っていない）、文字と同じ高さにすると小さく見える。
   1.6em にすると見えている部分が文字のふところと揃う。 */
.logomark { width: 1.6em; height: 1.6em; display: block; margin: -.2em 0; }
.tagline { margin: 0; font-size: 13px; color: var(--muted);
           flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* サイト名が和文 7 文字になり、タグライン＋ナビ 4 項目だと 900px でも収まらない。
   2 ペインが崩れる幅より前にタグラインを引っ込める */
@media (max-width: 1000px) { .tagline { display: none; } }
@media (max-width: 860px) { header.site nav { font-size: 13px; gap: 12px; } }
header.site nav { display: flex; gap: 16px; margin-left: auto; font-size: 14px; flex: 0 0 auto; }
header.site nav a { white-space: nowrap; }
header.site nav a { color: var(--fg); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
header.site nav a[aria-current] { border-color: var(--accent); }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
/* .wrap の padding とぶつかるので、要素セレクタではなく main.wrap で指定する
   （クラスのほうが詳細度が高く、上下の余白が効かなくなる） */
main.wrap { padding: 16px 16px 96px; }
footer.site { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; padding: 16px 0 32px; }
h1 { font-size: 24px; margin: 8px 0 12px; line-height: 1.3; }
h2 { font-size: 17px; margin: 0 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
h3 { font-size: 14px; margin: 12px 0 4px; color: var(--muted); }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.note { color: var(--muted); font-size: 14px; }

/* filters */
.filters { margin-bottom: 4px; }
/* 狭い画面では絞り込みだけで一画面が埋まるので app.js が畳む。開閉の見た目だけここで整える */
.filters-fold > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); list-style: none; }
.filters-fold > summary::-webkit-details-marker { display: none; }
.filters-fold > summary::before { content: "▸"; margin-right: 5px; color: var(--accent); }
.filters-fold[open] > summary::before { content: "▾"; }
.filters-fold[open] > summary { margin-bottom: 8px; }
.filters-fold .fcount { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--chip-on); color: var(--chip-on-fg); font-size: 11px; }
.filters-fold .fcount[hidden] { display: none; }
#q { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: 13px; padding: 4px 10px; border: 0; border-radius: 999px; background: var(--chip); color: var(--fg); cursor: pointer; }
.rail .chip { background: var(--bg); border: 1px solid var(--line); }
.rail .chip[aria-pressed="true"] { background: var(--chip-on); border-color: var(--chip-on); }
.chip[aria-pressed="true"] { background: var(--chip-on); color: var(--chip-on-fg); }
.count { font-size: 13px; color: var(--muted); margin: 0; }
button.link { font: inherit; font-size: 13px; background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; text-decoration: underline; }

/* list */
.card-list { list-style: none; margin: 0; padding: 0; }
/* 左の 3px は「持っている」の帯を出す場所。持っていない行でも幅を取っておかないと、チェックを入れるたびに一覧全体がずれる。 */
.card-row { display: flex; gap: 10px; padding: 14px 9px; border-bottom: 1px solid var(--line);
            border-left: 3px solid transparent; }
.card-row.owned { background: var(--good-bg); border-left-color: var(--good); }
.card-row.owned .head::after { content: "持っている"; font-size: 12px; padding: 1px 8px;
  border: 1px solid currentColor; border-radius: 4px; color: var(--good); }
.card-row[hidden] { display: none; }
/* 裸のチェックボックスだと何のためか分からないので、上に小さく見出しを置く */
.card-row .cmp { display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; }
.card-row .cmp span { font-size: 10px; line-height: 1; color: var(--muted); }
.card-row .cmp input { margin: 0; }
.card-row .body { flex: 1; min-width: 0; }
.card-row .head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.card-row .name { font-weight: 600; font-size: 17px; text-decoration: none; }
.card-row .name:hover { text-decoration: underline; }
/* 申し込みや最新条件の確認は公式サイトなので、一覧からも直接飛べるようにする */
.card-row .official { font-size: 12px; text-decoration: none; white-space: nowrap; }
.card-row .official::after { content: "↗"; margin-left: 2px; font-size: 10px; }
.card-row .official:hover { text-decoration: underline; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; color: var(--muted); margin: 4px 0; }
.meta b { color: var(--fg); }
/* 海外事務手数料はブランドと時期で変わるので、数字から本文の注意に飛ばす。
   ほかの meta と同じ色のまま、点線だけで「押せる」ことを示す */
.ovlink, .isslink { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--accent); }
.ovlink:hover, .isslink:hover { border-bottom-style: solid; }
.summary { margin: 4px 0; font-size: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag { font-size: 12px; padding: 1px 8px; border-radius: 4px; background: var(--chip); color: var(--muted); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
/* これまでの変更。日付を左にそろえて年表のように読ませる */
.history { list-style: none; padding: 0; margin: 0; }
.history > li { display: grid; grid-template-columns: 8.5em 1fr; gap: 4px 12px; padding: 7px 0;
  border-top: 1px solid var(--line); }
.history > li:first-child { border-top: 0; }
.hdate { color: var(--muted); font-weight: 400; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 480px) { .history > li { grid-template-columns: 1fr; } }
/* リボ払い専用のような、読まずに申し込むと損をする話。**還元率より先に目に入る**必要がある */
.alert { margin: 10px 0 0; padding: 10px 12px; border-radius: 8px; font-size: 14px; line-height: 1.7;
  background: var(--warn-bg); color: var(--fg); border: 1px solid var(--warn); }
.alert b { color: var(--warn); }
.rv { color: var(--warn); }
.card-row .tag.warn { background: var(--warn-bg); color: var(--warn); }
.grade { font-size: 12px; padding: 1px 8px; border-radius: 4px; border: 1px solid currentColor; color: var(--muted); }
.g-gold { color: var(--gold); } .g-platinum { color: var(--plat); } .g-black { color: var(--black); }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }

/* compare bar */
.cmp-bar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--panel); border-top: 1px solid var(--line); font-size: 14px; z-index: 10; }
.cmp-bar[hidden] { display: none; }
.cmp-bar span { flex: 1; }
.btn { display: inline-block; padding: 8px 16px; background: var(--accent); color: #fff; border-radius: 6px; text-decoration: none; font-weight: 600; }

/* detail */
.card-detail header .meta { align-items: center; }
.cmp-inline { font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.keyfacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 16px 0; padding: 0; }
.keyfacts div { background: var(--panel); border-radius: 8px; padding: 8px 12px; }
.keyfacts dt { font-size: 12px; color: var(--muted); }
.keyfacts dd { margin: 0; font-weight: 600; font-size: 17px; }
.sec { margin: 20px 0; }
.sec ul { margin: 4px 0; padding-left: 20px; }
.sec li b, .summary b { font-weight: 600; }  /* 本文中の強調は太くしすぎない */
.sec li { margin: 4px 0; }
.sec ul.good li, li.good { color: var(--good); }
.sec ul.caution li, li.caution { color: var(--warn); }
.sec ul.caution { background: var(--warn-bg); padding: 8px 8px 8px 28px; border-radius: 6px; }
li.warn { color: var(--warn); font-weight: 600; }
.sec.camp { background: var(--good-bg); padding: 10px 12px; border-radius: 8px; }
.sec.camp h2 { border: 0; margin-bottom: 4px; }
.src { font-size: 12px; margin-left: 4px; white-space: nowrap; }
.chk { font-size: 11px; color: var(--muted); margin-left: 4px; white-space: nowrap; }

/* compare table */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cmp-table { border-collapse: collapse; font-size: 14px; min-width: 100%; }
.cmp-table th, .cmp-table td { border: 1px solid var(--line); padding: 8px; vertical-align: top; text-align: left; min-width: 180px; }
.cmp-table th:first-child, .cmp-table td:first-child { position: sticky; left: 0; background: var(--panel); min-width: 110px; font-weight: 600; z-index: 1; }
.cmp-table thead th { background: var(--panel); }
.cmp-table ul { margin: 0; padding-left: 16px; }
.cmp-table .rm { font-size: 12px; font-weight: 400; }

@media (max-width: 600px) {
  /* 項目が 5 つになって 1 行に収まらないので、ロゴの下に回す。
     さらに折り返して 3 行になると見出しが押し下がるので、2 行目は横スクロールの 1 列にする */
  header.site .wrap { gap: 4px 12px; height: auto; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .tagline { display: none; }
  header.site nav { gap: 6px 12px; font-size: 13px; margin-left: 0; width: 100%;
                    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  /* 項目が 6 つあると 390px でも入りきらない。いちばん狭い端末では詰めて、
     それでも溢れる分は横スクロールで見せる（折り返すと見出しが押し下がるため） */
  @media (max-width: 430px) { header.site nav { gap: 6px 8px; font-size: 12px; } }
  @media (max-width: 400px) { header.site nav { gap: 6px 7px; font-size: 11.5px; } }
  header.site nav::-webkit-scrollbar { display: none; }
  header.site nav a { white-space: nowrap; }
  .card-row .name { font-size: 16px; }
  .cmp-table th, .cmp-table td { min-width: 150px; }
}

/* card faces */
.face { display: block; aspect-ratio: 1.586; object-fit: contain; border-radius: 6px; background: var(--panel); }
.face.sm { width: 96px; }
.face.lg { width: 100%; max-width: 280px; }
.face-ph { position: relative; overflow: hidden; padding: 6px 8px; color: #fff; background: linear-gradient(135deg, #3a4a63, #1f2a3a); font-size: 10px; line-height: 1.3; text-align: left; }
.face-ph.g-gold { background: linear-gradient(135deg, #c9a437, #7a5d12); }
.face-ph.g-platinum { background: linear-gradient(135deg, #b9bec8, #5d626c); }
.face-ph.g-black { background: linear-gradient(135deg, #3a3a3a, #0a0a0a); }
.face-ph b { display: block; font-size: 11px; }
.face-ph i { font-style: normal; display: block; opacity: .9; overflow: hidden; }
.face.lg.face-ph { font-size: 14px; padding: 12px 14px; } .face.lg.face-ph b { font-size: 16px; }
.card-row .thumb { flex: 0 0 auto; }
.detail-head { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.detail-face { flex: 0 0 auto; width: 100%; max-width: 280px; }
.detail-head > div:last-child { flex: 1 1 300px; min-width: 0; }
.cmp-table .face { width: 120px; margin-bottom: 6px; }
@media (max-width: 600px) {
  .face.sm { width: 72px; }
  .detail-face { max-width: 200px; }
}

/* ---- two-pane layout (PC): left rail aggregates search, filters and the compare list ---- */
/* 左ペインは下地の内側に 14px の余白を持つので、その分だけ列を広げてある */
.two-pane { display: grid; grid-template-columns: 288px minmax(0, 1fr); gap: 28px; align-items: start; }
.rail { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.rail > * + * { margin-top: 16px; }
/* 下地の上に置くので、枠だけの箱は背景を白に戻して浮かせる */
.rail .tray, .rail .keyfacts, .rail .netbox { background: var(--bg); }
.pane-main { min-width: 0; }
.fgroup + .fgroup { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.flabel { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.searchbox { margin: 0; }
.listhead { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.listhead .count { margin-right: auto; }
.listhead .updated { margin-left: 10px; }
.sortbox { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.sortbox select { font-size: 14px; }
select#sort { width: auto; max-width: 15em; }
.tray { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.tray .count { margin-bottom: 8px; }
.tray ul { list-style: none; margin: 0 0 10px; padding: 0; }
.tray li { display: flex; gap: 6px; align-items: baseline; font-size: 13px; line-height: 1.5; padding: 3px 0; }
.tray li + li { border-top: 1px solid var(--line); }
.tray-rm { flex: 0 0 auto; text-decoration: none; font-size: 15px; line-height: 1; }
/* 比較リストは左ペインの先頭に出る。チェックを入れた直後に気づけるよう枠を強めにする */
#cmp-tray { border-color: var(--accent); }
.tray-note { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.linklist { list-style: none; margin: 0 0 8px; padding: 0; font-size: 14px; }
.linklist li { padding: 3px 0; }
.btn.block { display: block; text-align: center; padding: 9px 12px; font-size: 14px; }
.btn.disabled { pointer-events: none; opacity: .45; }
.toc ul { list-style: none; margin: 0; padding: 0; font-size: 13px; border-left: 2px solid var(--line); }
.toc li a { display: block; padding: 4px 10px; text-decoration: none; }
.toc li a:hover { background: var(--panel); }
.prose { max-width: 720px; }
.lead { font-size: 15px; margin-top: 0; }
.page-head { margin-bottom: 16px; }
.page-head .lead { max-width: 780px; margin-bottom: 0; }
.page-head h1 { margin-bottom: 6px; }

/* rail variants of existing blocks */
.rail .detail-face { max-width: none; width: 100%; }
.face-note { font-size: 11px; color: var(--muted); margin: 6px 0 0; line-height: 1.5; }
.rail .face.lg { max-width: 100%; }
.rail .keyfacts { display: block; margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.rail .keyfacts div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; background: none; border-radius: 0; padding: 7px 11px; }
.rail .keyfacts div + div { border-top: 1px solid var(--line); }
.rail .keyfacts dt { flex: 0 0 auto; }
.rail .keyfacts dd { font-size: 14px; text-align: right; }
.rail .cmp-inline { font-size: 13px; padding: 0 2px; }

@media (max-width: 900px) {
  .two-pane { display: block; }
  .rail { position: static; max-height: none; overflow: visible; margin-bottom: 16px; padding: 12px; }
  .rail > * + * { margin-top: 12px; }
  /* 狭い画面では画面下の固定バーが同じ役目をするので、左ペインの比較リストは出さない */
  #cmp-tray { display: none; }
  .toc, .rail .keyfacts { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
  .rail .detail-face { max-width: 220px; }
}
@media (min-width: 901px) {
  .cmp-bar { display: none; }
}

/* ---- sorting and the assumptions behind the annual net ---- */
select#sort { width: 100%; font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); }
.netcard .flabel { margin-bottom: 6px; }
/* 利用額と収支のグラフ。SVG は app.js が組み立てる */
.chartbox { margin: 0; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart line { stroke-width: 1; }
.chart .ax { stroke: var(--line); }
.chart .zero { stroke: var(--muted); stroke-dasharray: 3 3; }
.chart .now { stroke: var(--accent); stroke-dasharray: 2 3; opacity: .7; }
.chart text { fill: var(--muted); font-size: 10px; }
.chart polyline { fill: none; stroke-width: 2; stroke-linejoin: round; }
/* 線は薄め、凡例とホバーの点は濃いままにして読めるようにする */
.chart polyline.s0 { stroke: var(--s0l); }
.chart polyline.s1 { stroke: var(--s1l); }
.chart polyline.s2 { stroke: var(--s2l); }
.chart polyline.s3 { stroke: var(--s3l); }
.key.s0, b.s0, .dot.s0 { color: var(--s0); fill: var(--s0); }
.key.s1, b.s1, .dot.s1 { color: var(--s1); fill: var(--s1); }
.key.s2, b.s2, .dot.s2 { color: var(--s2); fill: var(--s2); }
.key.s3, b.s3, .dot.s3 { color: var(--s3); fill: var(--s3); }
.chart .dot { stroke: var(--bg); stroke-width: 1.5; }
/* SVG の要素には UA スタイルの [hidden] が効かないので自分で消す */
.chart [hidden] { display: none; }
.chart .hover { stroke: var(--muted); stroke-width: 1; }
.chart-wrap { position: relative; }
/* グラフに重なるので半透明にする。線が透けて見えたほうが読みやすい */
.chart-tip { position: absolute; top: 4px; pointer-events: none; background: var(--tip-bg); border: 1px solid var(--line);
  border-radius: 6px; padding: 5px 8px; font-size: 12px; line-height: 1.5; white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,0,0,.10); backdrop-filter: blur(2px); }
.chart-tip[hidden] { display: none; }
.chart-tip b { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.chart-tip .row { display: block; }
.chart-tip .key::before { content: "—"; margin-right: 4px; }
.chart-note { font-size: 12px; color: var(--muted); margin: 6px 0 0; line-height: 1.6; }
.chart-note .key { margin-right: 12px; font-weight: 600; }
.chart-note .key::before { content: "—"; margin-right: 4px; }
.chart { touch-action: pan-y; }

/* 免責事項。読み飛ばされる前提の文章なので、囲って控えめにする */
.disclaimer { border: 1px solid var(--line); border-radius: 8px; padding: 2px 14px 10px; background: var(--panel); }
.disclaimer h2 { font-size: 15px; }
.disclaimer li { font-size: 13px; }
/* 前提のうち、使う人が限られるものを入れる折りたたみ */
.wpanel { font-size: 13px; }
.wpanel summary { cursor: pointer; color: var(--accent); }
/* 既定と違う前提が畳まれているときの印。勝手に開かずに、変えてあることだけ伝える */
.wmark { margin-left: 6px; padding: 0 5px; border-radius: 8px;
  background: var(--accent); color: #fff; font-size: 10px; vertical-align: 1px; }
.wmark[hidden] { display: none; }
.wrow { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 6px; margin-top: 8px; }
.wrow label { font-size: 12px; color: var(--muted); }
.wrow output { font-size: 12px; font-variant-numeric: tabular-nums; }
.wrow input[type="range"] { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); }

/* 年間の収支の内訳 */
.netbox { border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; }
.nb-head { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.netparts { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.netparts li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.netparts li[hidden] { display: none; }  /* display:flex overrides the UA rule for [hidden] */
.netparts li span { color: var(--muted); }
.netparts li b { font-variant-numeric: tabular-nums; font-weight: 500; }
.netparts li.sum { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 5px; }
.netparts li.sum span { color: var(--fg); font-weight: 600; }
.netparts li.sum b { font-size: 16px; font-weight: 700; }
.net-rate { margin-left: 6px; font-size: 11px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.nb-note { font-size: 11px; color: var(--muted); margin: 6px 0 0; }

/* 収支の前提（並び替えのすぐ下） */
.assump { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.spendbox { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.spendbox input[type="range"] { width: 190px; accent-color: var(--accent); }
.spendbox output { min-width: 5.5em; font-size: 14px; color: var(--fg); font-variant-numeric: tabular-nums; }
.spendbox.chk { gap: 5px; cursor: pointer; }
.spendbox.chk input { width: 15px; height: 15px; }
.spendbox select { width: auto; font: inherit; font-size: 14px; padding: 4px 8px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--bg); color: var(--fg); }
.assump .assump-note { flex: 1 1 100%; margin-top: 0; }
/* カードのページでは左ペインに入るので、横並びをやめて 1 行 1 項目にする */
.railprefs { margin-top: 10px; }
.railprefs .assump { display: block; padding: 0; border: 0; }
.railprefs .spendbox { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 7px; font-size: 12px; }
.railprefs .spendbox.chk { justify-content: flex-start; align-items: flex-start; line-height: 1.4; }
.railprefs .wpanel { margin-top: 9px; }
.railprefs .tray-note { font-size: 11px; }
.spendbox.num input[type="number"] { width: 4.6em; font: inherit; font-size: 14px; padding: 4px 6px; text-align: right;
  border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); }
.spendbox.num .unit { font-size: 13px; color: var(--muted); }
/* min-width: auto のままだと、中の「対象店での還元率（通常ポイントを含む…）」の
   ラベルと数値入力が縮まず、**パネルを開いたときだけ横にはみ出す**（2026-09-22 に気づいた）。
   狭い画面では details を開くので実際に踏む */
.assump .wpanel { flex: 1 1 100%; min-width: 0; max-width: 100%; }
.assump .wpanel .spendbox { flex-wrap: wrap; }
.assump .wpanel summary { font-size: 12px; }
.assump .wpanel .tray-note { max-width: 62em; }

/* 一覧の「収支」はカードの基本情報ではなく計算値なので、見た目を分ける */
.netline { display: inline-block; margin: 6px 0 0; background: var(--panel); border-radius: 6px; font-size: 12px; color: var(--muted); }
.netline > summary { display: flex; align-items: baseline; gap: 8px; padding: 3px 9px; cursor: pointer;
  list-style: none; border-radius: 6px; }
.netline > summary::-webkit-details-marker { display: none; }
/* 開けることが分かるように、既定のマーカーではなく回転する矢印を出す */
.netline > summary::after { content: "▾"; margin-left: 2px; font-size: 13px; line-height: 1; color: var(--accent);
  transition: transform .15s ease; }
.netline[open] > summary::after { transform: rotate(180deg); }
.netline > summary:hover { background: var(--chip); }
.netline > summary:hover::after { color: var(--fg); }
/* 「+20,000円相当」の途中で折り返さない。スマホの狭い幅で「相／当」に割れていた。
   b ごと nowrap にすると「実質+2.0%」まで同じ行に固定されて横にはみ出すので、金額だけ包む */
.net-val > .nv { white-space: nowrap; }
/* 320px のような極端に狭い画面では、固定すると横スクロールが出るので解除する */
@media (max-width: 340px) { .net-val > .nv { white-space: normal; } }
.netline b { font-size: 14px; color: var(--fg); font-variant-numeric: tabular-nums; }
.netline .netparts { padding: 2px 9px 7px 22px; min-width: 15em; }
.netline .netparts b { font-size: 12px; font-weight: 500; }
.netline .netparts li.sum b { font-size: 14px; font-weight: 700; }

/* 持っているカード（デッキ） */
.deck-entry { margin: 10px 2px 0; font-size: 13px; }
.deckadd { position: relative; margin: 12px 0; max-width: 420px; }
.deckadd input { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); }
.deck-sug { position: absolute; z-index: 5; left: 0; right: 0; margin: 2px 0 0; padding: 4px; list-style: none; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.deck-sug[hidden] { display: none; }
.deck-sug button { display: flex; justify-content: space-between; gap: 12px; width: 100%; text-align: left; padding: 7px 8px; text-decoration: none; }
.deck-sug button:hover { background: var(--panel); }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin: 16px 0; }
.shelf[hidden] { display: none; }
.shelf-card { margin: 0; }
.shelf-card img { width: 100%; height: auto; border-radius: 8px; display: block; }
.shelf-card figcaption { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-top: 7px; font-size: 15px; }
.shelf-card figcaption .deck-rm { font-size: 13px; }
.shelf-card figcaption .deck-rm { white-space: nowrap; flex: 0 0 auto; }
.deck-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 16px 0; }
.deck-actions[hidden] { display: none; }
#deck-sum[hidden], #deck-assump[hidden], #deck-empty[hidden] { display: none; }

@media (max-width: 600px) {
  .shelf { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  /* 2 列だと名前と「外す」が 1 行に並ばないので、縦に積む */
  .shelf-card figcaption { display: block; }
  .shelf-card figcaption .deck-rm { display: block; margin-top: 2px; }
}

/* 共有されたリンクを見ているときの断り書き。自分の保存は変えていない、と分かるように */
.viewing { margin: 10px 0; padding: 8px 12px; border-radius: 8px; background: var(--warn-bg); color: var(--warn); font-size: 13px; }
.viewing[hidden] { display: none; }
.viewing b { color: inherit; }
.viewing button.link { color: inherit; margin-left: 8px; }
.viewing a.link { color: inherit; margin-left: 8px; text-decoration: underline; font-size: 13px; }
.deckadd[hidden], #deck-clear[hidden] { display: none; }

/* 付帯保険の条件（自動付帯 / 利用付帯）。本文の頭に小さく出す */
.att { font-size: .72rem; margin: 0 .3em; padding: .05em .4em; border-radius: 3px;
       border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.att.a-auto, .att.a-partial { border-color: var(--good); color: var(--good); }

/* カード名のコピー。見出しの一部なので、文字サイズに合わせて小さく添える */
.copy { margin-left: .4em; padding: 2px; vertical-align: middle; background: none; cursor: pointer;
        border: 0; color: var(--muted); line-height: 0; border-radius: 4px; }
.copy svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.4; }
.copy:hover { color: var(--accent); background: var(--chip); }
.copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.copy.done { color: var(--good); }
.copy.done svg { display: none; }
.copy.done::after { content: "コピーしました"; font-size: .55em; line-height: 1; white-space: nowrap; }

/* 一覧の順位。既定は収支順なので、上から何番目かをそのまま出す。
   絞り込むと母数が変わるので、そのときは絞り込んだ中での順番になる。 */
.card-row .lead { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.card-row .rank { font-size: 20px; font-weight: 700; color: var(--muted);
                  line-height: 1.1; font-variant-numeric: tabular-nums; min-width: 2.2em; text-align: center; }
/* 数字だけだと順位だと気づきにくいので「位」を足す。JS は数字だけを書き換えるので、
   文字は CSS 側で付ける（renumber() を触らずに済む） */
.card-row .rank::after { content: "位"; font-size: .55em; font-weight: 400; margin-left: 1px; }
@media (max-width: 900px) { .card-row .rank { font-size: 16px; min-width: 2.4em; } }

/* デッキの年会費の内訳 */
.deckfee { width: 100%; border-collapse: collapse; font-size: 14px; }
.deckfee th, .deckfee td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.deckfee thead th { font-size: 12px; color: var(--muted); font-weight: 400; white-space: nowrap; }
.deckfee .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.deckfee .cut { color: var(--good); }
.deckfee tfoot th, .deckfee tfoot td { border-top: 2px solid var(--line); border-bottom: 0;
                                       font-weight: 700; font-size: 15px; }

/* どこで使うか（/where/） */
.wherehead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 12px 0; padding: 10px 12px; background: var(--panel); border-radius: 8px; }
.wherenav { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; margin-bottom: 8px; }
.merchant { margin: 0 0 18px; }
.merchant h3 { font-size: 15px; color: var(--fg); margin: 10px 0 4px; }
.mlist { list-style: none; margin: 0; padding: 0; }
.mrow { display: grid; grid-template-columns: 62px 1fr; gap: 2px 10px; padding: 7px 0; border-top: 1px solid var(--line); align-items: baseline; }
.mrow[hidden] { display: none; }
/* 率は横並びの左に固定幅で置き、店ごとに数字の位置がそろうようにする */
.mrate { font-size: 17px; color: var(--good); text-align: right; }
.mname { font-weight: 600; text-decoration: none; }
.mname:hover { text-decoration: underline; }
.miss { font-size: 13px; color: var(--muted); margin-left: 8px; }
.mnote { grid-column: 2; font-size: 13px; color: var(--muted); margin-top: 2px; }
@media (max-width: 600px) { .mrow { grid-template-columns: 54px 1fr; } .mrate { font-size: 15px; } }
/* その店での上乗せが無いカードの行。基本還元なので色を分ける */
/* 「確認できていません」は無料と見分けがつくよう薄く出す */
.keyfacts dd.unknown { color: var(--muted); font-weight: normal; }
/* /where/ の検索とジャンル */
.wherehead { display: block; }
#where-q { width: 100%; font: inherit; padding: 10px 12px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); }
.wcats { margin-bottom: 10px; }
/* 入力欄の見出しが長い（「対象店での還元率（これより率の高いカードはそのまま）」）ので、
   狭い画面では折り返させる。nowrap のままだと入力欄が画面の外に押し出されて横スクロールが出る */
@media (max-width: 600px) {
  .wherehead .spendbox { white-space: normal; flex-wrap: wrap; }
  .wherehead .spendbox > small { flex-basis: 100%; }
}
.wsec[hidden], .merchant[hidden] { display: none; }
#where-note:empty { display: none; }
/* 既定は店ごとに 1 行。条件の文は開いたときだけ出す（縦に長くなりすぎるため） */
.merchant .mnote { display: none; }
.merchant.open .mnote { display: block; }
.merchant { margin-bottom: 10px; }
.merchant h3 { margin: 8px 0 0; }
.mrow { padding: 5px 0; }
.mmore { margin-left: 72px; font-size: 12px; }
.wabout > summary { cursor: pointer; font-size: 13px; color: var(--accent); margin-bottom: 8px; }
.wabout .note { margin-top: 4px; }
/* 条件を積むと上がるカードは、無条件の率の下に最大値を小さく添える */
/* 名前と「最大◯%」は 1 つのグリッド項目にまとめる。別々にすると、
   折り返したときに「最大◯%」が 1 列目（率の下）に落ちて左にはみ出して見える */
.mline { grid-column: 2; min-width: 0; }
.mmax { font-size: 11px; color: var(--muted); margin-left: 6px; white-space: nowrap; }
/* 店名・率・カード名・展開リンクを 1 行に並べる。畳んだ状態で 1 店 1 行にするのが狙い */
.merchant { display: grid; grid-template-columns: minmax(5.5em, 8.5em) 1fr auto;
            align-items: baseline; column-gap: 10px;
            border-top: 1px solid var(--line); padding: 5px 0; }
.merchant h3 { margin: 0; grid-column: 1; font-size: 14px; color: var(--fg); }
.mlist { grid-column: 2; min-width: 0; }
.merchant .mmore { grid-column: 3; margin: 0; font-size: 12px; white-space: nowrap; }
/* 行の中は「率／カード名／（開いたら条件）」。条件だけ次の行に落とす */
.mrow { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 2px 0; border-top: 0; }
.mrate { flex: 0 0 auto; width: 3.2em; text-align: right; }
/* flex-basis を auto にすると、縮む前に次の行へ送られてしまう。0 にして同じ行に留める */
.mline { flex: 1 1 0%; min-width: 0; }
.mnote { flex-basis: 100%; }
.mrow + .mrow { border-top: 1px solid var(--line); }
.mmax[hidden] { display: none; }
/* 1 店 1 行を保証する。カード名は入らなければ省略記号で切る（全体はカードのページで見られる） */
.mline { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.merchant.open .mline { white-space: normal; overflow: visible; }
@media (max-width: 480px) {
  .merchant { grid-template-columns: minmax(4.5em, 6.5em) 1fr auto; column-gap: 6px; }
  .merchant h3 { font-size: 13px; }
  .merchant .mmore { font-size: 11px; }
  .mrate { width: 2.8em; }
}

/* ---------- キャンペーン一覧（/campaigns/） ---------- */
.camphead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 12px 0;
  padding: 10px 12px; background: var(--panel); border-radius: 8px; }
.camplist { list-style: none; margin: 6px 0 0; padding: 0; }
/* 日付が 2 つ（追加日・終了日）あるので、見出しの行を出して取り違えを防ぐ */
.camphdr { display: grid; grid-template-columns: 6.4em 7.6em 1fr; gap: 2px 10px; padding: 6px 0 4px;
  font-size: 12px; color: var(--muted); border-bottom: 2px solid var(--line); }
.camphdr small { display: block; font-size: 10px; font-weight: 400; }
.camprow { display: grid; grid-template-columns: 6.4em 7.6em 1fr; gap: 2px 10px; padding: 8px 0;
  border-top: 1px solid var(--line); align-items: baseline; }
.campadd { font-size: 13px; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* すぐ上の行と同じ追加日は出さない。まとめて足した日は同じ日付が延々と並ぶため */
.campadd.rep { visibility: hidden; }
.camprow[hidden] { display: none; }
.campdate { font-size: 14px; font-variant-numeric: tabular-nums; color: var(--fg); white-space: nowrap; }
/* 終了日に色は付けない。近いものを青くしていたが、**終了が近いことは並び順で分かる**うえ、
   リンクと同じ色なので押せるものに見えていた（2026-09-22 にオーナーが判断） */
.campdate.none { color: var(--muted); font-weight: 400; }
/* 終了したものは記録として残すだけなので、薄く出して現役と見分けられるようにする */
.campdate.over { color: var(--muted); font-weight: 400; }
.campdate.over small { display: block; font-size: 10px; }
.camprow.past .campcard, .camprow.past .camptext { color: var(--muted); }
/* 同じ本文のキャンペーンは 1 行にまとめてあるので、カード名が複数並ぶ */
.campcards { margin-right: 8px; }
.campcard { font-weight: 600; text-decoration: none; }
.campsep { color: var(--muted); margin: 0 1px; }
/* 目玉の額。大きいものほど濃く出して、大型と小粒を一目で分ける */
.campsize { display: inline-block; margin-right: 8px; padding: 1px 7px; border-radius: 10px;
  font-size: 12px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.campsize.s-big { background: var(--accent); color: #fff; }
.campsize.s-mid { background: var(--chip); color: var(--fg); }
/* 抽選・先着。**もらえるとは限らない**ことを額より先に見せる。
   額と同じ青で塗ると「良いこと」に見えてしまうので、注意の色（--warn）で塗る。
   枠線だけの控えめな印にしていたが目に入らなかった（2026-09-22 にオーナーが判断） */
.campchance { display: inline-block; font-size: 11px; font-weight: 700; line-height: 1.7;
  padding: 0 7px; margin-right: 5px; border-radius: 10px;
  background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn);
  white-space: nowrap; }
/* 終了したものは全体を薄くしているので、この印も合わせて引く */
.camprow.past .campchance { background: transparent; color: var(--muted); border-color: var(--line); }
.campsize.s-small { background: transparent; color: var(--muted); padding-left: 0; font-weight: 400; }
.camprow.past .campsize.s-big { background: var(--chip); color: var(--muted); }
/* カードのページのキャンペーン。大きいものは左に色の帯を付けて先に目に入るようにする */
.camplist-card { list-style: none; padding: 0; }
.camplist-card > li { padding: 6px 0 6px 10px; border-left: 3px solid transparent; margin-bottom: 4px; }
.camplist-card > li.c-big { border-left-color: var(--accent); background: var(--panel); border-radius: 0 6px 6px 0; }
.camplist-card > li.c-mid { border-left-color: var(--line); }
.campuntil { color: var(--muted); white-space: nowrap; }
/* 終了が迫っているもの。**日数は読んでいる人の今日で数える**（app.js の markSoon）。
   ビルド時に書くと、キャッシュされたページで日付が嘘になる */
.soonmark { display: inline-block; margin-left: 6px; font-size: 12px; color: var(--warn); white-space: nowrap; }
.camprow .soonmark { display: block; margin: 2px 0 0; }
.campcard:hover { text-decoration: underline; }
.camptext { color: var(--muted); }
.campchips { margin: 2px 0; }
.cmphead { align-items: center; margin: 10px 0; }
/* 比較表の箇条書き。**共通の項目は薄く、そのカードにしか無い項目は色を敷く**。
   行ごと畳む「違うところだけ」では、重なりの多い行（還元率が上がる条件など）の
   どこが違うのかが見えないため（2026-09-22 に追加） */
.cmp-table li.same { color: var(--muted); }
/* 箇条書きでない行で、そのカードだけ違うセル */
.cmp-table td.diffcell { background: var(--diff-bg); }
.cmp-table li.diff { background: var(--diff-bg); border-radius: 4px; padding: 1px 5px; margin-left: -5px; }
/* 1 文字しか違わない項目は、その 1 文字だけ塗る。**項目の背景（青）とは違う色**にする。
   青の濃淡だと見分けがつかなかった（2026-09-22 にオーナーが判断）。
   注意の琥珀（--warn）とは枠線と文字色の扱いが違うので紛れない */
.cmp-table mark.dc { background: var(--diff-mark); color: inherit; border-radius: 3px; padding: 0 2px; }
#cmp-legend .lgd { display: inline-block; width: 12px; height: 12px; border-radius: 3px;
  background: var(--diff-bg); border: 1px solid var(--line); margin-right: 5px; vertical-align: -2px; }
.cmphead .count { margin: 0; }
.camphead select { font: inherit; font-size: 14px; padding: 4px 8px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--bg); color: var(--fg); }
.camprow .src { margin-left: 6px; }
@media (max-width: 600px) {
  .camphdr, .camprow { grid-template-columns: 5.2em 6.2em 1fr; gap: 2px 6px; }
  /* 補足まで出すと見出しが 3 行に折り返して読みにくい。列名だけにする */
  .camphdr small { display: none; }
  .campadd { font-size: 12px; }
  .campbody { display: block; grid-column: 1 / -1; }
  .camphdr span:last-child { grid-column: 1 / -1; }
}

/* ---------- 改定カレンダー（/changes/） ---------- */
/* 日付・カード名・本文の 3 段。日付の列をそろえると「いつ何が起きるか」が縦に読める */
.changelist { list-style: none; margin: 10px 0 0; padding: 0; }
.changelist li { display: grid; grid-template-columns: 8.5em 1fr; gap: 2px 12px;
                 padding: 8px 0; border-top: 1px solid var(--line); align-items: baseline; }
.changelist .cdate { font-size: 13px; color: var(--muted); font-weight: 400; white-space: nowrap;
                     font-variant-numeric: tabular-nums; }
.changelist .cname { font-weight: 600; text-decoration: none; }
.changelist .cname:hover { text-decoration: underline; }
.changelist .ctext { display: block; font-size: 14px; margin-top: 2px; }
/* 予定日を過ぎたもの。まだ公式で確かめていないだけなので消さずに薄く出す */
.changelist li.due .cdate { color: var(--warn, #b4520a); }
@media (max-width: 600px) {
  .changelist li { grid-template-columns: 1fr; }
  .changelist .cdate { font-size: 12px; }
}

/* このカードが強い店（/where/ の逆引き） */
.storelist { list-style: none; margin: 0; padding: 0; }
.storelist li { display: grid; grid-template-columns: 5.4em 1fr; gap: 2px 12px; padding: 7px 0;
                border-top: 1px solid var(--line); align-items: baseline; }
.storelist li:first-child { border-top: 0; }
.srate { font-size: 16px; color: var(--good); text-align: right; }
.srate small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.sname { font-weight: 600; }
.snote { grid-column: 2; font-size: 13px; color: var(--muted); }
/* 年会費のもとが取れる利用額。グラフのすぐ下に太字で 1 行 */
.bepoint { font-size: 14px; color: var(--fg); margin-top: 6px; }
@media (max-width: 480px) { .storelist li { grid-template-columns: 4.6em 1fr; } }
/* 比較表の長い箇条書きを畳むボタン */
.cmp-table .morefacts { display: inline-block; margin-top: 4px; font-size: 12px; }
.cmp-table li[hidden] { display: none; }
