/* ===== 画面の骨組み（メンバー用・管理用 共通） ===== */
.bar .title { color: #fff; text-decoration: none; display: block; min-width: 0; }
.head { align-items: center; flex-direction: row !important; }
.iconbtn { background: none; border: 0; color: #fff; padding: 6px; margin-left: -6px; display: grid; place-items: center; }
.iconbtn svg { font-size: 24px; }
.actions { margin-top: 0 !important; align-self: center !important; }
.layout { max-width: 1240px; margin: 0 auto; }
.content { max-width: none; }
#page.narrow { max-width: 780px; margin: 0 auto; }

/* 左のメニュー（PC） */
.side { display: none; }
.sgroup { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .08em; margin: 18px 12px 6px; }
.slink { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 10px; color: var(--text);
  text-decoration: none; font-size: 15px; background: none; border: 0; text-align: left; }
.slink svg { font-size: 20px; color: var(--muted); }
.slink:hover { background: var(--card); }
.slink.on { background: var(--red-soft); color: var(--red); font-weight: 700; }
.slink.on svg { color: var(--red); }
.nbadge { font-style: normal; margin-left: auto; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px;
  min-width: 18px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center; }

@media (min-width: 900px) {
  .layout { display: grid; grid-template-columns: 220px 1fr; gap: 8px; align-items: start; }
  .side:not([hidden]) { display: block; position: sticky; top: 0; padding: 12px 8px 40px; max-height: 100vh; overflow-y: auto; }
  .tabs, #menuBtn { display: none !important; }
  body.member { padding-bottom: 0; }
}

/* 下のタブ（スマホ）：5つまで */
.tabs { justify-content: stretch !important; } /* 列の数はタブの数に合わせて JS で決める */
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; height: 56px; font-size: 11px;
  color: var(--muted); text-decoration: none; position: relative; }
.tabs a svg { font-size: 22px; }
.tabs a.on { color: var(--red); font-weight: 700; }
.tabs a .nbadge { position: absolute; top: 2px; left: 55%; margin: 0; }
.tabs a.center .plus { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--red); color: #fff; }
.tabs a.center .plus svg { font-size: 20px; stroke-width: 2.5; }

/* 名簿ページ上の赤い検索帯 */
.band { background: var(--red); margin: -16px -16px 0; padding: 4px 16px 16px; }
.band .search { margin-top: 0; }
@media (min-width: 900px) { .band { margin: 0 0 0; border-radius: 14px; padding: 14px 16px; } }
#page .chips { position: sticky; top: 0; margin: 0 -16px; }
@media (min-width: 900px) { #page .chips { margin: 0; border-radius: 0 0 12px 12px; } }
.meeting { margin-top: 14px; }

/* ホーム */
.hello { font-size: 20px; margin: 4px 0 14px; }
.hgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.hcard { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; color: var(--text); text-decoration: none; }
a.hcard:hover { border-color: var(--red-line); }
.hcard.accent { background: var(--red-soft); border-color: var(--red-line); }
.hlabel { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.hbig { font-size: 22px; font-weight: 800; color: var(--red); }
.hbig.warn { color: #c2410c; }
.hsub { font-size: 14px; color: var(--muted); margin-top: 4px; }
.hcard .stack { margin-top: 12px; }
.hrow { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-top: 1px solid var(--line); }
.hrow:first-of-type { border-top: 0; padding-top: 0; }

/* メニュー（スマホの ☰） */
.mgroup { font-size: 13px; color: var(--muted); margin: 20px 4px 8px; }
.mlist { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.mitem { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border: 0; border-top: 1px solid var(--line);
  background: none; color: var(--text); text-decoration: none; font-size: 16px; text-align: left; }
.mitem:first-child { border-top: 0; }
.mitem svg { font-size: 22px; color: var(--muted); }
.mitem span:first-of-type { flex: 1; }
.mitem .chev { font-size: 18px; }
.mitem.danger { color: var(--red); }

.card .notice { margin-top: 12px; }
.empty .primary.sm { margin-top: 10px; }

/* ===== レスポンシブ調整（画面の幅に合わせる） ===== */
/* 中身がはみ出さないように（横に長いチップ等があっても列が広がらない） */
.layout { max-width: 1440px; }
@media (min-width: 900px) { .layout { grid-template-columns: 220px minmax(0, 1fr); } }
.content { min-width: 0; }
.bar { text-align: left; }
.bar .head { max-width: 1440px; }
.title h1, .title .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* ☰ は下の「メニュー」タブと同じなので出さない */
#menuBtn { display: none !important; }

/* スマホ：ヘッダーを1行におさめる */
@media (max-width: 640px) {
  .bar { padding: calc(10px + env(safe-area-inset-top)) 0 10px; }
  .bar h1 { font-size: 15px; }
  .bar .sub { font-size: 11px; margin-top: 2px; }
  .hbtn { padding: 3px 10px 3px 3px; font-size: 12px; }
  .hbtn .av.xs { width: 26px; height: 26px; }
  .band { padding-top: 10px; }
  /* 名簿カードを少しコンパクトに */
  .grid { gap: 10px; }
  .mcard { padding: 12px; gap: 12px; }
  .mcard .photo { width: 64px; height: 78px; }
  .nm { font-size: 16px; }
}
/* タブレット：名簿は2列、PCは幅に合わせて3〜5列 */
/* 名簿のカード：横は最大3人（ノートPCでも事業の内容・紹介してほしいが読める幅）。狭い画面では2人→1人 */
.grid { grid-template-columns: repeat(auto-fill, minmax(max(260px, calc((100% - 24px) / 3)), 1fr)); }
.vgrid { grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
/* 中央寄せの指定（margin:auto）が残ると、列の幅を超えて伸びてしまうので打ち消す */
.layout > .content { margin: 0; width: 100%; max-width: 100%; }
@media (max-width: 899px) { .layout > .content { max-width: 1240px; margin: 0 auto; } }
@media (max-width: 420px) { .title h1 .lg { display: none; } }

/* ===== スマホ：左上の ☰ で左からメニューを引き出す ===== */
#menuBtn:not([hidden]) { display: grid !important; }
.sdhead { display: none; }
.slink small { margin-left: auto; font-size: 12px; }
.slink.danger { color: var(--red); }
.iconbtn.dark { color: var(--text); font-size: 26px; line-height: 1; }
.scrim { display: none; }
@media (max-width: 899px) {
  .side:not([hidden]) { display: block; position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; width: min(300px, 82vw);
    background: var(--bg); padding: calc(10px + env(safe-area-inset-top)) 10px 30px; overflow-y: auto;
    transform: translateX(-105%); transition: transform .22s ease; box-shadow: 4px 0 24px rgba(0,0,0,.18); }
  body.drawer .side { transform: none; }
  .sdhead { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 4px 12px; }
  .sdhead b { font-size: 17px; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.4); opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.drawer .scrim { opacity: 1; pointer-events: auto; }
  .slink { padding: 12px; font-size: 16px; }
}
@media (min-width: 900px) { #menuBtn { display: none !important; } }

/* 名簿カードのバッジ：ビジター紹介は青、話してみたいは赤 */
.mcard.intro { border: 2px solid #b9d3f5; box-shadow: 0 0 0 3px #eaf2fd; }
.mcard.intro .badge.b-intro { background: #2563eb; }
@media (prefers-color-scheme: dark) {
  .mcard.intro { border-color: #2b4a77; box-shadow: 0 0 0 3px #16253b; }
}

/* 自分が登録したビジターの操作 */
.vedit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.vedit .muted { flex: 1 1 100%; }

/* ===== PC：ログイン前は1列で中央に／☰は出さない ===== */
@media (min-width: 900px) {
  #menuBtn, #menuBtn:not([hidden]) { display: none !important; }
  body:not(.started) .layout { display: block; }
  body:not(.started) .layout > .content { max-width: 1240px; margin: 0 auto; }
  body:not(.started) .gate { margin-top: 48px; }
}

/* 名簿PDF */
.pdfcard { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.pdficon { width: 48px; height: 58px; border-radius: 8px; background: var(--red); color: #fff; font-weight: 800; font-size: 13px; display: grid; place-items: center; flex: none; }
a.primary.big { display: block; text-align: center; text-decoration: none; padding: 16px; font-size: 17px; font-weight: 700; border-radius: 12px; }
.sharerow { display: flex; gap: 8px; }
.sharerow input { flex: 1; min-width: 0; font: inherit; font-size: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); }
.steps-ol { margin: 8px 0 4px; padding-left: 1.4em; line-height: 1.9; font-size: 14px; }
.rowbtns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.rowbtns .primary.sm { margin-top: 0; }
a.soft { text-decoration: none; color: var(--text); }

/* メインプレゼン（金色） */
:root { --pres: #facc15; --pres-ink: #3f2d00; --pres-text: #a16207; --pres-soft: #fefbe6; --pres-line: #f5dc6b; } /* メインプレゼン＝黄色（文字は濃い色） */
@media (prefers-color-scheme: dark) { :root { --pres: #eab308; --pres-ink: #1d1d1f; --pres-text: #facc15; --pres-soft: #2b260b; --pres-line: #6b5a12; } }
.badges { position: absolute; top: -10px; right: 12px; display: flex; gap: 6px; }
.badges .badge { position: static; }
.badge.b-intro { background: #2563eb; }
.badge.b-conn { background: var(--red); }
.badge.b-pres { background: var(--pres); color: var(--pres-ink); }
.mcard.pres { border: 2px solid var(--pres-line); box-shadow: 0 0 0 3px var(--pres-soft); }
.ptag { display: inline-block; background: var(--pres); color: var(--pres-ink); font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 8px; margin-right: 6px; vertical-align: 1px; }
.mpres { font-size: 14px; margin: 4px 0 2px; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 12px; margin-top: 12px; }
.pcard { background: var(--pres-soft); border: 2px solid var(--pres-line); border-radius: 14px; padding: 16px 18px; display: grid; gap: 8px; }
.phead { display: flex; gap: 12px; align-items: center; }
.phead .av { width: 48px; height: 48px; }
.pwho b { font-size: 17px; }
.pwho .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.ptheme { font-size: 16px; font-weight: 700; }
.pwant { font-size: 14px; }
.pwant .lbl { display: block; font-size: 12px; color: var(--muted); padding: 0; }
.pnote { font-size: 14px; word-break: break-all; }
.pnote a { color: var(--red); }
.pcard .soft { justify-self: start; }
.none.small { padding: 14px 0; font-size: 13px; }
.date-opt .dpres { display: block; width: 100%; font-size: 12px; color: var(--muted); margin-top: 4px; }
.presadd { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.presbtn { border-color: var(--pres-line); color: var(--pres-text); }
.date-opt:has(.dpres) { flex-wrap: wrap; row-gap: 0; }
/* ビジター画面の日付見出し：日付は折り返さず、狭い画面ではボタンを小さく */
.vsec { gap: 10px; }
.vsec .sech { white-space: nowrap; flex-wrap: wrap; row-gap: 2px; min-width: 0; }
.vsec .fb { flex-shrink: 0; white-space: nowrap; }
@media (max-width: 420px) { .vsec .sech { font-size: 18px; } .vsec .fb { font-size: 12px; padding: 6px 10px; } }
/* ビジターのカード（タップで開く） */
details.vcard { padding: 0; }
details.vcard > summary { list-style: none; cursor: pointer; padding: 14px 16px; display: grid; gap: 4px; }
details.vcard > summary::-webkit-details-marker { display: none; }
details.vcard .vco { margin: 0; }
.vmini { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 13px; color: var(--muted); }
.vflag { background: var(--red-soft); color: var(--red); font-weight: 700; font-size: 11px; border-radius: 999px; padding: 1px 8px; }
.vflag.intro { background: var(--line); color: var(--text); }
.vmore { margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
details.vcard[open] .vmore { transform: rotate(-135deg); }
details.vcard .vbody { padding: 0 16px 16px; border-top: 1px dashed var(--line); padding-top: 12px; margin: 0 0 0; }
details.vcard[open] > summary { padding-bottom: 12px; }
@media (min-width: 900px) { details.vcard > summary { padding: 18px 20px 12px; } details.vcard .vbody { padding: 12px 20px 18px; } }
@media (max-width: 899px) { .vgrid { gap: 10px; } }
/* ビジター画面の日付タブ */
.dtabs { display: flex; gap: 8px; overflow-x: auto; margin: 14px -16px 0; padding: 2px 16px 6px; scrollbar-width: none; }
.dtabs::-webkit-scrollbar { display: none; }
.dtab { flex: none; display: grid; justify-items: center; gap: 2px; min-width: 84px; border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 12px; padding: 8px 12px; cursor: pointer; }
.dtab b { font-size: 14px; white-space: nowrap; }
.dtab small { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.dtab.on { background: var(--red); border-color: var(--red); color: #fff; }
.dtab.on small { color: rgba(255,255,255,.9); }
.dpdot { width: 8px; height: 8px; border-radius: 50%; background: #eab308; display: inline-block; }
.dtab.on .dpdot { background: #fde047; }
.dtabs + .vsec { margin-top: 14px; }
@media (min-width: 900px) { .dtabs { margin: 14px 0 0; padding: 2px 0 6px; } }
/* 名簿カードのバッジ：種類ごとの色（カードの枠の色に引っぱられないよう強めに指定） */
.mcard .badges .badge.b-intro { background: #2563eb; }
.mcard .badges .badge.b-conn { background: var(--red); }
.mcard .badges .badge.b-pres { background: var(--pres); color: var(--pres-ink); }
.badges { left: 12px; justify-content: flex-end; flex-wrap: nowrap; }
.badges .badge { white-space: nowrap; }
/* 名簿：グループのボタンと日付タブを、スクロールしても上に残す */
.rsticky { position: sticky; top: 0; z-index: 5; margin: 0 -16px; background: var(--card); border-bottom: 1px solid var(--line); }
#page .rsticky .chips { position: static; margin: 0; border-bottom: 0; border-radius: 0; }
.rsticky .rdays { margin: 0; padding: 0 16px 10px; gap: 6px; }
.rsticky .rdays .dtab { display: inline-flex; align-items: center; gap: 6px; min-width: 0; padding: 6px 12px; border-radius: 999px; }
.rsticky .rdays .dtab b { font-size: 13px; }
.rsticky .rdays .dtab small { font-size: 12px; }
@media (min-width: 900px) {
  .rsticky { margin: 0; border-radius: 0 0 12px 12px; }
  .rsticky .rdays { padding: 0 16px 12px; }
}
/* 募集中のカテゴリー：スマホはグループごと、PCは上にまとめて1つの枠に */
.recpanel { display: none; }
@media (min-width: 900px) {
  .group .recruit { display: none; }
  .recpanel:not(:empty) { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; margin-top: 14px; }
  .recpanel h3 { font-size: 15px; margin: 0 0 10px; }
  .recgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 28px; }
  .recrow { display: grid; grid-template-columns: 14.5em minmax(0, 1fr); gap: 10px; align-items: start; font-size: 13px; padding: 6px 0; border-top: 1px dashed var(--line); }
  .recrow:nth-child(-n+2) { border-top: 0; }
  .recrow .g { color: var(--muted); font-weight: 700; padding-top: 3px; }
  .recrow .rs { display: flex; flex-wrap: wrap; gap: 6px; }
}
.recrow .r { color: var(--red); border: 1px dashed var(--red); border-radius: 6px; padding: 2px 8px; background: var(--card); font-size: 12px; }
