/*
 * 管理画面(app.shukyakusite.com)のデザイントークン。
 * 以降の全画面がこのファイルを読み込む。画面ごとに色や余白を直接書かない。
 */

/*
 * アイコン（Font Awesome Free 7.3.1、solid のみ）。
 * CDNからは読み込まず、/vendor/fontawesome/ に置いた自前のファイルを使う。
 * ここで読み込むのは、このファイルを読む全画面からアイコンを使えるようにするため。
 * 元のファイルに入っている著作権表示のコメントは消さない
 * （アイコン CC BY 4.0／フォント SIL OFL 1.1／コード MIT。帰属表示が必要）。
 * 差し替えるときは builder で npm run assets:fontawesome を実行する。
 */
@import url("/vendor/fontawesome/css/fontawesome.css");
@import url("/vendor/fontawesome/css/solid.css");

:root {
  /* 色 */
  --color-point: #FEBE10;   /* データ変更を伴うボタン */
  --color-navy: #1A548F;    /* 編集ボタン、フロー途中の「次へ」 */
  --color-danger: #C8352C;  /* 削除ボタン */
  --color-black: #000000;   /* ロゴの地色 */
  --color-bg: #F6F6F6;      /* ページ全体の地 */
  --color-surface: #FFFFFF; /* カード・入力欄の背景 */
  --color-border: #E5E5E5;  /* 区切り・入力欄の枠 */
  --color-text: #333333;    /* 本文 */
  --color-muted: #9A9A9A;   /* 未到達のステップなど、抑えた文字 */
  --color-muted-dark: #858585;

  /* 上の色の明るい段階 */
  --color-point-light: #FFD45E;
  --color-point-lighter: #FFE9A8;
  --color-navy-light: #4A82BC;
  --color-navy-lighter: #A8C6E2;
  --color-danger-light: #E06A62;
  --color-danger-lighter: #F2B8B4;
  --color-muted-light: #C4C4C4;
  --color-muted-lighter: #E0E0E0;

  /* レイアウト */
  --width-single-column: 640px;
  --width-control: 480px;   /* 入力欄の上限。カード幅いっぱいに伸ばさない */
  --height-header: 56px;
  --size-step-circle: 24px;
  --space-page: 16px;
  --radius: 6px;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.06);

  /* 文字 */
  --font-base: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  /* 上は固定ヘッダーの高さぶんを空ける */
  padding: calc(var(--height-header) + 24px) var(--space-page) 48px;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-base);
  font-size: 16px;
  line-height: 1.6;
}

[hidden] { display: none !important; }

/*
 * ヘッダー。以降の全画面が同じものを使う。
 * 画面上部に固定し、中身は --width-single-column に合わせて中央に置く。
 */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  height: var(--height-header);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
  width: 100%;
  max-width: var(--width-single-column);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--space-page);
  display: flex;
  align-items: center;
}

/* タイトルは内側の左端に置く */
.site-header__title {
  color: var(--color-text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

/*
 * ステップ表示。以降の全画面で同じものを使う。
 * 5つのステップを横に並べ、番号の丸とその下の名前で構成する。
 * 640px幅に5つ収まるよう、名前は小さめの文字にする。
 */
.steps {
  display: flex;
  width: 100%;
  max-width: var(--width-single-column);
  margin: 0 auto 20px;
  padding: 0;
  list-style: none;
}

.steps__item {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* 丸と丸のあいだをつなぐ細い線 */
.steps__item::before,
.steps__item::after {
  content: "";
  position: absolute;
  top: calc(var(--size-step-circle) / 2);
  height: 1px;
  background: var(--color-border);
}

.steps__item::before {
  left: 0;
  right: 50%;
  margin-right: calc(var(--size-step-circle) / 2 + 4px);
}

.steps__item::after {
  left: 50%;
  right: 0;
  margin-left: calc(var(--size-step-circle) / 2 + 4px);
}

.steps__item:first-child::before,
.steps__item:last-child::after {
  content: none;
}

.steps__circle {
  position: relative;
  z-index: 1;
  width: var(--size-step-circle);
  height: var(--size-step-circle);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  /* 既定は「まだのステップ」 */
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-muted);
}

.steps__name {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.3;
  color: var(--color-muted);
}

/* 現在のステップ */
.steps__item--current .steps__circle {
  background: var(--color-navy);
  border-color: var(--color-navy);
  color: #FFFFFF;
}

.steps__item--current .steps__name {
  color: var(--color-text);
  font-weight: 700;
}

/* 完了したステップ */
.steps__item--done .steps__circle {
  background: var(--color-muted);
  border-color: var(--color-muted);
  color: #FFFFFF;
}

.steps__item--done .steps__name {
  color: var(--color-text);
}

/*
 * 1カラムの画面。--width-single-column で中央に固定し、
 * ウィンドウ幅いっぱいには伸ばさない。
 * 画面がこの幅より狭いときは body の左右パディングで余白を取って収める。
 * 左右2カラムの画面(デザイン設定・編集画面)はこのクラスを使わない。
 */
.single-column {
  width: 100%;
  max-width: var(--width-single-column);
  margin: 0 auto;
}

.page-title {
  font-size: 20px;
  font-weight: bold;
  margin: 0 0 16px;
}

/* 見出しを中央に置く画面で使う */
.page-title--center {
  text-align: center;
}

/* カード */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 20px 16px;
}

/* フォーム */
.field { margin-bottom: 24px; }
.field:last-child { margin-bottom: 0; }

.field__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: bold;
  margin-bottom: 6px;
}

.field__help {
  font-size: 13px;
  margin: 0 0 8px;
  opacity: 0.75;
}

/*
 * 大見出し。カードの中で入力項目をグループに分けるのに使う。
 * 文字の左右に --color-point-light の短い線を1本ずつ置く。
 * 線は flex の固定幅アイテムなので、文字の長さが変わっても文字に重ならない。
 * 区切り線(border)は使わない。
 */
.field__subhead {
  display: flex;
  align-items: center;
  justify-content: center;
  /* 文字と線のあいだの余白 */
  gap: 12px;
  font-size: 16px;
  font-weight: bold;
  color: var(--color-text);
  /* グループの区切りとして働くよう、上に広めの余白を取る */
  margin: 32px 0 16px;
}

.field__subhead::before,
.field__subhead::after {
  content: "";
  flex: none;
  width: 24px;
  height: 2px;
  background: var(--color-point-light);
}

/* カードの先頭に置いたときは上に余白を作らない */
.field__subhead:first-child {
  margin-top: 0;
}

/* 1つのまとまりとして入力欄を複数並べるとき（住所の4欄など） */
.field__group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 入力形式が正しくないときに、入力欄の下に出す */
.field__error {
  font-size: 13px;
  margin: 6px 0 0;
  color: var(--color-danger);
}

/* 必須バッジ。目立ちすぎない濃さにする */
.badge-required {
  font-size: 11px;
  font-weight: normal;
  line-height: 1.5;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  opacity: 0.7;
}

.input,
.select {
  display: block;
  width: 100%;
  max-width: var(--width-control);
  padding: 10px 12px;
  font-size: 16px;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.select { appearance: none; }

.input:focus,
.select:focus {
  outline: 2px solid var(--color-navy);
  outline-offset: -1px;
}

/*
 * 自動保存の状態表示。フォーム（カード）の外、その下の右端に置く。
 * 表示・非表示で高さが変わらないよう、行の高さを固定して文字だけ入れ替える。
 */
.form-status {
  margin: 0;
  text-align: right;
  font-size: 12px;
  line-height: 18px;
  height: 18px;
  color: var(--color-muted);
}

/*
 * ボタン。幅いっぱいには伸ばさず、内容にあわせた幅にする。
 * 用途ごとに色を決め、画面側で色を書かない。
 */
.btn {
  display: inline-block;
  /* 本文16pxに対して大きくなりすぎないサイズ。内容幅に対して過大にならない min-width を保つ */
  min-width: 160px;
  max-width: 100%;
  padding: 8px 20px;
  font-size: 14px;
  font-family: inherit;
  font-weight: bold;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
}

/* データ変更を伴うボタン(保存・確定・作成など) */
.btn--point {
  background: var(--color-point);
  color: var(--color-text);
  border-color: var(--color-point);
}

/* 編集ボタン、フロー途中の「次へ」 */
.btn--navy {
  background: var(--color-navy);
  color: #FFFFFF;
  border-color: var(--color-navy);
}

/* 戻る・キャンセル・閉じる */
.btn--gray {
  background: var(--color-bg);
  color: var(--color-text);
  border-color: var(--color-border);
}

/* 削除 */
.btn--danger {
  background: var(--color-danger);
  color: #FFFFFF;
  border-color: var(--color-danger);
}

/* 押せない状態。色の系統は保ったまま、彩度と輪郭を落とす */
.btn:disabled,
.btn[aria-disabled="true"] {
  background: var(--color-bg);
  color: var(--color-text);
  border-color: var(--color-border);
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

/* 行内に置く小さいボタン（削除など）。min-width を外し、内容ぶんの幅にする */
.btn--small {
  min-width: 0;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: normal;
}

/*
 * 並べ替えできる入力行。メニューのように同じ形の行を繰り返す箇所で使う。
 * 色・枠・角丸は既存のトークンをそのまま使う。
 */
.row-list {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.row-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

/* ドラッグで掴む位置 */
.row-item__handle {
  flex: none;
  width: 24px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  font-size: 14px;
  line-height: 1;
  cursor: grab;
  user-select: none;
  /* 掴んだ指で縦スクロールが始まらないようにする */
  touch-action: none;
}

.row-item__fields {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  gap: 8px;
}

/* 行の中の入力欄は、行幅にあわせて縮む */
.row-item__fields .input {
  max-width: none;
  min-width: 0;
}

.row-item__name { flex: 2 1 0; }
.row-item__price { flex: 1 1 0; }

/* ドラッグ中の行 */
.row-item--dragging {
  opacity: 0.5;
}

/* ボタンを並べる行。画面中央に置く */
.actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

/*
 * 候補のドロップダウン。入力した語に近いものを探して出し、押すと確定する箇所で使う。
 * 業種の入力で使い、以降の全画面で同じものを使う。
 *
 * .suggest は入力欄と候補を包む箱。候補を入力欄の直下に重ねて出すための位置の基準にする。
 * 読み込み中の回転も、行を増やして下の要素を押し下げないよう、入力欄の中に重ねる。
 */
.suggest {
  position: relative;
  width: 100%;
  max-width: var(--width-control);
}

/* 入力欄の右端に重ねる。.spinner そのものの定義は変えない */
.suggest .spinner {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 12px;
  margin: auto 0;
}

/*
 * 候補の一覧。1つの枠の中に候補が縦に並ぶ。
 * 入力欄と同じ幅にはせず、内容にあわせた幅にして、
 * 影を付けて浮かせることで、入力欄に重なって出ているドロップダウンだと分かるようにする。
 */
.suggest-list {
  position: absolute;
  /* 入力欄の直下。少しだけ間を空けて重なりを分かりやすくする */
  top: calc(100% + 4px);
  left: 0;
  z-index: 20;
  min-width: 220px;
  /* 入力欄より狭く収める */
  max-width: calc(var(--width-control) - 40px);
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.suggest-list__item {
  margin: 0;
}

/* 候補どうしの区切り。枠は一覧の外側に1本だけなので、行のあいだは細い線で分ける */
.suggest-list__item + .suggest-list__item .suggest-item {
  border-top: 1px solid var(--color-border);
}

/* 候補そのもの。行いっぱいを押せるようにする */
.suggest-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  font-size: 15px;
  font-family: inherit;
  line-height: 1.4;
  text-align: left;
  color: var(--color-text);
  background: transparent;
  border: 0;
  border-radius: 0;
  white-space: nowrap;
  /* 押せることが分かるようにする */
  cursor: pointer;
}

/* カーソルを乗せたとき、押しているあいだ、キーボードで移動してきたとき */
.suggest-item:hover {
  background: var(--color-point-lighter);
}

.suggest-item:active {
  background: var(--color-point-light);
}

.suggest-item:focus-visible {
  outline: 2px solid var(--color-navy);
  outline-offset: -2px;
}

/*
 * 読み込み中の回転。応答を待っているあいだだけ出す。
 * 業種の候補出しで使い、以降の全画面で同じものを使う。
 * 画像も外部ライブラリも使わず、borderの一辺だけを濃くした円を回す。
 * 大きさは 1em にして、本文の文字と釣り合う大きさにする。
 */
.spinner {
  display: block;
  width: 1em;
  height: 1em;
  /* 候補一覧と同じ位置に出るよう、上の余白を .suggest-list と揃える */
  margin: 8px 0 0;
  border: 2px solid var(--color-muted-lighter);
  border-top-color: var(--color-muted);
  border-radius: 50%;
  animation: spinner-rotate 0.8s linear infinite;
}

@keyframes spinner-rotate {
  to { transform: rotate(360deg); }
}

/*
 * AIを呼んでいるあいだの待ち表示（busy.js が出し入れする）。
 * 画面全体の中央に出す。左カラムの中に小さく出していたときは、
 * 右カラムを見て操作しているオーナーから見えなかった。
 *
 * 画面全体を覆うので、待っているあいだは下の要素を押せない。
 * z-index はライトボックス（20）より上に置く。
 */
.busy {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  /* 下の画面が透けて見えるくらいに留める。真っ白にすると何を待っているか分からない */
  background: rgba(255, 255, 255, 0.7);
}

/* あとでマスコットのアニメーションに差し替える。替えるのはこの中だけ */
.busy__mark {
  display: block;
  width: 48px;
  height: 48px;
  border: 4px solid var(--color-muted-lighter);
  border-top-color: var(--color-navy);
  border-radius: 50%;
  animation: spinner-rotate 0.8s linear infinite;
}

/*
 * プレビュー欄のタブ型タイトル。
 * 左右2カラムの画面で、プレビュー側のカードの左上に、カードに乗る形で重ねて使う。
 * 見出しではなく「その欄の名前」なので、文字は本文と同じ大きさに抑える。
 * 下側の角は丸めず、カードの上辺に続いているように見せる。
 */
.preview-tab {
  display: inline-block;
  position: relative;
  z-index: 1;
  /* カードの上辺に重ねて、タブがカードに乗っているように見せる */
  margin: 0 0 -1px;
  padding: 8px 12px;
  font-size: 16px;
  font-weight: bold;
  line-height: 1.4;
  color: var(--color-text);
  /* #C4C4C4 */
  background: var(--color-muted-light);
  border-radius: var(--radius) var(--radius) 0 0;
}

/*
 * 画面右下に固定で出すキャラクターと、それに合わせたボタン列の調整。
 * 左右2カラムの画面で共通に使う。
 */
:root {
  /*
   * キャラクターの高さ。大きいウィンドウでは頭打ちにし、
   * ウィンドウが小さいほど幅と高さに比例して小さくする。
   */
  --character-height: min(calc(var(--height-header) * 3), 20vh, 12vw);
}

/*
 * 全身のキャラクター。画面の右下に固定し、下端と右端を画面の端に接する。
 * 下の操作を邪魔しないよう、クリックは通す。
 */
.character {
  position: fixed;
  right: 0;
  bottom: 0;
  z-index: 5;
  height: var(--character-height);
  width: auto;
  pointer-events: none;
}

/*
 * 2カラム画面の下の余白。画面の高さいっぱいに組むため、1カラム画面より詰める。
 * 2カラムの画面では body にこのクラスを付ける。
 */
.two-column-page {
  padding-bottom: 24px;
}

/*
 * ボタン列。右端にキャラクターの幅ぶんの余白を空けて重ならないようにする。
 * 382 x 337 は character-full.png の大きさ。高さから幅を出す。
 * 上の余白は 1カラム画面の .actions（24px）より詰める。
 */
.two-column__main .actions {
  margin-top: 10px;
  padding-right: calc(var(--character-height) * 382 / 337);
}

/*
 * 2カラム画面のボタン。キャラクターが小さくなるのに合わせて幅も縮める。
 * 大きいウィンドウでは .btn の min-width と同じ 160px で頭打ちにする。
 * 横に収まらなくなったときだけ .actions の flex-wrap で縦に積まれる。
 */
.two-column__main .actions .btn {
  min-width: 0;
  width: min(calc(var(--character-height) * 382 / 337), 160px);
}

/*
 * 吹き出しの中でヒントを並べる箇条書き。
 * 行の中身を並べ替える .row-list とは用途が違うため、別のクラスにする。
 * 上下の余白は .row-list と同じ値にし、記号のぶんだけ左に余白を取る。
 * 幅は最も長い行に合わせ、そのまとまりを吹き出しの中で中央に置く。
 * 中の記号と文字は左揃えのままにする。
 */
.hint-list {
  width: fit-content;
  /* 吹き出しより長い行があるときは、はみ出さずに折り返す */
  max-width: 100%;
  margin: 0 auto 12px;
  padding: 0 0 0 var(--space-page);
  list-style: disc;
}

/* 記号だけを目立たせる。文字の色は行そのものの指定に任せる */
.hint-list > li::marker {
  color: var(--color-point);
}

/*
 * 充足度のゲージ。左右2カラムの画面で、集まり具合を帯で見せるのに使う。
 * 色・角丸・余白は既存の値だけで組む。
 */
.gauge {
  margin: 0 0 12px;
}

/*
 * 帯と％の行。帯が残りの幅を使い、％は右端に置く。
 * 帯の上の余白は、これまで .gauge__track が持っていたものをこの行に移す。
 */
.gauge__row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 0;
}

/* ％の数字。ラベルと同じ大きさにし、太字にはしない */
.gauge__value {
  flex: none;
  font-size: 15px;
}

/* 帯の外側。満たされていない部分の地 */
.gauge__track {
  height: 20px;
  /* 行の中では、残りの幅をすべて使う */
  flex: 1 1 auto;
  min-width: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 0;
  overflow: hidden;
}

/* 満たされた部分。幅を割合で指定する */
.gauge__bar {
  height: 100%;
  border-radius: 0;
  background: var(--color-point);
}

/* ラベルの行。文字と回転表示を横に並べる */
.gauge__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: bold;
  margin: 0;
}

/*
 * 引用ブロック。入力欄の上に、引用したもの（色・文章・画像）を1行ずつ積む。
 * 並びは 矢印アイコン → 見本 → 名前 → ×。背景は付けず、下地に溶かす。
 * 部品の中身は quote-block.js が組み立てる。
 */
.quote-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.quote {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: var(--color-text);
}

/* 矢印。文字より控えめにして、引用であることだけを示す */
.quote__icon {
  flex: none;
  color: var(--color-muted-dark);
}

/* 引用した色の見本。四角の大きさは文字の高さに合わせる */
.quote__swatch {
  flex: none;
  width: 20px;
  height: 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

/* 引用した画像の見本。大きさは色の四角と同じにそろえる */
.quote__thumb {
  flex: none;
  width: 20px;
  height: 20px;
  object-fit: cover;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

/* 引用したものの名前。長い文章を引用したときは1行に収めて末尾を省く */
.quote__name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* 外す。読み上げ用の名前は aria-label の「削除」で持たせ、×は文字としては置かない */
.quote__remove {
  flex: none;
  width: var(--size-step-circle);
  height: var(--size-step-circle);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: inherit;
  line-height: 1;
  color: var(--color-muted-dark);
  background: none;
  border: 0;
  cursor: pointer;
}

.quote__remove::before {
  content: "×";
}

/*
 * 左右2カラムの画面の骨組み。
 * ページ全体と左半分はスクロールさせず、右半分（チャット欄）の中だけを縦に送る。
 * 2カラムの画面で共通に使う。
 */
.two-column {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: stretch;
  gap: var(--space-page);
}

.two-column__side,
.two-column__main {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* 左半分はスクロールさせない */
.two-column__side { overflow: hidden; }

/* タブは内容ぶんの幅にして、カードの左上に寄せる */
.two-column__side .preview-tab {
  flex: none;
  align-self: flex-start;
}

/*
 * 左半分のカード。中身が画面に収まらない場合も、ページはスクロールさせない。
 * 左上はタブが乗るため角を丸めない。
 */
.preview-card {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-top-left-radius: 0;
}

/* 右半分。見出しとボタンは動かさず、チャット欄だけを縦スクロールさせる */
.chat {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  /* 端まで来てもページ側へスクロールを送らない */
  overscroll-behavior: contain;
}

/*
 * ボタンの9パターンを出しているあいだだけ、下にキャラクターの高さぶんを空ける。
 *
 * 9パターンは3列で縦に積まれるので、一番下の列が画面右下に固定した
 * キャラクターに完全に隠れた（2026-09-28・本番で発生）。
 * ほかの選択肢は縦1列で数が少なく、隠れないので空けない。
 * 常に空けておくと、どの工程でも下に大きな空白が残る。
 */
.chat--character-gap {
  padding-bottom: var(--character-height);
}

/*
 * チャット欄に並ぶものの間隔。
 * 「AIの吹き出しの次はオーナーの発言」のような組み合わせごとに指定を足すと、
 * 新しい並びが出るたびに抜けが出る。そのため規則を1つにまとめる。
 *   ・チャット欄の直下に並ぶものは、すべて前に 24px 持つ
 *   ・先頭だけ打ち消す（一番上に余計な余白が出るため）
 * 値は、これまで組み合わせごとに入れていたものと同じ 24px。
 *
 * 後ろではなく前に持たせる。後ろに持たせると最後の要素を打ち消すことになり、
 * 最後は増え続けるので打ち消し漏れが起きる。先頭は1つしかない。
 * ボタン列（.two-column__main .actions）も margin-top で入れている。
 */
.chat > * {
  margin: 24px 0 0;
}

.chat > :first-child {
  margin-top: 0;
}

/*
 * 発言に添える引用だけは、次に来る自分のバブルとの間を詰める。
 * どの発言に付いている引用かが分かるようにするため（上の 24px に対して 12px）。
 * 間隔は後ろに並ぶものが持つので、引用ではなく「引用の次」に指定する。
 */
.chat > .chat__quotes + * {
  margin-top: 12px;
}

/*
 * 吹き出しの行。顔アイコンを左、吹き出しを右に置く。
 * アイコンと吹き出しの間は、左右カラムの隙間の半分にする。
 */
.chat__row {
  display: flex;
  align-items: flex-start;
  gap: calc(var(--space-page) / 2);
}

/* 顔アイコンは円形に切り抜く */
.chat__face {
  flex: none;
  width: calc(var(--size-step-circle) * 4 / 3);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
}

.chat__bubble {
  flex: 1 1 auto;
  min-width: 0;
}

/*
 * オーナーの発言。バブルとアイコンをまとめて右に寄せる。
 * 見た目は visual1 で決めたものをそのまま共通の置き場に移した（2026-09-23）。
 * ChatMessage.owner() がこのクラスを付けるので、どの画面でも同じ見た目になる。
 */
.chat__row--user {
  justify-content: flex-end;
}

/* 発言バブル。角丸と余白はAIの吹き出しと同じで、面の色だけ変える */
.chat__bubble--user {
  background: #FFF9E3;
}

/*
 * オーナーのアイコン。大きさと形は顔アイコンと同じ。
 * 中に入れるのは苗字の先頭1文字だけ。円からはみ出す分は切り取る。
 * 名前は data-name に入れる。owner_auth が未実装のあいだは空のまま。
 */
.user-face {
  flex: none;
  width: calc(var(--size-step-circle) * 4 / 3);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: inherit;
  line-height: 1;
  color: var(--color-text);
  border-radius: 50%;
  /* #FFD45E */
  background: var(--color-point-light);
}

/* 吹き出しの中の見出しは、左右に伸びる線を出さない */
.chat__bubble .field__subhead::before,
.chat__bubble .field__subhead::after {
  content: none;
}

/*
 * デザインスタイルの一覧。
 * 基本のスタイルは例題の画像で、文化由来のスタイルはボタンで選ぶ。
 */
.style-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-page);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 例題の画像1つぶん。押して選ぶ */
.style-card {
  display: block;
  width: 100%;
  padding: 0;
  font: inherit;
  text-align: left;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
}

/*
 * 例題の画像。縦横比は画像そのものに任せる（横長だが、比は1枚ずつ違う）。
 * 幅いっぱいに伸び縮みさせ、切り取らない。
 * まだ用意していないものは灰色の面になる。
 */
.style-card__image {
  display: block;
  width: 100%;
  height: auto;
  background: var(--color-muted-lighter);
}

/* 文化由来のスタイル。例題を出さず、ボタンだけを並べる */
.style-button-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.style-button {
  padding: 8px 20px;
  font: inherit;
  color: #FFFFFF;
  background: var(--color-muted-dark);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}

/* 選ばれているものは枠を強くして分かるようにする */
.style-card--selected,
.style-button--selected {
  outline: 2px solid var(--color-navy);
  outline-offset: -2px;
}

/*
 * 選択肢のボタンを縦に積む行。幅は内容ぶんのまま、中央にそろえる。
 * チャット欄の中で使う（2カラム画面で共通）。
 */
.choice-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.choice-list .btn {
  margin: 0;
}

/* できあがったページのプレビュー。管理画面のCSSと混ざらないよう iframe に入れる */
.page-preview {
  display: block;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

/*
 * 3案を1枚にまとめた画像。プレビュー欄の幅いっぱいに出す。
 * 案の番号と、各案の輪郭は画像の中に描かれている（画面側では重ねない）。
 */
.design-image {
  display: block;
  width: 100%;
  height: auto;
}

/* 3案を出しているあいだのプレビュー欄。枠線と内側の余白を外して幅いっぱいに使う */
.preview-card--flush {
  padding: 0;
  border: 0;
  box-shadow: none;
}

/*
 * アイキャッチの候補。チャット欄の中に3枚を横に並べる。
 * 幅は3等分し、隙間は共通の値を使う。押すとライトボックスで大きく出す。
 */
.eyecatch-list {
  display: flex;
  /*
   * 縦に積んで中央に置く（2026-09-29に変更）。
   * 横に並べると、右端の1枚が画面右下に固定したキャラクターに隠れた。
   * 縦に積めば隠れないので、チャット欄の下に余白を入れる必要もない。
   */
  flex-direction: column;
  align-items: center;
  gap: var(--space-page);
  /*
   * margin は書かない。ul の既定の余白は .chat > * が上書きする。
   * ここで margin: 0 と書くと、チャット欄の間隔（後ろに24px）まで消えて、
   * 次に並ぶ発言が画像に接する。
   */
  padding: 0;
  list-style: none;
}

/*
 * 1枚の幅。横に3枚並べていたときと同じにする（大きくしない）。
 * 隙間2つぶんを引いた残りの3分の1。
 */
.eyecatch-list__item {
  width: calc((100% - var(--space-page) * 2) / 3);
}

.eyecatch-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-surface);
  cursor: pointer;
}

.eyecatch-button img {
  display: block;
  width: 100%;
  height: auto;
}

/*
 * ボタンの9案。画像を作らず、実物と同じ見た目をHTMLで並べる。
 * 形3種 × 色3種なので、3列にすると形ごとに行がそろう。
 */
.option-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-page);
  /* margin は書かない（.eyecatch-list と同じ理由） */
  padding: 0;
  list-style: none;
}

.option-grid li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

/* 見本そのものが選択ボタン。色と角丸は画面側が実物に合わせて入れる */
.option-swatch {
  display: block;
  width: 100%;
  padding: 10px 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: bold;
  line-height: 1.3;
  border: 0;
  cursor: pointer;
}

.option-caption {
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
  color: var(--color-muted-dark);
}

/*
 * 見出し・区切り線の3案。
 * 横に並べると1案が細くなり、見出しの幅が分からないので縦に積む。
 */
.option-grid--stack {
  grid-template-columns: 1fr;
}

/*
 * 見本そのものが選択ボタン。
 * 中身は案の実物で作る（案1はCSS、案2はSVG、案3は画像）。
 */
.option-sample {
  display: block;
  width: 100%;
  padding: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
}

.option-sample__body {
  display: block;
  width: 100%;
}

.option-sample__heading {
  display: inline-block;
  font-size: 15px;
  font-weight: bold;
  line-height: 1.4;
}

/* 見出しに添える飾り罫。左右の寄せは画面側が案に合わせて入れる */
.option-sample__rule {
  display: block;
  width: 40px;
  height: 2px;
  margin: 6px auto 0;
}

/* 区切り線そのもの。線の種類と色は画面側が案に合わせて入れる */
.option-sample__line {
  display: block;
  width: 100%;
}

/* 作った実物（SVGか画像）。高さだけをそろえる */
.option-sample__image {
  display: block;
  max-width: 100%;
  height: 32px;
  width: auto;
  margin: 6px auto 0;
  object-fit: contain;
}

/*
 * 押し直せる選択肢。どれを選んでいるかが分かるようにする。
 * 確定したあとは押せなくするが、並びは消さない（履歴を残すため）。
 */
.option-choice--selected {
  outline: 2px solid var(--color-navy);
  outline-offset: 2px;
}

.option-choice:disabled {
  cursor: default;
  opacity: 0.6;
}

/* 追加修正の入力欄一式（ステップ9） */
/*
 * サムネイルの一覧。1行に4つ並べ、足りない分は次の行に送る。
 * visual1 の素材と、visual2 で送った画像の発言で使う。
 */
.thumb-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-page);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* position は、visual1 で右上に重ねる削除ボタンの基準になる */
.thumb-list__item {
  position: relative;
  flex: 0 0 calc((100% - var(--space-page) * 3) / 4);
  min-width: 0;
}

/*
 * 画像のサムネイル。3か所で使う（確定・2026-09-29）。
 *   visual1 … アップロードした素材の一覧
 *   visual2 … フェーズ9で添えた画像のプレビューと、送ったあとの発言
 * 同じ見た目を何か所にも書かないよう、ここ1か所に置く。
 *
 * 正方形に切り抜く。縦横比を保ったまま枠に合わせ、はみ出す分は切り取る。
 * 幅は置き場所によって変わるので、使う側で指定する。
 * 影は持たない（visual1 では、包んでいる吹き出しの .card が影を出している）。
 */
.thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.adjust-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 枠をチャット欄の中で中央に置くためだけの行 */
.adjust-row {
  display: flex;
  justify-content: center;
}

/*
 * 入力欄の枠。線・角丸・背景を持つのはここだけで、
 * 中の入力欄とアイコンは持たない（枠の内側にアイコンが入る形）。
 * 幅は行の3分の2。
 *
 * 中は縦に2段。上が添えた画像のプレビュー、下が入力欄とアイコン。
 */
.adjust-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 66%;
  padding: 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

/*
 * 中身に焦点が移ったことは、枠のほうで示す。
 * 入力欄そのものから outline を外したぶん、ここが受け持つ。
 * 見え方は、もと .input:focus が出していたものと同じ。
 */
.adjust-box:focus-within {
  outline: 2px solid var(--color-navy);
  outline-offset: -1px;
}

/*
 * 添えた画像。枠の中、入力欄の上に置く。
 * 見た目は .thumb（visual1 の素材のサムネイルと同じ）で、
 * ここで決めるのは置き場所と幅だけ。
 *
 * 幅は visual1 の一覧と同じ出し方にする（隙間3つぶんを引いて4等分）。
 * 枠が行より狭いぶん、実際の大きさは visual1 より少し小さくなる。
 */
.adjust-preview {
  align-self: flex-start;
  width: calc((100% - var(--space-page) * 3) / 4);
}

/*
 * 枠の下の段。入力欄とアイコンを横に並べる。
 * 中身は段の高さいっぱいに伸ばす（stretch）。
 * 上端でそろえると、入力欄の下に使われない余白が残る。
 */
.adjust-main {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

/*
 * 入力欄。枠の中に溶け込ませるので、線も背景も余白も持たない。
 *
 * 手で伸縮させない。枠の中に入っているので、伸ばすと枠との釣り合いが崩れる。
 * 右下の伸縮マークも出さない。
 * 高さは枠が決める（rows の3行ぶんは、枠の高さの下限として効く）。
 */
.adjust-area .adjust-input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  max-width: none;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  resize: none;
}

.adjust-area .adjust-input:focus {
  outline: none;
}

/* 枠の右端に積む2つ。2つで1組に見えるよう、間は空けない */
.adjust-actions {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ファイル選択そのものは出さない。画像アイコンから呼ぶ */
.adjust-file {
  display: none;
}

/*
 * アイコンだけの小さなボタン。文字は持たないので、名前は aria-label で付ける。
 * 枠の内側に置くので、線も背景も持たない（枠と二重に見えるため）。
 */
.adjust-attach,
.adjust-send {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 18px;
  color: var(--color-muted-dark);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.adjust-attach:hover,
.adjust-send:not(:disabled):hover {
  color: var(--color-text);
}

/* 文章が空のあいだの送信。押せないことが見て分かるようにする */
.adjust-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/*
 * 「このデザインで決定」の下には余白を入れない。
 * この段階では、これがチャット欄の最後になる。
 */
.adjust-area > .choice-list:last-child {
  margin-bottom: 0;
}

/* 画像を添えるボタンと送信ボタンは横に並べる */
.choice-list--row {
  flex-direction: row;
  justify-content: center;
  flex-wrap: wrap;
}

/*
 * 画像を大きく出すライトボックス。どの画面でも同じものを使う（lightbox.js が組み立てる）。
 * 面の色と濃さは、この置き場にある値だけで作る（--color-black と 0.75）。
 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-page);
}

/* 後ろの画面を隠す暗い面。画像は上に重ねるので、濃さの影響を受けない */
.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: var(--color-black);
  opacity: 0.75;
}

/* 画像は画面に収まるまで縮小する。縦横比は保ち、切り取らない */
.lightbox__image {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
}

/* 左右の送り。画像の上に重ねる。切り替えに動きは付けない */
.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: calc(var(--size-step-circle) * 2);
  height: calc(var(--size-step-circle) * 2);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 24px;
  line-height: 1;
  color: #FFFFFF;
  background: var(--color-muted-dark);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.lightbox__nav--prev { left: var(--space-page); }
.lightbox__nav--next { right: var(--space-page); }

/* 矢印は文字として置かず、::before で描く（読み上げ用の名前は aria-label で持つ） */
.lightbox__nav--prev::before { content: "\2039"; }
.lightbox__nav--next::before { content: "\203A"; }

/* 決定のボタン。画像の下に重ねて中央に置く */
.lightbox__decide {
  position: absolute;
  left: 50%;
  bottom: var(--space-page);
  transform: translateX(-50%);
}
