/*
 * 条件案内チャットの見た目。
 * サイトは自分のトークンを --sc-* に割り当てる。下の値は既定値（コントラストは docs/impl-notes-widget.md）。
 * v7（2026-10-12）: チャットボットらしい見た目（角丸・影は札と小窓だけ・動きは prefers-reduced-motion: no-preference のときだけ）。末尾の v7 の節が前の規則を上書きする。
 * インラインの style 属性は使わない前提のクラス設計。
 * 1100px の境目は widget.js の WIDE_QUERY と同じ値。パネルの方式（PC の小窓／全面）は JS がクラスで切り替える。
 */

.sc-open,
.sc-floating,
.sc-panel {
  --sc-paper: #ffffff;
  --sc-ink: #1f2328;
  --sc-accent: #0a4d9c;
  --sc-plane: #f1f4f7;
  --sc-alert: #a61b1b;
  --sc-rule: #6b7280;
  --sc-gap: 16px;
}

html.sc-has-widget {
  /* 下端の札にフォーカス中の要素が隠れないようにする */
  scroll-padding-block-end: 80px;
}


.sc-open[hidden],
.sc-floating[hidden],
.sc-panel [hidden] {
  display: none;
}

/* ---- 入口のボタンと右下の札 ---- */

.sc-open,
.sc-floating,
.sc-btn,
.sc-choice {
  box-sizing: border-box;
  font: inherit;
  font-size: max(1rem, 16px);
  line-height: 1.5;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
}

.sc-open,
.sc-floating {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: 2px solid var(--sc-accent);
  /* 塗りにしない（記事の「公式サイトを見る」の塗りのボタンと、別の種類の操作だと分かるように・v5） */
  background: var(--sc-paper);
  color: var(--sc-accent);
  font-weight: 700;
  max-width: 100%;
  text-align: center;
}

.sc-floating {
  position: fixed;
  z-index: 900;
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}

/* ---- パネル ---- */

.sc-panel {
  box-sizing: border-box;
  padding: 0;
  border: 2px solid var(--sc-rule);
  border-radius: 0;
  box-shadow: none;
  background: var(--sc-paper);
  color: var(--sc-ink);
  font-size: max(1rem, 16px);
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.sc-panel *,
.sc-panel *::before,
.sc-panel *::after {
  box-sizing: border-box;
}

.sc-panel[open] {
  display: flex;
  flex-direction: column;
}

/* パネル全体はスクロールさせない（本文と選択肢の領域だけがスクロールする）。
   読み上げ用の .sc-sr（position: absolute）が dialog を包含ブロックにして、dialog の高さを伸ばさないようにする。 */
.sc-panel--side,
.sc-panel--modal {
  overflow: hidden;
}

.sc-body,
.sc-choices {
  position: relative;
}

/* 1100px 以上: 記事の表を見ながら使える右側の固定パネル（非モーダル） */
.sc-panel--side {
  position: fixed;
  z-index: 1000;
  inset: 0 0 0 auto;
  width: min(420px, 100vw);
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
}

/* 1100px 未満: 全面のモーダル。高さは dvh、ノッチ・ホームバーを避ける */
.sc-panel--modal {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border: 0;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}

.sc-panel::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

/* ---- ヘッダー（常に見える。広告表示を含む） ---- */

.sc-header {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  padding: 8px var(--sc-gap);
  background: var(--sc-plane);
  border-bottom: 2px solid var(--sc-rule);
}

/* 見出しと2つのボタンを1行に収める（320px でも）。広告表示は次の行 */
.sc-title {
  flex: 1 1 0;
  min-width: 5em;
  margin: 0;
  font-size: max(1.125rem, 18px);
  line-height: 1.5;
  font-weight: 700;
}

/* 広告表示: 本文と同じ 16px 以上・同じ濃さ・同じ太さ */


.sc-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 8px;
}

.sc-btn {
  padding: 8px 10px;
  border: 2px solid var(--sc-accent);
  background: var(--sc-paper);
  color: var(--sc-accent);
}

/* ---- 本文（スクロールする領域） ---- */

.sc-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scroll-padding: 8px;
  padding: var(--sc-gap);
  padding-bottom: 24px;
}

/* ---- 会話（v6）。新しい吹き出しは下に積み、選択肢のすぐ上に来る。角は 0・影なし ---- */

.sc-convo {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  min-height: 100%;
}

.sc-msg {
  margin: 0;
  max-width: 92%;
}

/* 案内の吹き出し（左）: 淡い地 */
.sc-msg--bot {
  align-self: flex-start;
  padding: 10px 12px;
  background: var(--sc-plane);
}

/* 表を含む吹き出し（結果・推し・比べる・目次）は横幅いっぱいのカードにする（表に幅を残す） */
.sc-msg--wide {
  align-self: stretch;
  max-width: none;
  background: var(--sc-paper);
  border: 1px solid var(--sc-rule);
}

/* 利用者の吹き出し（右）: 押したものの文 */
.sc-msg--user {
  align-self: flex-end;
  max-width: 80%;
  padding: 8px 12px;
  background: var(--sc-accent);
  color: var(--sc-paper);
}

.sc-msg .sc-screen > :last-child {
  margin-bottom: 0;
}

.sc-cond--past {
  cursor: default;
}

.sc-past-toggle {
  margin: 0 0 8px;
}

.sc-heading {
  margin: 0 0 12px;
  font-size: max(1.125rem, 18px);
  line-height: 1.5;
  font-weight: 700;
}

.sc-body:focus-visible,
.sc-choices:focus-visible {
  outline: 3px solid var(--sc-accent);
  outline-offset: -3px;
}

/* 見出しは画面が変わるたびにフォーカスを受ける。枠はキーボードで操作しているときだけ（押せるものに見せない・v5） */
.sc-heading:focus {
  outline: none;
}

.sc-heading:focus-visible,
.sc-open:focus-visible,
.sc-floating:focus-visible,
.sc-btn:focus-visible,
.sc-choice:focus-visible,
.sc-cond:focus-visible,
.sc-anchor:focus-visible,
.sc-table-wrap:focus-visible {
  outline: 3px solid var(--sc-accent);
  outline-offset: 2px;
}

.sc-text {
  margin: 0 0 12px;
}

.sc-progress {
  margin: 0 0 4px;
  color: var(--sc-ink);
}

.sc-summary {
  margin: 0 0 12px;
}

/* ---- 結果の先頭の条件（押すと1問だけ直す・v5） ---- */

.sc-conds {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  border: 1px solid var(--sc-rule);
  background: var(--sc-plane);
}

.sc-cond-item + .sc-cond-item {
  border-top: 1px solid var(--sc-rule);
}

.sc-cond {
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 8px;
  width: 100%;
  min-height: 36px;
  margin: 0;
  padding: 4px 12px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  color: var(--sc-ink);
  font: inherit;
  font-size: max(1rem, 16px);
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
}

.sc-cond-label {
  font-weight: 700;
}

.sc-cond-edit {
  margin-left: auto;
  color: var(--sc-accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* ---- 要約表（結果・推しのプラン。v5）。1プラン＝名前の行＋値の行 ---- */

.sc-sum {
  margin: 0 0 16px;
}

.sc-sum-heading {
  margin: 0 0 4px;
  font-size: max(1rem, 16px);
  font-weight: 700;
}

.sc-sum-table {
  width: 100%;
  border-collapse: collapse;
  line-height: 1.5;
  /* 列の幅を見出しの行で決め、「合う」と「一部分からない」の2つの表で列の位置をそろえる */
  table-layout: fixed;
}

.sc-sum-table--price .sc-sum-col:first-of-type {
  width: 58%;
}

.sc-sum-table th,
.sc-sum-table td {
  padding: 4px 8px;
  text-align: left;
  vertical-align: top;
}

.sc-sum-col {
  font-weight: 400;
  border-bottom: 2px solid var(--sc-rule);
}

.sc-sum-col:first-of-type,
.sc-sum-cell:first-of-type {
  padding-left: 0;
}

.sc-sum-table .sc-sum-name {
  padding: 8px 0 0;
  border-top: 1px solid var(--sc-rule);
  font-weight: 700;
}

.sc-sum-plan:first-of-type .sc-sum-name {
  border-top: 0;
}

.sc-sum-nameline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 12px;
}

.sc-sum-nameline .sc-link {
  margin-left: auto;
  font-weight: 400;
}

.sc-sum-values .sc-sum-cell {
  padding-bottom: 8px;
}

.sc-mark {
  margin-left: 2px;
  font-weight: 700;
}

.sc-foot {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.sc-foot-item {
  margin: 0 0 4px;
}

.sc-value--hidden {
  color: var(--sc-alert);
}

.sc-notes {
  margin: 0 0 4px;
  padding-left: 1.25em;
}

.sc-excluded {
  margin: 0 0 12px;
  padding: 8px 12px;
  background: var(--sc-plane);
}

.sc-excluded-list {
  margin: 4px 0 0;
  padding-left: 1.25em;
}

/* ---- 「こんな人ならこっち」（記事の原文を出す） ---- */

.sc-recommend {
  margin: 0 0 12px;
}

.sc-recommend-line {
  margin: 0 0 8px;
  font-weight: 700;
}

.sc-recommend-why,
.sc-recommend-plans {
  margin: 0 0 8px;
}

.sc-recommend-link {
  margin: 0;
}

/* ---- 比較の表 ---- */

.sc-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  margin: 0 0 12px;
}

.sc-compare {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
}

.sc-compare th,
.sc-compare td {
  padding: 8px 10px;
  border: 1px solid var(--sc-rule);
  text-align: left;
  vertical-align: top;
}

.sc-compare-corner {
  padding: 0;
}

.sc-compare thead th,
.sc-compare tbody th {
  background: var(--sc-plane);
  font-weight: 700;
}

/* ---- リンク（ボタン風にしない。カードの中・上側に置く） ---- */

.sc-links {
  margin: 4px 0 12px;
  padding: 0;
  list-style: none;
}

.sc-link {
  display: inline-block;
}

.sc-anchor {
  display: inline-block;
  min-height: 24px;
  padding-block: 4px;
  color: var(--sc-accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  background: none;
  border: 0;
}

/* PR 札はチャットのパネルの中だけ（スコープなしの .pr がサイト本体の PR 札を上書きしていた・2026-10-11） */
.sc-panel .pr {
  display: inline-block;
  margin-right: 4px;
  padding: 0 6px;
  border: 1px solid var(--sc-rule);
  background: var(--sc-plane);
  color: var(--sc-ink);
  font-size: max(0.875rem, 14px);
  line-height: 1.5;
}

/* ---- 選択肢（v6 までは領域の下端に固定。v7 は会話の末尾＝いちばん新しい吹き出しのすぐ下。下の v7 の節が上書きする） ----
   本文と一緒に縮まない（flex: 0 0 auto）。リンクとの間の 24px は、スクロールで消える内側の padding でなく、
   外側の margin-top と上線で確保する。選択肢が多い画面（6個）は、領域の半分まで広がり、それを超えたらこの領域の中でスクロールする。 */

.sc-choices {
  flex: 0 0 auto;
  max-height: 50%;
  overflow: auto;
  overscroll-behavior: contain;
  scroll-padding: 8px;
  margin-top: 24px;
  padding: 8px var(--sc-gap);
  border-top: 2px solid var(--sc-rule);
  background: var(--sc-plane);
}

.sc-choices:empty {
  display: none;
}

.sc-choice-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 選択肢は、幅が足りれば2列にして、本文に高さを残す（v5。2つでも横に並べる）。 */
.sc-choice-list:not(.sc-choice-list--long) {
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
}

/* ラベルが長い選択肢（全角で20字を超えるもの。「こんな人」の選択など）が1つでもあれば、1列にして折り返す。
   JS が .sc-choice-list--long を付ける */
.sc-choice-list--long {
  grid-template-columns: 1fr;
}

.sc-choice-item {
  margin: 0;
}

.sc-choice {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: 2px solid var(--sc-accent);
  background: var(--sc-paper);
  color: var(--sc-ink);
  text-align: left;
}

.sc-choice--selected {
  border-width: 4px;
}

/* 戻る・ここまでの条件で見る・そのまま次へ（答えではない操作）は、答えの選択肢と見分けられるよう枠を細くする */
.sc-choice--nav {
  border-width: 1px;
  border-color: var(--sc-rule);
  background: var(--sc-plane);
}

.sc-current {
  white-space: nowrap;
  margin-left: 0.5em;
  color: var(--sc-accent);
  font-weight: 700;
}

/* ---- 読み上げ専用（画面には出さない） ---- */

.sc-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 1100px) {
  .sc-header,
  .sc-body {
    padding-inline: 20px;
  }
}

/* ---- 高さが足りないとき（400% 拡大＝320×200 相当、横向きの小さな画面） ----
   本文と選択肢を別々にスクロールさせると、どちらも数十 px しか残らない。dialog 全体を1つのスクロール領域にし、
   広告表示だけを上端に貼り付ける（ヘッダーの子要素を dialog の直下に並べ直して、sticky の基準を dialog にする）。 */
@media (max-height: 520px) {
  .sc-panel.sc-panel[open] {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-content: flex-start;
    overflow: auto;
    overscroll-behavior: contain;
    scroll-padding: 40px 8px 8px;
  }

  .sc-header {
    display: contents;
  }

  .sc-title {
    padding: 8px 0 0 var(--sc-gap);
  }

  .sc-actions {
    padding: 8px var(--sc-gap) 0 0;
    margin-left: auto;
  }


  .sc-body {
    order: 4;
    flex: 1 0 100%;
    overflow: visible;
    min-height: auto;
  }

  .sc-choices {
    order: 5;
    flex: 1 0 100%;
    max-height: none;
    overflow: visible;
  }
}

/* 札がサイトの公式リンク・広告リンクに重なっている間は見えなくする（場所は残す・2026-10-11） */
.sc-floating.sc-floating--yield {
  visibility: hidden;
}

/* ===============================================================   v7（2026-10-12・試作）: チャットボットらしい見た目。
   角丸の吹き出し・案内役のアイコン・選択肢は吹き出しのすぐ下の丸いボタン・PC は右下の小窓。
   サイト本文の吹き出し（角丸・淡い地・編集部のアイコン）に合わせる。動きは prefers-reduced-motion: no-preference のときだけ（末尾の節）。
   ====================================================================== */

.sc-open,
.sc-floating {
  border-radius: 999px;
}

.sc-floating {
  gap: 8px;
  padding: 6px 18px 6px 6px;
  background: var(--sc-accent);
  color: var(--sc-paper);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.sc-avatar {
  display: inline-block;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
}

.sc-avatar svg {
  display: block;
  width: 100%;
  height: 100%;
}

.sc-avatar-bg {
  fill: var(--sc-accent);
}

.sc-avatar-line {
  fill: none;
  stroke: var(--sc-paper);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sc-floating .sc-avatar-bg {
  fill: var(--sc-paper);
}

.sc-floating .sc-avatar-line {
  stroke: var(--sc-accent);
}

.sc-header .sc-avatar {
  flex-basis: 36px;
  width: 36px;
  height: 36px;
}

/* 案内の吹き出し: アイコン＋角丸の吹き出し（左上だけ小さく、話し手から出ている形） */
.sc-msg--bot {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 0;
  background: none;
}

.sc-bubble {
  min-width: 0;
  padding: 10px 14px;
  border-radius: 4px 16px 16px 16px;
  background: var(--sc-bubble, var(--sc-plane));
}

.sc-msg--wide {
  border: 0;
  background: none;
}

.sc-msg--wide .sc-bubble {
  flex: 1 1 auto;
  background: var(--sc-paper);
  border: 1px solid var(--sc-rule);
}

.sc-msg--user {
  border-radius: 16px 4px 16px 16px;
}

/* 選択肢（クイックリプライ）: いちばん新しい案内の吹き出しのすぐ下に、丸いボタンで並べる */
.sc-convo > .sc-choices {
  flex: none;
  max-height: none;
  overflow: visible;
  margin: 0 0 0 40px;
  padding: 0;
  border: 0;
  background: none;
}

.sc-convo > .sc-choices .sc-choice-list,
.sc-convo > .sc-choices .sc-choice-list:not(.sc-choice-list--long) {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sc-choice {
  width: auto;
  border-radius: 999px;
  padding: 8px 16px;
  background: var(--sc-paper);
  color: var(--sc-accent);
  font-weight: 700;
}

.sc-choice-list--long .sc-choice {
  border-radius: 16px;
  text-align: left;
}

.sc-choice--nav {
  color: var(--sc-ink);
  font-weight: 400;
}

.sc-choice--selected {
  border-width: 2px;
  background: var(--sc-accent);
  color: var(--sc-paper);
}

.sc-choice--selected .sc-current {
  color: inherit;
}

.sc-conds {
  border-radius: 8px;
  overflow: hidden;
}

.sc-btn {
  border-radius: 999px;
}

/* 1100px 以上: 右下の小窓（記事の上に重ねる。非モーダル） */
.sc-panel--side {
  inset: auto 16px 16px auto;
  width: min(380px, calc(100vw - 32px));
  height: min(640px, calc(100vh - 32px));
  height: min(640px, calc(100dvh - 32px));
  border: 1px solid var(--sc-rule);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}


@media (max-height: 520px) {
  /* ヘッダーのボタン（最初から・閉じる）も上に残す（手を進めると画面の外へ流れていた） */
  .sc-actions {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--sc-plane);
  }
}

/* 狭い画面では、表を含む吹き出しのアイコンを外して、表に幅を残す */
@media (max-width: 480px) {
  .sc-msg--wide > .sc-avatar {
    display: none;
  }
}

/* ---- v7: 結果のプランのカード（横に流れる列）---- */

.sc-cards-scroll {
  margin: 0 -14px 8px;
  padding: 2px 14px 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 14px;
}

.sc-cards-scroll:focus-visible {
  outline: 3px solid var(--sc-accent);
  outline-offset: -3px;
}

.sc-card-row {
  display: flex;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sc-pcard {
  flex: 0 0 min(78%, 260px);
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
  padding: 12px 14px;
  border: 1px solid var(--sc-rule);
  border-radius: 12px;
  background: var(--sc-paper);
  line-height: 1.5;
}

.sc-pcard-name {
  margin: 0 0 8px;
  font-size: max(1rem, 16px);
  font-weight: 700;
}

.sc-pcard-values {
  margin: 0 0 12px;
}

.sc-pcard-value {
  margin: 0 0 6px;
}

.sc-pcard-label {
  margin: 0;
  color: var(--sc-ink);
  font-size: max(0.875rem, 14px);
}

.sc-pcard-text {
  margin: 0;
}

.sc-pcard-value--price .sc-pcard-text {
  font-size: max(1.125rem, 18px);
  font-weight: 700;
}

/* 公式サイトへのボタン（選択肢＝白地の丸い枠 と区別できるよう、塗りのボタンにする） */
.sc-pcard .sc-link {
  display: block;
  margin-top: auto;
}

.sc-cta {
  display: block;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 999px;
  background: var(--sc-accent);
  color: var(--sc-paper);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.sc-cta:focus-visible {
  outline: 3px solid var(--sc-ink);
  outline-offset: 2px;
}

/* ---- v7: ヘッダー（閉じる・最初からはアイコン、広告の表示は小さな札） ---- */

.sc-header {
  flex-wrap: nowrap;
  padding: 8px 8px 8px 12px;
}

.sc-title {
  font-size: max(1rem, 16px);
}

.sc-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--sc-ink);
  cursor: pointer;
}

.sc-icon-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sc-icon-btn:focus-visible {
  outline: 3px solid var(--sc-accent);
  outline-offset: 0;
}

.sc-actions {
  gap: 0;
}



.sc-title-wrap {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  min-width: 0;
}

/* 高さが足りないとき（v7）: ヘッダーはそのまま上に貼り付ける（広告の札・閉じる・最初からが一緒に残る） */
@media (max-height: 520px) {
  .sc-header {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 3;
    flex: 1 0 100%;
    order: 0;
  }

  .sc-title,
  .sc-actions {
    padding: 0;
    margin: 0;
  }

}

/* ---- v7: 結果の先頭の条件は、丸い小さなボタンを並べる（押すとその1問だけ直す） ---- */
.sc-conds {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border: 0;
  background: none;
  overflow: visible;
}

.sc-cond-item + .sc-cond-item {
  border-top: 0;
}

.sc-cond {
  display: inline-flex;
  width: auto;
  min-height: 36px;
  align-items: center;
  gap: 0 6px;
  padding: 4px 12px;
  border: 1px solid var(--sc-rule);
  border-radius: 999px;
  background: var(--sc-paper);
  font-size: max(0.875rem, 14px);
}

.sc-cond-label {
  font-weight: 400;
}

.sc-cond-value {
  font-weight: 700;
}

.sc-cond-edit {
  margin-left: 2px;
}

.sc-cond--past {
  border-style: dashed;
}

/* ---- v7: 動き（2026-10-12 運営者の判断）。動きを減らす設定（prefers-reduced-motion: reduce）では一切動かさない ---- */

.sc-typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
}

.sc-typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--sc-ink);
  opacity: 0.45;
}

@media (prefers-reduced-motion: no-preference) {
  /* 入力中の「…」: 3つの点が順に浮かぶ */
  .sc-typing-dot {
    animation: sc-typing 1s ease-in-out infinite;
  }

  .sc-typing-dot:nth-child(2) {
    animation-delay: 0.15s;
  }

  .sc-typing-dot:nth-child(3) {
    animation-delay: 0.3s;
  }

  /* 新しい吹き出しと選択肢は、下から軽く現れる */
  .sc-msg,
  .sc-convo > .sc-choices {
    animation: sc-rise 0.22s ease-out both;
  }

  /* 窓は右下から広がるように開く（PC の小窓）。スマホの全画面は下から */
  .sc-panel--side[open] {
    transform-origin: 100% 100%;
    animation: sc-pop 0.2s ease-out both;
  }

  .sc-panel--modal[open] {
    animation: sc-slide 0.22s ease-out both;
  }
}

@keyframes sc-typing {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }

  30% {
    transform: translateY(-4px);
    opacity: 0.9;
  }
}

@keyframes sc-rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes sc-pop {
  from {
    opacity: 0;
    transform: scale(0.92);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes sc-slide {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ---- v7 の検証で直したもの（2026-10-12） ---- */


/* 選択肢は、案内の吹き出し（公式サイトへのボタンを含む）から 24px 以上離す（押し間違いを防ぐ） */
.sc-convo > .sc-choices {
  margin-top: 12px;
}

/* 文字は 16px 以上（結果の先頭の条件・カードの列名） */
.sc-cond,
.sc-pcard-label {
  font-size: max(1rem, 16px);
}

/* 今の選択は、塗りにしない（塗りは「公式サイトを見る」だけ）。太い枠と淡い地で示す */
.sc-choice--selected {
  border-width: 3px;
  background: var(--sc-plane);
  color: var(--sc-accent);
}

.sc-choice--selected .sc-current {
  color: var(--sc-ink);
}

/* 高さが足りないとき: 上に貼り付いたヘッダーの下に、フォーカスした要素が隠れないようにする */
@media (max-height: 520px) {
  .sc-panel.sc-panel[open] {
    scroll-padding: 80px 8px 8px;
  }
}

/* ---- v7 の実画面審査で直したもの（2026-10-12） ---- */

/* 読み上げ用の非表示の文字（position: absolute）が、列の外へはみ出して会話欄全体を横にずらしていた */
.sc-cards-scroll,
.sc-pcard {
  position: relative;
}

/* 料金: 金額を大きく、括弧の但し書きは通常の大きさ */
.sc-pcard-value--price .sc-pcard-text {
  font-size: max(1rem, 16px);
  font-weight: 400;
}

.sc-pcard-amount {
  display: block;
  font-size: max(1.375rem, 22px);
  font-weight: 700;
  line-height: 1.3;
}

.sc-pcard-note {
  display: block;
  font-size: max(1rem, 16px);
}

/* 列の送り（前のプラン・次のプラン）と件数 */
.sc-cards-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin: -4px 0 8px;
}

.sc-cards-count {
  margin-right: auto;
  font-size: max(1rem, 16px);
}

.sc-cards-nav .sc-icon-btn {
  border: 1px solid var(--sc-rule);
}

/* 前の結果を見るは、選択肢と見分けられるよう文字のボタンにする */
.sc-past-toggle {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--sc-accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* ---- v7 最終確認（Opus）で直したもの（2026-10-12） ---- */

/* 高さが足りないとき: 会話欄がカードの列の幅まで広がって横にはみ出していた（min-width: auto のため） */
@media (max-height: 520px) {
  .sc-body,
  .sc-choices,
  .sc-convo,
  .sc-msg,
  .sc-bubble {
    min-width: 0;
  }

  .sc-heading,
  .sc-sum-heading {
    scroll-margin-top: 80px;
  }
}

.sc-convo,
.sc-msg,
.sc-bubble {
  min-width: 0;
}

/* 条件のボタンは、長いと折り返すので、完全な丸（999px）でなく角の丸みを抑える */
.sc-cond {
  border-radius: 18px;
}

/* 料金の但し書きは、語の途中で折れないようにする */
.sc-pcard-note {
  word-break: auto-phrase;
  text-wrap: pretty;
}

/* 送りボタンが両端で押せないときは薄くする */
.sc-cards-nav .sc-icon-btn[aria-disabled="true"] {
  opacity: 0.35;
  cursor: default;
}

/* 受付アイコンの耳当ては塗り（線だけだと小さい大きさで潰れる） */
.sc-avatar-fill {
  fill: var(--sc-paper);
  stroke: none;
}

.sc-floating .sc-avatar-fill {
  fill: var(--sc-accent);
}

/* ---- v7: PC の小窓の大きさ（標準／広い）。切り替えは画面のヘッダーのボタン（2026-10-12 運営者の要望） ---- */
.sc-panel--side.sc-panel--large {
  width: min(760px, calc(100vw - 32px));
  height: min(880px, calc(100vh - 32px));
  height: min(880px, calc(100dvh - 32px));
}

/* 広い窓では、案内の吹き出しを窓の幅に合わせて少し広げ、カードは2枚並べて見せる（PC の小窓のときだけ） */
.sc-panel--side.sc-panel--large .sc-pcard {
  flex-basis: min(46%, 320px);
}

.sc-panel--side.sc-panel--large .sc-msg {
  max-width: 88%;
}

/* 全画面（スマホ・1100px 未満）では大きさの切り替えは意味がないので出さない */
.sc-panel--modal .sc-size {
  display: none;
}

/* 記事側でキーボードの移動先が小窓に隠れるとき、小窓をヘッダーだけに畳む（押す・フォーカスが戻ると元に戻る） */
.sc-panel--side.sc-panel--peek {
  height: auto;
  min-height: 0;
}

.sc-panel--peek .sc-body {
  display: none;
}

/* 比べる画面の公式リンクに添えるプラン名 */
.sc-links-name {
  font-weight: 700;
}

/* サイト側の smooth スクロールの指定を受けない（会話の送りは即座に動かし、直後の測り直しとずれないようにする） */
.sc-body {
  scroll-behavior: auto;
}

/* ---- v0.4.4: 軽微の整理 ---- */

/* 除外の一覧は、1件ずつ行頭の印を付ける */
.sc-excluded-list {
  list-style: disc;
}

.sc-note-plan {
  font-weight: 700;
}

/* 狭い画面（スマホの全画面）の比べる表: プランを2列に並べ、項目名は各行の上に置く。横スクロールをなくす */
@media (max-width: 600px) {
  .sc-panel--modal .sc-table-wrap {
    overflow: visible;
  }

  .sc-panel--modal .sc-compare,
  .sc-panel--modal .sc-compare thead,
  .sc-panel--modal .sc-compare tbody {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .sc-panel--modal .sc-compare tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .sc-panel--modal .sc-compare thead {
    position: sticky;
    top: calc(-1 * var(--sc-gap));
    z-index: 1;
  }

  /* 左上の見出し（読み上げ用の「項目」）は、消さずに視覚的にだけ隠す。消すと列見出しが1列ずれて、料金が別のプランの値として読まれる */
  .sc-panel--modal .sc-compare-corner {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
  }

  .sc-panel--modal .sc-compare tbody th {
    grid-column: 1 / -1;
  }

  .sc-panel--modal .sc-compare th,
  .sc-panel--modal .sc-compare td {
    min-width: 0;
    border-width: 0 0 1px;
    overflow-wrap: anywhere;
  }

  .sc-panel--modal .sc-compare td + td,
  .sc-panel--modal .sc-compare-plan + .sc-compare-plan {
    border-left-width: 1px;
  }
}

/* 高さが足りないとき（200% 拡大など）は、ヘッダーと重なって切れた帯になるので、見出しの行を貼り付けない */
@media (max-width: 600px) and (max-height: 520px) {
  .sc-panel--modal .sc-compare thead {
    position: static;
  }
}

/* 320px 前後では、札は絵だけの丸にする（文字は読み上げ名に残す）。料金などの文字に重ならないように */
@media (max-width: 340px) {
  .sc-floating {
    padding: 6px;
  }

  .sc-floating .sc-floating-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
}

/* 公式リンクは、プラン名を1行目、リンクを次の行にそろえる（名前の長さで横に並んだり次の行に回ったりしない） */
.sc-links-item .sc-links-name {
  display: block;
}

/* 幅 360px 以下（320px など）の比べる表: 見出しの行に2つのプラン名が入りきらず語の途中で折れるので、
   プランを縦に並べ、各セルの前にプラン名を見せる。見出しの行は視覚的にだけ隠す（読み上げ用に残す） */
@media (max-width: 360px) {
  .sc-panel--modal .sc-compare tr {
    grid-template-columns: 1fr;
  }

  .sc-panel--modal .sc-compare thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .sc-panel--modal .sc-compare td::before {
    content: attr(data-plan) / "";
    display: block;
    font-weight: 700;
  }

  .sc-panel--modal .sc-compare td + td {
    border-left-width: 0;
  }
}


/* サイトの案内役の画像（data-avatar）。丸の地まで含めた絵を、そのまま丸く表示する */
.sc-avatar-img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

/* v0.5.1: 段階式の価格。全段階の原文は区切りごとにまとまりで折り返し、選んだ段階を太字にする */
.sc-pcard-tiers {
  display: block;
}

.sc-pcard-seg {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.sc-pcard-seg--on {
  font-weight: 700;
}

/* 外れた条件名・比べる表の項目名は、語の途中で折れないようにする（対応しないブラウザでは今までどおり） */
.sc-excluded-list li,
.sc-compare-label {
  word-break: auto-phrase;
  text-wrap: pretty;
}

/* v0.5.2: 金額は途中で折らない。比べる表の項目名・プラン名は語の途中でなく区切りで折る（anywhere は区切りを選ばず割ってしまう） */
.sc-pcard-nowrap {
  white-space: nowrap;
}

.sc-compare th {
  overflow-wrap: break-word;
  word-break: auto-phrase;
}

@media (max-width: 600px) {
  .sc-panel--modal .sc-compare th,
  .sc-panel--modal .sc-compare td {
    overflow-wrap: break-word;
  }
}

/* ---- 自由入力（Stage 2・文章で伝える）。影なし・塗りは「公式サイトを見る」だけ。角の丸みは吹き出し・選択肢に合わせる ---- */

.sc-free {
  margin-top: 12px;
  padding: var(--sc-gap);
  border: 1px solid var(--sc-rule);
  border-radius: 16px;
  background: var(--sc-plane);
  color: var(--sc-ink);
}

.sc-free-note,
.sc-free-hint,
.sc-free-count,
.sc-free-msg {
  margin: 0 0 8px;
  font-size: max(1rem, 16px);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.sc-free-label {
  display: block;
  margin: 8px 0 4px;
  font-size: max(1rem, 16px);
  font-weight: 700;
}

.sc-free-text {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-height: 88px;
  margin: 0 0 4px;
  padding: 8px 10px;
  border: 2px solid var(--sc-ink);
  border-radius: 8px;
  background: var(--sc-paper);
  color: var(--sc-ink);
  font: inherit;
  font-size: max(1rem, 16px);
  line-height: 1.6;
  resize: vertical;
}

.sc-free-text:focus-visible,
.sc-free-send:focus-visible,
.sc-free-cancel:focus-visible {
  outline: 3px solid var(--sc-accent);
  outline-offset: 2px;
}

.sc-free-count {
  text-align: right;
}

.sc-free-count--over {
  color: var(--sc-alert);
  font-weight: 700;
}

.sc-free-msg:empty {
  display: none;
}

.sc-free-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sc-free-send {
  border-width: 3px;
  font-weight: 700;
}

.sc-free-send[aria-disabled='true'] {
  opacity: 0.6;
  cursor: not-allowed;
}

.sc-free-read {
  margin: 0;
}

.sc-free-read + .sc-free-read {
  margin-top: 6px;
}
