/* ===== AIかけこみ寺 メンバー向けサイト =====
 * LPのブランドカラーを継承しつつ、メンバー向けにミニマル化
 * フォント: Yu Gothic UI（仕様書指定）
 * ============================================ */

:root {
  --primary: #2D6A4F;
  --primary-light: #52B788;
  --primary-pale: #D8F3DC;
  --accent: #E76F51;
  --accent-light: #F4A261;
  --warm-bg: #FDF8F0;
  --warm-bg-alt: #FFF5E8;
  --surface: #FFFFFF;
  --border: #E8E2D6;
  --text: #2C2C2C;
  --text-light: #5A5A5A;
  --text-mute: #8A8A8A;
  --danger: #C73E1D;
  --info: #2A6F97;
  --info-pale: #E8F4FD;
  --weekend: #C1440E;
  --weekend-pale: #FBE7DC;
  --saturday: #2E6FA7;
  --saturday-pale: #E4F0FA;
  --shadow-soft: 0 4px 24px rgba(45, 106, 79, 0.08);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.04);
  --shadow-strong: 0 8px 32px rgba(0, 0, 0, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --sidebar-w: 260px;
  --header-h: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: "Yu Gothic UI", "Yu Gothic", "Segoe UI", "Hiragino Sans", "Meiryo", sans-serif;
  color: var(--text);
  background: var(--warm-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

[hidden] { display: none !important; }

/* ===== LAYOUT ===== */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 0 24px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.sidebar-brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.02em;
}
.sidebar-brand-sub {
  font-size: 0.72rem;
  color: var(--text-mute);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 2px;
}

.nav { list-style: none; padding: 0 12px; }
.nav li { margin: 2px 0; }
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
  transition: background 0.15s;
}
.nav a:hover {
  background: var(--primary-pale);
  text-decoration: none;
  color: var(--primary);
}
.nav a.active {
  background: var(--primary);
  color: #fff;
}
.nav-icon { width: 18px; display: inline-block; text-align: center; }

.sidebar-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  margin-top: 24px;
  font-size: 0.78rem;
  color: var(--text-mute);
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.user-chip img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}
.user-chip-name {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.signout-link {
  font-size: 0.78rem;
  color: var(--text-mute);
  cursor: pointer;
}
.signout-link:hover { color: var(--accent); }

/* ===== MAIN ===== */
.main {
  padding: 48px 56px 80px;
  max-width: 960px;
  width: 100%;
  min-width: 0; /* grid item のデフォルト min-width:auto を打ち消し、
                   中身の長いテキストが .app グリッド全体を押し広げるのを防ぐ */
}

.page-head {
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.page-head h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.01em;
}
.page-head .lead {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-top: 6px;
}

h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-pale);
}
h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 24px 0 10px;
}
p { margin-bottom: 12px; }
ul, ol { padding-left: 1.5em; margin-bottom: 16px; }
li { margin-bottom: 6px; }

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}
.card h2, .card h3 { margin-top: 0; }
.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

/* ===== HERO (top page) ===== */
.hero-internal {
  background: linear-gradient(135deg, var(--primary-pale) 0%, var(--warm-bg-alt) 100%);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  margin-bottom: 32px;
}
.hero-brand {
  font-size: 0.8rem;
  color: var(--primary-light);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 8px;
}
.hero-title {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
}
.hero-sub {
  color: var(--text-light);
  font-size: 0.95rem;
}
.hero-cta {
  display: inline-block;
  margin-top: 18px;
  padding: 12px 22px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  border-radius: 999px;
  text-decoration: none;
}
.hero-cta:hover { filter: brightness(1.08); }
.hero-cta:active { transform: translateY(1px); }

/* ===== ページ内目次（長いサブページの冒頭に置く） ===== */
.page-toc {
  background: var(--primary-pale, #eaf3ee);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius-lg, 14px);
  padding: 20px 24px;
  margin-bottom: 32px;
}
.page-toc-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 12px;
}
.page-toc > ul {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}
.page-toc > ul > li {
  counter-increment: toc;
  margin: 8px 0;
}
.page-toc > ul > li::before {
  content: counter(toc);
  font-weight: 800;
  color: var(--primary);
  font-size: 0.9rem;
  background: #fff;
  border-radius: 50%;
  width: 1.6em;
  height: 1.6em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
}
.page-toc a {
  text-decoration: none;
  font-weight: 700;
  color: var(--text, #333);
  font-size: 1rem;
}
.page-toc a:hover { color: var(--primary); text-decoration: underline; }
/* サブセクション（2階層目） */
.page-toc ul ul {
  list-style: none;
  margin: 4px 0 0;
  padding-left: 2.5em;
}
.page-toc ul ul li { margin: 3px 0; }
.page-toc ul ul li::before {
  content: "–";
  color: var(--primary);
  font-weight: 700;
  margin-right: 8px;
}
.page-toc ul ul a {
  font-weight: 500;
  font-size: 0.92rem;
}

/* ===== MISSION (WHY → HOW → WHAT) =====
 * 共感優先の縦並び。各ブロック＝タグ＋見出し＋イラスト＋説明文。 */
.mission {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin: 24px 0 12px;
}
.mission-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid transparent;
  border-radius: var(--radius-lg);
  padding: 26px 30px 28px;
  box-shadow: var(--shadow-card);
}
.mission-block.m-why  { border-left-color: #E76F51; }
.mission-block.m-how  { border-left-color: #F4A261; }
.mission-block.m-what { border-left-color: #F9C97D; }

.mission-tag {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  font-weight: 800;
  margin-bottom: 6px;
}
.m-why  .mission-tag { color: #E76F51; }
.m-how  .mission-tag { color: #D58341; }
.m-what .mission-tag { color: #B07C00; }

.mission-headline {
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 16px;
}
.mission-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.mission-body {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.85;
  margin: 0;
}

/* ===== LINE GROUP JOIN ===== */
.line-join {
  display: flex;
  gap: 28px;
  align-items: center;
  margin: 16px 0 12px;
  padding: 24px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid #06C755;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
/* ステップ項目の中に埋め込むとき用。カードの中にカードが入るのを防ぐため
   枠・影・余白を落とす。詳細度を .line-join より高くしてメディアクエリにも勝たせる */
.line-join.is-inline {
  margin: 12px 0 2px;
  padding: 0;
  gap: 20px;
  background: none;
  border: none;
  box-shadow: none;
  border-radius: 0;
}
.line-join.is-inline .line-join-qr img { width: 120px; height: 120px; }
.line-join-text { flex: 1; min-width: 0; }
.line-join-text p {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.8;
  margin: 0 0 16px;
}
.line-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px 10px 14px;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  background: #06C755;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(6, 199, 85, 0.3);
  transition: background 0.15s, transform 0.1s;
}
.line-btn:hover { filter: brightness(0.94); }
.line-btn:active { transform: translateY(1px); }
.line-btn-logo {
  width: 28px;
  height: 28px;
  display: block;
}
.line-h2-icon {
  width: 26px;
  height: 26px;
  vertical-align: -6px;
  margin-right: 2px;
}
.line-note {
  font-size: 0.84rem !important;
  color: var(--text-mute) !important;
  margin: 14px 0 0 !important;
}
.line-join-qr {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.line-join-qr img {
  width: 150px;
  height: 150px;
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}
.line-join-qr span {
  font-size: 0.78rem;
  color: var(--text-mute);
  font-weight: 600;
}
@media (max-width: 640px) {
  .line-join { flex-direction: column-reverse; align-items: stretch; gap: 20px; padding: 22px 18px; }
  .line-join-qr { align-self: center; }
  .line-btn { justify-content: center; }
}

/* ===== TRUST BADGES ===== */
.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 8px;
}
.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 40px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  transition: all 0.15s;
  box-shadow: var(--shadow-card);
}
.trust-badge:hover {
  border-color: var(--primary-light);
  background: var(--primary-pale);
  color: var(--primary);
  text-decoration: none;
  transform: translateY(-1px);
}
.trust-badge-icon { font-size: 1.15rem; }

/* ===== CALLOUT BOXES ===== */
.callout {
  border-left: 4px solid var(--primary-light);
  background: var(--primary-pale);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin: 16px 0;
}
.callout.warn {
  border-left-color: var(--accent);
  background: #FFF1EB;
}
.callout.danger {
  border-left-color: var(--danger);
  background: #FCE8E4;
}
.callout-title {
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

/* ===== STEP BADGES ===== */
.steps { list-style: none; padding: 0; margin: 16px 0; }
.steps li {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.step-tag {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.74rem;
  font-weight: 700;
  height: 22px;
  white-space: nowrap;
}
.step-tag.s1 { background: #D8F3DC; color: #2D6A4F; }
.step-tag.s2 { background: #FFF3CD; color: #B07C00; }
.step-tag.s3 { background: #FFE0B2; color: #B45309; }
.step-tag.s4 { background: #FCE8E4; color: #C73E1D; }

/* ===== EVENT LIST ===== */
.event-list { list-style: none; padding: 0; margin: 16px 0; }
.event-list li {
  display: block;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary-light);
  border-radius: var(--radius);
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
/* 土曜は青系、日曜は暖色系に左バーを分ける */
.event-list li.is-saturday { border-left-color: var(--saturday); }
.event-list li.is-sunday { border-left-color: var(--weekend); }

/* 日時（＋集合情報）を1行にまとめて上部に表示。バッジが増えても崩れにくい */
.event-when {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
}
.event-date {
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1.2;
  color: var(--text);
}
.event-dow {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-left: 2px;
}
.event-list li.is-saturday .event-dow { color: var(--saturday); }
.event-list li.is-sunday .event-dow { color: var(--weekend); }
.event-time {
  font-weight: 600;
  color: var(--text-light);
  font-size: 0.84rem;
}
.event-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 14px 18px;
}
.event-title {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.45;
}
/* 開催場所・主催者の行（バッジ行とは分離） */
.event-loc-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.event-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.event-loc { color: var(--text-light); font-size: 0.86rem; }
.event-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  width: 100%;
  margin-top: 4px;
  row-gap: 6px;
}
.event-actions .btn-cal { margin-left: auto; }

.badge-fee {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 12px;
  letter-spacing: 0.04em;
}
.fee-free { color: var(--text-mute); background: transparent; border: 1px solid var(--border); }
.fee-paid { color: #8A5A00; background: #FFE08A; border: 1px solid #E3A400; }

/* --- サポート募集中・登壇：属性バッジとは別行、幅は中身に合わせる --- */
.event-extra-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.badge-recruit {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border-radius: 12px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
/* 集計がまだ取れていない状態。募集中(accent)の色で「空いている」と誤解させない */
.badge-recruit.is-loading {
  color: var(--text-light, #6B7487);
  background: #EFEFEC;
  border: 1px solid #D9D9D4;
}
/* サポート枠が埋まった状態。募集中(accent)と色で区別する */
.badge-recruit.is-full {
  color: var(--danger);
  background: #FCE8E4;
  border: 1px solid #E8A89C;
}
.badge-stage {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: var(--primary-light);
  border-radius: 12px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge-photo {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-light);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: help;
}
.tag-nespa {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-pale);
  border-radius: 10px;
  margin-left: 6px;
}
.btn-cal {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--primary);
  background: var(--primary-pale);
  border: 1px solid var(--primary-light);
  border-radius: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.btn-cal:hover { background: var(--primary-light); color: #fff; }
.btn-cal:active { transform: translateY(1px); }

/* 集合時間（event-when 内にインラインで表示） */
.event-gather {
  font-size: 0.84rem;
  color: var(--info);
  font-weight: 600;
}

/* 定員バッジ */
.badge-capacity {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--info);
  background: #E8F4FD;
  border: 1px solid #B0D4F1;
  border-radius: 12px;
}
.badge-capacity.is-full {
  color: var(--danger);
  background: #FCE8E4;
  border-color: #E8A89C;
}

/* 広報公開許可バッジ */
.badge-publicity {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 12px;
  letter-spacing: 0.04em;
  cursor: help;
}
.pub-ok { color: #1B7A3D; background: #E7F6EC; border: 1px solid #A3D9B7; }
.pub-ng { color: var(--danger); background: #FCE8E4; border: 1px solid #E8A89C; }
.pub-pending { color: var(--text-mute); background: transparent; border: 1px dashed var(--border); }

/* 開催実績 */
#akk-past { margin-top: 8px; }
.past-summary {
  padding: 12px 16px;
  background: #E7F6EC;
  border: 1px solid #A3D9B7;
  border-radius: var(--radius);
  font-size: 0.95rem;
  color: #1B5E32;
  margin-bottom: 12px;
}
.past-summary b { font-size: 1.15rem; color: #14532d; }
.past-list { list-style: none; margin: 0; padding: 0; }
.past-item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.past-item.is-paid { border-left: 3px solid #E9C56A; padding-left: 9px; }
.past-date { flex: 0 0 auto; color: var(--text-mute); font-variant-numeric: tabular-nums; min-width: 66px; }
.past-title { flex: 1 1 auto; color: var(--text); }
.past-people { flex: 0 0 auto; color: #1B7A3D; font-weight: 700; white-space: nowrap; }

/* パートナーバッジ */
.badge-partner {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-light);
  background: var(--warm-bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
}
.badge-partner:hover { border-color: var(--primary-light); color: var(--primary); text-decoration: none; }

/* 場所リンク */
a.event-loc { color: var(--text-light); font-size: 0.86rem; text-decoration: none; }
a.event-loc:hover { color: var(--primary); text-decoration: underline; }

/* ○△× ステータスボタン */
.rsvp-status-btns {
  display: inline-flex;
  gap: 4px;
}
.rsvp-status-btn {
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: inherit;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.rsvp-status-btn:hover { transform: scale(1.1); }
.rsvp-status-btn.status-yes { color: var(--primary); }
.rsvp-status-btn.status-maybe { color: #D4A017; }
.rsvp-status-btn.status-no { color: var(--danger); }
.rsvp-status-btn.status-yes.is-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.rsvp-status-btn.status-maybe.is-active {
  background: #D4A017;
  color: #fff;
  border-color: #D4A017;
}
.rsvp-status-btn.status-no.is-active {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

/* モーダル内の○△× は横長 */
.rsvp-status-modal .rsvp-status-btn {
  width: auto;
  height: auto;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 0.88rem;
  flex: 1;
}

/* カウント */
.rsvp-counts {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-light);
  white-space: nowrap;
}

/* 出欠回答ボタン */
.btn-rsvp-answer {
  padding: 6px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, transform 0.1s;
}
.btn-rsvp-answer:not(:disabled):hover { background: var(--primary-light); }
.btn-rsvp-answer:not(:disabled):active { transform: translateY(1px); }
/* 回答確認中・満席では操作できないことを示す */
.btn-rsvp-answer:disabled {
  color: var(--text-light);
  background: #EDEDED;
  border: 1px solid #D5D5D5;
  cursor: not-allowed;
}
.btn-rsvp-answer:disabled:active { transform: none; }
.btn-rsvp-answer.is-answered {
  background: var(--primary-pale);
  border: 1px solid var(--primary-light);
  color: var(--primary);
}
.btn-rsvp-answer.is-answered.status-maybe {
  background: #FFF8E1;
  border-color: #D4A017;
  color: #B8860B;
}
.btn-rsvp-answer.is-answered.status-no {
  background: #FCE8E4;
  border-color: var(--danger);
  color: var(--danger);
  opacity: 0.7;
}
.btn-rsvp-answer.is-answered:hover { filter: brightness(0.95); }

/* 出欠状況ボタン */
.btn-attendance {
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--primary);
  background: var(--primary-pale);
  border: 1px solid var(--primary-light);
  border-radius: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-attendance:hover { background: var(--primary-light); color: #fff; }

/* 出欠テーブル */
.attendance-modal { max-width: 560px; }
.attendance-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin: 16px 0;
}
.attendance-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 0.78rem;
  color: var(--text-mute);
  border-bottom: 2px solid var(--border);
}
.attendance-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.td-status { text-align: center; font-weight: 700; font-size: 1rem; }
.td-yes { color: var(--primary); }
.td-maybe { color: #D4A017; }
.td-no { color: var(--danger); }
.td-comment { font-size: 0.82rem; color: var(--text-light); max-width: 160px; word-break: break-word; }
.att-row-no { opacity: 0.5; }
.attendance-summary {
  text-align: center;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  padding: 8px 0;
}

/* RSVPモーダル */
.rsvp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.rsvp-modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-strong);
  max-height: 90vh;
  overflow-y: auto;
}
.rsvp-modal h3 {
  font-size: 1.1rem;
  color: var(--primary);
  margin: 0 0 4px;
}
.rsvp-modal-date {
  font-size: 0.88rem;
  color: var(--text-light);
  margin-bottom: 20px;
}
.rsvp-field {
  margin-bottom: 16px;
}
.rsvp-field > label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.rsvp-select {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.88rem;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.rsvp-input {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.88rem;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 8px;
}
.rsvp-input:focus, .rsvp-select:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(82,183,136,0.15);
}
.rsvp-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rsvp-checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}
.rsvp-checkbox-row label {
  display: inline !important;
  margin-bottom: 0 !important;
  font-weight: 500 !important;
  font-size: 0.88rem !important;
}
.rsvp-checkbox-row .help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--warm-bg);
  color: var(--text-mute);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
  padding: 0;
  transition: border-color 0.15s, color 0.15s;
}
.rsvp-checkbox-row .help-btn:hover,
.rsvp-checkbox-row .help-btn:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
  outline: none;
}
.rsvp-hint {
  font-size: 0.8rem;
  color: var(--text-light);
  background: var(--warm-bg);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin: 4px 0 0 26px;
  line-height: 1.5;
}
.rsvp-actions {
  display: flex;
  gap: 8px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.rsvp-submit {
  flex: 1;
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}
.rsvp-submit:hover { background: var(--primary-light); }
.rsvp-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.rsvp-cancel-btn {
  padding: 12px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--danger);
  background: transparent;
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.rsvp-cancel-btn:hover { background: #FCE8E4; }
.rsvp-close-btn {
  padding: 12px 16px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text-mute);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.rsvp-close-btn:hover { background: var(--warm-bg); }

/* ===== TABLE ===== */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin: 16px 0;
}
.akk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 520px;
}
.akk-table th, .akk-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.akk-table thead th {
  background: var(--primary-pale);
  color: var(--primary);
  font-weight: 700;
  position: sticky;
  top: 0;
}
.akk-table tbody tr:last-child td { border-bottom: 0; }
.akk-table tbody tr:hover { background: rgba(82, 183, 136, 0.06); }
.akk-table td.note { white-space: normal; color: var(--text-light); font-size: 0.85rem; }
.akk-table .grp td {
  background: var(--warm-bg);
  font-weight: 700;
  color: var(--text);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}
.mk-ok { color: var(--primary); font-weight: 700; }
.mk-cond { color: var(--accent); font-weight: 700; }
.mk-unknown { color: var(--text-mute); font-weight: 700; }

/* ===== MATERIALS GRID ===== */
.materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin: 16px 0;
}
.material-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 18px;
  text-align: center;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.material-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
  text-decoration: none;
}
.material-icon { font-size: 2rem; }
.material-name { font-size: 0.88rem; font-weight: 600; line-height: 1.4; }
.material-size { font-size: 0.76rem; color: var(--text-mute); }

/* ===== SKELETON LOADER ===== */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton-list { list-style: none; padding: 0; margin: 16px 0; }
.skeleton-card {
  display: flex;
  gap: 16px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary-pale);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.skeleton-when {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 92px;
  flex-shrink: 0;
}
.skeleton-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.skeleton-bone {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--border) 25%, var(--primary-pale) 50%, var(--border) 75%);
  background-size: 800px 14px;
  animation: shimmer 1.5s infinite ease-in-out;
}
.skeleton-bone.w-short { width: 60px; }
.skeleton-bone.w-med { width: 80px; }
.skeleton-bone.w-title { width: 70%; height: 16px; }
.skeleton-bone.w-meta { width: 45%; }
.skeleton-bone.w-actions { width: 30%; }

/* ===== CALENDAR ===== */
.calendar-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.calendar-wrap iframe {
  width: 100%;
  height: 640px;
  border: 0;
  display: block;
}

/* ===== AUTH GATE ===== */
.gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-pale) 0%, var(--warm-bg-alt) 100%);
  padding: 24px;
}
.gate-card {
  max-width: 440px;
  width: 100%;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: var(--shadow-strong);
  text-align: center;
}
.gate-logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}
.gate-sub {
  font-size: 0.84rem;
  color: var(--text-mute);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.gate-msg {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 28px;
}
.gate-actions {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.gate-error {
  color: var(--danger);
  font-size: 0.88rem;
  margin-top: 16px;
  padding: 14px 16px;
  background: #FCE8E4;
  border-radius: var(--radius-sm);
  text-align: left;
}
.gate-error b { display: block; margin-bottom: 4px; }
.gate-foot {
  margin-top: 24px;
  font-size: 0.78rem;
  color: var(--text-mute);
}

/* loading overlay while we boot auth */
.boot {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--warm-bg);
  z-index: 9999;
  color: var(--text-mute);
  font-size: 0.9rem;
}

/* ===== MOBILE NAV ===== */
.menu-btn {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(45,106,79,0.35);
}

.sidebar-close {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--text-mute);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}
.sidebar-close:hover { background: var(--primary-pale); color: var(--primary); }

/* ===== SITE GUIDE (index top) ===== */
.site-guide { margin-bottom: 32px; }
.site-guide h2 { margin-bottom: 14px; }
.site-guide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.site-guide-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.site-guide-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-soft);
  text-decoration: none;
}
.site-guide-icon {
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}
.site-guide-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 2px;
}
.site-guide-desc {
  font-size: 0.78rem;
  color: var(--text-mute);
  line-height: 1.5;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .menu-btn { display: block; }
  .sidebar-close { display: block; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    z-index: 150;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-strong);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 140;
  }
  .sidebar-backdrop.show { display: block; }
  .main { padding: 64px 20px 40px; }
  .mission-block { padding: 20px 18px 22px; }
  .mission-headline { font-size: 1.1rem; }
  .hero-internal { padding: 32px 24px; }
  .hero-title { font-size: 1.5rem; }
  .site-guide-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 540px) {
  .main { padding: 64px 16px 32px; }
  .card { padding: 18px 16px; }
  .calendar-wrap iframe { height: 520px; }
  .site-guide-grid { grid-template-columns: 1fr; }
}