/* サイト詳細の枠(上部のカード・生成の状況・タブ・タブの中身)と、ヒアリング
   内容のタブのスタイル(layout.tsのlayout()がapp.cssの後に読み込む) */

.gen-status {
  display:flex;
  align-items:center;
  gap:14px;
  background:var(--warning-soft);
  border:1px solid #f3dca8;
  padding:14px 16px;
  border-radius:12px;
}

.spinner {
  flex:0 0 auto;
  width:20px;
  height:20px;
  border:3px solid #f3dca8;
  border-top-color:var(--warning);
  border-radius:50%;
  animation:spin .8s linear infinite;
}

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

.section-heading {
  margin-top:32px;
}

/* サイト詳細: 「ヒアリング内容」の見出し */
.brief-summary-heading {
  margin-top:28px;
}

/* 上部のカード(サイト名・状態・操作・生成ボタン)。どのタブでも出す */
.site-hero {
  margin:12px 0 20px;
  padding:24px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow-small);
}

.site-hero-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:16px;
}

.site-hero-title {
  display:flex;
  flex-direction:column;
  gap:8px;
  min-width:0;
}

.site-hero-title h1 {
  margin:0;
  overflow-wrap:anywhere;
}

.site-hero-meta {
  margin:0;
}

.site-hero-actions {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.site-hero-actions .badge {
  margin-left:2px;
}

/* 生成ボタン・生成中・失敗の表示。カードの下段に区切って置く */
.site-hero-status {
  margin-top:20px;
  padding-top:18px;
  border-top:1px dashed var(--border);
}

.site-hero-status form,
.site-hero-status p {
  margin:0;
}

/* タブの並び。横にスクロールさせると、画面の外のタブがあることに気づかれ
   ないため、入りきらなければ折り返して全てのタブを見せる */
.tabs {
  display:flex;
  flex-wrap:wrap;
  gap:4px;
  margin-bottom:16px;
  padding:4px;
  background:var(--track);
  border-radius:16px;
}

.tab {
  display:inline-flex;
  flex:1 1 auto;
  align-items:center;
  justify-content:center;
  gap:6px;
  padding:8px 16px;
  border-radius:12px;
  color:var(--text-muted);
  font-size:14px;
  font-weight:700;
  text-decoration:none;
  white-space:nowrap;
}

.tab .icon {
  flex:0 0 auto;
}

.tab:hover {
  color:var(--text);
}

.tab[aria-current="page"] {
  background:var(--surface);
  color:var(--primary);
  box-shadow:var(--shadow-small);
}

/* 1行に入りきらない幅: 半端に1つだけ折り返さないよう、3列にそろえる */
@media (max-width: 1199px) {
  .tabs {
    display:grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
  }
}

/* スマホ: 2列に並べ、長い名前はタブの中で折り返す */
@media (max-width: 760px) {
  .tabs {
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }

  .tab {
    justify-content:flex-start;
    padding:10px 12px;
    font-size:13px;
    line-height:1.4;
    white-space:normal;
    word-break:keep-all;
    overflow-wrap:anywhere;
  }
}

/* 開いているタブの中身 */
.tab-panel {
  padding:24px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow-small);
}

.tab-panel > h2:first-child,
.tab-panel > .row:first-child h2,
.tab-panel > .preview-head:first-child h2 {
  margin-top:0;
}


@media (max-width: 760px) {
  .site-hero,
  .tab-panel {
    padding:16px;
  }
}

/* タブの中に置くカードは、タブの枠と二重に浮いて見えないよう影を付けない */
.tab-panel .card {
  background:var(--surface-tint);
  box-shadow:none;
}

/* サイト詳細のヒアリング内容のタブ: 上のサイト名の変更と線で区切って、
   ヒアリング内容を下に置く */
.brief-panel-summary {
  margin-top:32px;
  border-top:1px solid var(--border);
}

/* サイト詳細のヒアリング内容のタブ: サイト名の入力欄の下に、変更ボタンを
   左揃えで置く(サイトの削除と同じ「説明 → 操作 → ボタン」の並びにそろえる) */
.rename-form {
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:12px;
}

.rename-form input {
  width:100%;
  max-width:480px;
  margin:0;
}
