/* 公開メンバー一覧 - スタイル
   明るく親しみやすいSaaS系トーン。初見のビジター・見込み客が身構えない、
   あたたかい off-white 背景。
   配色は「アクセント＝親しみレッド1色 ＋ ニュートラル（オフブラック/グレー）」に統一し、
   色数を絞って情報を見やすくする。緑/金はステータス表示など意味のある箇所だけに限定する。
   フォントは Noto Sans JP（本文）/ Zen Kaku Gothic New（見出し）を CDN で読み込み、
   読み込めない環境ではシステムフォントにフォールバックする。 */

:root {
  /* 色 --------------------------------------------------------------- */
  --brand: #e23744;          /* 唯一のアクセント色（親しみレッド） */
  --brand-dark: #c31f2d;
  --brand-tint: #fdeeef;     /* レッドのごく淡い色面 */

  --ink: #262229;            /* 純黒を避けたあたたかいオフブラック */
  --muted: #78727a;          /* 補助テキスト */
  --line: #eee7e1;           /* あたたかいボーダー */
  --line-strong: #e2d9d1;
  --bg: #fbf8f5;             /* あたたかい off-white 背景 */
  --card: #ffffff;
  --surface: #f5f1ed;        /* 情報ブロック/チップのニュートラルな面色 */
  --surface-line: #e9e2db;

  /* ステータス表示専用（意味を持つ色。UIの装飾には使わない） */
  --ok: #237a3c;
  --ok-tint: #ecf6ee;
  --warn-tint: #fdf3e0;

  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(38, 26, 20, 0.04), 0 8px 22px rgba(38, 26, 20, 0.06);
  --shadow-lg: 0 18px 44px rgba(38, 26, 20, 0.14);
  --shadow-brand: 0 6px 16px rgba(226, 55, 68, 0.28);

  --font: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  --font-head: "Zen Kaku Gothic New", var(--font);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open { overflow: hidden; }

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(16px, 5vw, 32px);
}

/* ---- ヘッダー（明るい・スティッキー） ---- */
.site-header {
  background: rgba(251, 248, 245, 0.82);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand { display: flex; flex-direction: column; line-height: 1.25; }
.brand-mark {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
}
.brand-mark::before {
  content: "";
  display: inline-block;
  width: 22px; height: 22px;
  margin-right: 9px;
  border-radius: 7px;
  background: var(--brand);
  box-shadow: var(--shadow-brand);
}
.brand-sub { font-size: 0.78rem; color: var(--muted); margin-left: 31px; }

/* ---- ボタン ---- */
.btn {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  padding: 11px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-import {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-brand);
}
@media (hover: hover) and (pointer: fine) {
  .btn-import:hover:not(:disabled) {
    background: var(--brand-dark);
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(226, 55, 68, 0.34);
  }
}
.btn-icon { font-size: 1.05rem; }

/* ---- ヒーロー（明るい・あたたかいトーン） ---- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(80% 130% at 50% -20%, var(--brand-tint) 0%, transparent 60%),
    var(--bg);
  padding: clamp(44px, 7vw, 76px) 0 clamp(40px, 6vw, 64px);
}
.hero-title {
  margin: 0 0 16px;
  font-family: var(--font-head);
  font-size: clamp(1.7rem, 4.4vw, 2.7rem);
  font-weight: 900;
  line-height: 1.28;
  letter-spacing: 0.01em;
  color: var(--ink);
  max-width: 24em;
  /* 行末に文字が1つだけ孤立するような不自然な折り返しを避け、均等に折り返す */
  text-wrap: balance;
}
.hero-lead {
  margin: 0;
  max-width: 640px;
  color: var(--muted);
  font-size: clamp(0.98rem, 1.6vw, 1.08rem);
}

/* ---- チャプターの特徴 ---- */
.chapter-features {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}
.chapter-feature {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1 1 220px;
  min-width: 220px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.cf-icon { font-size: 1.4rem; line-height: 1.2; }
.cf-body { display: flex; flex-direction: column; gap: 2px; }
.cf-title { font-size: 0.96rem; color: var(--ink); }
.cf-text { font-size: 0.85rem; color: var(--muted); line-height: 1.5; }

/* ---- メンバー案内AIの目立つ導線（ヒーロー） ---- */
.hero-ai { margin-top: 30px; }
.hero-ai-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 480px;
  padding: 18px 22px;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-lg);
  color: #fff;
  background: var(--brand);
  box-shadow: var(--shadow-brand);
  font-family: inherit;
  text-align: left;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.hero-ai-btn:hover {
  transform: translateY(-2px);
  background: var(--brand-dark);
  box-shadow: var(--shadow-lg);
}
.hero-ai-icon {
  flex: 0 0 auto;
  font-size: 1.4rem;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 12px;
}
.hero-ai-text { flex: 1 1 auto; display: flex; flex-direction: column; gap: 3px; }
.hero-ai-text strong { font-size: 1.02rem; font-weight: 700; }
.hero-ai-text small { font-size: 0.78rem; opacity: 0.92; line-height: 1.5; }
.hero-ai-arrow { flex: 0 0 auto; font-size: 1.2rem; }
@media (max-width: 520px) {
  .hero-ai-btn { max-width: none; }
  .hero-ai-text small { display: none; }
}

/* ---- コントロール ---- */
.main { padding: clamp(26px, 4vw, 40px) 0 72px; }
.controls { margin-bottom: 28px; }
.search-wrap { margin-bottom: 16px; }
.search-input {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 14px 18px;
  border: 1.5px solid var(--line-strong);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(38, 26, 20, 0.03);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search-input::placeholder { color: #a79f9a; }
.search-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-tint);
}

.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.tag-chip {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 14px;
  border: 1.5px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.14s cubic-bezier(0.16, 1, 0.3, 1);
}
@media (hover: hover) and (pointer: fine) {
  .tag-chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-tint); }
}
.tag-chip.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.tag-chip.is-hidden { display: none; }

/* 「もっと見る／閉じる」トグル */
.tag-toggle {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 7px 14px;
  border: 1.5px dashed var(--line-strong);
  background: #fff;
  color: var(--brand);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.14s ease;
}
.tag-toggle:hover { border-color: var(--brand); background: var(--brand-tint); }
.tag-toggle[aria-expanded="true"] { color: var(--muted); }
.tag-toggle[aria-expanded="true"]:hover { border-color: var(--line-strong); background: #faf7f4; }

.result-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 24px;
}
.result-count { font-size: 0.85rem; color: var(--muted); }
.link-btn {
  background: none;
  border: none;
  color: var(--brand);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---- ステータス ---- */
.status {
  margin: 12px 0;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  border: 1px solid transparent;
}
.status--info    { background: var(--brand-tint); color: var(--brand-dark); border-color: #f6d7da; }
.status--success { background: var(--ok-tint); color: var(--ok); border-color: #cbe8d1; }
.status--warn    { background: var(--warn-tint); color: #9a6a0c; border-color: #f4dfae; }
.status--error   { background: #fdecec; color: #b42318; border-color: #f7cfcc; }

/* ---- メンバーグリッド ---- */
.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

.member-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px 24px 22px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.18s ease, border-color 0.18s ease;
  position: relative;
}
@media (hover: hover) and (pointer: fine) {
  .member-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
}
.member-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

.card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 15px; }
.avatar {
  flex: 0 0 auto;
  width: 50px; height: 50px;
  border-radius: 16px;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.25rem;
  box-shadow: var(--shadow-brand);
}
.avatar.has-photo {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: transparent;
}
.avatar-lg { width: 64px; height: 64px; font-size: 1.6rem; border-radius: 19px; }
.card-head-text { min-width: 0; }
.card-name { margin: 0; font-family: var(--font-head); font-size: 1.12rem; font-weight: 700; color: var(--ink); }
.card-field {
  display: inline-block;
  font-size: 0.72rem;
  color: var(--brand-dark);
  background: var(--brand-tint);
  padding: 2px 9px;
  border-radius: 999px;
  margin-top: 4px;
  font-weight: 700;
}
.card-business {
  margin: 0 0 14px;
  font-weight: 700;
  font-size: 0.96rem;
  color: var(--ink);
}
.card-catch {
  margin: 0 0 16px;
  font-size: 0.9rem;
  color: var(--muted);
  flex: 1 1 auto;
}

/* カードの値ブロック（強み / 紹介してほしい人 / 関連職種） */
.card-block { margin: 0 0 12px; }
.card-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 3px;
}
.card-clamp {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* 「こんな方の力になれます」はリファーラルの入口なので、
   ニュートラルな面色＋左のアクセント罫線でさりげなく強調する（色は増やさない）。 */
.card-block-egg {
  background: var(--surface);
  border: 1px solid var(--surface-line);
  border-left: 3px solid var(--brand);
  border-radius: 10px;
  padding: 10px 13px;
}
.card-block-egg .card-label { color: var(--brand-dark); }
.card-circles { display: flex; flex-wrap: wrap; gap: 6px; }
.card-circle {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--surface-line);
  padding: 3px 10px;
  border-radius: 999px;
}
.card-circle-more { color: var(--muted); }

.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.card-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  padding: 3px 10px;
  border-radius: 999px;
}
.card-more {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--brand);
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.15s ease;
}
@media (hover: hover) and (pointer: fine) {
  .member-card:hover .card-more { gap: 9px; }
}

.empty-state {
  text-align: center;
  padding: 56px 20px;
  color: var(--muted);
}

/* ---- フッター（明るいバンド） ---- */
.site-footer {
  background: #fff;
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 32px 0;
  font-size: 0.85rem;
  text-align: center;
}
.site-footer p { margin: 4px 0; }
.footer-note { color: #a79f9a; font-size: 0.78rem; }
.footer-admin { margin-top: 10px !important; }
.footer-admin a { color: #b8b0aa; font-size: 0.76rem; text-decoration: underline; }
.footer-admin a:hover { color: var(--brand); }

/* ---- モーダル ---- */
.modal[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(38, 26, 20, 0.42);
  backdrop-filter: blur(3px);
}
.modal-dialog {
  position: relative;
  background: #fff;
  width: 100%;
  max-width: 640px;
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  padding: 34px 34px 36px;
  z-index: 1;
  animation: modalIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .modal-dialog { animation: none; }
  .btn, .member-card, .tag-chip, .card-more { transition: none; }
}
.modal-close {
  position: absolute;
  top: 16px; right: 18px;
  width: 36px; height: 36px;
  border: none;
  background: #f4efeb;
  border-radius: 50%;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}
.modal-close:hover { background: var(--brand-tint); color: var(--brand); }

.detail-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; padding-right: 30px; }
.detail-name { margin: 0; font-family: var(--font-head); font-size: 1.45rem; font-weight: 900; }
.detail-business { margin: 5px 0 0; color: var(--ink); font-weight: 700; }
.detail-catch {
  margin: 0 0 20px;
  padding: 14px 18px;
  background: var(--surface);
  border-left: 3px solid var(--brand);
  border-radius: 10px;
  font-size: 0.96rem;
  color: var(--ink);
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.meta-item { font-size: 0.9rem; color: var(--ink); display: flex; flex-direction: column; }
.meta-item strong {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 2px;
}
.detail-tags { margin-bottom: 20px; }

.detail-section { margin-bottom: 22px; }
.detail-section h4 {
  margin: 0 0 10px;
  font-family: var(--font-head);
  font-size: 0.98rem;
  color: var(--ink);
  font-weight: 700;
  display: flex;
  align-items: center;
}
.detail-section h4::before {
  content: "";
  width: 6px; height: 16px;
  background: var(--brand);
  border-radius: 999px;
  margin-right: 9px;
}
.detail-section ul { margin: 0; padding-left: 20px; }
.detail-section li { margin-bottom: 6px; font-size: 0.93rem; }

.referral-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.referral-card {
  border-radius: 12px;
  padding: 15px 17px;
  background: var(--surface);
  border: 1px solid var(--surface-line);
}
.referral-label {
  display: block;
  font-size: 0.79rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--brand-dark);
}
.referral-card p { margin: 0; font-size: 0.9rem; }

.detail-links { display: flex; gap: 14px; margin-top: 8px; }
.detail-links a { color: var(--brand); font-weight: 700; font-size: 0.9rem; }

/* ---- 公開メンバー チャット / 相性診断 ---- */
.chat-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  display: flex; align-items: center; gap: 8px;
  font-family: inherit; font-size: 0.92rem; font-weight: 700;
  color: #fff; background: var(--brand); border: none;
  border-radius: 999px; padding: 13px 20px; cursor: pointer;
  box-shadow: var(--shadow-brand);
}
.chat-fab[hidden] { display: none; }
.chat-fab-dot { width: 8px; height: 8px; border-radius: 50%; background: #7ee2a8;
  box-shadow: 0 0 0 0 rgba(126,226,168,.7); animation: cpulse 2s infinite; }
@keyframes cpulse { 0%{box-shadow:0 0 0 0 rgba(126,226,168,.7);} 70%{box-shadow:0 0 0 10px rgba(126,226,168,0);} 100%{box-shadow:0 0 0 0 rgba(126,226,168,0);} }
@media (hover: hover) and (pointer: fine) { .chat-fab:hover { background: var(--brand-dark); } }

.chat-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 50;
  width: min(420px, calc(100vw - 40px)); height: min(600px, calc(100vh - 40px));
  background: #fff; border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow-lg); display: none; flex-direction: column; overflow: hidden;
}
.chat-panel.open { display: flex; }
.chat-head {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff; padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.chat-head strong { font-family: var(--font-head); font-size: 0.98rem; }
.chat-sub { display: block; font-size: 0.72rem; opacity: 0.9; margin-top: 2px; }
.chat-head button { background: transparent; border: none; color: #fff; font-size: 1.35rem; cursor: pointer; line-height: 1; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; background: #faf7f4; }
.cmsg { margin: 8px 0; display: flex; }
.cmsg.user { justify-content: flex-end; }
.cbubble { max-width: 88%; padding: 10px 13px; border-radius: 14px; font-size: 0.9rem; line-height: 1.7; word-break: break-word; }
.cmsg.user .cbubble { background: var(--brand); color: #fff; border-bottom-right-radius: 3px; white-space: pre-wrap; }
.cmsg.bot .cbubble { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 3px; }
.cmsg.bot .cbubble h4 { margin: 10px 0 4px; font-size: 0.92rem; color: var(--brand-dark); }
.cmsg.bot .cbubble ul { margin: 4px 0; padding-left: 20px; }
.cmsg.bot .cbubble li { margin: 2px 0; }
.cmsg.bot .cbubble p { margin: 6px 0; }
.cmsg.bot .cbubble strong { color: var(--brand-dark); }
.cchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cchips button {
  font-family: inherit; font-size: 0.76rem; color: var(--brand-dark);
  background: var(--brand-tint); border: 1px solid #f6d7da; border-radius: 999px;
  padding: 5px 11px; cursor: pointer;
}
.chat-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: #fff; }
.chat-input textarea {
  flex: 1; resize: none; height: 46px; font-family: inherit; font-size: 0.9rem;
  border: 1px solid var(--line-strong); border-radius: 12px; padding: 9px 11px;
}
.chat-input textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.chat-input button {
  font-family: inherit; font-weight: 700; font-size: 0.9rem; color: #fff;
  background: var(--brand); border: none; border-radius: 12px; padding: 0 18px; cursor: pointer;
}
.chat-input button:disabled { opacity: 0.5; cursor: default; }

/* ---- レスポンシブ ---- */
@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; }
  .btn-import { font-size: 0.82rem; padding: 10px 14px; }
  .member-grid { grid-template-columns: 1fr; }
  .referral-grid { grid-template-columns: 1fr; }
  .modal { padding: 16px; }
  .modal-dialog { padding: 26px 22px 28px; }
}
