/*
  AI 連携の画面（ai-connect.mjs）と、AI 連携の許可の画面（ai-authorize.mjs）の並び。
  ここには並びと余白だけを書く。色、面の質感、影、角丸は、styles.css の変数と glass.css の決まりをそのまま使う。
*/

/* 主役の面: 左に説明と接続先のアドレス、右の板に、つなぎ方 */
.s-ai-lead__main {
  flex: 1 1 320px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-12);
}

.s-ai-lead__steps {
  flex: 1.2 1 360px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-12);
}

.s-ai-address {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.s-ai-address__label {
  font-size: var(--fs-small);
  font-weight: 600;
}

/* 接続先のアドレスは、読むだけの文字で出す（主役の面には入力欄を置かない）。長いアドレスは、どこでも折り返す */
.s-ai-address code,
.s-ai-host {
  overflow-wrap: anywhere;
}

.s-ai-address code {
  font-weight: 600;
}

.s-ai-steps {
  margin: 0;
  padding-left: 1.4em;
  list-style: decimal;
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
}

/* コマンドの1行と、コピーのボタン。長いアドレスは、どこでも折り返す */
.s-ai-command {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-8) var(--sp-12);
}

.s-ai-command code {
  flex: 1 1 240px;
  min-width: 0;
  font-size: var(--fs-small);
  overflow-wrap: anywhere;
}

/* 頼み方のひな形の並び。1件は、左に名前と説明と例、右にコピーのボタン */
.s-ai-prompts,
.s-ai-tools {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
}

.s-ai-prompt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-8) var(--sp-16);
  padding: var(--sp-12) 0;
  border-top: 1px solid var(--color-row-divider);
}

.s-ai-prompt:first-child {
  border-top: 0;
}

.s-ai-prompt__text {
  flex: 1 1 320px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.s-ai-prompt__text p,
.s-ai-consent p,
.s-ai-lead__main p,
.s-ai-lead__steps p {
  margin: 0;
}

.s-ai-prompt__example {
  font-size: var(--fs-small);
}

/* 道具の一覧は、畳んでおく */
.s-ai-more {
  margin-top: var(--sp-12);
  padding-top: var(--sp-12);
  border-top: 1px solid var(--color-row-divider);
}

.s-ai-more summary {
  cursor: pointer;
  font-weight: 600;
  padding: var(--sp-4) 0;
}

.s-ai-more > * + * {
  margin-top: var(--sp-12);
}

.s-ai-tool {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-4) var(--sp-12);
  padding: var(--sp-8) 0;
  border-top: 1px solid var(--color-row-divider);
}

.s-ai-tool:first-child {
  border-top: 0;
}

/* 分析の対象（リード、クライアント、議事録、担当者、期間）は、区切って折り返す */
.s-ai-target {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4) var(--sp-12);
}

/* AI が書いた本文。見出し、箇条書き、段落の間を、読みやすい幅と行間で出す */
.s-ai-doc {
  max-width: 46em;
  display: flex;
  flex-direction: column;
  gap: var(--sp-12);
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.s-ai-doc > * {
  margin: 0;
}

.s-ai-doc h2 {
  margin-top: var(--sp-12);
  font-size: var(--fs-h2);
  font-weight: 600;
}

.s-ai-doc h3,
.s-ai-doc h4 {
  margin-top: var(--sp-8);
  font-size: var(--fs-h3);
  font-weight: 600;
}

.s-ai-doc ul,
.s-ai-doc ol {
  padding-left: 1.4em;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.s-ai-doc ul,
.s-ai-consent__scopes ul {
  list-style: disc;
}

.s-ai-doc ol {
  list-style: decimal;
}

/* 許可の画面。1枚の面の中に、求めの内容、できることとできないこと、2つのボタンを縦に並べる */
.s-ai-consent {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-20);
}

.s-ai-consent__scopes {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-16) var(--sp-32);
}

.s-ai-consent__scopes > div {
  flex: 1 1 280px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
}

.s-ai-consent__scopes ul {
  margin: 0;
  padding-left: 1.4em;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

/* 戻り先を確かめてもらう区切り。見出しと説明とチェックを、縦に並べる */
.s-ai-consent__host {
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
}

.s-ai-consent__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-12);
}

@media (max-width: 640px) {
  /* 幅が狭いときは、コピーのボタンと2つの答えのボタンを、押しやすい高さで横いっぱいにする */
  .s-ai-prompt .btn,
  .s-ai-command .btn,
  .s-ai-lead__main .btn {
    flex: 1 1 100%;
    min-height: var(--h-button);
  }

  /* 2つの答えのボタンは、縦に積んで、それぞれ横いっぱいにする */
  .s-ai-consent__buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .s-ai-consent__buttons .btn {
    justify-content: center;
  }
}
