/* =========================================================
   JTG 正会員ポータル 共通スタイル (common.css)
   - デザインシステム変数 / リセット
   - サイドバー（PC固定 + モバイルドロワー）
   - カード / ピル / ボタン など全ページ共通UI
   ページ固有のCSSは各HTMLの <style> に残す
   ========================================================= */

:root {
  --navy: #1C2434;
  --navy-light: #253044;
  --gold: #A78B3E;
  --gold-light: rgba(167,139,62,0.15);
  --gold-bg: rgba(167,139,62,0.07);
  --cream: #F7F5F0;
  --beige: #EDE8DE;
  --white: #FFFFFF;
  --text: #1C2434;
  --text-gray: #6E6E74;   /* コントラスト比AA対応（旧 #888888） */
  --text-light: #98989E;  /* 同上（旧 #AAAAAA） */
  --font-display: 'Shippori Mincho', 'Noto Sans JP', serif;
  --green: #4CAF50;
  --red-orange: #E8654A;
  --amber: #D4A017;
  --teal: #2A9D8F;
  --brown: #8B6F47;
  --sidebar-w: 240px;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.10);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Noto Sans JP', sans-serif;
  background: var(--cream);
  color: var(--text);
  line-height: 1.6;
  display: flex;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: .01em;
}

a { color: inherit; }

/* 視覚的に隠すがスクリーンリーダーには読ませる */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* キーボードフォーカスを明示（A11y） */
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ===== Sidebar (PC) ===== */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--navy);
  border-radius: 0 var(--radius) var(--radius) 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
}
.sidebar-logo {
  padding: 28px 20px 8px;
  text-align: center;
}
.sidebar-logo img {
  height: 44px;
  filter: brightness(0) invert(1);
  opacity: .92;
}
.sidebar-logo span {
  display: block;
  color: rgba(255,255,255,.5);
  font-size: 11px;
  letter-spacing: 1px;
  margin-top: 4px;
}
.sidebar-logo-accent {
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 8px auto 0;
}
.nav-list {
  list-style: none;
  margin-top: 20px;
  flex: 1;
}
.nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  border-left: 3px solid transparent;
  transition: all .2s;
}
.nav-item a:hover {
  background: var(--navy-light);
  color: rgba(255,255,255,.9);
}
.nav-item.active a {
  background: var(--navy-light);
  color: var(--gold);
  border-left-color: var(--gold);
  font-weight: 500;
}
.nav-item a svg {
  width: 20px; height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.nav-divider {
  height: 1px;
  background: rgba(255,255,255,.08);
  margin: 8px 20px;
}
.nav-item .admin-badge {
  font-size: 10px;
  background: var(--gold);
  color: var(--white);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: auto;
}
.nav-item .notif-dot {
  width: 8px; height: 8px;
  background: var(--red-orange);
  border-radius: 50%;
  margin-left: auto;
  flex-shrink: 0;
}
.sidebar-user {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-user-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  color: var(--white);
  font-size: 13px;
  font-weight: 500;
}
.sidebar-user-role {
  color: var(--gold);
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.sidebar-user-role svg {
  width: 12px; height: 12px;
  stroke: var(--gold);
  fill: none;
  stroke-width: 2;
}
.sidebar-logout {
  margin-top: 8px;
  background: none;
  border: none;
  color: rgba(255,255,255,.5);
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  border-radius: 4px;
}
.sidebar-logout:hover { color: var(--red-orange); }
.sidebar-logout svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ===== Mobile Topbar + Drawer ===== */
.mobile-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 90;
  height: calc(56px + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--navy);
  align-items: center;
  gap: 12px;
  padding-left: 16px;
  padding-right: 16px;
}
.mobile-topbar img { height: 30px; filter: brightness(0) invert(1); }
.mobile-topbar .mt-title {
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
}
.hamburger {
  background: none;
  border: none;
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.hamburger svg { width: 24px; height: 24px; stroke: var(--white); fill: none; stroke-width: 2; stroke-linecap: round; }
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
}
.drawer-overlay.open { display: block; }

/* ===== Main Content ===== */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
}

/* ===== Card ===== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}
.card-header {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 2px solid var(--beige);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-header svg {
  width: 18px; height: 18px;
  stroke: var(--gold);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.card-header .card-count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-gray);
}
.card-header .card-more {
  margin-left: auto;
  font-size: 12px;
  color: var(--gold);
  text-decoration: none;
  font-weight: 500;
}
.card-header .card-more:hover { text-decoration: underline; }

/* ===== Pills ===== */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.pill svg {
  width: 12px; height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pill-gold { background: var(--gold); color: var(--white); }
.pill-navy { background: var(--navy); color: var(--white); }
.pill-teal { background: var(--teal); color: var(--white); }
.pill-green { background: var(--green); color: var(--white); }
.pill-amber { background: var(--amber); color: var(--white); }
.pill-brown { background: var(--brown); color: var(--white); }
.pill-red { background: var(--red-orange); color: var(--white); }
.pill-gray { background: #ccc; color: #555; }
.pill-outline { background: transparent; border: 1.5px solid var(--beige); color: var(--text-gray); }

/* ===== Notice / list item (共通：黒塗りSVG防止のため共通化) ===== */
.notice-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-xs); background: var(--cream); margin-bottom: 8px; }
.notice-item:last-child { margin-bottom: 0; }
.notice-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notice-icon svg { width: 18px; height: 18px; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.notice-icon.ni-gold { background: var(--gold-light); }
.notice-icon.ni-gold svg { stroke: var(--gold); }
.notice-icon.ni-red { background: rgba(232,101,74,0.12); }
.notice-icon.ni-red svg { stroke: var(--red-orange); }
.notice-text { font-size: 13px; line-height: 1.5; }
.notice-text strong { font-weight: 600; }
.notice-meta { font-size: 11px; color: var(--text-gray); margin-top: 2px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  font-family: inherit;
  transition: all .2s;
}
/* ボタン内アイコンを必ず表示（stroke指定が無いと透明になる問題の対策） */
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.btn-gold {
  background: var(--gold);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(167,139,62,0.25);
}
.btn-gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(167,139,62,0.35);
}
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid #ccc;
}
.btn-outline:hover { border-color: var(--navy); }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: var(--radius-xs); }
.btn[disabled], .btn.is-active-no { opacity: .55; }
.btn.is-selected { outline: 2px solid var(--gold); outline-offset: 1px; }

/* ===== Toast (操作フィードバック) ===== */
.toast-wrap {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.toast {
  background: var(--navy);
  color: var(--white);
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(10px);
  transition: all .25s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast svg { width: 16px; height: 16px; stroke: var(--gold); fill: none; stroke-width: 2.5; flex-shrink: 0; }
.toast.toast-error { background: #B3402A; }
.toast.toast-error svg { stroke: #FFD9CF; }

/* ===== カスタム確認・入力モーダル ===== */
#jtg-modal { position: fixed; inset: 0; background: rgba(28,36,52,.55); z-index: 900; display: flex; align-items: center; justify-content: center; padding: 20px; }
.jtg-modal-box { background: var(--white); border-radius: var(--radius); width: 100%; max-width: 400px; padding: 24px 26px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.jtg-modal-title { font-size: 16px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.jtg-modal-body { font-size: 13px; color: var(--text-gray); line-height: 1.8; }
.jtg-modal-input { width: 100%; min-height: 72px; border: 1.5px solid var(--beige); border-radius: var(--radius-sm); padding: 10px 12px; font-family: inherit; font-size: 13px; resize: vertical; margin-top: 10px; }
.jtg-modal-input:focus { outline: none; border-color: var(--gold); }
.jtg-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ===== ボタンのローディング表示 ===== */
.btn.is-loading { pointer-events: none; opacity: .75; position: relative; }
.btn.is-loading::after { content: ''; width: 13px; height: 13px; border: 2px solid rgba(255,255,255,.45); border-top-color: currentColor; border-radius: 50%; animation: jtg-spin .7s linear infinite; margin-left: 4px; }
@keyframes jtg-spin { to { transform: rotate(360deg); } }

/* ===== スケルトン（読み込み中プレースホルダ） ===== */
.skeleton { border-radius: var(--radius-xs); background: linear-gradient(90deg, rgba(28,36,52,.06) 25%, rgba(28,36,52,.11) 50%, rgba(28,36,52,.06) 75%); background-size: 200% 100%; animation: jtg-shimmer 1.3s ease-in-out infinite; min-height: 16px; }
@keyframes jtg-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-row { height: 52px; margin-bottom: 10px; }

/* ===== 起動・遷移ローディング（JTGロゴスプラッシュ） ===== */
#jtg-loader {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(150deg, #1C2434 0%, #24304A 60%, #1A2130 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px;
  opacity: 1; transition: opacity .45s ease;
}
#jtg-loader.done { opacity: 0; pointer-events: none; }
#jtg-loader.waiting { opacity: 0; pointer-events: none; }  /* 遅延表示：速い遷移では見せない */
#jtg-loader img {
  height: 66px;
  filter: brightness(0) invert(1);
  animation: jtg-pulse 1.6s ease-in-out infinite;
}
#jtg-loader .ld-brand {
  font-family: var(--font-display);
  color: #F3EFE6; font-size: 13px; font-weight: 600; letter-spacing: 5px;
  animation: jtg-fadein .8s ease both;
}
#jtg-loader .ld-bar {
  width: 128px; height: 2px; border-radius: 2px;
  background: rgba(255,255,255,.12); overflow: hidden; position: relative;
}
#jtg-loader .ld-bar::after {
  content: ''; position: absolute; top: 0; left: 0; width: 45%; height: 100%;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  animation: jtg-slide 1.1s ease-in-out infinite;
}
@keyframes jtg-pulse { 0%,100% { transform: scale(1); opacity: .82; } 50% { transform: scale(1.07); opacity: 1; } }
@keyframes jtg-slide { 0% { transform: translateX(-110%); } 100% { transform: translateX(340%); } }
@keyframes jtg-fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  #jtg-loader img, #jtg-loader .ld-bar::after { animation: none; }
}

/* ===== オフラインバナー ===== */
.offline-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 950; background: var(--red-orange); color: var(--white); font-size: 12px; font-weight: 600; text-align: center; padding: 8px calc(12px + env(safe-area-inset-top, 0px)) 8px 12px; }

/* ===== フィールドエラー ===== */
.input-error { border-color: var(--red-orange) !important; background: rgba(232,101,74,.05) !important; }
.field-error-msg { font-size: 11px; color: var(--red-orange); margin-top: 4px; }

/* =========================================================
   UI 仕上げレイヤー（余白・奥行き・操作感の微調整）
   ========================================================= */
:root {
  --shadow: 0 1px 2px rgba(28,36,52,0.04), 0 4px 16px rgba(28,36,52,0.05);
  --shadow-hover: 0 2px 4px rgba(28,36,52,0.06), 0 10px 28px rgba(28,36,52,0.09);
}

/* カード：薄いボーダー＋柔らかい影＋ホバーで軽く浮く */
.card, .widget, .stat-card, .detail-card, .panel, .cert-card, .search-filter, .member-card, .service-card {
  border: 1px solid rgba(28,36,52,0.05);
  transition: box-shadow .22s ease, transform .22s ease, border-color .22s ease;
}
.card { padding: 26px 28px; }
.card-header { letter-spacing: .02em; }

/* 見出し：明朝ディスプレイ書体で「ギルド」の格を出す */
.page-title, .cal-title, h1, h2 { letter-spacing: .04em; font-family: var(--font-display); }
.hero-content h1 { font-family: var(--font-display); letter-spacing: .06em; }

/* KPI数字：桁を揃える */
.stat-number { font-variant-numeric: tabular-nums; }

/* ドロワー・モーダル表示中は背景スクロールをロック */
body.drawer-open, body.modal-open { overflow: hidden; }

/* ボタン：押下のフィードバック */
.btn { letter-spacing: .02em; }
.btn:active { transform: translateY(1px); }
.btn-gold:active { box-shadow: 0 1px 4px rgba(167,139,62,0.3); }

/* サイドバー：アクティブ項目をなめらかに */
.nav-item a { transition: background .18s ease, color .18s ease, border-color .18s ease; border-radius: 0 10px 10px 0; margin-right: 10px; }
.nav-item.active a { box-shadow: inset 0 0 0 1px rgba(167,139,62,0.12); }

/* ピル：少しコントラストを上げる */
.pill { letter-spacing: .02em; }

/* 共通の空状態 */
.empty {
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
  padding: 28px 16px;
  line-height: 1.8;
}

/* リンク・行のホバーを上品に */
.schedule-item, .notice-item, .recruit-item, .feed-post, .status-item, .quick-action, .member-card, .upcoming-item { transition: background .18s ease, box-shadow .22s ease, transform .18s ease; }

/* スクロールバー（WebKit） */
* { scrollbar-width: thin; scrollbar-color: rgba(28,36,52,0.18) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: rgba(28,36,52,0.16); border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(28,36,52,0.28); background-clip: content-box; }

/* テキスト選択色 */
::selection { background: rgba(167,139,62,0.22); }

/* 画像が読めない時の体裁（alt崩れ防止） */
img { color: transparent; }

/* =========================================================
   モバイルアプリUI（680px以下のみ・PCには一切影響しない）
   設計の根拠：
   ・意図優先／装飾より内容（2026 mobile design best practice）
   ・iOS inset grouped list ＝ カード羅列より走査が速く省スペース
   ・8ptグリッド（端16 / カード内16 / 要素間8）
   ・親指ゾーンに主要操作、微細な動きは「反応の伝達」に限定
   ========================================================= */

/* PC・タブレットではアプリシェルを完全に隠す（DOMは残すが不可視） */
.mapp-tabbar, .mapp-fab, .mapp-sheet-wrap, .mapp-bell, .mapp-only { display: none; }
.feed-tab .t-short { display: none; }

@media (max-width: 680px) {
  /* ---------- 基礎トークン（モバイル用に上書き） ---------- */
  :root {
    --m-gap: 16px;         /* 画面端・カード内の基本余白 */
    --m-gap-s: 8px;
    --m-radius: 16px;      /* コンテナ */
    --m-radius-s: 12px;    /* コントロール */
    --m-line: rgba(28,36,52,.07);
    --m-shadow: 0 1px 2px rgba(28,36,52,.04), 0 8px 24px rgba(28,36,52,.05);
  }
  .mapp-only { display: block; }

  /* 旧ドロワー導線は下タブに統合（ナビの二重化を避ける） */
  .hamburger { display: none !important; }
  .sidebar, .drawer-overlay { display: none !important; }

  /* ---------- 上バー：52px・ロゴ＋タイトル＋通知 ---------- */
  .mobile-topbar {
    height: calc(52px + env(safe-area-inset-top, 0px));
    padding-left: var(--m-gap); padding-right: 4px; gap: 10px;
    background: var(--navy);
  }
  .mobile-topbar img { height: 24px; }
  .mobile-topbar .mt-title { font-size: 14px; letter-spacing: 1px; font-family: var(--font-display); font-weight: 600; }
  .mapp-bell {
    margin-left: auto; position: relative; background: none; border: none;
    width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .mapp-bell svg { width: 21px; height: 21px; stroke: rgba(255,255,255,.85); fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  .mapp-bell:active svg { opacity: .5; }
  .mapp-bell .dot {
    position: absolute; top: 10px; right: 10px; min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 8px; background: var(--red-orange); color: #fff;
    font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
    border: 2px solid var(--navy); box-sizing: content-box;
  }

  /* ---------- 本文の器 ---------- */
  body { font-size: 16px; background: #F4F1EB; }
  .main {
    padding: var(--m-gap) var(--m-gap) calc(84px + env(safe-area-inset-bottom, 0px)) !important;
    max-width: 100vw; overflow-x: hidden;
  }
  .content-area { padding: 0 !important; gap: 0 !important; }

  /* カード＝白い器。影は最小限、境界はヘアラインで示す */
  .card, .panel, .widget, .search-filter, .cert-card, .detail-card {
    padding: var(--m-gap) !important;
    margin-bottom: var(--m-gap) !important;
    border-radius: var(--m-radius) !important;
    border: 1px solid var(--m-line) !important;
    box-shadow: var(--m-shadow) !important;
  }

  /* セクション見出し：カード内の帯 → 上に置く小見出し（iOSのグループ見出し） */
  .card-header, .panel-header, .widget-title, .detail-card-header {
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: .08em;
    color: var(--text-gray) !important;
    border-bottom: none !important;
    padding-bottom: 0 !important;
    margin: 0 0 12px !important;
    font-family: inherit !important;
  }
  .card-header svg, .panel-header svg, .widget-title svg, .detail-card-header svg {
    width: 15px !important; height: 15px !important; stroke: var(--gold) !important;
  }
  .card-header .card-more, .card-header .card-count, .card-header .card-action,
  .card-header .btn { margin-left: auto; font-size: 12px; }
  .card-header .btn { min-height: 34px; padding: 6px 12px; }

  .page-title { font-size: 20px !important; margin-bottom: 14px !important; }
  h2 { font-size: 16px !important; letter-spacing: .04em; }

  /* 数値は等幅（桁が揃う） */
  .stat-number, .bar-count, .act-num, .mc-field-value, .data-table td { font-variant-numeric: lining-nums tabular-nums; }

  /* ---------- 入力・ボタン（タップ48px／iOS自動ズーム防止16px） ---------- */
  input, select, textarea,
  .adm-input, .adm-select, .ef-input, .modal-input, .search-input, .form-input {
    font-size: 16px !important; min-height: 48px; border-radius: var(--m-radius-s);
    border: 1.5px solid var(--beige); background: var(--white);
  }
  textarea, textarea.adm-input, textarea.ef-input, .modal textarea.modal-input { min-height: 96px; padding: 12px 14px; }
  .btn { min-height: 46px; padding: 12px 18px; font-size: 14px; border-radius: var(--m-radius-s); transition: transform .12s ease, opacity .12s ease; }
  .btn-sm { min-height: 40px; padding: 9px 14px; font-size: 13px; }
  .btn:active { transform: scale(.97); }          /* 押した感触を返す */
  .btn-gold { box-shadow: 0 2px 10px rgba(167,139,62,.28); }

  /* ---------- インセット・グループドリスト（走査が速い） ---------- */
  /* 塗りつぶしカードの羅列 → 1つの器に区切り線 */
  .notice-item, .status-item, .upcoming-item, .recruit-item, .feed-post, .link-row {
    background: transparent !important;
    border-radius: 0 !important;
    margin-bottom: 0 !important;
    padding: 14px 0 !important;
    border-bottom: 1px solid var(--m-line);
  }
  .notice-item:last-child, .status-item:last-child, .upcoming-item:last-child,
  .recruit-item:last-child, .feed-post:last-child, .link-row:last-child { border-bottom: none; }
  .notice-item:active, .status-item:active, .link-row:active, .feed-post:active { background: rgba(28,36,52,.03) !important; }
  .notice-icon { width: 34px; height: 34px; border-radius: 10px; }
  .notice-text { font-size: 15px; }
  .notice-meta { font-size: 12px; }
  .link-row { min-height: 52px; }
  .link-row span { font-size: 15px; }

  /* ---------- KPI：2×2の数値タイル（区切りは線だけ） ---------- */
  .stats-row {
    grid-template-columns: 1fr 1fr !important; gap: 0 !important;
    background: var(--white); border: 1px solid var(--m-line);
    border-radius: var(--m-radius); overflow: hidden; box-shadow: var(--m-shadow);
    margin-bottom: var(--m-gap);
  }
  .stats-row .stat-card {
    box-shadow: none !important; border: none !important; border-radius: 0 !important;
    padding: 14px var(--m-gap) !important; text-align: left !important;
    border-right: 1px solid var(--m-line); border-bottom: 1px solid var(--m-line);
  }
  .stats-row .stat-card:nth-child(2n) { border-right: none; }
  .stats-row .stat-card:nth-last-child(-n+2) { border-bottom: none; }
  .stats-row .stat-card::before { display: none; }   /* 上の色帯は情報を持たない */
  .stat-icon { display: none !important; }
  .stat-label { font-size: 11px !important; margin-bottom: 3px !important; letter-spacing: .04em; }
  .stat-number { font-size: 24px !important; letter-spacing: -.02em; }
  .stat-number .unit, .stat-number span { font-size: 11px !important; font-weight: 500 !important; }

  /* ---------- グラフ：横棒（角度より位置の方が正確に読める） ---------- */
  .bar-chart-item { flex-wrap: wrap; gap: 6px 8px; margin-bottom: 14px; }
  .bar-label { width: auto !important; flex: 1 1 100%; font-size: 13px; white-space: normal; font-weight: 500; }
  .bar-track { flex: 1 1 auto; height: 14px; border-radius: 7px; }
  .bar-fill { border-radius: 7px; }
  .bar-count { font-size: 12px; margin-left: 6px; color: var(--text-gray); }

  /* ---------- 表：1件=1行のリストに畳む ---------- */
  .stack-table tr {
    border: none; border-bottom: 1px solid var(--m-line); border-radius: 0;
    padding: 14px 0; margin-bottom: 0; background: transparent !important;
  }
  .stack-table tr:last-child { border-bottom: none; }
  .stack-table td { font-size: 14px; padding: 3px 0 !important; }
  .stack-table td::before { font-size: 11px; letter-spacing: .04em; }
  .stack-table td.td-actions { padding-top: 12px !important; }

  /* ---------- セグメント式タブ（下線タブ → iOS風ピル） ---------- */
  .feed-tabs {
    background: rgba(28,36,52,.05); border-radius: 10px; padding: 3px; gap: 2px;
    overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 14px;
  }
  .feed-tabs::-webkit-scrollbar { display: none; }
  .feed-tab {
    border: none !important; border-radius: 8px; padding: 8px 14px;
    font-size: 12.5px; font-weight: 600; white-space: nowrap; color: var(--text-gray);
    transition: background .18s ease, color .18s ease;
  }
  .feed-tab.active { background: var(--white); color: var(--navy) !important; box-shadow: 0 1px 3px rgba(28,36,52,.12); }

  /* ---------- 空状態：まる型アイコン＋一言＋行動 ---------- */
  .empty, .empty-state, .empty-detail { padding: 28px 12px !important; font-size: 14px; line-height: 1.9; }

  /* ---------- モーダル → ボトムシート ---------- */
  .modal-overlay, #jtg-modal, #rosterModal, #onboarding { align-items: flex-end !important; padding: 0 !important; }
  .modal, .jtg-modal-box, #rosterModal > div, #onboarding > div {
    max-width: none !important; width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    padding: 22px var(--m-gap) calc(20px + env(safe-area-inset-bottom, 0px)) !important;
    max-height: 90vh !important; overflow: auto;
    animation: mapp-sheet-up .3s cubic-bezier(.2,.9,.25,1) both;
  }
  .modal-actions, .jtg-modal-actions, .ef-actions { gap: 10px; }
  .modal-actions .btn, .jtg-modal-actions .btn, .ef-actions .btn { flex: 1; }
  @keyframes mapp-sheet-up { from { transform: translateY(18%); opacity: .5; } to { transform: none; opacity: 1; } }

  /* ---------- 下タブバー ---------- */
  .mapp-tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 300;
    height: calc(56px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255,255,255,.94);
    backdrop-filter: saturate(1.8) blur(16px);
    -webkit-backdrop-filter: saturate(1.8) blur(16px);
    border-top: 1px solid rgba(28,36,52,.07);
  }
  .mapp-tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    background: none; border: none; font-family: inherit; cursor: pointer;
    color: #9AA0A8; font-size: 10px; font-weight: 600; text-decoration: none;
    -webkit-tap-highlight-color: transparent; padding-top: 4px;
    transition: color .16s ease;
  }
  .mapp-tab svg { width: 23px; height: 23px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .mapp-tab.active { color: var(--navy); }
  .mapp-tab.active svg { stroke: var(--gold); }
  .mapp-tab:active { opacity: .5; }
  .mapp-tab-spacer { flex: 1; }
  .mapp-tab { position: relative; }
  .tab-badge {
    position: absolute; top: 2px; left: 50%; margin-left: 6px;
    min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px;
    background: var(--red-orange); color: #fff; font-size: 10px; font-weight: 700; line-height: 17px; text-align: center;
  }
  .menu-badge {
    margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
    background: var(--red-orange); color: #fff; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center;
  }
  .mapp-menu-item .menu-badge + .chev { margin-left: 8px; }

  /* 中央FAB＝出欠回答（忘れやすい最重要行動） */
  .mapp-fab {
    position: fixed; left: 50%; transform: translateX(-50%);
    bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 301;
    width: 56px; height: 56px; border-radius: 50%; border: none;
    background: linear-gradient(160deg, #C0A24E, #A78B3E); color: #fff; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
    box-shadow: 0 4px 16px rgba(167,139,62,.42), 0 0 0 4px #fff;
    font-family: inherit; font-size: 9px; font-weight: 700; letter-spacing: .04em;
    transition: transform .14s ease;
  }
  .mapp-fab svg { width: 20px; height: 20px; stroke: #fff; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
  .mapp-fab:active { transform: translateX(-50%) scale(.93); }
  /* 未回答が無いときは控えめに（用が無い日まで催促しない） */
  .mapp-fab.quiet {
    background: #fff; color: var(--navy);
    box-shadow: 0 3px 12px rgba(28,36,52,.16), 0 0 0 1px rgba(28,36,52,.07), 0 0 0 4px #fff;
  }
  .mapp-fab.quiet svg { stroke: var(--gold); }

  /* 掲示板タブ：狭い画面では短いラベルに差し替え（端で切れて壊れて見えるのを防ぐ） */
  .feed-tab .t-long { display: none; }
  .feed-tab .t-short { display: inline; }
  .mapp-fab .fab-badge {
    position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px;
    border-radius: 10px; background: var(--red-orange); color: #fff;
    font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; border: 2px solid #fff;
  }
  .mapp-fab.has-todo::after {
    content: ''; position: absolute; inset: -4px; border-radius: 50%;
    border: 2px solid rgba(232,101,74,.5); animation: mapp-pulse 2s ease-out infinite;
  }
  @keyframes mapp-pulse { 0% { transform: scale(.92); opacity: .85; } 100% { transform: scale(1.32); opacity: 0; } }

  /* ---------- ボトムシート（メニュー・出欠） ---------- */
  .mapp-sheet-wrap { position: fixed; inset: 0; z-index: 400; display: none; }
  .mapp-sheet-wrap.open { display: block; }
  .mapp-sheet-bg { position: absolute; inset: 0; background: rgba(28,36,52,.5); animation: mapp-fade .2s ease both; }
  @keyframes mapp-fade { from { opacity: 0; } to { opacity: 1; } }
  .mapp-sheet {
    position: absolute; left: 0; right: 0; bottom: 0;
    background: var(--white); border-radius: 20px 20px 0 0;
    padding: 8px var(--m-gap) calc(20px + env(safe-area-inset-bottom, 0px));
    max-height: 86vh; overflow: auto;
    animation: mapp-sheet-up .3s cubic-bezier(.2,.9,.25,1) both;
  }
  .mapp-sheet-handle { width: 36px; height: 4px; border-radius: 2px; background: #DCD7CC; margin: 8px auto 16px; }
  .mapp-sheet-title { font-size: 17px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
  .mapp-sheet-sub { font-size: 13px; color: var(--text-gray); margin-bottom: 14px; }

  /* メニュー：アイコン付きの行リスト（2列グリッドより押しやすい） */
  .mapp-menu-list { border-top: 1px solid var(--m-line); }
  .mapp-menu-item {
    display: flex; align-items: center; gap: 14px; width: 100%;
    min-height: 56px; padding: 14px 4px; background: none; border: none;
    border-bottom: 1px solid var(--m-line);
    text-decoration: none; color: var(--text); font-size: 15px; font-weight: 600;
    font-family: inherit; text-align: left; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .mapp-menu-item:active { background: rgba(28,36,52,.03); }
  .mapp-menu-item svg { width: 21px; height: 21px; stroke: var(--gold); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
  .mapp-menu-item .chev { margin-left: auto; width: 16px; height: 16px; stroke: #C9C4BA; }
  .mapp-menu-item.admin { color: var(--gold); }
  .mapp-menu-item.logout { color: var(--red-orange); border-bottom: none; }
  .mapp-menu-item.logout svg { stroke: var(--red-orange); }
  .mapp-user { display: flex; align-items: center; gap: 12px; padding: 0 4px 16px; }
  .mapp-user img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); }
  .mapp-user b { display: block; font-size: 16px; color: var(--navy); }
  .mapp-user span { font-size: 12px; color: var(--gold); font-weight: 600; }

  /* 通知シートの1件 */
  .mapp-nt {
    display: flex; align-items: flex-start; gap: 12px; padding: 13px 0;
    border-bottom: 1px solid var(--m-line); text-decoration: none; color: var(--text);
  }
  .mapp-nt:last-of-type { border-bottom: none; }
  .mapp-nt:active { background: rgba(28,36,52,.03); }
  .mapp-nt.read { opacity: .55; }
  .mapp-nt-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--gold-light); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .mapp-nt-ic svg { width: 17px; height: 17px; stroke: var(--gold); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .mapp-nt-ic.rej { background: rgba(232,101,74,.12); } .mapp-nt-ic.rej svg { stroke: var(--red-orange); }
  .mapp-nt-tx { flex: 1; min-width: 0; }
  .mapp-nt-tx b { display: block; font-size: 14px; font-weight: 500; line-height: 1.55; }
  .mapp-nt-tx i { display: block; font-style: normal; font-size: 11.5px; color: var(--text-gray); margin-top: 3px; }
  .mapp-nt-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red-orange); flex-shrink: 0; margin-top: 6px; }

  /* はじめの一歩カード */
  .fs-card { background: var(--white); border: 1px solid var(--m-line); border-radius: var(--m-radius); box-shadow: var(--m-shadow); padding: var(--m-gap); margin-bottom: var(--m-gap); }
  .fs-head { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--text-gray); margin-bottom: 4px; }
  .fs-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--m-line); text-decoration: none; color: var(--text); }
  .fs-row:last-of-type { border-bottom: none; }
  .fs-row:active { background: rgba(28,36,52,.03); }
  .fs-num {
    width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: #fff;
    font-family: var(--font-display); font-size: 14px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  }
  .fs-txt { flex: 1; min-width: 0; }
  .fs-txt b { display: block; font-size: 15px; font-weight: 600; }
  .fs-txt i { display: block; font-style: normal; font-size: 12px; color: var(--text-gray); margin-top: 2px; line-height: 1.6; }
  .fs-chev { width: 16px; height: 16px; stroke: #C9C4BA; flex-shrink: 0; }
  .fs-note { font-size: 12.5px; color: var(--text-gray); line-height: 1.8; padding-top: 12px; border-top: 1px solid var(--m-line); margin-top: 4px; }

  /* 出欠シートの1件 */
  .mapp-att-item { padding: 14px 0; border-bottom: 1px solid var(--m-line); }
  .mapp-att-item:last-child { border-bottom: none; }
  .mapp-att-title { font-size: 15px; font-weight: 600; color: var(--navy); }
  .mapp-att-meta { font-size: 12.5px; color: var(--text-gray); margin-top: 3px; }
  .mapp-att-actions { display: flex; gap: 10px; margin-top: 12px; }
  .mapp-att-actions .btn { flex: 1; }

  /* トーストは下タブの上に */
  .toast-wrap { bottom: calc(82px + env(safe-area-inset-bottom, 0px)); }
  .toast { max-width: calc(100vw - 32px); }

  /* 読み込み中の骨組み */
  .skeleton-row { height: 60px; }
}

/* ===== Responsive Sidebar -> Drawer ===== */
@media (max-width: 768px) {
  body { display: block; }
  .mobile-topbar { display: flex; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
    border-radius: 0;
    width: 260px;
    z-index: 210;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar { padding-top: env(safe-area-inset-top, 0px); }
  .main { margin-left: 0; }

  /* 幅広テーブルはカード内で横スクロール（ページ全体がはみ出るのを防ぐ） */
  .card, .panel { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table:not(.stack-table) { min-width: 520px; }

  /* stack-table：スマホでは1件=1カードに積み上げ（横スクロール不要・改行詰まり解消） */
  .stack-table, .stack-table tbody, .stack-table tr, .stack-table td { display: block; width: auto; min-width: 0; }
  .stack-table thead { display: none; }
  .stack-table tr { background: var(--white); border: 1px solid var(--beige); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 10px; }
  .stack-table tr:nth-child(even) { background: var(--white); }
  .stack-table td { border: none !important; padding: 5px 0 !important; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; }
  .stack-table td::before { content: attr(data-label); font-weight: 600; color: var(--text-gray); font-size: 11px; flex-shrink: 0; }
  .stack-table td:empty { display: none; }
  .stack-table td.td-actions { justify-content: flex-end; flex-wrap: wrap; gap: 6px; padding-top: 8px !important; }
  .stack-table td.td-actions::before { display: none; }
  /* 万一の横はみ出し対策＋下部セーフエリア */
  .main { max-width: 100vw; overflow-x: hidden; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
}
