/* ========================================
   全体・共通スタイル
   ======================================== */
html {
  width: 100%;
  box-sizing: border-box;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans",
    "Noto Sans CJK JP", "Original Yu Gothic", "Yu Gothic", sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  margin: 0;
  width: 100%;
  background: var(--body-bg);
  color: var(--text-primary);
  box-sizing: border-box;
}

a {
  color: var(--info-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ========================================
   コンテナ・レイアウト
   ======================================== */
.main-container {
  width: 100%;
  max-width: var(--container-max-width, 1600px);
  margin: 2rem auto;
  padding: 0 1rem;
  box-sizing: border-box;
}

/* エディタ画面では全画面表示に（クラス指定で確実に適用）
   編集画面の main 直下は .lp-editor-fixed-header → .editor-container の順。
   max-width: 100vw で main をビューポート幅に制限し、
   子の .lp-editor-fixed-header（width: 100%）がタブレット幅でも見切れないようにする。 */
main.main-container.main-container--editor,
main.main-container:has(.editor-container) {
  max-width: 100vw;
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* エディタ画面でHTML最上位から右余白が出ないようにする */
body:has(main.main-container--editor) {
  overflow-x: hidden;
}

/* 編集画面: 共通ヘッダー（ハンバーガーメニュー含む）を固定ヘッダーより手前に表示 */
body:has(main.main-container--editor) .site-header {
  z-index: var(--z-editor-site-header);
}

/* 編集画面はページ全体をスクロールさせない＝上に貼り付く物はいつも見えている。
   🔴 **高さを引き算で決めない**（2026-09-12）。以前は .editor-container が `100vh - 61px` で
      「グローバルメニュー 60px」しか引いておらず、お知らせ帯（40px）・パンくず・固定ヘッダー・
      フッターの分だけ画面からはみ出していた。はみ出した分ページが縦に動き、動かすと固定ヘッダーが
      グローバルメニューの下へ 40px 潜って「保存する」「一覧へ戻る」が半分隠れた（実測）。
      いまは残りの高さをエディタが受け取るので、何かを足しても引き算を直す必要がない。
   ⚠ 768px 以下は「編集/プレビュー」を縦積みにして body でスクロールさせる設計なので対象外。 */
@media (min-width: 769px) {
  body:has(main.main-container--editor) {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* 積んだ物は既定で縮めない＝潰れると行が重なる。
     ⚠ **名前を並べない**＝後から帯やバナーが増えても、書き足さずに効く
     （伸びるのは下の 2 つ＝器とエディタ本体だけ。どちらもこれより詳しいので後勝ちに頼らない） */
  body:has(main.main-container--editor) > *,
  main.main-container--editor > * {
    flex: 0 0 auto;
  }

  /* 器（レイアウト・main）が残りの高さを受け取り、そのまま下へ渡す */
  body:has(main.main-container--editor) .layout-with-notice,
  main.main-container--editor {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
  }

  /* 最後に残った高さはエディタ本体のもの（中身は左右のパネルが自分でスクロールする） */
  main.main-container--editor > .editor-container {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
  }
}

/* 管理画面では全画面表示に */
main.main-container:has(.admin-container) {
  max-width: none;
  margin: 0;
  padding: 0;
}

/* AIクレジット0時の共通バナー */
.ai-credit-zero-banner {
  display: block;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: var(--alert-warning-bg);
  border: 1px solid var(--warning-color);
  border-radius: 6px;
  color: var(--alert-warning-text);
  font-size: 0.9375rem;
}

/* ========================================
   ヘッダー・フッター (Updated: 2025-01-10)
   ======================================== */
/* グローバルお知らせバー（サイトヘッダーより上に固定） */
.global-notice-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--global-notice-height);
  z-index: var(--z-dropdown);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0 1rem;
  background: var(--alert-warning-bg);
  color: var(--gray-900);
  font-size: 0.875rem;
  box-sizing: border-box;
}
.global-notice-bar__text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.global-notice-bar__link {
  flex-shrink: 0;
  color: var(--gray-900);
  text-decoration: underline;
  font-weight: 500;
}
.global-notice-bar__link:hover {
  color: var(--gray-800);
}
/* お知らせ帯が出ている分だけ中身を下げ、貼り付く物の基準もまとめてずらす。
   ⚠ 下げるのはここだけ＝個々の sticky が自分で 40px を足さない（足し忘れが起きる）。 */
.layout-with-notice--has-notice {
  padding-top: var(--global-notice-height);
  --app-sticky-top: calc(var(--app-header-height) + var(--global-notice-height));
}
.site-header {
  background: var(--theme-gradient);
  padding: 0 2rem;
  border-bottom: none;
  box-shadow: 0 4px 20px rgba(var(--theme-navy-rgb), 0.15);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
}
.layout-with-notice--has-notice .site-header {
  top: var(--global-notice-height);
}

/* 代理ログイン中のヘッダ（社内の人が会員のアカウントで画面を開いている間・views/_partials/header.php）。
   ⚠ 色と中身で伝える＝高さは変えない（貼り付く物の基準 --app-sticky-top を動かさない）。
   ⚠ ヘッダは上に貼り付いている＝スクロールしても「誰のアカウントか」が見える（以前のページ先頭の帯は消えた）。 */
.site-header--acting {
  background: var(--acting-header-bg);
}
/* 代理ログイン中はロゴを印だけにする＝空いた幅を相手の名前に使う。
   ⚠ 主ナビの幅を削らない（社内の人は項目が多く、名前の分だけ削ると 1400 幅で項目名が「キ…」まで省略された＝2026-10-02 実測） */
.site-header--acting .logo-icon {
  width: auto;
  aspect-ratio: 23 / 25;
  justify-content: flex-start;
  overflow: hidden;
}
.site-header--acting .logo-icon img {
  height: 100%;
  max-width: none;
}
/* 相手の名前と「終了」をひとかたまりに見せる（囲み罫線は使わず、背景のトーンで分ける）。
   ⚠ 幅が足りない時は、主ナビより先にここが縮む（縮む強さ 100）。ただし名前が 7 文字ほど読める幅は残す */
.header__acting-group {
  display: flex;
  align-items: stretch;
  flex: 0 100 auto;
  min-width: 12rem;
  border-radius: 6px;
  background: var(--white-15);
  overflow: hidden;
}
/* 誰に代理ログイン中か（押すと決まりの小窓）。どの幅でも出す＝2 段に積んで横幅を取らない */
.header__acting {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.1rem;
  flex: 0 1 auto;
  min-width: 0;
  /* ⚠ 13rem＝幅 1400 で主ナビ（社内の人の 6 項目）が 1px も削られない上限（16rem では「キャンペーン一覧」が省略された＝実測） */
  max-width: 13rem;
  margin: 0;
  padding: 0.3rem 0.65rem;
  border: none;
  background: none;
  color: var(--white);
  font: inherit;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}
.header__acting:hover,
.header__acting-stop-button:hover {
  background: var(--white-15);
}
.header__acting-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
/* ⚠ ユーザーが自由に付けた名前が入る＝1 行に省略する（全文は title・決まりの小窓・メニューの中） */
.header__acting-name {
  align-self: stretch;
  min-width: 0;
  max-width: 100%;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header__acting-stop {
  display: flex;
  flex: 0 0 auto;
  margin: 0;
}
.header__acting-stop-button {
  padding: 0 0.75rem;
  border: none;
  background: var(--white-10);
  color: var(--white);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

/* ヘッダー8方針: 外枠2カラム・高さ固定・縦中央 */
.header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: calc(100% - 4rem);
  margin: 0 2rem;
  height: var(--app-header-height);
  box-sizing: border-box;
  gap: 2rem;
}

/* 左ブロック: 横並びの基準（ロゴ＋ナビを flex + gap で固定） */
.header__left {
  display: flex;
  align-items: center;
  gap: 1rem; /* 12〜16px */
  min-width: 0;
  flex: 1 1 auto;
  flex-wrap: nowrap;
}

/* ロゴ: 縮まない（flex: 0 0 auto）。テキストは長いとき省略 */
.header__left .logo {
  flex: 0 0 auto;
}

.header__left .logo-text {
  display: block; /* 共通の display:none を打ち消す */
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header__left .logo-main {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 主ナビ: 必要分だけ幅、足りなければ縮む（flex: 0 1 auto）+ min-width:0 で省略が効く。480px 以下で非表示（B案） */
.header__main-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem 1rem;
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
}

.header__main-nav a {
  color: var(--white-90);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    text-decoration 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.header__main-nav a:hover {
  color: var(--white);
  background: var(--white-10);
}

/* 右側: 2グループ・同じサイズのピル */
.header__utility {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-shrink: 0;
}

.header__utility-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* 共通ピル: 管理画面・ログアウト */
.header__pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 36px;
  padding: 0 1rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s ease;
  color: var(--white-95);
  background: var(--white-08);
  border: 1px solid var(--white-15);
}

.header__pill:hover {
  background: var(--white-15);
  color: var(--white);
  text-decoration: none;
}

a.header__pill[href*="logout"] {
  background: rgba(var(--danger-rgb), 0.2);
  border-color: rgba(var(--danger-rgb), 0.3);
}

a.header__pill[href*="logout"]:hover {
  background: rgba(var(--danger-rgb), 0.3);
}

/* アカウント表示（ユーザー名・省略可） */
.header__account {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.75rem;
  min-width: 0;
}

.header__account-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: var(--white-20);
  border-radius: 50%;
  color: var(--white);
}

.header__account-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* AI残: シンプル2行表示（中央揃え・1px枠） */
.header__ai-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05rem;
  padding: 0.25rem 0.5rem;
  font-weight: normal;
  font-size: 0.6rem;
  color: var(--white-90);
  border: 1px solid var(--white-25);
  cursor: default;
  position: relative;
}

.header__ai-pill .header__ai-line1,
.header__ai-pill .usage-line2,
.header__ai-pill .usage-remaining {
  color: inherit;
  font-size: 0.6rem;
  text-align: center;
}

.header__ai-pill.updating {
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.header__ai-pill-warning {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  background: var(--danger-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  animation: header-pulse 2s infinite;
}

@keyframes header-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* ヘッダー・ユーザーメニュー（ハンバーガー）ドロップダウン */
.header__user-menu {
  position: relative;
}

.header__hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--white-90);
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.header__hamburger:hover {
  background: var(--white-10);
  color: var(--white);
}

.header__menu-panel {
  /* 見出しとパネルの間のすき間。⚠ **この数字はここ 1 か所**（下の「渡り板」も同じ値を使う） */
  --header-panel-gap: 0.5rem;
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: var(--header-panel-gap);
  min-width: 200px;
  padding: 0.75rem 0;
  background: var(--white);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  z-index: var(--z-overlay);
}

/* 開いているかどうかは is-active クラス 1 つで決める（ユーザーメニューもフォーム営業も同じ）。
   ⚠ 親ごとに同じ規則を書き足さない＝ドロップダウンが増えるたびに 1 行増える形にしない。 */
.js-dropdown.is-active .header__menu-panel {
  display: block;
}

/* ハンバーガーの中の主ナビ（上部の横並びと同じ項目）。
   ⚠ 横並びが見えている幅では**同じ項目が 2 か所に出る**ので、ここでは出さない。
      横並びを隠す 768px 以下でだけ出す（下のメディアクエリ）＝狭い画面ではここが唯一の入口。
   ⚠ 項目そのものを減らして重複を消さない（狭い画面でメニューが消える）。 */
.header__menu-mobile-nav {
  display: none;
}

.header__menu-user-name {
  padding: 0.5rem 1rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  white-space: nowrap;
  /* ⚠ ここには**ユーザーが自由に付けた名前**が入る＝長いとページ本体を横へ押し広げる
     （2026-09-11 実測: 390px の画面でページ幅 685px）。1 行に省略し、全文は title 属性で見せる。 */
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header__menu-user-id {
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* メニューの中の代理ログインの欄（相手の名前の全文・決まり・戻る）。囲み罫線は使わず背景のトーンで分ける */
.header__menu-acting {
  margin: -0.75rem 0 0; /* パネルの上の余白を埋めて、先頭から色を付ける */
  padding: 0.75rem 0 0.25rem;
  border-radius: 8px 8px 0 0;
  background: var(--alert-warning-bg);
}
.header__menu-acting-title {
  padding: 0 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--alert-warning-text);
}
.header__menu-acting-name {
  max-width: 18rem;
  padding: 0.15rem 1rem 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-900);
  overflow-wrap: anywhere;
}
.header__menu-acting-form,
.acting-modal__stop {
  margin: 0;
}
/* メニューの項目の形をしたボタン（リンクでない物） */
.header__menu-item--button {
  width: 100%;
  border: none;
  background: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.header__menu-divider {
  height: 1px;
  margin: 0.5rem 0;
  background: var(--gray-200);
  border: none;
}

.header__menu-item {
  display: block;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  color: var(--info-link);
  text-decoration: none;
  transition:
    background 0.2s ease,
    color 0.2s ease;
  white-space: nowrap;
}

.header__menu-item:hover {
  background: var(--gray-50);
  color: var(--info-dark);
  text-decoration: none;
}

.header__menu-item.is-active {
  font-weight: 500;
  color: var(--gray-800);
}

/* 主ナビの中のドロップダウン（フォーム営業）。
   ⚠ 親はリンクのまま・開閉は隣の caret ボタンが持つ（js-dropdown と同じ仕組みを使う）。
   ⚠ 開閉状態は JS の is-active だけで決める。:hover で開くと Esc や外側クリックで閉じられない
      （ホバーが残る限り CSS が開き続ける）うえ、aria-expanded と食い違う。 */
.header__nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
}

/* パネルは親の左端から下に開く（右側のユーザーメニューは右寄せなので別指定） */
.header__nav-panel {
  left: 0;
  right: auto;
}

/* 🔴 すき間をまたぐ間に閉じてしまうのを防ぐ「渡り板」（2026-09-10・ユーザー報告で発覚）。
   見出しとパネルの間に 8px のすき間があり、マウスがそこへ入った瞬間、**どちらの要素の上でも
   なくなる**ので mouseleave が起きて閉じていた（実測: 親の下端 46.6px / パネル上端 54.6px、
   y=48 で閉じた）。⇒ すき間ぶんの透明な帯をパネルに付けて、当たり判定を繋げる。
   ⚠ タイマーで遅らせて誤魔化さない（調整の要る数字が増え、速く動かすと結局閉じる）。
   ⚠ クリックで開くユーザーメニュー側には付けない（閉じる操作を邪魔しうるうえ、必要が無い）。 */
.header__nav-panel::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--header-panel-gap) * -1);
  height: var(--header-panel-gap);
}

/* 🔴 パネルの中の文字色を、ヘッダの帯の白文字から取り戻す。
   ⚠ `.header__main-nav a`（濃紺の帯に白文字）は `.header__menu-item`（白いパネルに濃色）より
      詳細度が高いので、指定しないと **白いパネルに白文字**で中身が見えなくなる
      （2026-09-10 に画面で発見。DOM 上は文字があるので DOM 検査では気付けなかった）。 */
.header__main-nav .header__nav-panel .header__menu-item {
  color: var(--info-link);
  background: transparent;
}

.header__main-nav .header__nav-panel .header__menu-item:hover {
  color: var(--info-dark);
  background: var(--gray-50);
}

.header__main-nav .header__nav-panel .header__menu-item.is-active {
  color: var(--gray-800);
  font-weight: 500;
}

.header__nav-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--white-90);
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.header__nav-caret:hover {
  background: var(--white-10);
  color: var(--white);
}

.header__nav-dropdown.is-active .header__nav-caret {
  transform: rotate(180deg);
}

/* ハンバーガーの中のグループ（フォーム営業の子項目）。
   ⚠ 囲み罫線・左の縦罫は使わない（UI 規約）。見出しのラベルと字下げだけで関係を示す。 */
.header__menu-group {
  padding: 0.25rem 0;
}

.header__menu-group-label {
  padding: 0.4rem 1rem 0.2rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  white-space: nowrap;
}

.header__menu-group-label--sub {
  padding-top: 0.5rem;
  font-weight: 500;
}

.header__menu-item--nested {
  padding-left: 1.75rem;
}

.header__menu-item--logout {
  color: var(--danger-color);
}

.header__menu-item--logout:hover {
  background: var(--alert-error-bg);
  color: var(--danger-dark);
}

.header__menu-logout-form {
  display: block;
}

.header__menu-logout-form .header__menu-item {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  width: 100%;
  text-align: left;
}

/* ロゴスタイル（ヘッダー・error・success 共通）: 固定高さのフレックス＋画像は箱に収める */
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem; /* 8〜12px */
  text-decoration: none;
  transition: all 0.3s ease;
  justify-content: flex-start;
}

.logo:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

/* ロゴの箱: 高さ基準・幅は画像のアスペクト比に従う（logo-white.png は 4220×849 の横長） */
.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  width: auto;
  min-width: 0;
  max-width: 200px;
  flex-shrink: 0;
}

/* 画像は箱に収める（height 強制指定は廃止） */
.logo-icon img {
  max-height: 100%;
  width: auto;
  object-fit: contain;
}

.logo-text {
  display: none;
}

.logo-main {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
  text-shadow: 0 2px 4px var(--black-15);
  letter-spacing: -0.02em;
}

/* アプリ共通フッター（© FIELD-X）。LP/Thanks の .footer とは別。 */
.site-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 28px;
  padding: 0 0.75rem;
  font-size: 0.75rem;
  line-height: 1;
  color: var(--secondary-color);
}

.site-footer-bottom p {
  margin: 0;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========================================
   ボタン（共通） - デザインシステムに統合
   ======================================== */
/* 既存のボタンクラスは後方互換性のため残すが、デザインシステムのクラスを推奨 */






















/* ========================================
   フォーム（共通）
   ======================================== */
.form-group {
  margin-bottom: 1rem;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-400);
  border-radius: 4px;
  box-sizing: border-box;
}

.form-section {
  margin-bottom: 2rem;
}

.form-label-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.form-label {
  font-weight: bold;
  font-size: 1rem;
  color: var(--text-primary);
  margin: 0;
}

.form-readonly-value-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.form-readonly-value-wrap .form-readonly-value {
  color: var(--text-primary);
}

.form-checkboxes {
  display: flex;
  gap: 1rem;
}

.form-help {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0.25rem 0 0.5rem 0;
}

/* 注意書きセクション（ステップ3・4で共通） */
.step-note {
  background-color: var(--alert-warning-bg);
  padding: 0.75rem 1rem;
  margin: 0.5rem 0 1rem 0;
  border-radius: 4px;
  text-align: center;
}
.step-note .help {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-primary);
}
.step-note .bulk-ai-trigger {
  margin-top: var(--spacing-md);
}

/* SERP キーワード候補（ステップ3） */
.serpapi-keyword-suggestions-list {
  margin-top: 0.5rem;
  line-height: 1.8;
}
.serpapi-kw-tag {
  display: inline-block;
  margin: 0 0.5rem 0.25rem 0;
  padding: 0.2rem 0.5rem;
  background: var(--gray-100, #f3f4f6);
  border-radius: 4px;
  font-size: 0.9rem;
}

.serpapi-keyword-suggestions-by-source {
  margin-top: 0.5rem;
}
.serpapi-kw-source-section {
  margin-bottom: 1rem;
}
.serpapi-kw-source-section:last-child {
  margin-bottom: 0;
}
.serpapi-kw-source-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}
.serpapi-kw-source-section .serpapi-keyword-suggestions-list {
  margin-top: 0;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  box-sizing: border-box;
  font-size: 1rem;
  line-height: 1.5;
  background: var(--secondary-light);
}

/* フォームセクション（LP・Thanks 編集・管理画面等で使用） */
.form-section {
  margin-bottom: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--border-lighter);
  border-radius: 8px;
  background: var(--white);
}

.form-section:last-child {
  margin-bottom: 0;
}

/* ========================================
   カラーパレット
   ======================================== */
.color-palette {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.3rem;
  margin-top: 0.5rem;
  padding: 0.8rem;
  background: var(--secondary-light);
  border-radius: 6px;
  border: 1px solid var(--border-lighter);
  max-width: 200px;
}

.color-palette-item {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px var(--black-10);
}

.color-palette-item:hover {
  transform: scale(1.15);
  border-color: var(--info-link);
  box-shadow: 0 2px 8px rgba(var(--info-link-rgb), 0.4);
  z-index: var(--z-sticky);
}

.color-palette-item.active {
  border-color: var(--info-link);
  box-shadow: 0 0 0 2px rgba(var(--info-link-rgb), 0.3);
  transform: scale(1.1);
}

.color-palette-item::after {
  content: "✓";
  color: var(--white);
  font-size: 10px;
  font-weight: bold;
  opacity: 0;
  transition: opacity 0.2s ease;
  text-shadow: 0 0 2px var(--black-80);
}

.color-palette-item.active::after {
  opacity: 1;
}

/* カラーパレットのカテゴリ */
.color-palette-category {
  margin-bottom: 0.8rem;
}

.color-palette-category h4 {
  margin: 0 0 0.3rem 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* グラデーション用の特別なスタイル */
.gradient-palette-item {
  background: linear-gradient(45deg, var(--start-color), var(--end-color));
  position: relative;
}

.gradient-palette-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    transparent 30%,
    var(--white-30) 50%,
    transparent 70%
  );
  border-radius: 6px;
}

/* カラーパレットのトグルボタン */
.color-palette-toggle {
  background: var(--secondary-light);
  border: 1px solid var(--border-lighter);
  border-radius: 4px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  transition: all 0.2s ease;
}

.color-palette-toggle:hover {
  background: var(--border-lighter);
  color: var(--text-primary);
}

.color-palette-toggle.active {
  background: var(--info-link);
  color: var(--white);
  border-color: var(--info-link);
}

/* ========================================
   グラデーションカスタマイザー
   ======================================== */
.gradient-customizer {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--secondary-light);
  border-radius: 6px;
  border: 1px solid var(--border-lighter);
}

.gradient-customizer h4 {
  margin: 0 0 0.8rem 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gradient-color-picker {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.gradient-color-picker label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 50px;
}

.gradient-start-color,
.gradient-end-color {
  width: 40px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  cursor: pointer;
  background: none;
}

.apply-gradient-btn {
  background: var(--info-link);
  color: var(--white);
  border: none;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: background-color 0.2s ease;
}

.apply-gradient-btn:hover {
  background: var(--info-link-hover);
}

.gradient-preview {
  height: 40px;
  border-radius: 4px;
  margin-top: 0.5rem;
  border: 1px solid var(--gray-300);
  box-shadow: 0 1px 3px var(--black-10);
}

/* ========================================
   ログイン画面
   ======================================== */
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-grow: 1;
  position: relative;
  overflow: hidden;
  padding: 2rem 1rem;
  box-sizing: border-box;
}

/* 背景＝スライドの見本を並べたタイル。奥へ傾けた面を、左下から右上へ流す。
   🔴 **スライドの並びと流れる向きをそろえてある**（2026-10-18 林周平さん指示）＝面の中で grid ごと
      30 度ひねり（`rotateZ`）、進むのはその面の「上」方向だけ（`translate3d(0, -1150px, 0)`＝敷いたタイルの高さちょうど）。
      だから列がそのまま流れの線になる。⚠ 動かす量はタイルのちょうど 1 枚ぶん＝継ぎ目が出ない。
   ⚠ **「動きを減らす」設定でも止めない**（2026-10-18 林周平さん決定）＝この動きは画面の見せ場で、
      止めると意図が伝わらない。毎秒 7px ほどのゆっくりした流れ（2026-10-18 林周平さんが 10 分の 1 →5 倍と決めた結果）。 */
.login-bg {
  position: fixed;   /* 画面いっぱいに敷く（下に白い帯を残さない） */
  inset: 0;
  overflow: hidden;
  z-index: 0;
  perspective: 460px;   /* 遠近をさらに強く＝手前が大きく、奥が小さく */
}

.login-bg__plane {
  position: absolute;
  top: -130%;
  left: -130%;
  width: 360%;
  height: 360%;
  background: url("../../images/login/login-bg-tile.webp") 0 0 / 1350px 1150px repeat;
  transform: rotateX(36deg) rotateZ(30deg);
  animation: login-bg-drift 160s linear infinite;
  will-change: transform;
}

/* 奥（上）は暗く、手前（下）は明るく＝奥行きを出す膜。文字の読みやすさも兼ねる。
   ⚠ タイル側で既に色を抑えて白へ寄せてあるので、ここは薄く掛ける（二重に白くしない） */
.login-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(16, 22, 36, 0.40) 0%,
    rgba(16, 22, 36, 0.10) 30%,
    rgba(255, 255, 255, 0.18) 66%,
    rgba(255, 255, 255, 0.42) 100%
  );
}

@keyframes login-bg-drift {
  from { transform: rotateX(36deg) rotateZ(30deg) translate3d(0, 0, 0); }
  to { transform: rotateX(36deg) rotateZ(30deg) translate3d(0, -1150px, 0); }
}

.login-container {
  position: relative;
  z-index: 1;
  background: var(--white);
  padding: 2rem 3rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--black-10);
  text-align: center;
  min-width: 320px;
  max-width: 420px;
  width: 100%;
}

.login-container h1 {
  margin-top: 0;
}

.login-container .form-group input {
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  box-sizing: border-box;
}

.errors {
  color: red;
  margin-bottom: 1rem;
  list-style: none;
  padding: 0;
  font-size: 0.9rem;
}

.login-message {
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

/* 案内メールのリンクから来た人に出す行き先（タグ＋ページ名・中央寄せ）
   囲みは罫線を使わず背景のトーンで表す（UI 規約）。タグは囲みより薄い白地で抜く */
.login-destination {
  margin: 0 0 1.25rem;
  padding: 0.9rem 1rem;
  border-radius: 8px;
  background: var(--gray-100, #f3f4f6);
  text-align: center;
}

.login-destination__tag {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--white, #fff);
  color: var(--text-secondary);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.login-destination__name {
  display: block;
  margin-top: 0.45rem;
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.5;
}

.login-forgot {
  margin-top: 1rem;
  font-size: 0.9rem;
}

.login-forgot a {
  color: var(--theme-navy);
}

/* ========================================
   ダッシュボード
   ======================================== */
/* キャンペーン一覧の公開状態の列（dashboard-funnel.js）
   ⚠ 後から読まれる form.css の .form-select（padding 8px 12px）に負けないよう、表の中に絞って書く */
.dashboard-table .dashboard-visibility-select {
  width: auto;
  padding: var(--spacing-sm);
}

/* 表の列に押し縮められて「公開中」に矢印が重なっていた（2026-09-25 画面で確認）＝中身の幅を下限に（選択肢は短い 2 つだけ） */
.dashboard-visibility-select {
  min-width: max-content;
}

/* ファネル設定のモーダル（一覧の「設定」ボタン・2026-09-26） */
.dashboard-funnel-modal__campaign {
  font-weight: 600;
}

.dashboard-funnel-modal__options {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin: var(--spacing-md) 0 var(--spacing-lg);
}

.dashboard-funnel-modal__option {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  cursor: pointer;
}

/* 列が多い一覧なので左右の余白を詰める（2026-09-26 ユーザー指示「見切れているので列幅や余白を調整」） */
.dashboard-table th,
.dashboard-table td {
  padding-left: var(--spacing-xs);
  padding-right: var(--spacing-xs);
}

/* 両端の列だけは表の縁から離す */
.dashboard-table th:first-child,
.dashboard-table td:first-child {
  padding-left: var(--spacing-md);
}

.dashboard-table th:last-child,
.dashboard-table td:last-child {
  padding-right: var(--spacing-md);
}

/* 名前は折り返してよいが、1 行 2〜3 文字まで細らないように */
.dashboard-table__name {
  min-width: 6em;
}

/* 構築アクションの列幅はこのボタンで決まる＝左右の余白を詰める */
.dashboard-table .action-dropdown .dropdown-toggle {
  padding-left: var(--spacing-sm);
  padding-right: var(--spacing-sm);
}

.dashboard-table__nowrap {
  white-space: nowrap;
}

/* キャンペーン名以外（公開状態から右）は見出しも中身も中央揃え（2026-09-26 ユーザー指示「中央揃えに統一」）。
   ⚠ 構築アクションのメニュー（表の中に開く）は中央揃えを受け継がないよう左に戻す */
.dashboard-table th:not(:first-child),
.dashboard-table td:not(:first-child) {
  text-align: center;
}

.dashboard-table .dropdown-menu {
  text-align: left;
}

/* 表の中のボタンは左右の余白を詰める（列が多く 1280 幅に収めるため） */
.dashboard-table .btn-sm {
  padding-left: var(--spacing-sm);
  padding-right: var(--spacing-sm);
}

/* 公開中は色で見分ける（非公開は既定の見た目） */
.dashboard-visibility-select.is-published {
  color: var(--success-color);
  font-weight: 600;
}

.dashboard-step {
  white-space: nowrap;
}

.dashboard-step__arrow {
  margin-right: var(--spacing-xs);
  color: var(--gray-400);
}

.dashboard-step__none {
  color: var(--gray-500);
}

/* ステップのページの公開 URL をコピー（2026-09-26）。「〜を編集」の下の 2 行目に置く＝列の幅は「〜を編集」で決まり、これで広げない。
   枠も背景も付けない小さな灰色の文字（2026-09-26 ユーザー指示「主張が激しい・控えめに」） */
.dashboard-step__copy {
  display: block;
  margin-top: 2px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: var(--font-size-xs);
  color: var(--gray-500);
  text-align: left;
  cursor: pointer;
}

.dashboard-step__copy:hover:not(:disabled) {
  color: var(--gray-600);
  text-decoration: underline;
}

.dashboard-step__copy:disabled {
  color: var(--gray-400);
  cursor: not-allowed;
}

/* 「〜を編集」とコピーを 1 つの箱にし、②③では矢印の右に並べる（ボタンの頭が文字の頭に揃う） */
.dashboard-step__main {
  display: inline-block;
  vertical-align: top;
}







.no-documents {
  text-align: center;
  padding: 3rem;
  background: var(--white);
}

/* ========================================
   ドロップダウン（共通スタイル）
   ======================================== */
.dropdown,
.action-dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background-color: white;
  min-width: 280px;
  box-shadow: 0 8px 16px 0 var(--black-20);
  z-index: var(--z-sticky);
  border-radius: 4px;
  padding: 0.5rem 0;
  margin-top: 0.5rem;
}

/* クリック表示制御 */
.dropdown.is-active .dropdown-menu {
  display: block;
}

.dropdown-item {
  display: block;
  padding: 0.75rem 1.25rem;
  color: var(--text-primary);
  white-space: nowrap;
}

.dropdown-item:hover {
  background-color: var(--gray-100);
  text-decoration: none;
}

/* 押せない項目（権限なし等・views/dashboard.php）。見た目の正本はここ（以前は `.timeline-item.disabled` が偶然定義を満たしていた） */
.dropdown-item.disabled,
.dropdown-item.disabled:hover {
  color: var(--secondary-color);
  background-color: transparent;
  cursor: not-allowed;
}

.dropdown-item small {
  display: block;
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.dropdown-divider {
  margin: 0.25rem 0;
  border: 0;
  border-top: 1px solid var(--gray-200);
}

/* アクションドロップダウン固有のスタイル */
.action-dropdown .dropdown-menu {
  min-width: 120px;
  font-size: 0.9rem;
}

/* ========================================
   2分割エディタレイアウト
   ======================================== */
.editor-container {
  display: flex;
  height: calc(100vh - 61px); /* ヘッダーの高さを引く */
  overflow: hidden;
}

/* 左側：編集パネル（スクロール時も右端余白を常時確保しない） */
.editor-panel {
  flex: 0 0 450px;
  min-width: 0;
  background: var(--white);
  overflow-y: auto;
  scrollbar-gutter: auto;
  border-right: 1px solid var(--gray-300);
  display: flex;
  flex-direction: column;
}

/* パネル自体が白い面なので、中のフォームをカードにしない（灰色の余白に白いカードが浮く二重の枠をやめた） */
.editor-panel > .editor-form {
  border-radius: 0;
  box-shadow: none;
}

/* 右側：プレビューパネル */
.preview-panel {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--border-lighter);
  display: flex;
  flex-direction: column;
}

/* 768px 以下で表示する編集/プレビュー切り替えタブ（LP・Thanks 共通） */
.editor-tabs {
  display: none;
}

.preview-controls {
  flex-shrink: 0;
  padding: 0.75rem 1.5rem;
  background: var(--white);
  border-bottom: 1px solid var(--gray-300);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

/* プレビュー iframe: 表示する画面幅(px)をスライダーで指定し、はみ出しはコンテナの横スクロールで表示 */
.preview-window-wrapper {
  flex-grow: 1;
  min-width: 0;
  padding: 0 1.5rem 1.5rem 1.5rem;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: auto;
}

.preview-viewport-toolbar {
  position: sticky;
  top: 0;
  z-index: var(--z-above-base);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  padding: 0.75rem 0 0.5rem 0;
  gap: 0.5rem;
  color: var(--secondary-color);
  font-size: 0.9rem;
  min-width: 0;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
}

.preview-viewport-toolbar__label {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-width: 0;
  margin-left: 5px;
}

.preview-viewport-toolbar input[type='range'] {
  width: 120px;
  max-width: 100%;
  min-width: 80px;
}

.preview-iframe-scale-container {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.preview-iframe-scaler {
  transform-origin: top left;
}

#preview-iframe {
  border: none;
  background: var(--white);
  box-shadow: 0 4px 12px var(--black-10);
}

/* ========================================
   エディタ画面個別スタイル
   ======================================== */
.editor-form {
  background: var(--white);
  padding: 0;
  border-radius: 8px;
  box-shadow: 0 2px 4px var(--black-05);
}

.editor-header {
  margin-bottom: 2rem;
}

.editor-header h1 {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.editor-header p {
  margin-top: 0;
  color: var(--secondary-color);
}

.category-dropdown {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-lighter);
  border-radius: 6px;
  background: var(--white);
  font-size: 1rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.category-dropdown:focus {
  outline: none;
  border-color: var(--info-link);
  box-shadow: 0 0 0 3px rgba(var(--info-link-rgb), 0.1);
}

.category-dropdown:hover {
  border-color: var(--info-link);
}

.category-content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  background: var(--white);
}

.category-panel {
  display: none;
  padding: 1rem;
  animation: fadeIn 0.3s ease-in-out;
}

.category-panel.active {
  display: block;
}

.category-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--secondary-light);
}

.category-header h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.category-header h3 i {
  color: var(--info-link);
  font-size: 1.3rem;
}

.category-description {
  margin: 0 0 1.5rem 0;
  color: var(--secondary-color);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* 黄色背景の説明文（共通） */
.explanation-note {
  margin: 0 0 1.5rem 0;
  padding: 0.75rem 1rem;
  background: var(--brand-accent-yellow-bg);
  border: 1px solid var(--brand-accent-yellow-border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* AI生成機能のスタイル */
.ai-context-selector {
  min-width: 0;
  background: linear-gradient(
    90deg,
    rgba(var(--ai-gradient-start-rgb), 0.08),
    rgba(var(--ai-gradient-mid-rgb), 0.08) 64.5%,
    rgba(var(--ai-gradient-end-rgb), 0.08)
  );
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid rgba(var(--ai-gradient-start-rgb), 0.2);
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
  box-shadow:
    0 4px 12px rgba(var(--ai-gradient-start-rgb), 0.15),
    0 2px 4px rgba(var(--ai-gradient-mid-rgb), 0.1);
}

.ai-context-selector h4 {
  margin: 0 0 0.75rem 0;
  font-size: 1.1rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ai-context-selector h4 i {
  color: var(--info-link);
}

.selected-campaign-display {
  background: var(--white);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--gray-200);
  margin: 0.75rem 0;
  font-size: 0.95rem;
  color: var(--secondary-dark);
}

/* AI一括生成ボタン用の共通ラッパー。上下余白はトークンで指定。 */
.bulk-ai-trigger {
  margin-top: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.bulk-ai-trigger .bulk-ai-abort {
  margin-left: 0;
}

.bulk-ai-trigger .bulk-ai-abort .bulk-ai-abort__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
}

.bulk-ai-trigger .bulk-ai-abort .bulk-ai-abort__hint {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  white-space: normal;
  text-align: center;
}

.lp-hero-candidates {
  margin-top: var(--spacing-md);
  padding: var(--spacing-md);
  border-left: 4px solid var(--primary, #2563eb);
  background: var(--bg-secondary, #f8fafc);
  border-radius: 0 4px 4px 0;
}

/* モーダル内では modal-content が余白を持つため、枠スタイルを弱める。flex でタイトル・リスト・アクションを縦並びにし高さを親に合わせる */
.modal-content .lp-hero-candidates {
  margin-top: 0;
  padding: 0;
  border-left: none;
  background: transparent;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.lp-hero-candidates__title {
  margin: 0 0 var(--spacing-sm);
  font-size: 1rem;
  font-weight: 600;
}

.lp-hero-candidates__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

/* モーダル内ではリストのみスクロールさせる */
.modal-content .lp-hero-candidates__list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* モーダル内でタイトル・アクションは固定表示（縮まない） */
.modal-content .lp-hero-candidates__title,
.modal-content .lp-hero-candidates__actions {
  flex-shrink: 0;
}

.lp-hero-candidates__actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.lp-hero-candidates__item {
  padding: var(--spacing-sm);
  background: #fff;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.lp-hero-candidates__item:hover {
  border-color: var(--primary, #2563eb);
}

.lp-hero-candidates__item--selected {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.lp-hero-candidates__preview {
  margin-bottom: var(--spacing-sm);
}

/* ヒーロープレビュー（LPテンプレート .fvWrap と同じスタイル。コンテナ幅ベースでスケール）
   CSS変数（--css_themeColor 等）は JS の renderHeroCandidatesList でフォーム入力値からインライン注入される */
.lp-hero-candidates__hero {
  container-type: inline-size;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  background: #fff;
  box-sizing: border-box;
}

/* 資料請求ショートLP: 候補プレビュー（ロングFVではなく資料ブロック想定のレイアウト） */
.lp-hero-candidates__hero--lead-download {
  text-align: left;
}
.lp-hero-candidates__hero--lead-download .lp-hero-candidates__leadTitle {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--css_deepColor, #1b224c);
}
.lp-hero-candidates__hero--lead-download .lp-hero-candidates__leadLead {
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  white-space: pre-wrap;
  color: var(--text-secondary, #475569);
}
.lp-hero-candidates__hero--lead-download .lp-hero-candidates__leadSub {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--css_themeColor, #00afb9);
}
.lp-hero-candidates__hero--lead-download .lp-hero-candidates__leadBullets {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--text-secondary, #475569);
}

.lp-hero-candidates__hero p.subCatchcopy {
  margin: 9px 0 0;
  padding: 9px;
  font-size: clamp(15px, calc(100cqw * 15 / 769), 22px);
  font-weight: 700;
  line-height: 1.5em;
  text-align: center;
}

.lp-hero-candidates__hero p.upperCatchcopy {
  display: inline-block;
  padding: 0.18em 0.45em;
  text-align: center;
  width: 100%;
  margin: 5px 0;
  font-size: clamp(18px, calc(100cqw * 19 / 769), 27px);
  font-weight: 700;
}

.lp-hero-candidates__hero .catchcopy {
  font-size: clamp(22px, calc(100cqw * 22 / 769), 37px);
  font-weight: 900;
  line-height: 1.3em;
  margin: 5px 0;
  padding: 9px 0 18px;
  text-align: center;
}

.lp-hero-candidates__hero .catchcopy span.blueBack {
  font-size: inherit;
  display: inline-block;
  line-height: 1.15;
  padding: 0.12em 0.28em;
  background: var(--css_themeColor);
  color: var(--css_invertedTextColor);
}

.lp-hero-candidates__hero .catchcopy span.underline {
  font-size: inherit;
  letter-spacing: 0.09em;
  display: inline;
  line-height: 1.15;
  padding: 0 0.05em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.lp-hero-candidates__hero span.underline {
  background: linear-gradient(transparent 60%, var(--css_fvHighlightColor) 30%);
  display: inline;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.lp-hero-candidates__hero p {
  font-size: clamp(11px, calc(100cqw * 11 / 769), 16px);
  margin: 12px 0 0;
  line-height: 1.5em;
}

.lp-hero-candidates__pre,
.lp-hero-candidates__main,
.lp-hero-candidates__sub {
  font-size: 0.9375rem;
  line-height: 1.5;
}

.lp-hero-candidates__main {
  font-weight: 600;
}

.lp-hero-candidates__sub {
  color: var(--text-secondary, #64748b);
}

.lp-hero-candidates__direction {
  margin-top: var(--spacing-sm);
  margin-bottom: var(--spacing-xs);
  padding: 0.65rem 0.75rem;
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 6px;
}

.lp-hero-candidates__directionTitle {
  margin: 0 0 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.02em;
  color: var(--primary, #2563eb);
}

.lp-hero-candidates__directionBody {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text-secondary, #475569);
}

.lp-hero-candidates__btn {
  margin-top: 4px;
}

/* 「採用中」は押せない（disabled）が、選んだ印として色を保つ。
   ⚠ `.btn:disabled`（design-system.css）の灰色と同じ詳細度＝後に読む本ファイルで勝つ（:disabled まで書く） */
.lp-hero-candidates__btn--selected,
.lp-hero-candidates__btn--selected:disabled {
  opacity: 1;
  background: var(--primary, #2563eb);
  color: #fff;
  border-color: var(--primary, #2563eb);
  cursor: default;
}

.lp-hero-candidates__abort,
.lp-hero-candidates__continue {
  margin-top: 0;
}

@media (max-width: 768px) {
  .lp-hero-candidates__list {
    grid-template-columns: 1fr;
  }
  .lp-hero-candidates__hero {
    padding: 14px;
  }
}


/* ========================================
   ステップバー & コンテナ
   ======================================== */
.step-bar {
  max-width: 800px;
  margin: 2rem auto;
}

.step-bar-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.step-bar-item,
.step-bar-item:hover {
  text-decoration: none;
}

.step-bar-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 0 0 auto;
  min-width: 80px;
  color: var(--gray-400);
  text-decoration: none;
}

/* form.css の .step-number { min-width: 60px } と競合するため、正円を維持するために明示 */
.step-bar-item .step-number {
  position: relative;
  width: 40px;
  height: 40px;
  min-width: 40px;
  max-width: 40px;
  line-height: 40px;
  border-radius: 50%;
  background-color: var(--gray-400);
  color: var(--white);
  font-weight: bold;
  margin-bottom: 0.5rem;
  transition: background-color 0.3s;
}

.step-bar-item .step-name {
  font-size: 0.8rem;
  line-height: 1.2;
  white-space: nowrap;
}

/* 進み具合（2026-10-06）: 済＝✓・見直し＝！の印。判定は ServiceDevProgress */
.step-bar-item[data-status="done"],
.step-bar-item[data-status="review"] {
  color: var(--text-primary);
}

.step-bar-item[data-status="done"] .step-number {
  background-color: var(--success-color);
  font-size: 0;
}

.step-bar-item[data-status="done"] .step-number::before {
  content: "✓";
  font-size: 1.1rem;
}

.step-bar-item[data-status="review"] .step-number {
  background-color: var(--success-color);
}

.step-bar-item[data-status="review"] .step-number::after {
  content: "!";
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  line-height: 18px;
  border-radius: 50%;
  background: var(--danger-color);
  color: var(--white);
  font-size: 0.75rem;
}

/* 見直しの理由（2026-10-07）: 印にマウスを載せた時・キーボードで選んだ時だけ出す（そのステップを開いたら JS が消す・2026-10-13〜）。位置の基準は .step-bar-item（relative） */
.step-bar-notice {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  z-index: var(--z-dropdown);
  width: max-content;
  max-width: min(320px, 80vw);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  background: var(--danger-dark);
  color: var(--white);
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  transform: translateX(-50%);
  box-shadow: 0 4px 12px var(--black-10);
}
.step-bar-item[data-status="review"]:hover .step-bar-notice:not([hidden]),
.step-bar-item[data-status="review"]:focus-visible .step-bar-notice:not([hidden]) {
  display: block;
}

.step-bar-item.active {
  color: var(--text-primary);
  font-weight: bold;
}

.step-bar-item.active .step-number {
  box-shadow: 0 0 0 3px var(--white), 0 0 0 5px var(--info-link);
}

.step-bar-item.active[data-status="todo"] .step-number {
  background-color: var(--info-link);
}

.step-bar-parts {
  display: flex;
  gap: 3px;
  margin-top: 0.35rem;
  min-height: 6px;
}

.step-bar-part {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gray-200);
}

.step-bar-part[data-done="1"] {
  background: var(--success-color);
}

.step-bar-connector {
  flex-grow: 1;
  height: 2px;
  background-color: var(--gray-400);
  margin: 20px 0;
}

.step-bar-connector[data-done="1"] {
  background-color: var(--success-color);
}

.step-bar-progress {
  height: 4px;
  margin-top: 1rem;
  border-radius: 2px;
  background: var(--gray-200);
  overflow: hidden;
}

.step-bar-progress__fill {
  display: block;
  height: 100%;
  background: var(--success-color);
  transition: width 0.4s;
}

/* スマホ: 名前は今いるステップだけ（ほかは番号と ✓ で足りる）。名前は帯の下に 1 行で出す */
@media (max-width: 600px) {
  .step-bar-container {
    position: relative;
    padding-bottom: 1.6rem;
  }

  .step-bar-item {
    min-width: 40px;
  }

  .step-bar-item .step-name {
    display: none;
  }

  /* 丸（40px＋下 0.5rem）と点（0.35rem＋6px）の下に置く */
  .step-bar-item.active .step-name {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(40px + 0.85rem + 6px + 0.35rem);
  }
}

/* 処理中の区切りの帯（2026-10-06・operation-progress.js が押したボタンのすぐ下に出す）。割合は出さず、全段ぶんの区切りを順に埋める */
.op-progress {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex-basis: 100%;
  width: 100%;
  max-width: 420px;
  margin-top: 0.5rem;
}

.op-progress__track {
  display: flex;
  gap: 3px;
}

.op-progress__track > span {
  flex: 1 1 0;
  height: 4px;
  border-radius: 2px;
  background: var(--gray-200);
}

.op-progress__track > span.is-done {
  background: var(--success-color);
}

.op-progress__track > span.is-current {
  background: linear-gradient(90deg, var(--info-link) 0%, var(--gray-200) 50%, var(--info-link) 100%);
  background-size: 200% 100%;
  animation: op-progress-run 1.4s linear infinite;
}

@keyframes op-progress-run {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .op-progress__track > span.is-current {
    animation: none;
    background: var(--info-link);
  }
}

.op-progress__label {
  font-size: 0.8125rem;
  color: var(--gray-600);
}

.step-container {
  display: none;
  padding: 2rem;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  margin-top: 1rem;
  background: var(--white);
  box-shadow: 0 4px 12px var(--black-05);
  scroll-margin-top: 2rem;
}

.step-container.active {
  display: block;
}

/* ステップヘッダー（見出し＋ボタン）と次のブロックの間の余白 */
.step-header-with-action {
  margin-bottom: var(--spacing-md);
}

/* サービス開発: 見出しの右端にボタン（「入力内容をクリアする」など・2026-10-07）。狭い画面は見出しの下へ折り返す */
.step-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}
.step-title-row > h2 {
  margin: 0;
}
.step-title-row__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

/* サービス開発: 左のサブメニュー（2026-10-07・JS の buildStepSubnav が data-subnav の塊から作る）。
   狭い画面は上に貼り付く横並び、広い画面は左の列。今いる所は aria-current（色は背景のトーンだけ） */
.subnav {
  position: sticky;
  top: var(--app-sticky-top);
  z-index: var(--z-dropdown);
  margin: -0.5rem 0 1rem;
  padding: 0.5rem 0;
  background: var(--white);
  box-shadow: 0 2px 8px var(--black-10);
}

/* 狭い画面の横並びは、並びの中だけを横に送る（ページを押し広げない） */
.subnav__list {
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  white-space: nowrap;
  overflow: auto;
}

/* 2 列の右側＝中身が長くても列からはみ出さない */
.step-layout__body {
  min-width: 0;
}

.subnav__list li[hidden] {
  display: none;
}

.subnav__link {
  display: block;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-decoration: none;
}

.subnav__link:hover {
  background: var(--gray-100);
  color: var(--text-primary);
}

.subnav__link[aria-current="location"] {
  background: var(--info-link);
  color: var(--white);
}

[data-subnav] {
  scroll-margin-top: calc(var(--app-sticky-top) + 4rem);
}

@media (min-width: 1100px) {
  .step-layout {
    display: grid;
    grid-template-columns: 11rem minmax(0, 1fr);
    column-gap: 1.75rem;
    align-items: start;
  }

  .subnav {
    top: calc(var(--app-sticky-top) + 1rem);
    margin: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  .subnav__list {
    flex-direction: column;
    white-space: normal;
    overflow: visible;
  }

  [data-subnav] {
    scroll-margin-top: calc(var(--app-sticky-top) + 1rem);
  }
}

/* ========================================
   見出し・サブヘッドライン
   ======================================== */
h2 {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-primary);
  margin: 0 0 1rem 0;
  padding: 0;
  background: none;
  border: none;
  cursor: default;
}

h2:hover {
  background: none;
  color: var(--text-primary);
}

h3.sub-headline {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--info-link);
}

h3.sub-headline:first-of-type {
  margin-top: 1rem;
}

/* ステップ3：作業手順1〜4の見出し（背景オーバーレイで区切りを明確に） */
.work-step-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 1.75rem;
  margin-bottom: 0;
  padding: 0.75rem 1rem;
  background-color: var(--gray-100);
  border-left: 4px solid var(--theme-navy);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 1px 2px var(--black-05);
}

.work-step-title:first-of-type {
  margin-top: 1rem;
}

/* 作業手順内の子見出し・説明文（子見出し → 説明文 → ボタン の構成用） */
.work-step-subtitle {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 1.25rem 0 0.35rem;
}
.work-step-subtitle:first-child {
  margin-top: 0;
}
.work-step-desc {
  margin: 0 0 0.75rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* 見出し直後のコンテンツとの余白 */
.step-container .work-step-title + .form-section,
.step-container .work-step-title + .action-buttons-container,
.step-container .work-step-title + .competitor-url-grid,
.step-container .work-step-title + .competitor-rows-wrapper,
.step-container .work-step-title + .accordion,
.step-container .work-step-title + .work-step-subtitle {
  margin-top: 1rem;
}

/* ========================================
   フォームアクション・ボタンコンテナ
   ======================================== */
.form-actions,
.action-buttons-container {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-200);
}

/* ========================================
   モーダルウィンドウ
   ======================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--overlay-bg);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: calc(var(--app-header-height) + 1rem) 0 2rem 0;
  z-index: var(--z-lp-editor-fixed-header);
  overflow-y: auto;
}

.modal-content {
  background-color: var(--white);
  padding: 2rem;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  color: var(--gray-400);
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text-primary);
}

/* ========================================
   スピナー・アニメーション
   ======================================== */
.spinner {
  border: 2px solid var(--gray-100);
  border-top: 2px solid var(--gray-500);
  border-radius: 50%;
  width: 1em;
  height: 1em;
  animation: spin 1s linear infinite;
  display: inline-block;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes sparkle {
  0%,
  100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

@keyframes sparkle {
  0%,
  100% {
    transform: scale(1) rotate(0deg);
  }
  50% {
    transform: scale(1.1) rotate(180deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   比較テーブル
   ======================================== */
.table-wrapper,
.table-preview-wrapper {
  margin-top: 1rem;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
  border: 1px solid var(--gray-300);
  padding: 0.75rem;
  text-align: left;
  vertical-align: top;
  font-size: 0.9rem;
}

.comparison-table th {
  background-color: var(--secondary-light);
  font-weight: bold;
}

.comparison-table tbody tr:nth-child(odd) {
  background-color: var(--white);
}

.comparison-table-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.comparison-table-list li {
  display: flex;
  gap: 0.2em;
  align-items: flex-start;
  margin: 0 0 0.2rem 0;
}

.comparison-table-list li::before {
  content: "-";
  flex-shrink: 0;
  line-height: inherit;
}

.comparison-table-list li:last-child {
  margin-bottom: 0;
}

.table-preview .comparison-table {
  font-size: 0.8rem;
}

/* テーブルラッパー：横に長いテーブルはラッパー内で横スクロール（10列並ぶ箇所など） */
.table-wrapper {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

/* サービス開発エディタ：このページ内のみ余白を小さめに（俯瞰しやすくする）。
   ⚠ 塊どうしの間（.form-section）は form.css が後に読まれて勝つので、あちらが正本（2026-10-09 に死んでいた写しを外した） */
.service-dev-editor .table-wrapper {
  margin-top: 0.75rem;
}
.service-dev-editor .comparison-table th,
.service-dev-editor .comparison-table td {
  padding: 0.5rem;
}

/* 比較表（AIによる競合比較表）：ビュー幅に収め、横スクロールなし。列幅は colgroup で固定 */
#comparison-table-wrapper {
  overflow-x: visible;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}
#comparison-table-wrapper.table-wrapper {
  overflow-x: visible;
}
#comparison-table-wrapper .comparison-table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
}
#comparison-table-wrapper col.comparison-col-label {
  width: 6%;
}
#comparison-table-wrapper col.comparison-col-data {
  width: 13.4%;
}
#comparison-table-wrapper .comparison-table th:first-child,
#comparison-table-wrapper .comparison-table td:first-child {
  min-width: 0;
  position: sticky;
  left: 0;
  z-index: var(--z-above-base);
  background-color: var(--secondary-light);
  box-shadow: 2px 0 4px var(--black-05);
  font-size: 0.72rem;
  line-height: 1.25;
  padding: 0.35rem 0.25rem;
  /* ヘッダー列（項目・行ラベル）は縦書きで横幅を抑える */
  writing-mode: vertical-rl;
  text-orientation: mixed;
  /* 縦書き時は字間が詰まりやすいので読みやすくする */
  letter-spacing: 0.12em;
  white-space: nowrap;
  vertical-align: middle;
  text-align: center;
}
#comparison-table-wrapper .comparison-table td:first-child {
  background-color: var(--white);
}
#comparison-table-wrapper
  .comparison-table
  tbody
  tr:nth-child(odd)
  td:first-child {
  background-color: var(--white);
}
#comparison-table-wrapper
  .comparison-table
  tbody
  tr:nth-child(even)
  td:first-child {
  background-color: var(--gray-50);
}
#comparison-table-wrapper .comparison-table th:not(:first-child),
#comparison-table-wrapper .comparison-table td:not(:first-child) {
  min-width: 0;
  padding: 0.35rem 0.3rem;
  font-size: 0.78rem;
  line-height: 1.35;
  word-break: break-word;
  overflow-wrap: anywhere;
}
/* ヘッダー行（自社・競合など）は横書きのまま */
#comparison-table-wrapper thead th:not(:first-child) {
  writing-mode: horizontal-tb;
  text-align: center;
  vertical-align: middle;
}

/* 共通訴求列のみ：薄黄色ベース＋風呂敷（市松）を連想する淡い格子 */
#comparison-table-wrapper .comparison-table th.comparison-col-common-appeal,
#comparison-table-wrapper .comparison-table td.comparison-col-common-appeal {
  font-weight: 700;
  background-color: #fff8e8;
  background-image: linear-gradient(
      45deg,
      rgba(200, 160, 80, 0.09) 25%,
      transparent 25%,
      transparent 75%,
      rgba(200, 160, 80, 0.09) 75%
    ),
    linear-gradient(
      45deg,
      rgba(200, 160, 80, 0.09) 25%,
      transparent 25%,
      transparent 75%,
      rgba(200, 160, 80, 0.09) 75%
    );
  background-size: 10px 10px;
  background-position: 0 0, 5px 5px;
}

/* スマホ表示：同じくビュー幅に収める（固定ピクセル幅は付けない） */
@media (max-width: 768px) {
  #comparison-table-wrapper .comparison-table th:first-child,
  #comparison-table-wrapper .comparison-table td:first-child {
    font-size: 0.65rem;
    padding: 0.28rem 0.18rem;
    letter-spacing: 0.1em;
  }
  #comparison-table-wrapper .comparison-table th:not(:first-child),
  #comparison-table-wrapper .comparison-table td:not(:first-child) {
    font-size: 0.72rem;
    padding: 0.3rem 0.25rem;
  }
}

/* 競合URL入力：2列グリッド・コンパクト（サービス開発エディタ内） */
.competitor-url-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  max-width: 100%;
  margin-bottom: 1rem;
}
.competitor-url-cell {
  min-width: 0;
  margin-bottom: 0;
}
.competitor-url-cell .form-input {
  max-width: 100%;
  box-sizing: border-box;
}
@media (max-width: 600px) {
  .competitor-url-grid {
    grid-template-columns: 1fr;
  }
}

/* 競合分析：1行3要素（URL｜取得元テキスト｜サイト情報分析）×10行 */
.competitor-rows-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
  max-width: 100%;
}

.competitor-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1fr 1fr;
  gap: 0.75rem 1rem;
  align-items: start;
  min-width: 0;
}

.competitor-row-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.competitor-row-col .form-label {
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.competitor-row-col .form-input,
.competitor-row-col .form-textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* 作業手順3：表示欄の縦幅を5行程度で揃える */
.competitor-row-col .form-textarea.competitor-row-textarea {
  min-height: 8.5rem;
  resize: vertical;
}
.competitor-row-col .form-textarea:not(.competitor-row-textarea) {
  min-height: 6em;
  resize: vertical;
}
/* 作業手順3の入力欄：スクロールバーを非表示（スクロールは可能） */
.competitor-rows-wrapper .form-textarea {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.competitor-rows-wrapper .form-textarea::-webkit-scrollbar {
  display: none;
}

@media (max-width: 768px) {
  .competitor-row {
    grid-template-columns: 1fr;
  }
}

/* 補助ツールへ残した 2 欄（取得元テキスト｜サイト情報分析）。URL 欄は ② の下へ出した（2026-10-09） */
.competitor-row.competitor-row--pair {
  grid-template-columns: 1fr 1fr;
}
/* その枠の取得中・分析中・失敗（保存されない表示行。2026-10-16） */
.competitor-row-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: -0.25rem 0 0.75rem;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  background: #f5f7fa;
  font-size: 0.85rem;
  color: #374151;
}
.competitor-row-status.is-error {
  background: #fef2f2;
  color: #b91c1c;
}
.competitor-row-status .spinner {
  flex: none;
}

/* 競合調査対象の URL（② の下・次の段へ渡る正本。2026-10-09） */
.competitor-url-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
  max-width: 100%;
}
.competitor-url-list__row {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 0 0.75rem;
  align-items: center;
}
.competitor-url-list__row .form-label {
  margin-bottom: 0;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}
.competitor-url-list__row .form-input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .competitor-row.competitor-row--pair {
    grid-template-columns: 1fr;
  }
  .competitor-url-list__row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

/* SERP結果テーブル：画面幅ははみ出さず、ラッパー内で横スクロール可能にする
   - スマホ（特にSafari）では table-cell の overflow が効かず、長いURLで表自体が右にはみ出すことがあるため
   - 表全体をスクロールコンテナで受け、ビューポート外には出さない */
#serpapi-ads-table-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}
/* 並び・種別・判定・タイトル・リンクURL・ドメイン・スニペット — 幅を配分しリンクURLは折り返し（2026-09-27 に 7 列へ・並びは「競合調査対象1」が入る幅） */
.serpapi-ads-table {
  table-layout: fixed;
  width: 100%;
  max-width: 100%;
}
.serpapi-ads-table th:nth-child(1),
.serpapi-ads-table td:nth-child(1) {
  width: 10%;
  min-width: 7rem;
}
.serpapi-ads-table th:nth-child(2),
.serpapi-ads-table td:nth-child(2) {
  width: 10%;
}
.serpapi-ads-table th:nth-child(3),
.serpapi-ads-table td:nth-child(3) {
  width: 16%;
}
.serpapi-ads-table th:nth-child(4),
.serpapi-ads-table td:nth-child(4) {
  width: 15%;
}
.serpapi-ads-table th:nth-child(5),
.serpapi-ads-table td:nth-child(5) {
  width: 19%;
}
.serpapi-ads-table th:nth-child(6),
.serpapi-ads-table td:nth-child(6) {
  width: 11%;
}
.serpapi-ads-table th:nth-child(7),
.serpapi-ads-table td:nth-child(7) {
  width: 19%;
}

.serpapi-ads-table th,
.serpapi-ads-table td {
  max-height: 8em;
  overflow: auto;
  vertical-align: top;
  word-break: break-word;
  overflow-wrap: anywhere;
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.serpapi-ads-table th::-webkit-scrollbar,
.serpapi-ads-table td::-webkit-scrollbar {
  display: none;
}
/* リンクURL列：長いURLは折り返し（列幅を食いつぶさない） */
.serpapi-ads-table td:nth-child(5) {
  white-space: normal;
  word-break: break-all;
}
/* 並び列: 競合1〜5 に入った行の印と、元の検索順 */
.serpapi-ads-table .serp-pick-badge {
  display: block;
  margin-top: 0.25rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: var(--theme-navy);
  color: #fff;
  font-size: 0.75rem;
  text-align: center;
}
.serpapi-ads-table .serp-search-rank {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-muted, #6b7280);
  font-size: 0.75rem;
  white-space: nowrap;
}
/* 規則だけで並べた時の案内（罫線なしの背景トーン） */
/* ステップ2: 点を上げるには（背景の色だけで区切る・罫線は付けない） */
.kw-advice {
  margin: 16px 0 0;
  padding: 12px 14px;
  background: #f5f7fa;
}
.kw-advice__title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
}
.kw-advice__item + .kw-advice__item {
  margin-top: 10px;
}
.kw-advice__head {
  margin: 8px 0 2px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-900);
}
.kw-advice__list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  line-height: 1.7;
  color: var(--gray-700);
}
.kw-advice__kind {
  display: inline-block;
  margin-right: 8px;
  padding: 0 6px;
  background: #e0ecff;
  color: #1e3a8a;
  font-size: 12px;
  font-weight: 700;
  border-radius: 3px;
}
.kw-advice__kind--ok {
  background: var(--gray-200, #e5e7eb);
  color: var(--gray-700, #374151);
}
/* ステップ2: キーワードの横の月間検索回数（背景の色だけで目立たせる・罫線は付けない） */
.dokenzai-pick__volume {
  display: inline-block;
  margin: 0 6px;
  padding: 2px 8px;
  border-radius: 3px;
  background: #e0ecff;
  color: #1e3a8a;
  font-size: 13px;
  font-weight: 700;
  vertical-align: middle;
  white-space: nowrap;
}
.dokenzai-pick__volume--none {
  background: var(--gray-100, #f3f4f6);
  color: var(--gray-700, #374151);
  font-weight: 400;
}
/* ステップ2 ①: 切り口の仮決め（2026-10-06・service_dev_editor.js の angle ブロック）
   2026-10-09: 下の段（② 買い手・③ 言い方・④ キーワード）と同じ `.s2-stage` の見た目にした
   ＝箱と見出しの形は `.s2-stage` が持つ。ここは中身だけを書く。
   ⚠ 囲みは罫線なしの背景トーン＋ラベル（UI の決まり）＝左アクセントバーと全周細罫線は使わない */
.angle__head-action {
  margin-left: auto;
}
.angle__lead,
.angle__pick-lead {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.7;
  color: #4b5563;
}
.angle__error {
  margin: 8px 0;
  color: #b91c1c;
  font-size: 13px;
}
.angle__error[hidden],
.angle__body[hidden] {
  display: none;
}
/* 3 つの軸（見込み客・困りごと・実現したいこと）を縦に並べ、各軸の 5 つは横に並べて見比べる（2026-10-07 作り替え） */
.angle__axis {
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  min-width: 0;
}
.angle__axis-q {
  display: block;
  margin: 0 0 6px;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}
.angle__axis-note {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 400;
  color: #6b7280;
}
.angle__options {
  display: grid;
  gap: 8px;
  /* 狭い画面は縦に積む */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
}
.angle__option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
}
.angle__option:has(input:checked) {
  background: #eef4ff;
}
.angle__option-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.angle__option-text {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.6;
  color: #111827;
}
.angle__volume {
  font-size: 12px;
  color: #1e3a8a;
}
.angle__volume-note {
  display: block;
  color: #6b7280;
}
.angle__own {
  margin-top: 8px;
  width: 100%;
}
.angle__questions {
  margin: 14px 0 0;
  padding: 12px;
  background: #fff;
  border-radius: 6px;
}
.angle__q-lead {
  margin: 0 0 8px;
  font-size: 12.5px;
  color: #4b5563;
}
.angle__q {
  display: block;
  margin-bottom: 10px;
}
.angle__q-text {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #111827;
}
.angle__restate {
  display: block;
  margin: 14px 0 0;
}
.angle__restate-label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 13px;
  color: #374151;
}
.angle__next {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.angle__draft {
  font-size: 12.5px;
  color: #b45309;
}
.angle__draft[hidden] {
  display: none;
}
.angle__decided,
.angle__review {
  font-size: 12.5px;
  color: #4b5563;
}
/* 決定済みの印（2026-10-10 林周平さん「押したらチェックマークが表示される・緑系」） */
.angle__done {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: #047857;
}
.angle__done-icon {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--success-color, #10b981);
}
.angle__done .angle__decided {
  font-weight: 400;
}
.angle__to-next {
  font-size: 13px;
}
.angle__done[hidden],
.angle__to-next[hidden] {
  display: none;
}
.angle__review {
  margin: 10px 0 0;
  padding: 8px 10px;
  background: #fff7ed;
  border-radius: 4px;
}
/* ステップ3: 他社の打ち出しの型の見立て（2026-10-06） */
.market-pitch {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 4px;
  background: #eef4ff;
  font-size: 13px;
  line-height: 1.7;
  color: #1e3a8a;
}
.market-pitch[hidden] {
  display: none;
}
/* ステップ3: 市場の課題の地図（2026-10-05・service_dev_editor.js の renderMarketMap） */
.market-map {
  margin: 16px 0 28px;
}
.market-map[hidden] {
  display: none;
}
.market-map__scope,
/* AI の結果を描く箱の「作成中」の 1 行（押した時点で前の結果を消して出す・service_dev_editor.js clearAiOutput） */
.ai-output-pending .spinner {
  vertical-align: -3px;
}
.ai-output-pending {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: #f5f7fa;
  font-size: 13px;
  line-height: 1.7;
  color: #374151;
}
.market-map__note {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: #f5f7fa;
  font-size: 13px;
  line-height: 1.7;
  color: #374151;
}
.market-map__table td {
  vertical-align: top;
}
/* 具体的な記述内容（他社のページの字のまま・2026-10-07） */
.market-map__details {
  margin: 0;
  padding-left: 1.1em;
  font-size: 0.8125rem;
  line-height: 1.6;
}
.market-map__details li + li {
  margin-top: 0.25rem;
}
.market-map__detail-seller {
  display: block;
  color: var(--gray-600);
  font-size: 0.75rem;
}
.market-map__count {
  white-space: nowrap;
  min-width: 150px;
}
.market-map__bar {
  display: block;
  height: 6px;
  margin: 4px 0;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
}
.market-map__bar > span {
  display: block;
  height: 100%;
  background: #2563eb;
}
.market-map__sellers {
  display: block;
  white-space: normal;
  font-size: 12px;
  color: #6b7280;
}
.market-map__tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  background: #fef3c7;
  color: #92400e;
  font-size: 12px;
  border-radius: 3px;
}
.market-map__row--low td:first-child strong {
  font-weight: 600;
}
.market-map__marks {
  min-width: 190px;
}
.market-map__mark {
  display: block;
  font-size: 13px;
  line-height: 1.9;
  cursor: pointer;
}
.market-map__list {
  margin: 0 0 16px 1.2em;
  font-size: 14px;
  line-height: 1.8;
}
.market-map__question {
  margin: 0 0 16px;
  padding: 12px;
  background: #f5f7fa;
}
.market-map__finding,
.market-map__possibility {
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.7;
}

/* ステップ1: 公開資料から見つけた事実の候補（2026-10-07・囲みは背景のトーンだけ） */
.own-facts {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: var(--gray-50);
}
.own-facts__inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.5rem 0.75rem;
  margin: 0.5rem 0 0.75rem;
}
.own-facts__input {
  display: block;
}
.own-facts__input-label {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.8125rem;
  color: var(--gray-600);
}
.own-facts__list {
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}
.own-facts__item + .own-facts__item {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-200);
}
.own-facts__pick {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-700);
}
.own-facts__fact {
  margin: 0.25rem 0;
  font-weight: 700;
}
.own-facts__quote {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--gray-600);
  overflow-wrap: anywhere;
}
/* ステップ2 ③: 決めるボタンが画面の外にある間だけ、画面の下に出す帯（2026-10-07） */
.s2-nextbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-dropdown);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1rem;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
  background: var(--white);
  box-shadow: 0 -2px 10px var(--black-10);
}
.s2-nextbar__keyword {
  font-weight: 700;
  color: var(--gray-800);
}
/* クリック単価が分からず、その項目を除いて点を出した評価の印と注意（2026-10-07） */
.dokenzai-pick__warn {
  margin-left: 0.25rem;
  color: #b45309;
  font-weight: 700;
  cursor: help;
}
.dokenzai-pick__note--warn {
  color: #b45309;
}
/* 調べた結果の件数のサマリー（2026-10-07・表の上） */
.serp-summary {
  margin: 0.75rem 0 0.25rem;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--gray-800);
}
.serp-rank-message {
  margin: 0.5rem 0;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  background: #fff7e6;
  color: #8a5a00;
  font-size: 0.875rem;
}
.serp-rank-message[hidden] {
  display: none;
}
/* 調べた件数の内訳（円グラフ・2026-10-07 林周平さん指示）。囲みは罫線なしの背景トーン（UI の決まり） */
.serp-breakdown {
  margin: 0.5rem 0 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: var(--gray-50);
}
.serp-breakdown[hidden] {
  display: none;
}
.serp-breakdown__head {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
}
.serp-pie {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
}
.serp-pie__svg {
  flex: 0 0 auto;
}
.serp-pie__total {
  font-size: 26px;
  font-weight: 700;
  fill: var(--gray-900);
}
.serp-pie__legend {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.25rem 1.25rem;
  flex: 1 1 260px;
}
.serp-pie__legend-item {
  font-size: 0.875rem;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.serp-pie__swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex: 0 0 auto;
}
/* クリック単価: 低額帯で決め、高額帯は参考として薄く出す（2026-10-07 林周平さん「低価格帯で意思決定が進む UI に」） */
.kw-cpc--sub {
  color: var(--gray-500);
  font-weight: 400;
}
.c-table__th--sub {
  color: var(--gray-500);
  font-weight: 500;
}
.serp-fold {
  margin: 0.5rem 0 0;
}
.serp-fold[hidden] {
  display: none;
}
.serpapi-ads-table .serp-link-url {
  color: var(--theme-navy);
  text-decoration: underline;
  white-space: normal;
  word-break: break-all;
  overflow-wrap: anywhere;
}
.serpapi-ads-table .serp-link-url:hover {
  text-decoration: none;
}

/* 競合分析結果（取得元テキスト・サイト情報）2列表示 */
.competitor-results-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
  max-width: 100%;
}

.competitor-result-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.competitor-result-column .form-label {
  margin-bottom: 0.5rem;
  font-weight: bold;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.competitor-result-column .form-textarea {
  flex: 1;
  min-height: 200px;
  resize: vertical;
}

/* ========================================
   アコーディオンUI
   ======================================== */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.accordion-item {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
}

.accordion-item {
  scroll-margin-top: 2rem;
}

.accordion-header {
  width: 100%;
  padding: 1rem 1.5rem;
  background: var(--info-link);
  border: none;
  text-align: left;
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--white);
  cursor: pointer;
  transition: background-color 0.3s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.accordion-header:hover {
  background: var(--info-link-hover);
}

.accordion-header.active {
  background: var(--info-link);
  color: var(--white);
}

.accordion-header::after {
  content: "▲";
  transition: transform 0.3s;
}

.accordion-header.closed::after {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: none;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  padding: 1.5rem;
}

.accordion-content.closed {
  max-height: 0;
  padding: 0 1.5rem;
}

/* ツールチップ表示時はアコーディオン枠でクリップされないよう overflow を解除（開いているときのみ） */
.accordion-item:has(.accordion-content:not(.closed) .c-help-tooltip:hover),
.accordion-item:has(.accordion-content:not(.closed) .c-help-tooltip--visible),
.accordion-item:has(.accordion-content:not(.closed) .c-help-tooltip--open) {
  overflow: visible;
}
.accordion-content:has(.c-help-tooltip:hover):not(.closed),
.accordion-content:has(.c-help-tooltip--visible):not(.closed),
.accordion-content:has(.c-help-tooltip--open):not(.closed) {
  overflow: visible;
}

/* ========================================
   プレビュー制御（LP・Thanks エディタ共通）
   ======================================== */
.preview-controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}


/* ========================================
   レスポンシブ対応
   ======================================== */
@media (max-width: 1024px) {
  .header__inner {
    gap: 1rem;
  }

  .header__ai-pill {
    font-size: 0.55rem;
  }
}

@media (max-width: 768px) {
  .site-header {
    padding: 0;
  }

  .header__inner {
    /* 高さは基底（--app-header-height）のまま */
    gap: 0.5rem;
    margin: 0 1rem;
    width: calc(100% - 2rem);
  }

  .header__left {
    gap: 1.25rem;
  }

  .header__left .logo-text {
    display: none;
  }

  /* モバイルでは主ナビを非表示（ログイン済はハンバーガー内に同等ナビあり。
     未ログインのリンクはほぼログインへのリダイレクトのため、省略表示で残すより非表示にする） */
  .header__main-nav {
    display: none;
  }

  /* login / forgot_password / reset_password 共通カード。
     ベース定義（box-sizing 未指定=content-box）のままだと width:100%+padding 6rem+min-width:320px の
     合成で 375px 画面から横にはみ出すため、モバイルのみ border-box 化して画面内に収める */
  .login-container {
    box-sizing: border-box;
    min-width: 0;
    padding: 2rem 1.25rem;
  }

  /* パネル内主ナビ（ハンバーガー開時・768px 以下で表示）。
     ここから上（769px 以上）では上部の横並びが同じ項目を出しているので隠している。 */
  .header__menu-mobile-nav {
    display: block;
  }

  .header__menu-nav {
    padding: 0.5rem 0 0;
  }

  .header__menu-nav .header__menu-item {
    display: block;
  }

  .header__utility {
    gap: 1rem;
  }

  /* 狭い画面では「戻る」をヘッダに出さない（メニューと決まりの小窓の中にある）。相手の名前は出したまま */
  .header__acting-stop {
    display: none;
  }

  /* 主ナビが無い＝残りの幅を名前に使ってよい（下限は要らない） */
  .header__acting-group {
    min-width: 0;
  }

  .header__acting-name {
    font-size: 0.8rem;
  }

  .header__pill {
    padding: 0 0.75rem;
    font-size: 0.85rem;
  }

  .header__pill span {
    display: inline;
  }

  .header__account-name {
    display: none;
  }

  .header__account-avatar {
    width: 28px;
    height: 28px;
  }

  .header__ai-pill {
    font-size: 0.55rem;
  }

  .logo {
    gap: 0.75rem;
  }

  .logo-icon {
    height: 32px;
    max-width: 180px;
  }

  .logo-main {
    font-size: 1.4rem;
  }

  /* LP・Thanks エディタ: 縦積み・タブ切り替え・プレビュー高さ確保 */
  .editor-container {
    flex-direction: column;
    height: calc(100vh - 61px);
    min-height: calc(100vh - 61px);
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
  }

  /* 編集タブ選択時: body スクロール化（右端縦帯解消）。コンテナはコンテンツ高に合わせる */
  .editor-container[data-active-tab="editor"] {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  /* 768px 以下: タブは固定ヘッダー内（文言設定ドロップダウンの上）に配置されるため sticky 不要 */
  .editor-tabs {
    display: flex;
    flex-shrink: 0;
    gap: 0;
    padding: 0;
    margin: 0;
    border-bottom: 1px solid var(--gray-300);
    background: var(--white);
  }

  .editor-tabs__tab {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: var(--font-size-base, 14px);
    font-weight: 500;
    color: var(--text-primary);
    background: var(--gray-100);
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition:
      background 0.2s ease,
      border-color 0.2s ease;
  }

  .editor-tabs__tab:hover {
    background: var(--gray-200);
  }

  .editor-tabs__tab--active {
    background: var(--white);
    border-bottom-color: var(--theme-navy);
    color: var(--theme-navy);
  }

  .editor-container[data-active-tab="preview"] .editor-panel {
    display: none;
  }

  .editor-container[data-active-tab="editor"] .preview-panel {
    display: none;
  }

  /* 編集タブ選択時: パネルはコンテンツ高まで伸ばし、body でスクロール（右端縦帯解消） */
  .editor-container[data-active-tab="editor"] .editor-panel {
    overflow-y: visible;
    min-height: auto;
  }

  /* 編集タブ選択時もパネルを画面下まで伸ばし、中身だけスクロール（右端余白は scrollbar-gutter: auto で常時確保しない） */
  .editor-panel {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    scrollbar-gutter: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* プレビュータブ選択時はパネルをビューポートいっぱいに伸ばし、縦幅不足・右余白を防ぐ */
  .preview-panel {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
  }

  .preview-window-wrapper {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    padding: 0 0.75rem 0.75rem 0.75rem;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: auto;
    -webkit-overflow-scrolling: touch;
  }

  .category-panel {
    padding: 1rem;
  }

  .ai-context-selector {
    padding: 1rem;
  }

  .color-input-wrapper {
    flex-direction: column;
    align-items: stretch;
  }

  .form-color {
    width: 100%;
    height: 50px;
  }

  .color-text-input {
    max-width: none;
  }

  .preview-controls {
    flex-direction: column;
  }


  /* サービス開発エディタ（ステップ3）モバイル */
  .competitor-results-container {
    grid-template-columns: 1fr;
  }

  .competitor-result-column {
    min-width: 0;
    width: 100%;
  }

  .competitor-result-column .form-section {
    padding: 0.75rem;
    margin-bottom: 1rem;
  }

  .competitor-result-column .form-label-container {
    margin-bottom: 0.25rem;
  }

  /* .table-wrapper の overflow-x は共通で指定済みのためここでは省略 */

  .comparison-table {
    min-width: 600px;
  }

  /* サービス開発の比較表プレビューはビュー幅に収める（上記 min-width を上書き） */
  #comparison-table-wrapper .comparison-table {
    min-width: 0;
  }

  .comparison-table th,
  .comparison-table td {
    padding: 0.5rem;
  }

  /* ステップの帯のスマホ表示は「ステップバー & コンテナ」の節にまとめた（2026-10-06） */

  .step-container {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  /* 狭い画面ではメニューを少し低くする。⚠ 高さはトークンで下げる＝貼り付く物の位置
     （--app-sticky-top）も一緒に下がる（片方だけ直すと 4px の隙間から中身が覗く） */
  :root {
    --app-header-height: 56px;
  }

  .site-header {
    padding: 0;
  }

  .header__inner {
    margin: 0 0.5rem;
    width: calc(100% - 1rem);
  }

  .header__pill span {
    display: none;
  }

  .header__pill[aria-label="管理画面"] span {
    display: none;
  }

  /* スマホでもAI残数は表示する（以前は .usage-line2 を display:none で非表示にしていた） */
  .header__ai-pill {
    font-size: 0.55rem;
  }

  .logo {
    gap: 0.5rem;
  }

  .logo-icon {
    height: 28px;
    max-width: 160px;
  }

  .logo-main {
    font-size: 1.3rem;
  }

  .header__account-avatar {
    width: 24px;
    height: 24px;
  }

  /* サービス開発エディタ（ステップ3）モバイル */
  .step-container {
    padding: 0.75rem;
  }

  .preview-window-wrapper {
    padding: 0 0.5rem 0.5rem 0.5rem;
  }

}

/* ========================================
   キャンペーン削除機能のスタイル（共通スタイルに統合済み）
   ======================================== */


.delete-confirmation {
  background-color: var(--secondary-light);
  border: 1px solid var(--gray-200);
  border-radius: 0.375rem;
  padding: 1rem;
  margin: 1rem 0;
  text-align: center;
}

.warning-text {
  color: var(--danger-color);
  font-size: 0.875rem;
  margin: 1rem 0;
  font-weight: 500;
}

/* モーダルのスタイル（既存のモーダルスタイルと統合） */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--black-50);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: calc(var(--app-header-height) + 1rem) 0 2rem 0;
  z-index: var(--z-lp-editor-fixed-header);
  overflow-y: auto;
}

.modal-content {
  background: var(--white);
  border-radius: 0.5rem;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  position: relative;
  box-shadow: 0 10px 25px var(--black-20);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--secondary-color);
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: var(--secondary-dark);
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
}


/* ⚠ ここにあった `.status-badge` 一式（+ status-sent / status-failed / status-cancelled）は
   削除した（2026-09-11）。バッジの正本は design-system.css の `.badge` 1 つ。
   ⚠ この 4 つは**どの画面からも使われていなかった**（実測）。 */

/* ⚠ ここにあった `.button` 系一式は削除した（2026-09-11）。ボタンは design-system.css の
   `.btn` ＋ modifier が唯一の正本。⚠ `.button-text`（ボタン内の文字要素）は**別の部品**なので残る。
   ⚠ 復活させないこと＝`verify:css-contract` の廃止リストが赤くする。 */

/* ========================================
   トースト通知システム（唯一の正本・2026-09-27 に design-system.css との二重定義を畳んだ）
   レイアウト・z-index は CSS で一元管理（JS のインラインは最小限）。
   ⚠ 背景は「単色＋グラデーション」＝畳む前に実際に出ていた重ね合わせ（design-system の background: 勾配が
      style の background-color に消されず残っていた）をそのまま移した＝見た目を変えていない。
   z-index は var(--z-toast)（ヘルプツールチップ・LP/Thanks 固定ヘッダー・オーバーフローより手前）。
   数値の正本: public_html/assets/css/design-system.css の :root
   ======================================== */
/* 並べる置き場（toast-notification.js が 1 つだけ作る・操作ごとの 1 枚を縦に並べる・2026-09-27）。
   位置はここで持ち、中のトーストは流れに乗せる。縦位置は JS が固定ヘッダーの下へ逃がす。 */
.toast-stack {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

/* いま動いている依頼の置き場（右下）。ふつうのお知らせ（右上）に押し出されない場所へ常に出す。
   2026-10-06・正本 docs/plans/active/2026-10-06-parallel-execution-headroom.md 段 1-h */
.toast-stack--queue {
  top: auto;
  bottom: 20px;
  right: 20px;
  max-width: min(360px, calc(100vw - 32px));
}

/* 右下の列の札は全部「動いている依頼」（順番待ちも含む）＝くるくるを回す（2026-10-16 林周平さん指摘「生成中はくるくるを」） */
.toast-stack--queue > .toast-notification::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  vertical-align: -1px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .toast-stack--queue > .toast-notification::before {
    animation-duration: 3s;
  }
}

/* 置き場の見出し（何の列か分かるように）。⚠ 罫線で囲まない＝背景のトーンとラベルで表す */
.toast-stack--queue .toast-queue-label {
  pointer-events: none;
  align-self: flex-end;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(17, 24, 39, 0.72);
  color: #fff;
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 0.02em;
}

@media (max-width: 640px) {
  /* スマホは画面幅いっぱい（押せるボタンの邪魔をしない高さに留める） */
  .toast-stack--queue {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
    align-items: stretch;
  }
  .toast-stack--queue .toast-queue-label {
    align-self: flex-start;
  }
}

.toast-stack > .toast-notification {
  position: relative;
  top: auto;
  right: auto;
  pointer-events: auto;
}

/* 単独のトースト（サーバーが描く保存の知らせ等）は置き場の外で自分で位置を持つ */
.toast-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 6px;
  color: var(--white);
  font-weight: 500;
  z-index: var(--z-toast);
  animation: slideInRight 0.3s ease-out;
  /* 300px では保存の通知（20 字前後）が最後の 1 字で折り返した（2026-09-15）。狭い画面でも左右 20px を残す。
     ⚠ box-sizing は html/body にしか付いていない（子へ継承しない）＝ここで border-box にしないと max-width に padding が足され 400px になった（E2E 実測） */
  box-sizing: border-box;
  max-width: min(360px, calc(100vw - 40px));
  word-wrap: break-word;
  box-shadow: 0 4px 12px var(--black-15);
}

/* LP/Thanks 編集画面: 右端だけ画面の切り欠きを避ける。
   🔴 **縦位置は CSS で決めない**（2026-09-11）。以前はここに `60px + 90px + 12px` と
   ヘッダーの高さを書いていたが、編集画面の固定ヘッダーは幅で高さが変わり（1440px で 77px・
   768px 以下で 194px）、**狭い画面ではトーストがずっと固定ヘッダーに重なっていた**。
   いまは toast-notification.js が「そのとき実際に上に貼り付いている物」の下へ逃がす。 */
body:has(main.main-container--editor) .toast-stack,
body:has(main.main-container--editor) .toast-notification {
  right: max(12px, env(safe-area-inset-right, 0px));
}

/* 閉じるまで残す札（見出し・本文・リンク・✕）。LP 全体のブラッシュアップが終わった知らせ（lp-brushup-notifier.js）が使う。
   2026-09-27 に右下の別部品（.lp-brushup-notice）から寄せた＝依頼ごとの鍵で、ほかのお知らせに消されない。 */
.toast-notification--closable {
  padding-right: 40px;
}

.toast-notification__title {
  font-weight: 700;
}

.toast-notification__text {
  margin-top: 2px;
  white-space: pre-line;
  font-weight: 400;
}

.toast-notification__link {
  display: inline-block;
  margin-top: 6px;
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
}

.toast-notification__close {
  position: absolute;
  top: 6px;
  right: 8px;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.toast-success {
  background-color: var(--success-color);
  background-image: var(--success-gradient);
}

.toast-error {
  background-color: var(--danger-color);
  background-image: var(--danger-gradient);
}

.toast-warning {
  background-color: var(--warning-color);
  background-image: var(--warning-gradient);
  color: var(--gray-900);
}

.toast-info {
  background-color: var(--info-color);
  background-image: var(--info-gradient);
}

/* トースト通知のアニメーション */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* ========================================
   メール履歴モーダル
   ======================================== */
.modal-large {
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.history-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border-lighter);
}

.history-tab {
  padding: 10px 20px;
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.3s;
  font-size: 14px;
  font-weight: 500;
  color: var(--secondary-color);
}

.history-tab:hover {
  color: var(--info-link);
  background-color: var(--secondary-light);
}

.history-tab.active {
  border-bottom-color: var(--info-link);
  color: var(--info-link);
  background-color: var(--secondary-light);
}

.history-panel {
  display: none;
}

.history-panel.active {
  display: block;
}






.schedule-input {
  padding: 4px 8px;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  font-size: 14px;
  width: 100%;
  max-width: 200px;
}

.schedule-input:focus {
  outline: none;
  border-color: var(--info-link);
  box-shadow: 0 0 0 2px rgba(var(--info-link-rgb), 0.25);
}




/* ⚠ ここにあった `.status-pending` は削除した（2026-09-11）。
   背景の値が `var(--white) 3cd` という**不正な値**で（元は `#fff3cd`・トークン置換で壊れた跡）、
   そもそも**どの画面からも使われていなかった**。直すと使っていないコードが生き返って見えるので消す。 */




.step-intro-browser-btn,
.step-intro-browser-btn:hover {
  text-decoration: none;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .modal-large {
    width: 95%;
    max-height: min(90vh, calc(100vh - 140px));
  }



  .schedule-input {
    max-width: 150px;
  }

}

/* ========================================
   ボタン個別スタイル
   ======================================== */
#js-s4-bulk-generate-button {
  margin: 5px;
}

/* ========================================
   戦略レビュー表示スタイル（2026-09-27 作り直し）
   判定のカード → 次にやること → キーワード案 → 各項目。色は主色（info）と注意色（warning）の 2 つだけ。
   囲みは罫線なしの背景トーン（左の縦線は使わない＝UI の決まり）。
   ======================================== */
.strategy-review-display {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 26px;
  margin-top: 16px;
  line-height: 1.7;
  color: var(--text-primary);
}

/* 旧い保存値（文章の形式）の表示 */
.strategy-review-display h2 {
  margin: 26px 0 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
}

.strategy-review-display h2:first-child {
  margin-top: 0;
}

.strategy-review-display p {
  margin: 0 0 10px;
}

.strategy-review-display ul,
.strategy-review-display ol {
  margin: 0 0 10px;
  padding-left: 1.3em;
}

.strategy-review-display .evaluation-section,
.strategy-review-display .advantage-section,
.strategy-review-display .improvement-section,
.strategy-review-display .opportunity-section,
.strategy-review-display .action-section {
  margin: 16px 0;
  padding: 16px 20px;
  border-radius: 8px;
  background: var(--gray-50);
}

/* 新しい形式（2026-09-27・初めての人向けに作り直し）: 答えのカード → 次にやること → 各項目のカード */
.sr {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

/* 答え（「〇〇」のド顕在キーワードとしての評価は？ → 等級と一言 → ◎◯△✕？ の理由） */
.sr-hero {
  padding: 24px;
  border-radius: 10px;
  background: rgba(var(--info-color-rgb), 0.07);
}

.sr-hero--warn {
  background: color-mix(in srgb, var(--warning-color) 12%, var(--white));
}

.strategy-review-display .sr-hero__question {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--gray-700);
}

.sr-hero__answer {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* 等級 A〜E の色分け（オススメ選び・戦略レビューほか、等級の印すべて・data-grade で塗る）。
   ⚠ 「--warn」の塗り（.sr-hero--warn など）より強く効かせる＝同じクラスを 2 回書いて強める */
.grade-badge.grade-badge[data-grade="A"] { background: var(--grade-a-bg); color: var(--white); }
.grade-badge.grade-badge[data-grade="B"] { background: var(--grade-b-bg); color: var(--white); }
.grade-badge.grade-badge[data-grade="C"] { background: var(--grade-c-bg); color: var(--gray-900); }
/* D は薄い灰＝白字だと読めない（2026-10-07 の色替えで濃い字にした） */
.grade-badge.grade-badge[data-grade="D"] { background: var(--grade-d-bg); color: var(--gray-900); }
.grade-badge.grade-badge[data-grade="E"] { background: var(--grade-e-bg); color: var(--white); }

.sr-hero__grade {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--info-color);
  color: var(--white);
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
}

.sr-hero--warn .sr-hero__grade {
  background: var(--warning-dark);
}

.sr-hero__message {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--gray-900);
}


.strategy-review-display .sr-hero__note {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--gray-700);
}

/* ド顕在キーワードの評価: 4 つの物差し＋総合の半円メーター（2026-10-04・service_dev_editor.js keywordGaugesHtml）。
   色は物差し 1 色（--info-color）＋灰色の背景、総合だけ等級の色（--grade-*-bg）。囲みは背景トーンだけ（縦罫・枠線なし） */
.kw-gauges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.kw-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}
.kw-gauge__svg {
  width: 100%;
  max-width: 120px;
  height: auto;
}
.kw-gauge__track,
.kw-gauge__value {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
}
.kw-gauge__track {
  stroke: var(--gray-200);
}
.kw-gauge__value {
  stroke: var(--info-color);
}
.kw-gauge__center {
  font-size: 26px;
  font-weight: 800;
  fill: var(--gray-900);
}
.kw-gauge--total .kw-gauge__value { stroke: var(--grade-e-bg); }
/* 総合だけ大きく（2026-10-04 ユーザー指示）＝2 列分の幅を取り、半円・文字とも大きくする */
.kw-gauge--total {
  grid-column: span 2;
}
.kw-gauge--total .kw-gauge__svg {
  max-width: 200px;
}
.kw-gauge--total .kw-gauge__label {
  font-size: 14px;
}
.kw-gauge--total .kw-gauge__text {
  font-size: 15px;
}
.kw-gauges--small .kw-gauge--total .kw-gauge__svg {
  max-width: 110px;
}
.kw-gauge--total[data-grade="A"] .kw-gauge__value { stroke: var(--grade-a-bg); }
.kw-gauge--total[data-grade="B"] .kw-gauge__value { stroke: var(--grade-b-bg); }
.kw-gauge--total[data-grade="C"] .kw-gauge__value { stroke: var(--grade-c-bg); }
.kw-gauge--total[data-grade="D"] .kw-gauge__value { stroke: var(--grade-d-bg); }
.kw-gauge__label {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-700);
}
.kw-gauge__text {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-900);
}
.kw-gauge--unknown .kw-gauge__text {
  font-weight: 400;
  color: var(--gray-500);
}
.kw-gauge__sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--gray-700);
}
.kw-gauges--small {
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.kw-gauges--small .kw-gauge__svg {
  max-width: 72px;
}
.kw-gauges--small .kw-gauge__center {
  font-size: 30px;
}
.kw-gauges--small .kw-gauge__label {
  font-size: 11px;
  font-weight: 400;
}
.kw-gauges--small .kw-gauge__text {
  font-size: 12px;
}
/* 総合は半円のスコア・項目は棒グラフ（2026-10-05 林周平さん決定）。左に総合・右に項目（狭い画面では縦に積む） */
.kw-score {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin: 16px 0 0;
}
.kw-score > .kw-bars:only-child {
  grid-column: 1 / -1;
}
.kw-score .kw-gauge--total {
  grid-column: auto;
}
.kw-gauge__score {
  margin-top: -6px;
  font-size: 26px;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1.2;
}
.kw-gauge__score small {
  font-size: 13px;
  font-weight: 700;
}
.kw-bars {
  margin: 0;
  padding: 0;
  list-style: none;
}
.kw-bars__item {
  /* 項目名・棒・点を 1 行に並べる（2026-10-05）。実数や内訳の文は、その下に全幅で添える */
  display: grid;
  grid-template-columns: minmax(120px, 190px) minmax(0, 1fr) 36px;
  column-gap: 10px;
  row-gap: 3px;
  align-items: center;
  padding: 8px 0;
}
.kw-bars__item + .kw-bars__item {
  border-top: 1px solid var(--gray-200);
}
.kw-bars__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-900);
}
.kw-bar {
  display: block;
  height: 10px;
  border-radius: 5px;
  background: var(--gray-200);
  overflow: hidden;
}
.kw-bar__value {
  display: block;
  height: 100%;
  border-radius: 5px;
  /* 点の高さで色を変える（2026-10-07 林周平さん指示・緑＝よい／黄＝中間／灰＝だめ）。印の無い棒は灰 */
  background: var(--band-poor);
}
.kw-bar__value[data-band="good"] { background: var(--band-good); }
.kw-bar__value[data-band="mid"] { background: var(--band-mid); }
.kw-bar__value[data-band="poor"] { background: var(--band-poor); }
.kw-bar--unknown {
  background: repeating-linear-gradient(90deg, var(--gray-200) 0 6px, var(--gray-100) 6px 12px);
}
.kw-bar__score {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-900);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.kw-bars__fact {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--gray-700);
}
.kw-score--small {
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 10px;
  margin-top: 8px;
}
.kw-score--small .kw-gauge--total .kw-gauge__svg {
  max-width: 84px;
}
.kw-score--small .kw-gauge__score {
  font-size: 15px;
}
.kw-score--small .kw-gauge__label {
  display: none;
}
.kw-score--small .kw-bars__item {
  grid-template-columns: minmax(90px, 130px) minmax(0, 1fr) 28px;
  padding: 3px 0;
  border-top: 0;
}
.kw-score--small .kw-bars__label {
  font-size: 11px;
  font-weight: 400;
}
.kw-score--small .kw-bar {
  height: 6px;
}
@media (max-width: 640px) {
  .kw-score {
    grid-template-columns: minmax(0, 1fr);
  }
  .kw-bars__item {
    grid-template-columns: minmax(0, 1fr) 36px;
  }
  .kw-bars__label {
    grid-column: 1 / -1;
  }
}
.kw-note {
  margin: 10px 0 0;
  font-size: 15px;
  color: var(--gray-900);
}
.kw-note--stale {
  font-size: 13px;
  color: var(--gray-500);
}
.kw-guide {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--gray-50);
  font-size: 13px;
}
.kw-guide__summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--gray-700);
}
.kw-guide__list {
  margin: 8px 0 0;
}
.kw-guide__list dt {
  margin-top: 8px;
  font-weight: 700;
  color: var(--gray-900);
}
.kw-guide__list dd {
  margin: 2px 0 0;
  color: var(--gray-700);
}



.sr-check__mark {
  flex: none;
  width: 22px;
  font-weight: 800;
  text-align: center;
}





/* カード */
.sr-card {
  padding: 22px 24px;
  border-radius: 10px;
  background: var(--gray-50);
}

.strategy-review-display .sr-card__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
}

.strategy-review-display .sr-card__lead {
  margin: 2px 0 16px;
  font-size: 13px;
  color: var(--gray-500);
}

.sr-card__title + .sr-todo,
.sr-card__title + .sr-sub {
  margin-top: 16px;
}

/* 次にやること */
.strategy-review-display .sr-todo {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: sr-todo;
}

.sr-todo__item {
  position: relative;
  padding: 12px 14px 12px 46px;
  border-radius: 8px;
  background: var(--white);
  counter-increment: sr-todo;
}

.sr-todo__item::before {
  content: counter(sr-todo);
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--info-color);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
}

.strategy-review-display .sr-todo__title {
  margin: 0;
  font-weight: 700;
  color: var(--gray-900);
}

.strategy-review-display .sr-todo__why {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--gray-500);
}

.strategy-review-display .sr-label {
  margin: 22px 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-700);
}

/* おすすめのド顕在キーワード・調べた言い方 */
.strategy-review-display .sr-words {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sr-word {
  display: inline-flex;
  flex-direction: column;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--white);
}

.sr-word__text {
  font-weight: 700;
  color: var(--gray-900);
}

.sr-word__volume {
  font-size: 12px;
  color: var(--gray-500);
}

.sr-word--good .sr-word__volume {
  font-weight: 700;
  color: var(--info-dark);
}

.sr-advice {
  margin-top: 22px;
  padding: 16px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--warning-color) 10%, var(--white));
}

.strategy-review-display .sr-advice__label {
  margin: 0 0 10px;
  font-weight: 700;
  color: var(--warning-dark);
}

.sr-advice .sr-todo__item::before {
  background: var(--warning-dark);
}

.strategy-review-display .sr-note {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--gray-500);
}

/* オススメのファネル設計 */
.strategy-review-display .sr-stage {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
}

.strategy-review-display .sr-flow__title {
  margin: 12px 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-700);
}

.strategy-review-display .sr-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px 30px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sr-flow__step {
  position: relative;
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--white);
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
}

.sr-flow__step:not(:last-child)::after {
  content: "→";
  position: absolute;
  top: 50%;
  right: -22px;
  transform: translateY(-50%);
  font-weight: 700;
  color: var(--info-color);
}

/* どんな人が検索しているか */
.strategy-review-display .sr-people {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sr-person {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--white);
  color: var(--gray-500);
}

.sr-person__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}

.sr-person__who {
  flex: 1 1 12em;
  font-weight: 600;
}

.sr-person__tag {
  font-size: 12px;
}

/* 分布の棒（長さ＝検索する人全体の中での割合の見立て） */
.sr-person__bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sr-person__track {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: var(--gray-100);
  overflow: hidden;
}

.sr-person__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--gray-400);
}

.strategy-review-display .sr-people__legend {
  margin: 0 0 8px;
}

.strategy-review-display .sr-people__verdict {
  margin: 10px 0 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
}

/* 1 行の印は「見込み度 × 検索割合」の 2 軸を掛け合わせた 1 つ（2026-10-09）。
   色はこの画面の正本の 3 段＝緑 よい／黄 中間／灰 だめ（--band-*）。赤は壊れて見えるので使わない */
.sr-person[data-band="good"] {
  color: var(--gray-900);
}
.sr-person[data-band="good"] .sr-person__fill {
  background: var(--band-good);
}
.sr-person[data-band="good"] .sr-person__tag {
  font-weight: 700;
  color: var(--band-good);
}

.sr-person[data-band="mid"] {
  color: var(--gray-900);
}
.sr-person[data-band="mid"] .sr-person__fill {
  background: var(--band-mid);
}
.sr-person[data-band="mid"] .sr-person__tag {
  font-weight: 700;
  color: var(--band-mid-text);
}

.sr-person[data-band="poor"] .sr-person__fill {
  background: var(--band-poor);
}

/* くわしく見る */
.sr-more {
  margin-top: 16px;
}

.sr-more__summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--info-dark);
}


/* 要点（左）と説明の全文（右）の 2 カラム（2026-10-07・狭い画面は縦に積む） */
.sr-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px 28px;
}
@media (min-width: 900px) {
  .sr-cols {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  }
}
.sr-cols__main {
  min-width: 0;
}
.sr-cols__detail {
  padding: 4px 16px 12px;
  border-radius: 8px;
  background: var(--gray-50);
}

/* 戦略レビューの「この文を直す」（2026-10-09 林周平さん指示「すべての出力されている結果を直接編集できるように」）。
   描画の下に欄を出し、打った文は保存値へ書き戻す（service_dev_editor.js の strategyReviewBindEditing）。見る専用の画面にはボタンを出さない */
/* 戦略レビューのカードの本文（2026-10-09 の「この文を直す」が hidden で入れ替える器）。
   ⚠ 定義が無いと `verify_css_class_contract` が赤になる＝器にも 1 行を置く */
.sr-card__body {
  min-width: 0;
}
.sr-card__body[hidden] {
  display: none;
}
.sr-edit {
  margin-top: 8px;
}
.sr-edit__field {
  width: 100%;
  font-size: 0.875rem;
  line-height: 1.7;
}
.sr-edit__toggle {
  margin-top: 10px;
}
form[data-view-only] .sr-edit__toggle {
  display: none;
}

/* 文章（くわしく見る・旧い形式） */
.strategy-review-display .sr-sub {
  margin: 18px 0 6px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--gray-700);
}

.strategy-review-display .sr-sub:first-child {
  margin-top: 0;
}

.sr-text {
  margin: 0 0 8px;
  color: var(--gray-800);
}

.strategy-review-display .sr-list {
  margin: 0;
  padding-left: 1.2em;
}

.sr-list li {
  margin: 4px 0;
  color: var(--gray-800);
}

/* キーワードが変わった時の注意／競合の URL が変わった時の注意（ステップ3・.step3-stale-note） */
.strategy-review-display .sr-stale,
.step3-stale-note {
  margin: 0 0 20px;
  padding: 12px 14px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--warning-color) 14%, var(--white));
  font-weight: 700;
  color: var(--gray-900);
}

@media (max-width: 768px) {
  .strategy-review-display {
    padding: 16px;
  }

  .sr-hero,
  .sr-card {
    padding: 18px 16px;
  }

  .sr-hero__grade {
    width: 52px;
    height: 52px;
    font-size: 28px;
  }

  .sr-hero__message {
    font-size: 18px;
  }

  .strategy-review-display .sr-flow {
    flex-direction: column;
    gap: 24px;
  }

  .sr-flow__step:not(:last-child)::after {
    content: "↓";
    top: auto;
    right: auto;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* 問合せ詳細（design-system 変数のみ使用） */
.inquiry-detail-content {
  margin-top: 1.5rem;
}

.spam-reason-explanation {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--surface-subtle, #f5f5f5);
  border-left: 3px solid var(--danger, #dc3545);
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-radius: 0 4px 4px 0;
}

.inquiry-detail-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.inquiry-detail-list dt {
  margin-top: 1rem;
  margin-bottom: 0.25rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.inquiry-detail-list dt:first-child {
  margin-top: 0;
}

.inquiry-detail-list dd {
  margin: 0;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-lighter);
  color: var(--text-primary);
}

.inquiry-detail-list dd:last-child {
  border-bottom: none;
}



/* 問合せ詳細：メール送信履歴 */
.inquiry-mail-history {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-lighter);
}

/* 個別停止の完了フラッシュ */
.inquiry-mail-flash {
  margin: 0 0 0.75rem;
  padding: 0.6rem 0.9rem;
  border-radius: 6px;
  background: var(--info-bg, #eff6ff);
  color: var(--info-color, #2563eb);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* 個別停止ボタン（ステップメール履歴の下） */
.inquiry-mail-stop-form {
  margin-top: 0.75rem;
}

.inquiry-mail-stop-form .form-help {
  display: block;
  margin-top: 0.35rem;
}

.inquiry-mail-history-title {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.inquiry-mail-history-block {
  margin-bottom: 1.5rem;
}

.inquiry-mail-history-block:last-child {
  margin-bottom: 0;
}

.inquiry-mail-history-subtitle {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.inquiry-mail-history-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.inquiry-mail-history-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-lighter);
  font-size: 0.875rem;
  color: var(--text-primary);
}

.inquiry-mail-history-item:last-child {
  border-bottom: none;
}

.inquiry-mail-status {
  display: inline-block;
  margin-right: 0.5rem;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
}

.inquiry-mail-status-sent {
  background: var(--success-bg, #e8f5e9);
  color: var(--success-fg, #2e7d32);
}

.inquiry-mail-status-failed {
  background: var(--danger-bg, #ffebee);
  color: var(--danger-fg, #c62828);
}

.inquiry-mail-status-pending {
  background: var(--border-lighter);
  color: var(--text-secondary);
}

.inquiry-mail-response-code {
  margin-right: 0.5rem;
  color: var(--text-secondary);
}

.inquiry-mail-meta {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-secondary);
}

.inquiry-mail-error {
  display: block;
  margin-top: 0.25rem;
  color: var(--danger-fg, #c62828);
  font-size: 0.8125rem;
}

/* ステップメール反応（開封・クリック）。バッジ自体は design-system.css の .badge-* を使う。
   ここはバッジと日時を並べる行ラッパーと、反応なしのミュート表示のみ。 */
.inquiry-mail-engagement {
  display: block;
  margin-top: 0.25rem;
}

.inquiry-mail-engagement-none {
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

/* ===== 共通タグ / カスタムコード パネル（custom_code_panel.php） ===== */
.custom-code-scope {
  border: 1px solid var(--border-color, #d9dee5);
  border-radius: 8px;
  background: var(--panel-subtle-bg, #fafbfc);
  padding: 14px 16px 6px;
  margin: 0 0 16px;
}
.custom-code-scope__legend {
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0 8px;
  color: var(--text-strong, #23303e);
}
.custom-code-field {
  margin: 0 0 14px;
}
.custom-code-field__label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin: 0 0 2px;
}
.custom-code-field__label code,
.custom-code-field__hint code {
  font-size: 0.78em;
  background: rgba(0, 0, 0, 0.06);
  padding: 1px 4px;
  border-radius: 3px;
}
.custom-code-field__hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted, #6b7683);
  margin: 0 0 4px;
}
textarea.custom-code-textarea {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.5;
  white-space: pre;
  tab-size: 2;
}
.custom-code-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 8px;
}
.custom-code-status {
  font-size: 0.8125rem;
  color: var(--text-muted, #6b7683);
}

/* ⚠ ボタンの統一（2026-09-11）で消してしまった文脈調整を戻した。
   AI に渡す文脈を選ぶボタンは、他より大きく見せる（押す対象がこれ 1 つの画面）。 */
.ai-context-selector .btn {
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
}

/* サービス開発ステップ1：自社サービスの参考URL（2026-09-27） */
.step1-reference-urls {
  margin-top: var(--spacing-md);
}
.step1-reference-urls__item {
  margin-bottom: var(--spacing-sm);
}
.step1-reference-urls__label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}
.step1-reference-urls__status {
  font-size: 0.85rem;
  margin: 0.25rem 0 0 0;
  color: var(--text-secondary);
}
.step1-reference-urls__status[data-state="ok"] {
  color: var(--alert-success-text);
}
.step1-reference-urls__status[data-state="error"] {
  color: var(--alert-error-text);
}
.step1-reference-urls__auto {
  margin-bottom: var(--spacing-sm);
}
.step1-reference-urls__auto ul {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.step1-reference-urls__auto li {
  overflow-wrap: anywhere;
}
.step1-reference-urls__auto li[data-state="ok"] {
  color: var(--alert-success-text);
}
.step1-reference-urls__auto li[data-state="error"] {
  color: var(--alert-error-text);
}
.step1-reference-urls__guide {
  background-color: var(--alert-info-bg);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin-top: var(--spacing-sm);
  font-size: 0.85rem;
  color: var(--text-primary);
}
.step1-reference-urls__guide-title {
  font-weight: bold;
  margin: 0 0 0.25rem 0;
}
.step1-reference-urls__guide ul {
  margin: 0;
  padding-left: 1.25rem;
}
.step1-reference-urls__guide li + li {
  margin-top: 0.25rem;
}

/* ステップ1 の補足（お客様の事実・追記推奨・2026-10-07）: 本体の欄と色で見分ける（背景のトーンだけ・左の縦罫は使わない） */
.step1-group--supplement {
  margin-top: 2rem;
  padding: 1rem 1.25rem 0.5rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--warning-color) 8%, var(--white));
}

/* 束の見出し（帯）の色は form.css「サービス開発（S1〜S5）の見出しの帯と余白」が持つ */

/* サブメニューの補助の項目（2026-10-07）: 罫線で区切って一番下に */
.subnav__item--aux {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--gray-300);
}

/* ── 会員のアクセス解析: 流入元 × 問合せ × 費用（views/_partials/mail_analytics/_funnel.php・2026-10-11）──
   囲みは罫線なしの背景トーン＋ラベル（左の縦罫・全周の細罫線は使わない）。色は既存の 2 アクセントのまま */
.traffic-funnel { margin-bottom: 1rem; }
.traffic-funnel__row > td:first-child { min-width: 14rem; }
.traffic-funnel__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.5rem 1rem; margin-bottom: 0.75rem; }
.traffic-funnel__period { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.traffic-funnel__period label { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.8rem; }
.traffic-funnel__period-label { font-size: 0.8rem; color: var(--secondary-color, #666); margin-right: 0.25rem; }
.traffic-funnel__period .btn.is-active { background: var(--theme-navy, #1f3a5f); color: #fff; border-color: var(--theme-navy, #1f3a5f); }
.traffic-funnel__asof { font-size: 0.8rem; color: var(--secondary-color, #666); margin: 0; }
.traffic-funnel__refresh-note { margin-left: 0.5rem; color: var(--danger-color, #b23); }
.traffic-funnel__title { margin: 1rem 0 0.5rem; font-size: 1rem; }
.traffic-funnel__table td { vertical-align: top; }
.traffic-funnel__toggle { margin-left: 0.5rem; padding: 0.1rem 0.5rem; font-size: 0.78rem; border: 1px solid var(--gray-300, #ccc); border-radius: 999px; background: var(--gray-50, #fafafa); cursor: pointer; }
.traffic-funnel__toggle[aria-expanded="true"] { background: var(--gray-200, #e5e7eb); }
.traffic-funnel__detail { margin-top: 0.25rem; font-size: 0.78rem; color: var(--secondary-color, #666); }
.traffic-funnel__detail summary { cursor: pointer; }
.traffic-funnel__detail dl { margin: 0.25rem 0 0; }
.traffic-funnel__detail dt { font-weight: 600; margin-top: 0.25rem; }
.traffic-funnel__detail dd { margin: 0; }
.traffic-funnel__child td { background: var(--gray-50, #fafafa); font-size: 0.9rem; }
.traffic-funnel__child-label { padding-left: 1.5rem !important; }
.traffic-funnel__muted { display: block; font-size: 0.78rem; color: var(--secondary-color, #888); margin: 0.25rem 0 0; }
.traffic-funnel__state { white-space: normal; font-size: 0.85rem; }
.traffic-funnel__actions { white-space: nowrap; font-size: 0.85rem; }
.traffic-funnel__empty { text-align: center; color: var(--secondary-color, #666); padding: 1.5rem !important; }
.traffic-funnel__conditions { margin-top: 1rem; padding: 0.75rem 1rem; background: var(--gray-50, #f6f7f9); border-radius: 8px; font-size: 0.8rem; color: var(--secondary-color, #555); }
.traffic-funnel__conditions-label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.traffic-funnel__conditions ul { margin: 0; padding-left: 1.2rem; }
.traffic-funnel__mail-title { margin-top: 2rem; }
/* 流入元＋参照元（配信 ID・参照元のホスト＝任意長）。折り返して列の幅を抑える（nowrap だと長い参照元で表が伸びる） */
.traffic-source-cell { min-width: 7rem; max-width: 16rem; overflow-wrap: anywhere; }
.inquiry-source { margin-top: 1.5rem; }
@media (max-width: 640px) {
  .traffic-funnel__head { flex-direction: column; align-items: stretch; }
  .traffic-funnel__actions { white-space: normal; }
  .traffic-funnel__child-label { padding-left: 0.75rem !important; }
}
