:root {
  /* 配色は agent(blueqat.app)の :root と同じ値。行き来しても地の色が変わらない
     ようにするため。左が agent 側の変数名。
       --bg / --surface / --surface-2 / --text / --muted / --faint / --border
       --accent / --accent-strong / --ok / --warn / --error  */
  --bg: #ffffff;
  --bg-subtle: #f7f8fa;      /* agent --surface */
  --bg-subtle-2: #eceef3;    /* agent --surface-2 */
  --bg-card: #ffffff;
  --fg: #16181d;             /* agent --text */
  --fg-secondary: #5a5f6a;   /* agent --muted */
  --fg-muted: #8b909b;       /* agent --faint */
  --border: #dcdfe6;         /* agent --border */
  --border-strong: #c6cad3;

  /* アクセント */
  --accent: #2563d8;         /* agent --accent */
  --accent-soft: rgba(37, 99, 216, .10);
  --accent-hover: #1b4bad;   /* agent --accent-strong */

  /* ステータス色: 状況ごとに意味を持たせる。
     緑/橙/赤は agent の --ok / --warn / --error に合わせた */
  --green: #2e8b57;      /* 開催予定(受付中) */
  --green-soft: #e7f2ec;
  --amber: #96670a;      /* まもなく開催 */
  --amber-soft: #fbf1de;
  --red: #c0392b;        /* 満席 */
  --red-soft: #fbecea;
  --gray: #6b7280;       /* 終了 */
  --gray-soft: #f1f2f4;
  --purple: #6f42c1;     /* 主催イベント */
  --purple-soft: #f1ecfb;

  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(20, 22, 26, .05);
  --shadow-md: 0 4px 12px rgba(20, 22, 26, .07);
  --shadow-lg: 0 12px 28px rgba(20, 22, 26, .12);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
               "Noto Sans JP", Meiryo, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- 骨格(サイドバー + 上バー) ----------

   agent(blueqat.app)と同じ寸法・同じトークンで組んである。行き来したときに
   別のサービスに来た感じにならないようにするため。
   サイドバー240px / 上バー50px / 角丸8px / 文字12px は agent 側の値。 */

.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-subtle);
  border-right: 1px solid var(--border-strong);
  /* 画面に貼り付けておく。ページ丈に伸ばすと、下端の agent リンクと
     アカウントが画面外に行ってしまう */
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
/* 余白・字送りは agent(blueqat.app)の実物から取った値。
   ⚠️ サイドバーの行はすべて同じ見た目にすること。枠や破線を付けない
   （agent 側も 2026-08-22 に「新規プロジェクト」の枠を外して揃えている）。 */
.app-sidebar { line-height: 1.45; }
/* ⚠️ 高さと padding は上バーと揃えること。左右で行の高さが違うと、
   ロゴとタイトルの文字がずれて見える */
.sidebar-head {
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 14px 0 18px;
}
.brand-logo { height: 20px; width: auto; display: block; }

.primary-action,
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 2px 10px 4px;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  color: var(--fg-secondary);
  font-size: 13px;
}
.primary-action svg { flex-shrink: 0; }
.primary-action:hover,
.sidebar-nav a:hover { background: var(--bg-subtle-2); color: var(--fg); }

.sidebar-nav { display: flex; flex-direction: column; }

.sidebar-spacer { flex: 1; }

/* サイト間の行き来（→ ~/pm/SIDEBAR.md）。一覧の下・アカウントの上に置き、
   上に細い線を引いて本文の一覧と分ける。外のサイトなので見た目は控えめに */
.site-links {
  display: flex;
  flex-direction: column;
  margin-top: 2px;
  padding-top: 4px;
  padding-bottom: 2px;
  border-top: 1px solid var(--border);
}
.site-links a {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 10px 4px;
  padding: 8px 10px;
  color: var(--fg-secondary);
  font-size: 13px;
  border-radius: 8px;
}
.site-links a:hover { background: var(--bg-subtle-2); color: var(--fg); }
.site-links svg { flex: none; }

.sidebar-footer { padding: 4px 10px 8px; }

.quick-links { margin: 0 0 1.5rem; font-size: .9rem; }

.app-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.app-topbar {
  /* ⚠️ サイドバーのヘッダーと同じ高さ・同じ左右余白にすること。
     違うとロゴとタイトルの文字がずれて見える */
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-title {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--fg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 広い画面では常に開いているので、たたむ幕は要らない */
.sidebar-backdrop { display: none; }

.inline-form { display: inline-flex; align-items: center; gap: .6rem; }
.user-email { color: var(--fg-muted); font-size: .85rem; }

/* アカウントメニュー。開閉は <details> の標準機能でJSは使わない。
   そのぶん外側をクリックしても閉じないが、この程度のメニューでは許容する */
.account-menu { position: relative; }
/* 半円の囲い。高さ・角丸・ホバーは agent(blueqat.app)の #account-pill と同じ */
.account-menu summary {
  display: flex;
  width: 100%;
  height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--fg-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;          /* 三角のマーカーを消す */
  white-space: nowrap;
}
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.account-menu summary svg {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.account-menu summary .caret { width: 14px; height: 14px; }
.account-menu[open] summary .caret { transform: rotate(180deg); }
.account-name { max-width: 12ch; overflow: hidden; text-overflow: ellipsis; }

.account-menu summary svg,
.account-menu summary .caret { flex: none; }
.account-menu summary .caret { transition: transform .15s; }

.account-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  /* サイドバーの一番下にあるので、下ではなく上へ開く */
  bottom: calc(100% + .4rem);
  z-index: 30;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 5px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 9px;
  box-shadow: var(--shadow-lg);
}
.account-dropdown .account-email {
  padding: .45rem .6rem .55rem;
  color: var(--fg-muted);
  font-size: .8rem;
  word-break: break-all;
  border-bottom: 1px solid var(--border);
  margin-bottom: .3rem;
}
.account-dropdown a,
.account-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--fg);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.account-dropdown a:hover,
.account-dropdown button:hover { background: var(--bg-subtle); color: var(--accent); }
.account-dropdown form { margin: 0; }

/* 設定画面 */
.pref-group { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.pref-group legend { padding: 0 .4rem; font-size: .85rem; font-weight: 700; color: var(--fg-muted); }
/* form.stack label が column なので、勝てる詳細度で横並びに戻す */
form.stack label.checkbox {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: .6rem;
  font-size: .95rem;
  font-weight: 500;
  color: var(--fg);
}
form.stack label.checkbox input[type="checkbox"] {
  width: auto;
  flex: none;
  margin: .35rem 0 0;
  accent-color: var(--accent);
}
form.stack label.checkbox .field-hint { margin-top: .15rem; }
.notice-ok {
  padding: .7rem 1rem;
  border: 1px solid var(--green);
  border-radius: var(--radius);
  background: var(--green-soft);
  color: var(--green);
  font-size: .92rem;
}

/* ログイン/ログアウトはアイコンで表す(デスクトップ)。狭い画面ではラベルを併記する */
.icon-button {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: .3rem;
  color: var(--fg-secondary);
  cursor: pointer;
  font: inherit;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.icon-button:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.icon-label { display: none; font-size: .9rem; font-weight: 500; padding-right: .35rem; }

/* 未ログイン時もアカウントの囲いと同じ形にする(サイドバー下端で並ぶため) */
.sidebar-footer .icon-button {
  width: 100%;
  height: 34px;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border-color: var(--border);
  border-radius: 999px;
  color: var(--fg-secondary);
  font-size: 13px;
  font-weight: 500;
}
.sidebar-footer .icon-label { display: inline; padding: 0; font-size: 13px; }

/* ハンバーガー(スマホのみ表示) */
.nav-toggle { display: none; }
.nav-burger { display: none; cursor: pointer; padding: .5rem; }
.nav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--fg);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-burger span + span { margin-top: 5px; }

.lang-switch {
  display: inline-flex;
  gap: .2rem;
  padding: .15rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .8rem;
}
.lang-switch a {
  padding: .15rem .6rem;
  border-radius: 999px;
  color: var(--fg-muted);
  font-weight: 600;
}
.lang-switch a:hover { color: var(--fg); }
.lang-switch a.active { background: #fff; color: var(--accent); box-shadow: var(--shadow-sm); }

/* ---------- レイアウト ---------- */

main { max-width: 1120px; margin: 0 auto; padding: 2.5rem 1.75rem 1rem; }

h1, h2, h3 { color: var(--fg); letter-spacing: -.02em; }
h1 { font-size: 2rem; font-weight: 700; line-height: 1.35; margin: 0 0 .6rem; }
h2 { font-size: 1.3rem; font-weight: 700; }

.lead { color: var(--fg-secondary); font-size: 1.02rem; max-width: 62ch; margin: 0; }

.section-title {
  margin: 3rem 0 1.25rem;
  font-size: 1.25rem;
  display: flex;
  align-items: baseline;
  gap: .6rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}
.section-title .count { color: var(--fg-muted); font-size: .88rem; font-weight: 500; }
/* 開催予定の見出しは強調して、過去一覧より先に目に入るようにする */
.section-title.accent {
  font-size: 1.45rem;
  border-bottom-color: var(--accent);
}

.page-head { margin-bottom: 1.75rem; }

/* ---------- イベントカード ---------- */

.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

/* 開催予定: 大きめ3列。PCでも情報量を確保して目立たせる */
.featured-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

/* 過去アーカイブ: PCでは4列に詰めて一覧性を優先する */
.compact-grid { grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
@media (max-width: 1024px) { .compact-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px)  { .compact-grid { grid-template-columns: repeat(2, 1fr); } }

/* 開催予定セクションは背景で囲って、過去一覧と視覚的に分離する */
.upcoming-section {
  background: linear-gradient(180deg, var(--accent-soft) 0%, rgba(255,255,255,0) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.5rem 1.75rem;
  margin-top: 2rem;
}
.upcoming-section .section-title { margin-top: 0; }

.section-more { margin-top: 1.25rem; font-size: .92rem; font-weight: 500; }

.event-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  color: inherit;
}
.event-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
  color: inherit;
}
.event-card.is-past { opacity: .82; }
.event-card.is-past:hover { opacity: 1; }

.event-card .thumb {
  position: relative;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}
.event-card .thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.event-card .thumb .badge-overlay {
  position: absolute;
  top: .7rem;
  left: .7rem;
  display: flex;
  gap: .4rem;
}

.event-card .body {
  padding: 1rem 1.15rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  flex: 1;
}
.event-card .date {
  color: var(--fg-muted);
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.event-card h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.event-card .meta {
  color: var(--fg-muted);
  font-size: .85rem;
  display: flex;
  align-items: center;
  gap: .35rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.event-card .meta-row { margin-top: auto; padding-top: .35rem; }

/* --- 開催予定カード(featured) --- */
.event-card.featured {
  border-color: var(--accent-soft);
  box-shadow: var(--shadow-md);
}
.event-card.featured:hover { border-color: var(--accent); }
.event-card.featured .body { padding: 1.15rem 1.3rem 1.3rem; gap: .55rem; }
.event-card.featured h3 { font-size: 1.12rem; -webkit-line-clamp: 3; }
.event-card.featured .date.big {
  color: var(--accent);
  font-size: .95rem;
  font-weight: 700;
}
.event-card.featured .meta { font-size: .88rem; }

/* 残り日数バッジ: 開催が近いことを一目でわかるようにする */
.countdown {
  position: absolute;
  right: .7rem;
  bottom: .7rem;
  background: var(--accent);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  padding: .25rem .7rem;
  border-radius: 999px;
  box-shadow: var(--shadow-md);
}

.card-cta {
  display: inline-block;
  margin-top: .5rem;
  color: var(--accent);
  font-size: .88rem;
  font-weight: 700;
}

/* ---------- バッジ(状況ごとに色を変える) ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  border: 1px solid transparent;
}

/* 開催予定 = 受付中 → 緑 */
.badge.is-upcoming { background: var(--green-soft); color: var(--green); border-color: #bfe6d0; }
/* まもなく開催(7日以内) → オレンジで注意喚起 */
.badge.is-soon { background: var(--amber-soft); color: var(--amber); border-color: #f4d9b0; }
/* 満席 → 赤 */
.badge.is-full { background: var(--red-soft); color: var(--red); border-color: #f7c9c5; }
/* 終了 → グレー */
.badge.is-past { background: var(--gray-soft); color: var(--gray); border-color: var(--border); }
/* 主催イベント → 紫(アクセント) */
.badge.is-native { background: var(--purple-soft); color: var(--purple); border-color: #ddd0f5; }
/* connpass由来 → 控えめ */
.badge.is-archive { background: #fff; color: var(--fg-muted); border-color: var(--border-strong); }

/* サムネイル上に重ねるバッジは白背景で視認性を確保 */
.badge-overlay .badge {
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(4px);
  box-shadow: var(--shadow-sm);
}
.badge-overlay .badge.is-upcoming { color: var(--green); border-color: transparent; }
.badge-overlay .badge.is-soon { color: var(--amber); border-color: transparent; }
.badge-overlay .badge.is-full { color: var(--red); border-color: transparent; }
.badge-overlay .badge.is-past { color: var(--gray); border-color: transparent; }

/* ---------- 詳細ページ ---------- */

.event-detail { max-width: 780px; }
/* ヘッダー画像はページを占有しない程度の大きさに抑える */
.event-detail .hero {
  display: block;
  width: 100%;
  max-width: 460px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  margin: 0 0 1.75rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.event-detail .badges { display: flex; gap: .5rem; margin-bottom: .85rem; flex-wrap: wrap; }
.event-detail h1 { margin-bottom: 1.25rem; }

.fact-list {
  list-style: none;
  margin: 0 0 2rem;
  padding: 1.1rem 1.25rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  gap: .6rem;
}
.fact-list li { display: flex; gap: .75rem; font-size: .95rem; align-items: baseline; }
.fact-list .label {
  color: var(--fg-muted);
  font-size: .85rem;
  font-weight: 600;
  min-width: 5.5em;
  flex-shrink: 0;
}
.fact-list .value { color: var(--fg); }
.fact-list .sub { color: var(--fg-muted); font-size: .85rem; margin-left: .4rem; }

.event-detail h2 {
  font-size: 1.1rem;
  margin: 2rem 0 .75rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--border);
}
.event-detail .description {
  white-space: pre-wrap;
  color: var(--fg-secondary);
  margin: 0;
}

.ticket-list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: grid;
  gap: .5rem;
}
.ticket-list li {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  padding: .65rem .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  font-size: .93rem;
  flex-wrap: wrap;
}
.ticket-name { font-weight: 600; }
.ticket-fee { color: var(--fg-secondary); font-size: .88rem; }
.ticket-count { margin-left: auto; color: var(--fg-muted); font-size: .88rem; font-variant-numeric: tabular-nums; }

.source-link { margin-top: 1.5rem; font-size: .9rem; }

/* 参加登録した人にだけ見せる参加方法(オンライン開催のURLなど) */
.private-box {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-soft);
}
.private-box h2 { margin-top: 0; border: none; padding: 0; font-size: 1.05rem; }
.private-box .description { color: var(--fg); }
.private-box.is-locked { border-style: dashed; border-color: var(--border-strong); background: var(--bg-subtle); }
.private-box.is-locked h2 { color: var(--fg-secondary); }

/* 管理者だけに見える告知メールの送信欄 */
.announce-box { margin-top: 1.5rem; }
.announce-box form { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; }
.announce-box .field-hint { margin: 0; }

/* 管理者だけに見える「参加方法」の編集欄 */
.private-edit {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  align-items: flex-start;
  max-width: 640px;
  margin-top: 1.5rem;
  padding: 1rem 1.15rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}
.private-edit label {
  width: 100%;
  font-size: .88rem;
  font-weight: 600;
  color: var(--fg-secondary);
}
.private-edit textarea {
  width: 100%;
  margin-top: .35rem;
  padding: .7rem .85rem;
  font: inherit;
  font-size: .92rem;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #fff;
  resize: vertical;
}
.private-edit textarea:focus { outline: none; border-color: var(--accent); }

/* 管理者だけに見える画像アップロード欄 */
.image-upload {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .6rem;
  margin: -.5rem 0 1.5rem;
  padding: .85rem 1rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}
.image-upload input[type="file"] { font: inherit; font-size: .85rem; min-width: 0; flex: 1 1 200px; }
.field-hint { display: block; margin-top: .3rem; font-size: .8rem; color: var(--fg-muted); font-weight: 400; }

/* カレンダー登録・シェア。JSは使わず、ただのリンクとして置いている */
.event-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.action-group { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.action-label {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--fg-muted);
  margin-right: .15rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .85rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--fg-secondary);
  font-size: .87rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.chip:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.chip svg { width: 16px; height: 16px; flex: none; }
/* 線画のアイコン(カレンダー)と塗りのアイコン(SNSロゴ)で描き分けを変える */
.chip svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chip svg.solid { fill: currentColor; stroke: none; }

.register-box {
  margin-top: 2rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}
.register-box p { margin-top: 0; }
.register-box .status-note { color: var(--fg-secondary); font-size: .95rem; }
/* 変更フォームの下に置くキャンセル。誤操作しないよう少し離す */
.register-box .cancel-form { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* ---------- ボタン・フォーム ---------- */

.btn {
  display: inline-block;
  padding: .65rem 1.35rem;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: .95rem;
  transition: background .15s ease, box-shadow .15s ease;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--accent-hover); color: #fff; box-shadow: var(--shadow-md); }
.btn.secondary {
  background: #fff;
  color: var(--fg-secondary);
  border-color: var(--border-strong);
}
.btn.secondary:hover { background: var(--bg-subtle); color: var(--fg); }
.btn.danger { background: #fff; color: var(--red); border-color: #f2b8b3; }
.btn.danger:hover { background: var(--red-soft); color: var(--red); }

form.stack { display: flex; flex-direction: column; gap: 1rem; max-width: 520px; }
form.stack label {
  font-size: .88rem;
  color: var(--fg-secondary);
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
form.stack input, form.stack textarea {
  padding: .6rem .75rem;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--fg);
  font: inherit;
  font-weight: 400;
}
form.stack input:focus, form.stack textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
form.stack .btn { align-self: flex-start; }

/* ハイブリッド開催の参加方法の選択 */
.attendance-choice { border: 0; margin: 0; padding: 0; }
.attendance-choice legend {
  padding: 0;
  margin-bottom: .5rem;
  font-size: .88rem;
  font-weight: 600;
  color: var(--fg-secondary);
}
.attendance-choice .radio {
  display: inline-flex;
  /* form.stack label が column なので、ここで横並びに戻す */
  flex-direction: row;
  align-items: center;
  gap: .4rem;
  margin-right: 1.25rem;
  font-size: .95rem;
  font-weight: 400;
  color: var(--fg);
  cursor: pointer;
}
.attendance-choice input[type="radio"] {
  accent-color: var(--accent);
  width: auto;      /* form.stack input の width:100% を打ち消す */
  flex: none;
  margin: 0;
}
/* オンラインを選んだら氏名欄を隠す。:has() が効かないブラウザでは出たままになるが、
   その場合も送信はでき、必要なときだけサーバ側が姓・名を求める */
.register-form:has(input[name="attendance"][value="online"]:checked) .name-fields { display: none; }

/* 参加者一覧の会場/オンラインの区別 */
.attend-tag {
  padding: .12rem .5rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  border: 1px solid transparent;
}
.attend-tag.is-onsite { background: var(--accent-soft); color: var(--accent); }
.attend-tag.is-online { background: var(--gray-soft); color: var(--gray); }

/* 姓・名は横に並べる。狭い画面では縦に落ちる */
.name-fields { display: flex; gap: 1rem; }
.name-fields label { flex: 1; min-width: 0; }
@media (max-width: 480px) { .name-fields { flex-direction: column; gap: 1rem; } }

/* ---------- フィルタータブ ---------- */

.filter-tabs {
  display: inline-flex;
  gap: .25rem;
  margin-bottom: 1.75rem;
  padding: .25rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
  flex-wrap: wrap;
}
.filter-tabs a {
  padding: .4rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .88rem;
  color: var(--fg-secondary);
  transition: background .15s ease, color .15s ease;
}
.filter-tabs a:hover { background: rgba(255, 255, 255, .8); color: var(--fg); }
.filter-tabs a.active {
  background: #fff;
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

/* ---------- 参加者一覧(管理者) ---------- */

/* 当日の受付でスマホから見る前提。横に広がる表をやめ、氏名だけを大きく出して
   照合にしか使わないメール・日時はグレーで下に回している。 */
.reg-list {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  border-top: 1px solid var(--border);
  max-width: 640px;
}
.reg-item {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  padding: .8rem .25rem;
  border-bottom: 1px solid var(--border);
}
.reg-index {
  flex: none;
  min-width: 1.75rem;
  color: var(--fg-muted);
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
}
.reg-main { min-width: 0; flex: 1; }
.reg-name {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .5rem .7rem;   /* 姓と名のあいだを空けて切れ目を見せる */
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--fg);
}
.reg-name .unnamed { color: var(--fg-muted); font-weight: 400; }
.reg-sub {
  display: flex;
  flex-wrap: wrap;
  gap: .1rem 1rem;
  margin-top: .2rem;
  color: var(--fg-muted);
  font-size: .82rem;
}
.reg-sub .reg-email { word-break: break-all; }
.reg-sub .reg-time { font-variant-numeric: tabular-nums; }
.reg-item.is-waitlist { background: var(--bg-subtle); }

/* ---------- ページネーション ---------- */

.pagination {
  display: flex;
  gap: 1.5rem;
  margin: 3rem 0 1rem;
  justify-content: center;
  align-items: center;
  font-weight: 500;
  font-size: .92rem;
}
.pagination span { color: var(--fg-muted); font-variant-numeric: tabular-nums; }

/* ---------- その他 ---------- */

.site-footer {
  text-align: center;
  color: var(--fg-muted);
  font-size: .85rem;
  padding: 2.5rem 1.75rem;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  background: var(--bg-subtle);
}

.empty {
  color: var(--fg-muted);
  background: var(--bg-subtle);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
}

@media (max-width: 760px) {
  main { padding: 1.75rem 1.15rem 1rem; }
  h1 { font-size: 1.6rem; }
  .site-header { padding: .8rem 1.15rem; position: relative; }
  .event-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.15rem; }
  .fact-list li { flex-direction: column; gap: .1rem; }
  /* 横に並べきれないので、カレンダーとシェアを縦に積む */
  .event-actions { flex-direction: column; gap: 1.1rem; }
  /* 参加者一覧: メールと日時を横に並べると溢れるので縦に積む */
  .reg-sub { flex-direction: column; gap: .12rem; }

  /* サイドバーは画面外へ逃がし、ハンバーガーで引き出す(agent と同じ挙動) */
  .app-topbar { padding: 0 10px 0 6px; }
  .nav-burger { display: block; }
  .app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 260px;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform .2s ease;
  }
  .nav-toggle:checked ~ .app-shell .app-sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(16, 18, 24, .18);
  }
  /* 開いている間は、外側をタップすれば閉じられるようにする */
  .nav-toggle:checked ~ .app-shell .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(16, 18, 24, .32);
  }

  .icon-label { display: inline; }
  .icon-button { border: none; padding: .5rem .1rem; width: 100%; }
  .icon-button:hover { background: none; }

  .nav-toggle:checked ~ .app-shell .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle:checked ~ .app-shell .nav-burger span:nth-child(2) { opacity: 0; }
  .nav-toggle:checked ~ .app-shell .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}
