.sbdp-filter-wrap { margin-bottom: 16px; }
.sbdp-search-box { margin-bottom: 12px; }
.sbdp-filter-search { width: 100%; max-width: 400px; padding: 10px 14px; border: 1px solid #ccc; border-radius: 6px; font-size: 1em; box-shadow: inset 0 1px 3px rgba(0,0,0,0.05); transition: border-color 0.2s; }
.sbdp-filter-search:focus { border-color: #0068b7; outline: none; }
.sbdp-category-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 8px; }
.sbdp-filter-tab { flex: 0 0 auto; background: #fff; border: 1px solid #0068b7; color: #0068b7; border-radius: 20px; padding: 6px 16px; font-size: 0.9em; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.sbdp-filter-tab.active { background: #0068b7; color: #fff; }


.sbdp-filter-toolbar { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.sbdp-filter-count { font-size: 0.85em; color: #888; }
.sbdp-filter-reset { padding: 6px 12px; border: 1px solid #ccc; border-radius: 4px; font-size: 0.85em; color: #555; background: #fff; cursor: pointer; transition: all 0.15s; }
.sbdp-filter-reset:hover { border-color: #0068b7; color: #0068b7; }
.sbdp-sortable { cursor: pointer; user-select: none; }
.sbdp-sortable:hover { opacity: 0.8; }
.sbdp-sort-indicator { font-size: 0.8em; margin-left: 2px; }

.sbdp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; max-width: 1000px; margin: 0 auto; }
@media (max-width: 768px) { .sbdp-grid { grid-template-columns: 1fr; gap: 16px; } }
.sbdp-card { border-radius: 12px; overflow: hidden; transition: box-shadow 0.2s; border: 1px solid #eaeaea; }
.sbdp-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.sbdp-card-image { padding: 20px; text-align: center; min-height: 140px; display: flex; align-items: center; justify-content: center; }
.sbdp-card-image img { max-width: 100%; max-height: 160px; height: auto; object-fit: contain; margin: 0 auto; display: block; }
.sbdp-no-image { color: #aaa; font-size: 0.9em; }
.sbdp-card-body { padding: 16px; }
.sbdp-card-name { display: block; font-size: 1.1em; font-weight: 700; margin: 0 0 4px; color: #333; }
.sbdp-card-release { font-size: 0.85em; color: #888; margin: 0 0 12px; }
.sbdp-selector { margin: 10px 0; }
.sbdp-selector-label { display: block; font-size: 0.9em; font-weight: 700; color: #555; margin-bottom: 6px; }
.sbdp-selector-options { display: flex; flex-wrap: nowrap; gap: 6px; width: 100%; }
@media (max-width: 600px) {
    .sbdp-selector-options { flex-wrap: wrap; }
    .sbdp-radio-btn { flex: 1 1 calc(50% - 6px); }
}
.sbdp-radio-btn { display: flex; flex: 1 1 0; min-width: 0; margin: 0; cursor: pointer; }
.sbdp-radio-btn input { position: absolute; opacity: 0; width: 0; height: 0; }
.sbdp-radio-btn span { width: 100%; display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px 4px; border: 1px solid #ccc; border-radius: 4px; font-size: 0.85em; color: #555; background: #fff; transition: all 0.15s; line-height: 1.2; box-sizing: border-box; }
.sbdp-radio-btn--active span, .sbdp-radio-btn input:checked + span { border-color: #0068b7; background: #e8f1fa; color: #0068b7; font-weight: 700; }
/* 条件を満たさない契約方法。並べはするが選ばせない */
.sbdp-radio-btn--disabled { cursor: not-allowed; }
.sbdp-radio-btn--disabled span { background: #f5f5f5; border-color: #e0e0e0; color: #b0b0b0; }
.sbdp-prices { margin-top: 12px; }
.sbdp-section-title { font-size: 1em; font-weight: 700; color: #333; padding: 8px 0 4px; border-bottom: 2px solid #0068b7; margin-bottom: 4px; }
.sbdp-section-title small { font-weight: 400; color: #888; font-size: 0.85em; }
.sbdp-price-table { margin-bottom: 8px; }
.sbdp-price-row { display: flex; justify-content: space-between; align-items: baseline; padding: 3px 0; font-size: 1em; }
.sbdp-price-row.sbdp-sub { font-size: 0.9em; color: #666; padding-top: 6px; }
.sbdp-price-row.sbdp-sub-detail { font-size: 0.9em; color: #666; padding-left: 8px; }
.sbdp-price-row.sbdp-price-main { padding: 4px 0; }
.sbdp-price-label { color: #555; }
.sbdp-price-value { font-weight: 600; color: #333; text-align: right; }
.sbdp-price-highlight { color: #e74c3c; font-size: 1.2em; font-weight: 700; }
.sbdp-tokuten-block { margin-top: 8px; padding: 8px; border-radius: 8px; }
.sbdp-detail-link { display: block; text-align: center; padding: 10px; margin-top: 12px; color: #0068b7; font-size: 1em; font-weight: 700; text-decoration: none; border: 1px solid #0068b7; border-radius: 8px; transition: all 0.15s; }
.sbdp-detail-link:hover { background: #0068b7; color: #fff; }

.sbdp-list-wrap { max-width: 800px; margin: 0 auto; }
.sbdp-list-selector { margin-bottom: 16px; }
.sbdp-list-table { width: 100%; border-collapse: collapse; font-size: inherit; }
.sbdp-list-table th, .sbdp-list-table td { padding: 12px 10px; vertical-align: middle; }
.sbdp-list-table thead th { text-align: center; }
.sbdp-list-table tbody th, .sbdp-list-table tbody td { text-align: left; }
.sbdp-list-table th:first-child { min-width: 120px; word-break: normal; overflow-wrap: break-word; }
.sbdp-list-table td:nth-child(2) { white-space: nowrap; }

.sbdp-col-desktop { display: table-cell; }
.sbdp-row-mobile { display: none !important; }
.sbdp-toggle-btn { display: none; }

.sbdp-tokuten-a-content, .sbdp-tokuten-b-content { text-align: center; }
.sbdp-list-total { font-weight: 700; color: #e74c3c; margin-bottom: 8px; text-align: center; white-space: nowrap; font-size: 1.2em; }
.sbdp-yen { font-size: 0.8em; font-weight: normal; margin-left: 2px; }
.sbdp-list-breakdown { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; align-items: center; }
.sbdp-bd-row { display: block; text-align: center; }
.sbdp-bd-monthly { color: #666; font-size: 0.85em; }
.sbdp-bd-monthly strong { color: #e74c3c; font-size: 1.1em; }
.sbdp-bd-fee { color: #888; font-size: 0.8em; }

@media (max-width: 600px) {
    .sbdp-list-table th, .sbdp-list-table td { padding: 10px 6px; }
    
    .sbdp-col-desktop { display: none !important; }
    
    .sbdp-toggle-btn { display: block; width: fit-content; background: #fff; border: 1px solid #0068b7; border-radius: 4px; color: #0068b7; cursor: pointer; padding: 6px 12px; margin-top: 8px; font-family: inherit; font-size: 0.8em; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.05); transition: all 0.2s; }
    .sbdp-toggle-btn:active { background: #f0f8ff; }
    .sbdp-toggle-btn::before { content: "▼ 内訳を見る"; }
    .is-expanded .sbdp-toggle-btn::before { content: "▲ 内訳を閉じる"; }

    .sbdp-row-mobile { display: none; }
    tr.is-expanded + .sbdp-row-mobile { display: table-row !important; }
    
    .sbdp-mobile-bd-wrapper { padding: 12px; background: #fdfdfd; border: 1px solid #eaeaea; border-radius: 6px; margin: 4px 0 12px; }
    .sbdp-bd-heading { display: block; font-weight: 700; font-size: 1em; color: #333; padding-bottom: 6px; border-bottom: 1px solid #ddd; margin: 0 0 10px 0; text-align: left; }
    .sbdp-bd-heading::before { content: ""; display: inline-block; width: 3px; height: 12px; background-color: #0068b7; margin-right: 6px; vertical-align: -1px; }

    .sbdp-row-mobile .sbdp-list-total { text-align: center; }
    .sbdp-row-mobile .sbdp-bd-row { justify-content: space-between; }
    
    .sbdp-list-selector .sbdp-ct-row, .sbdp-selector-options.sbdp-ct-row { flex-direction: column; width: 100%; }
    .sbdp-list-selector .sbdp-radio-btn, .sbdp-selector-options.sbdp-ct-row .sbdp-radio-btn { width: 100%; flex: none; margin-bottom: 4px; }
    .sbdp-list-selector .sbdp-radio-btn span, .sbdp-selector-options.sbdp-ct-row .sbdp-radio-btn span { padding: 12px 8px; }
    
    .sbdp-cap-row { flex-wrap: wrap; }
    .sbdp-cap-row .sbdp-radio-btn { flex: 1 1 calc(50% - 6px); }

}

.sbdp-ct-row { display: flex; flex-wrap: nowrap; gap: 6px; width: 100%; }
.sbdp-cap-row { display: flex; flex-wrap: nowrap; gap: 6px; width: 100%; }
.sbdp-ct-row .sbdp-radio-btn, .sbdp-cap-row .sbdp-radio-btn { flex: 1 1 0; min-width: 0; }
.sbdp-fee-note { justify-content: flex-start; }
.sbdp-fee-note span { font-size: 0.85em; color: #888; white-space: pre-line; line-height: 1.6; }
.sbdp-nopay { color: #e74c3c; }

/* シリーズモード */
.sbdp-series-wrap { max-width: 800px; margin: 0 auto; }
.sbdp-series-card { border: 1px solid #eaeaea; border-radius: 12px; padding: 24px; margin-bottom: 24px; transition: box-shadow 0.2s; }
.sbdp-series-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.sbdp-series-name { font-size: 1.3em; font-weight: 700; color: #333; margin: 0 0 12px; }
.sbdp-series-release { font-weight: 400; color: #888; font-size: 0.75em; }
.sbdp-series-image { padding: 16px 0; text-align: center; }
.sbdp-series-image img { max-width: 100%; max-height: 200px; height: auto; object-fit: contain; margin: 0 auto; display: block; }

/* 機種名リンク */
a.sbdp-card-name { text-decoration: none; color: #333; }
a.sbdp-card-name:hover { color: #0068b7; }
.sbdp-series-name a { text-decoration: none; color: inherit; }
.sbdp-series-name a:hover { color: #0068b7; }
th[scope="row"] a { color: #0068b7; text-decoration: none; font-weight: 600; }
th[scope="row"] a:hover { text-decoration: underline; }

/* 注意事項 */
.sbdp-th-note { display: block; font-weight: normal; }

/* 契約方法ごとの金額は全部書き出してあり、選択中のものだけを見せる */
.sbdp-plan[hidden] { display: none; }
.sbdp-list-wrap[data-plan="a"] .sbdp-plan--a,
.sbdp-list-wrap[data-plan="b"] .sbdp-plan--b,
.sbdp-list-wrap[data-plan="c"] .sbdp-plan--c,
.sbdp-list-wrap[data-plan="d"] .sbdp-plan--d { display: block; }
.sbdp-list-wrap[data-plan="a"] .sbdp-plan:not(.sbdp-plan--a),
.sbdp-list-wrap[data-plan="b"] .sbdp-plan:not(.sbdp-plan--b),
.sbdp-list-wrap[data-plan="c"] .sbdp-plan:not(.sbdp-plan--c),
.sbdp-list-wrap[data-plan="d"] .sbdp-plan:not(.sbdp-plan--d) { display: none; }

/* 容量と契約方法の組は、選ばれているものだけを見せる */
.sbdp-combo { display: none; }
.sbdp-combo.is-shown { display: block; }

/* 金額で絞っているときは、条件に合う契約方法でのみ行を見せる */
.sbdp-list-wrap[data-plan="a"] tbody[data-plans-ok]:not([data-plans-ok~="a"]),
.sbdp-list-wrap[data-plan="b"] tbody[data-plans-ok]:not([data-plans-ok~="b"]),
.sbdp-list-wrap[data-plan="c"] tbody[data-plans-ok]:not([data-plans-ok~="c"]),
.sbdp-list-wrap[data-plan="d"] tbody[data-plans-ok]:not([data-plans-ok~="d"]) { display: none; }

/* 機種名のセルは、画像と文字を横に並べる */
/* 画像の横に機種名と発売日を積む */
.sbdp-name-cell { display: flex; align-items: center; gap: 10px; }
.sbdp-thumb { flex: 0 0 auto; width: 56px; height: auto; aspect-ratio: 418 / 616; object-fit: contain; display: block; }
.sbdp-name-text { flex: 1 1 auto; min-width: 0; line-height: 1.3; }

@media (max-width: 600px) {
    .sbdp-name-cell { gap: 8px; }
    .sbdp-thumb { width: 44px; }
}

.sbdp-release-date { display: block; font-size: .8em; font-weight: normal; margin-top: 4px; }

/* 機種ごとの詳しい説明 */
.sbdp-detail-selector { margin: 1.2em 0; }
/*
 * 契約方法・容量・返却時期の3つが合うものだけ見せる。
 * 組み合わせが増えるので、CSSでは隠すほうを書いて数を抑える。
 */
.sbdp-detail-wrap .sbdp-plan { display: block; }
.sbdp-detail-wrap[data-plan="a"] .sbdp-plan:not(.sbdp-plan--a),
.sbdp-detail-wrap[data-plan="b"] .sbdp-plan:not(.sbdp-plan--b),
.sbdp-detail-wrap[data-plan="c"] .sbdp-plan:not(.sbdp-plan--c),
.sbdp-detail-wrap[data-plan="d"] .sbdp-plan:not(.sbdp-plan--d),
.sbdp-detail-wrap[data-benefit="a"] .sbdp-plan:not(.sbdp-benefit--a),
.sbdp-detail-wrap[data-benefit="b"] .sbdp-plan:not(.sbdp-benefit--b),
.sbdp-detail-wrap[data-cap="0"] .sbdp-plan:not(.sbdp-cap--0),
.sbdp-detail-wrap[data-cap="1"] .sbdp-plan:not(.sbdp-cap--1),
.sbdp-detail-wrap[data-cap="2"] .sbdp-plan:not(.sbdp-cap--2),
.sbdp-detail-wrap[data-cap="3"] .sbdp-plan:not(.sbdp-cap--3),
.sbdp-detail-wrap[data-cap="4"] .sbdp-plan:not(.sbdp-cap--4) { display: none; }
.sbdp-benefit-selector { margin-top: 0; }

.sbdp-detail-image { margin-top: 1.2em; margin-bottom: 1.2em; text-align: center; }
.sbdp-detail-image img { width: 209px; max-width: 100%; height: auto; margin-left: auto; margin-right: auto; display: block; }

/*
 * 機種ごとの説明は、テーマのブロック用の余白が効かないため
 * ここで段落や表の間隔を持たせる。
 * 更新日・見出し・画像・特徴・末尾の解説文は sbdp-detail-wrap の外に出るので、
 * wrap 配下に限定せずクラス単体で当てること。
 * 見出し(h3modoki/h4modoki)はSWELL側の指定に任せ、こちらでは触らない。
 */
.sbdp-desc { margin: 0 0 1.2em; line-height: 1.9; }
.sbdp-plan > .sbdp-desc:last-child { margin-bottom: 0; }
.sbdp-detail-image + .sbdp-detail-wrap .sbdp-detail-selector:first-child { margin-top: 0; }
.sbdp-features { margin: 0 0 1.2em; padding-left: 1.4em; }
.sbdp-features li { margin-bottom: 0.4em; line-height: 1.8; }
.sbdp-updated { margin: 0 0 1em; font-size: 0.85em; color: #888; }

.sbdp-detail-table { width: 100%; border-collapse: collapse; margin: 0 0 1.6em; }
.sbdp-detail-table th, .sbdp-detail-table td { padding: 12px 10px; vertical-align: middle; }
.sbdp-detail-table thead th { text-align: center; }
.sbdp-detail-table tbody th { text-align: left; white-space: nowrap; }
.sbdp-detail-table tbody td { text-align: left; }

.sbdp-buy-wrap { margin: 1.6em 0; text-align: center; }
.sbdp-buy-button { display: inline-block; padding: 14px 28px; border-radius: 8px; background: #0068b7; color: #fff; font-weight: 700; text-decoration: none; transition: opacity 0.15s; }
.sbdp-buy-button:hover { opacity: 0.85; color: #fff; }

/* 一覧表の前に置く説明文 */
.sbdp-lead { margin-bottom: 1.2em; }
.sbdp-list-lead { margin: 0 0 0.8em; line-height: 1.9; }
.sbdp-list-lead:last-child { margin-bottom: 0; }
