/* ============================================================
 * saps-rounder スタイルシート
 * - テーマカラー：オレンジ基調（ロゴ色を踏襲）
 * - モバイルファースト
 * - 素の CSS のみ（フレームワーク不使用）
 * ============================================================ */

:root {
  /* ブランド（アンバー） */
  --color-primary:        #D88B12;
  --color-primary-dark:   #A96A0E;
  --color-primary-light:  #FFE7BA;

  /* ニュートラル */
  --color-text:           #2A2A2A;
  --color-text-muted:     #6B6257; /* 本文ミュート（暖色グレー、WCAG AA 4.5:1 以上） */
  --color-bg:             #FFFFFF;
  --color-bg-soft:        #FAF7F2;
  --color-border:         #E5DED2;

  /* セマンティック（意味を持つ色） */
  --color-success:        #4A8F6D;
  --color-success-dark:   #2F6F55;
  --color-success-bg:     #E8F0EA;
  --color-success-border: #C3D8CA;
  --color-warning:        #C77D13;
  --color-warning-dark:   #8A4A0F;
  --color-warning-bg:     #FFF4E6;
  --color-warning-border: #FFD7A8;
  --color-error:          #B73E3E;
  --color-error-dark:     #8B1F1F;
  --color-error-bg:       #F7E5E9;
  --color-error-border:   #E6C0C5;
  --color-info:           #3F7096;
  --color-info-dark:      #1F4F7A;
  --color-info-bg:        #E8F2FB;
  --color-info-border:    #BCDAF1;

  /* データカテゴリ（時間構成 / 訪問種別） */
  --color-cat-visit:      #4A8F6D;  /* 訪問（セージグリーン） */
  --color-cat-move:       #C8BFA8;  /* 移動（ライトタン） */
  --color-cat-office:     #8A7F6F;  /* 内勤（ウォームグレー） */
  --color-cat-other:      #C77D13;  /* その他（ゴールド） */

  /* 旧エイリアス（段階的置換の互換用） */
  --color-danger:         var(--color-error);

  --radius-sm:            6px;
  --radius-md:            10px;
  --radius-lg:            14px;
  --shadow-sm:            0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md:            0 4px 12px rgba(0, 0, 0, 0.06);
  --font-sans:            -apple-system, BlinkMacSystemFont, "Segoe UI",
                          "Hiragino Kaku Gothic ProN", "Yu Gothic Medium",
                          "Meiryo", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--color-text);
  background: var(--color-bg-soft);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

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

img { max-width: 100%; height: auto; }

/* ------------------------------------------------------------
 * レイアウト：ヘッダ・メイン・フッタ
 * ------------------------------------------------------------ */
.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: var(--shadow-sm);
}
.site-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text);
  font-weight: 700;
}
.site-logo:hover { text-decoration: none; }
.site-logo__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.site-logo__text { font-size: 16px; }

.site-nav {
  /* モバイル：横スクロール可能な単一行ナビ */
  display: flex;
  align-items: center;
  gap: 6px;
  flex-basis: 100%;
  order: 3;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* 右端に「続きあり」を示すフェード */
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent 100%);
          mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent 100%);
  padding-right: 12px;
}
.site-nav::-webkit-scrollbar { display: none; }
.site-nav__link {
  color: var(--color-text-muted);
  font-size: 14px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  flex-shrink: 0;
  scroll-snap-align: start;
}
.site-nav__link:hover {
  color: var(--color-primary-dark);
  background: var(--color-warning-bg);     /* hover は薄く */
  text-decoration: none;
}
.site-nav__link.is-active {
  color: var(--color-primary-dark);
  background: var(--color-primary-light);  /* active は濃く */
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--color-primary-dark); /* 下線で現在地を強調 */
}
.site-nav__role-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  background: var(--color-bg-soft);
  color: var(--color-text-muted);
  border-radius: 999px;
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}
/* モバイルナビの「マスタ管理:」ラベル */
.site-nav__group-label {
  font-size: 11px;
  color: var(--color-text-muted);
  padding: 0 4px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  align-self: center;
}
/* サブリンク（マスタ管理項目）は通常リンクと同等の見た目 */
.site-nav__link--sub { color: var(--color-text-muted); }
.site-nav__role-badge--admin {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.site-header__user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.site-header__name { font-size: 13px; color: var(--color-text-muted); }
.site-header__logout { margin: 0; }

.site-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 96px; /* モバイル下部タブ(≒64px)+余白 */
}

/* ハンバーガーボタン（モバイルのみ） */
.site-header__menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.site-header__menu-btn:hover {
  background: var(--color-warning-bg);
  border-color: var(--color-primary);
}

/* ドロワー（モバイル：左からスライドイン） */
.site-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 84vw;
  max-width: 320px;
  background: #FFF7E8;
  border-right: 1px solid var(--color-border);
  box-shadow: 0 0 24px rgba(0,0,0,0.15);
  z-index: 60;
  transform: translateX(-100%);
  transition: transform 0.24s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.site-drawer.is-open { transform: translateX(0); }
.site-drawer[aria-hidden="true"] { /* 閉時にフォーカスを当てない補助 */ }

.site-drawer__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 55;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.site-drawer__backdrop.is-open {
  opacity: 1;
}

.site-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
}
.site-drawer__user {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}
.site-drawer__user-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-drawer__close {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.site-drawer__close:hover { background: var(--color-warning-bg); }

.site-drawer__nav {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px 0;
}
.site-drawer__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-drawer__link {
  display: block;
  padding: 12px 18px;
  color: var(--color-text);
  font-size: 15px;
}
.site-drawer__link:hover {
  background: rgba(0, 0, 0, 0.03);
  text-decoration: none;
}
.site-drawer__link.is-active {
  background: rgba(0, 0, 0, 0.06);
  color: var(--color-primary-dark);
  font-weight: 600;
}
.site-drawer__link--sub {
  padding-left: 34px;
  font-size: 14px;
  color: var(--color-text-muted);
}
.site-drawer__group-title {
  margin: 12px 18px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  text-transform: uppercase;
}
/* 2段アコーディオン：親「メンバー業務を見る」配下 */
.site-sidebar__section--wrap > .site-sidebar__section-toggle {
  background: rgba(184, 137, 58, 0.08);
  font-weight: 700;
}
.site-sidebar__section--wrap.is-open > .site-sidebar__section-toggle {
  background: rgba(184, 137, 58, 0.15);
  color: #8A5A00;
}
.site-sidebar__section-body--nest {
  display: none;
  padding-left: 8px;
  border-left: 2px solid rgba(184, 137, 58, 0.2);
  margin-left: 14px;
}
.site-sidebar__section--wrap.is-open > .site-sidebar__section-body--nest {
  display: block;
}
.site-sidebar__section-body--nest .site-sidebar__section {
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px dashed var(--color-border);
}
.site-sidebar__section-body--nest .site-sidebar__section:first-child {
  border-top: none;
  margin-top: 2px;
}
.site-sidebar__section-body--nest .site-sidebar__section-toggle {
  padding: 9px 14px;
  font-size: 14px;
}

.site-drawer__accordion {
  border-top: 1px solid var(--color-border);
}
.site-drawer__accordion--wrap > .site-drawer__accordion-summary {
  background: rgba(184, 137, 58, 0.08);
}
.site-drawer__accordion--wrap[open] > .site-drawer__accordion-summary {
  background: rgba(184, 137, 58, 0.15);
}
.site-drawer__nest {
  padding-left: 10px;
  border-left: 2px solid rgba(184, 137, 58, 0.2);
  margin-left: 14px;
}
.site-drawer__nest .site-drawer__accordion {
  border-top: 1px dashed var(--color-border);
}
.site-drawer__nest .site-drawer__accordion-summary {
  padding: 12px 14px;
  font-size: 13px;
}
.site-drawer__accordion-summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--color-text);
}
.site-drawer__accordion-summary::-webkit-details-marker { display: none; }
.site-drawer__accordion-chevron {
  transition: transform 0.2s;
  color: var(--color-text-muted);
}
.site-drawer__accordion[open] .site-drawer__accordion-chevron {
  transform: rotate(180deg);
}
.site-drawer__accordion[open] .site-drawer__accordion-summary {
  background: #FFF7E6;
  color: #8A5A00;
}
.site-drawer__accordion .site-drawer__list {
  padding-bottom: 8px;
}
.site-drawer__footer {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--color-border);
}

/* ボトムタブ（モバイルのみ） */
.site-bottomtab {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: stretch;
  background: #fff;
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
  z-index: 40;
  padding-bottom: env(safe-area-inset-bottom);
}
.site-bottomtab__item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 4px 10px;
  color: var(--color-text-muted);
  font-size: 10px;
  line-height: 1.2;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  position: relative;
}
.site-bottomtab__item:hover {
  color: var(--color-primary-dark);
  background: var(--color-warning-bg);
  text-decoration: none;
}
.site-bottomtab__item.is-active {
  color: var(--color-primary-dark);
  font-weight: 600;
}
.site-bottomtab__item.is-active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 3px;
  background: var(--color-primary-dark);
  border-radius: 0 0 3px 3px;
}
.site-bottomtab__icon {
  font-size: 20px;
  line-height: 1;
}
.site-bottomtab__label {
  font-size: 10px;
}

.site-footer {
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  margin-top: 48px;
}
.site-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 12px;
}
.site-footer__links {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 13px;
}
.site-footer__links a { color: var(--color-text-muted); }
.site-footer__links a:hover { color: var(--color-primary-dark); }
.site-footer__sep { color: var(--color-border); }
.site-footer__copy { display: block; }

/* ------------------------------------------------------------
 * カード／セクション
 * ------------------------------------------------------------ */
.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.card__title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-text);
}
.card__subtitle {
  color: var(--color-text-muted);
  font-size: 13px;
  margin-bottom: 12px;
}

/* ページトップ見出し（h1 相当） */
.section-title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 8px;
  color: var(--color-text);
}
.section-subtitle {
  color: var(--color-text-muted);
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.4;
}

/* ------------------------------------------------------------
 * フォーム
 * ------------------------------------------------------------ */
.form-group {
  margin-bottom: 14px;
}
.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 16px;
  font-family: inherit;
  color: var(--color-text);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary-dark);
  box-shadow: 0 0 0 3px rgba(216, 139, 18, 0.45);
}
/* キーボード操作時のみフォーカスリングを濃く（マウスクリックは控えめに） */
.form-input:focus-visible,
.form-select:focus-visible,
.form-textarea:focus-visible {
  outline: 2px solid var(--color-primary-dark);
  outline-offset: 1px;
}
/* リンク・ボタン共通のキーボードフォーカスリング */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.site-nav__link:focus-visible,
.site-sidebar__link:focus-visible {
  outline: 2px solid var(--color-primary-dark);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
.form-help { font-size: 12px; color: var(--color-text-muted); margin-top: 4px; }

/* ------------------------------------------------------------
 * ボタン
 * ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  min-height: 44px;            /* タッチターゲット確保 */
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: background 0.12s ease, transform 0.06s ease;
}
.btn:hover { background: var(--color-primary-dark); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--block { width: 100%; }
.btn--sm {
  padding: 8px 14px;
  font-size: 13px;
  min-height: 36px;            /* PC のテーブル内では 36px、モバイル時は下で 44px に */
}
@media (max-width: 1023px) {
  .btn--sm { min-height: 44px; padding: 10px 16px; }
}
.btn--ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: var(--color-border);
}
.btn--ghost:hover {
  background: var(--color-bg-soft);
  color: var(--color-text);
}
.btn--secondary {
  background: #fff;
  color: var(--color-primary-dark);
  border-color: var(--color-primary);
}
.btn--secondary:hover { background: var(--color-primary-light); }
.btn--danger { background: var(--color-error); }
.btn--danger:hover { background: #9B2828; }

/* ------------------------------------------------------------
 * フラッシュメッセージ
 * ------------------------------------------------------------ */
.flash {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  font-size: 14px;
}
.flash--success { background: var(--color-success-bg); border-color: var(--color-success-border); color: var(--color-success); }
.flash--warning { background: var(--color-warning-bg); border-color: var(--color-warning-border); color: var(--color-warning-dark); }
.flash--error   { background: var(--color-error-bg); border-color: var(--color-error-border); color: var(--color-error); }
.flash--info    { background: var(--color-info-bg); border-color: var(--color-info-border); color: var(--color-info-dark); }

/* ------------------------------------------------------------
 * ログインページ
 * ------------------------------------------------------------ */
.login-wrap {
  max-width: 420px;
  margin: 40px auto;
  padding: 0 16px;
}
.login-wrap__title {
  text-align: center;
  font-size: 24px;
  margin: 0 0 8px;
  color: var(--color-primary-dark);
}
.login-wrap__lead {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 13px;
  margin-bottom: 20px;
}
.login-demo {
  margin-top: 20px;
  padding: 14px;
  background: var(--color-bg-soft);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--color-text-muted);
}
.login-demo__title { font-weight: 600; margin-bottom: 6px; color: var(--color-text); }
.login-demo__list { margin: 4px 0 0; padding-left: 18px; line-height: 1.8; }
.login-demo__list code { background: var(--color-bg); padding: 1px 6px; border-radius: 4px; font-size: 11px; }
.login-demo__note { margin: 10px 0 0; font-size: 11px; color: var(--color-text-muted); line-height: 1.6; }
.login-demo__note code { background: var(--color-bg); padding: 1px 5px; border-radius: 3px; }

/* ------------------------------------------------------------
 * ホーム
 * ------------------------------------------------------------ */
.home-greeting {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 6px;
}
.home-role-note {
  color: var(--color-text-muted);
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.4;
}
.home-ym-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 24px;
  padding: 6px 10px;
  background: #FFFFFF;
  border: 1px solid var(--color-border, #E2DCC8);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  font-size: 14px;
}
.home-ym-label {
  color: var(--color-text-muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.home-ym-select {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text, #2A2A2A);
  padding: 4px 22px 4px 6px;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'><path d='M2 3.5L5 6.5L8 3.5' stroke='%23666' fill='none' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 4px center;
}
.home-ym-select:focus {
  outline: 2px solid var(--color-accent, #2EA389);
  outline-offset: 2px;
  border-radius: 4px;
}
.home-ym-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #F5F1E6;
  color: #4A5A78;
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease;
}
.home-ym-nav:hover {
  background: #E8E0CC;
}
.home-ym-today {
  margin-left: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--color-accent, #2EA389);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.home-ym-today:hover {
  filter: brightness(0.95);
}

/* ============================================================
 * 共通: オフィス／エリア フィルタチップ ＋ オフィス選択モーダル
 *  - home.php / pages/dashboard/detail.php で共有
 * ============================================================ */
.dash-office-toolbar{display:inline-flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:14px;}
.dash-office-area-select,
.dash-office-trigger{
  display:inline-flex;align-items:center;gap:10px;
  background:#FFFFFF;border:1px solid #E5E1D8;border-radius:8px;
  padding:8px 14px;font-size:13px;color:#2C3E2D;
  height:38px;line-height:1;cursor:pointer;
  transition:border-color 0.12s ease;
}
.dash-office-area-select:hover,
.dash-office-trigger:hover{border-color:#C97A2E;}
.dash-office-area-select:focus,
.dash-office-trigger:focus{outline:2px solid var(--color-primary,#1F4D3A);outline-offset:2px;}
.dash-office-area-select{
  appearance:none;-webkit-appearance:none;
  padding-right:32px;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'><path d='M2 3.5L5 6.5L8 3.5' stroke='%237A715F' fill='none' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat:no-repeat;background-position:right 12px center;
  font-weight:500;
}
.dash-office-trigger{max-width:100%;appearance:none;}
.dash-office-trigger__icon{color:#C97A2E;font-size:14px;}
.dash-office-trigger__label{color:#7A715F;font-size:12px;}
.dash-office-trigger__count{background:#1F4D3A;color:#fff;border-radius:10px;padding:2px 10px;font-size:12px;font-weight:700;}
.dash-office-trigger__names{color:#5C5346;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:280px;}
.dash-office-trigger__caret{color:#7A715F;}

.dash-office-modal{position:fixed;inset:0;display:none;z-index:1000;}
.dash-office-modal.is-open{display:block;}
.dash-office-modal__backdrop{position:absolute;inset:0;background:rgba(0,0,0,.4);}
.dash-office-modal__panel{
  position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);
  background:#fff;border-radius:12px;width:min(560px,92vw);max-height:84vh;
  display:flex;flex-direction:column;box-shadow:0 12px 40px rgba(0,0,0,.18);
}
.dash-office-modal__head{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;border-bottom:1px solid #E5E1D8;}
.dash-office-modal__title{margin:0;font-size:15px;color:#2C3E2D;}
.dash-office-modal__close{appearance:none;background:none;border:none;font-size:22px;cursor:pointer;color:#7A715F;line-height:1;}
.dash-office-modal__toolbar{display:flex;gap:8px;padding:10px 18px;border-bottom:1px solid #EFE9DD;align-items:center;flex-wrap:wrap;}
.dash-office-modal__search{flex:1;min-width:160px;padding:6px 10px;border:1px solid #E5E1D8;border-radius:6px;font-size:13px;}
.dash-office-modal__bulk{display:flex;gap:6px;}
.dash-office-modal__list{padding:8px 14px;overflow-y:auto;flex:1;}
.dash-office-modal__group{margin-bottom:10px;}
.dash-office-modal__group-head{display:flex;align-items:center;justify-content:space-between;padding:6px 8px 4px;border-bottom:1px solid #EFE9DD;margin-bottom:4px;}
.dash-office-modal__group-name{font-size:13px;font-weight:600;color:#1F4D3A;}
.dash-office-modal__group-count{color:#7A715F;font-weight:400;font-size:12px;margin-left:4px;}
.dash-office-modal__group-toggle{appearance:none;background:none;border:none;font-size:11px;color:#1F4D3A;cursor:pointer;padding:2px 6px;border-radius:4px;}
.dash-office-modal__group-toggle:hover{background:rgba(0,0,0,0.04);}
.dash-office-modal__group .dash-office-modal__item{display:flex;}
.dash-office-modal__group:has(.dash-office-modal__item){display:grid;grid-template-columns:1fr;}
.dash-office-modal__item{
  display:flex;align-items:center;gap:8px;padding:6px 8px;
  border-radius:6px;cursor:pointer;font-size:13px;color:#2C3E2D;
}
.dash-office-modal__item:hover{background:#FBF8F1;}
.dash-office-modal__item input{margin:0;}
.dash-office-modal__foot{display:flex;justify-content:space-between;align-items:center;padding:12px 18px;border-top:1px solid #E5E1D8;gap:10px;flex-wrap:wrap;}
.dash-office-modal__count{font-size:12px;color:#7A715F;}
@media (max-width:540px){
  .dash-office-modal__list{grid-template-columns:1fr;}
  .dash-office-trigger__names{display:none;}
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

/* ------------------------------------------------------------
 * 「はじめに」関連
 * ------------------------------------------------------------ */
.guide-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 720px) {
  .guide-list { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1100px) {
  .guide-list { grid-template-columns: 1fr 1fr 1fr; }
}
.guide-list__item {
  position: relative;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  overflow: hidden;
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}
.guide-list__item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--color-primary), var(--color-primary-dark));
  opacity: 0.85;
  transition: width 0.18s ease, opacity 0.18s ease;
}
.guide-list__item:hover {
  border-color: var(--color-primary);
  box-shadow: 0 8px 20px -10px rgba(216, 139, 18, 0.35);
  transform: translateY(-1px);
}
.guide-list__item:hover::before {
  width: 5px;
  opacity: 1;
}
.guide-list__item.is-read {
  background: linear-gradient(180deg, #FAFCFA, var(--color-bg));
}
.guide-list__item.is-read::before {
  background: linear-gradient(180deg, var(--color-success), var(--color-success-dark));
  opacity: 0.7;
}

.guide-list__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 14px 18px;
  color: inherit;
  text-decoration: none;
}
.guide-list__link:hover { text-decoration: none; }

.guide-list__num {
  flex-shrink: 0;
  font-family: "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--color-primary);
  opacity: 0.55;
  min-width: 34px;
  transition: opacity 0.18s ease, color 0.18s ease;
}
.guide-list__item:hover .guide-list__num {
  opacity: 1;
  color: var(--color-primary-dark);
}
.guide-list__item.is-read .guide-list__num {
  color: var(--color-success-dark);
  opacity: 0.55;
}

.guide-list__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.guide-list__eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--color-primary-dark);
  text-transform: none;
}
.guide-list__item.is-read .guide-list__eyebrow {
  color: var(--color-success-dark);
}
.guide-list__main {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(15px * 1.45 * 2);
}

.guide-list__status {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--color-bg-soft);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  letter-spacing: 0.02em;
}
.guide-list__status--read {
  background: var(--color-success-bg);
  color: var(--color-success-dark);
  border-color: var(--color-success-border);
}

.guide-list__chevron {
  flex-shrink: 0;
  color: var(--color-text-muted);
  transition: transform 0.18s ease, color 0.18s ease;
}
.guide-list__item:hover .guide-list__chevron {
  transform: translateX(3px);
  color: var(--color-primary-dark);
}

@media (max-width: 640px) {
  .guide-list__link { padding: 14px 16px; gap: 12px; }
  .guide-list__num { font-size: 22px; min-width: 32px; }
  .guide-list__main { font-size: 14px; }
  .guide-list__chevron { display: none; }
}

.guide-progress {
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--color-text-muted);
}
.guide-progress__bar {
  width: 100%;
  height: 8px;
  background: var(--color-border);
  border-radius: 999px;
  margin-top: 6px;
  overflow: hidden;
}
.guide-progress__fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.guide-chapter__meta {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}
.guide-chapter__title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 16px;
  color: var(--color-text);
}
.guide-chapter__body {
  background: #FFFDF8;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px 26px;
  line-height: 1.85;
  color: var(--color-text);
}
.guide-chapter__body > *:first-child { margin-top: 0 !important; }
.guide-chapter__body > *:last-child  { margin-bottom: 0 !important; }

/* 見出し：左アクセントバー＋薄い背景グラデ */
.guide-chapter__body h1,
.guide-chapter__body h2,
.guide-chapter__body h3,
.guide-chapter__body h4 {
  position: relative;
  margin: 28px 0 12px;
  padding: 6px 10px 6px 14px;
  color: var(--color-primary-dark);
  background: linear-gradient(90deg, rgba(216, 139, 18, 0.10) 0%, rgba(216, 139, 18, 0) 70%);
  border-left: 4px solid var(--color-primary);
  border-radius: 0 4px 4px 0;
  letter-spacing: 0.02em;
  line-height: 1.4;
}
.guide-chapter__body h2 { font-size: 18px; font-weight: 700; }
.guide-chapter__body h3 { font-size: 16px; font-weight: 700; }
.guide-chapter__body h4 { font-size: 14px; font-weight: 700; }

.guide-chapter__body p {
  margin: 0 0 14px;
}

/* 箇条書き：菱形カスタムマーカー */
.guide-chapter__body ul,
.guide-chapter__body ol {
  list-style: none;
  padding-left: 6px;
  margin: 0 0 16px;
}
.guide-chapter__body ul li,
.guide-chapter__body ol li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  line-height: 1.75;
}
.guide-chapter__body ul li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 0.68em;
  width: 7px;
  height: 7px;
  background: var(--color-primary);
  transform: rotate(45deg);
  border-radius: 1px;
}
.guide-chapter__body ol { counter-reset: guide-olist; }
.guide-chapter__body ol li { counter-increment: guide-olist; }
.guide-chapter__body ol li::before {
  content: counter(guide-olist);
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 50%;
}

/* 強調：下線のマーカーハイライト（文字は濃紺寄りの黒、マーカーはアンバー） */
.guide-chapter__body strong {
  color: var(--color-text);
  font-weight: 700;
  background: linear-gradient(180deg, transparent 62%, rgba(216, 139, 18, 0.28) 62%);
  padding: 0 2px;
}

/* 引用 / code */
.guide-chapter__body blockquote {
  margin: 12px 0;
  padding: 10px 14px;
  background: rgba(216, 139, 18, 0.06);
  border-left: 3px solid var(--color-primary);
  color: var(--color-text);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.guide-chapter__body code {
  background: rgba(0,0,0,0.05);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.92em;
}
.guide-chapter__body hr {
  margin: 20px 0;
  border: none;
  border-top: 1px dashed var(--color-border);
}

.guide-chapter__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  gap: 12px;
  flex-wrap: wrap;
}

.guide-onboarding-banner {
  background: var(--color-primary-light);
  border: 1px solid var(--color-primary);
  color: var(--color-primary-dark);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 13px;
}

/* ------------------------------------------------------------
 * ユーティリティ
 * ------------------------------------------------------------ */
.text-muted   { color: var(--color-text-muted); }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.mt-0  { margin-top: 0 !important; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0  { margin-bottom: 0 !important; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }

/* ------------------------------------------------------------
 * ナビゲーション：ドロップダウン（マスタ管理）
 * ------------------------------------------------------------ */
.site-nav__dropdown {
  position: relative;
}
.site-nav__dropdown-toggle {
  background: transparent;
  border: 0;
  font: inherit;
  cursor: pointer;
}
.site-nav__dropdown.is-active > .site-nav__dropdown-toggle {
  color: var(--color-primary-dark);
  background: var(--color-primary-light);
  font-weight: 600;
}
.site-nav__dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 6px 0;
  z-index: 40;
}
.site-nav__dropdown:hover .site-nav__dropdown-menu,
.site-nav__dropdown:focus-within .site-nav__dropdown-menu,
.site-nav__dropdown.is-open .site-nav__dropdown-menu {
  display: block;
}
.site-nav__dropdown-menu a {
  display: block;
  padding: 8px 14px;
  color: var(--color-text);
  font-size: 14px;
}
.site-nav__dropdown-menu a:hover {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  text-decoration: none;
}

/* ------------------------------------------------------------
 * 管理画面：ヘッダ・ツールバー・テーブル
 * ------------------------------------------------------------ */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.admin-header__title {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
}
.admin-header__sub {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.admin-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.admin-table-wrap {
  overflow-x: auto;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.admin-table th,
.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: middle;
}
.admin-table th {
  background: var(--color-bg-soft);
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 600;
  white-space: nowrap;
  /* スクロール時にヘッダ行を固定 */
  position: sticky;
  top: 0;
  z-index: 5;
  /* 上端の境界線を sticky 中も維持 */
  box-shadow: inset 0 -1px 0 var(--color-border);
}
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: #FFFBF3; }
.admin-table tbody tr:focus-within { background: var(--color-primary-light); }
.admin-table .col-num { text-align: right; white-space: nowrap; }
.admin-table .col-actions {
  text-align: right;
  white-space: nowrap;
}
.admin-table .col-actions form {
  display: inline-block;
  margin: 0 0 0 6px;
}
.admin-table .col-actions .btn,
.admin-table .col-actions .btn--sm {
  margin-bottom: 4px;     /* 折り返し時の縦間隔 */
}
.admin-table__empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--color-text-muted);
  font-size: 14px;
  background: var(--color-bg-soft);
}
.admin-table__empty .empty-state__icon {
  display: block;
  font-size: 32px;
  margin-bottom: 8px;
  opacity: 0.4;
}
.admin-table__empty .empty-state__cta {
  display: inline-block;
  margin-top: 12px;
}

/* ============================================================
 * 直近 12 ヶ月の自分の記録（pass_metrics.php）
 * デスクトップ：表 / モバイル：月カード
 * ============================================================ */
.pm-history-cards { display: none; }

/* 前年比バッジ（▲▼） */
.pm-yoy {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  border-radius: 999px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}
.pm-yoy__arrow { font-size: 9px; line-height: 1; }
.pm-yoy--up    { color: var(--color-success-dark, #1f7a5c); background: var(--color-success-bg, #e4f3ec); }
.pm-yoy--down  { color: var(--color-error-dark, #a3312b);  background: var(--color-error-bg, #fbe7e4); }
.pm-yoy--muted { color: var(--color-text-muted, #6b7280);  background: var(--color-bg-soft, #f3f5f8); }

@media (max-width: 600px) {
  .pm-history-table-wrap { display: none; }
  .pm-history-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .pm-history-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  }
  .pm-history-card.is-current {
    background: #FFFBF3;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary) inset;
  }
  .pm-history-card__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--color-border);
    margin-bottom: 8px;
  }
  .pm-history-card__ym {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.01em;
  }
  .pm-history-card__total {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-left: auto;
  }
  .pm-history-card__total {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  .pm-history-card__total b {
    font-size: 16px;
    font-weight: 800;
    color: var(--color-text);
    margin-left: 4px;
    font-variant-numeric: tabular-nums;
  }
  .pm-history-card__chips {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px 8px;
  }
  .pm-history-chip {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
    font-size: 11px;
    color: var(--color-text-muted);
    padding: 4px 8px;
    background: var(--color-bg-soft);
    border-radius: 6px;
    min-width: 0;
  }
  .pm-history-chip__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }
  .pm-history-chip__val {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text);
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
  }
}

/* ---------- レスポンシブ：<=600px で行をカード化 ---------- */
@media (max-width: 600px) {
  /* .admin-table に --responsive を付けた場合のみ有効 */
  .admin-table-wrap:has(.admin-table--responsive) { overflow-x: visible; border: 0; background: transparent; }
  .admin-table--responsive,
  .admin-table--responsive thead,
  .admin-table--responsive tbody,
  .admin-table--responsive tr,
  .admin-table--responsive td { display: block; width: 100%; }
  .admin-table--responsive thead { display: none; }  /* ヘッダ非表示 */
  .admin-table--responsive tr {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  }
  .admin-table--responsive tr:hover { background: var(--color-bg); }
  .admin-table--responsive td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border: 0;
    text-align: right;
    white-space: normal;
  }
  .admin-table--responsive td::before {
    content: attr(data-label);
    font-size: 12px;
    color: var(--color-text-muted);
    font-weight: 600;
    flex-shrink: 0;
    text-align: left;
  }
  /* 最初の td（種別名）はラベル非表示・大きめ文字で見出し扱い */
  .admin-table--responsive td:first-child {
    padding: 4px 0 8px;
    border-bottom: 1px dashed var(--color-border);
    margin-bottom: 6px;
    font-size: 15px;
    justify-content: flex-start;
  }
  .admin-table--responsive td:first-child::before { display: none; }
  /* グループ見出し行（colspan）はラベル出さずそのまま */
  .admin-table--responsive .admin-table__group td {
    justify-content: flex-start;
    background: var(--color-bg-soft);
    padding: 10px 12px;
    border-radius: 6px;
  }
  .admin-table--responsive .admin-table__group td::before { display: none; }
  /* 合計行は少し色を変えて区別 */
  .admin-table--responsive tr.admin-table__sum {
    background: var(--color-bg-soft);
    border-color: var(--color-primary);
  }
}

/* 共通：空状態（カード内・ページ全体） */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  background: var(--color-bg-soft);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
}
.empty-state__icon {
  display: block;
  font-size: 36px;
  margin-bottom: 10px;
  opacity: 0.4;
}
.empty-state__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 6px;
}
.empty-state__desc {
  font-size: 13px;
  margin: 0 0 14px;
  line-height: 1.5;
}

/* ------------------------------------------------------------
 * バッジ（ロール・ランク・関係性・システム）
 * ------------------------------------------------------------ */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  white-space: nowrap;
  line-height: 1.4;
}
.badge--admin     { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.badge--manager   { background: var(--color-warning-bg); color: var(--color-warning-dark); border-color: var(--color-warning-border); }
.badge--leader    { background: var(--color-info-bg); color: var(--color-info-dark); border-color: var(--color-info-border); }
.badge--member    { background: var(--color-success-bg); color: var(--color-success-dark); border-color: var(--color-success-border); }
.badge--system    { background: #EEEEEE; color: #555; border-color: #DDD; }
.badge--rank-S    { background: var(--color-error-bg); color: var(--color-error); border-color: var(--color-error-border); }
.badge--rank-A    { background: var(--color-warning-bg); color: var(--color-warning-dark); border-color: var(--color-warning-border); }
.badge--rank-B    { background: var(--color-info-bg); color: var(--color-info-dark); border-color: var(--color-info-border); }
.badge--rank-C    { background: #F0F0F0; color: #666; border-color: #DDD; }
.badge--rel-new       { background: var(--color-info-bg); color: var(--color-info-dark); border-color: var(--color-info-border); }
.badge--rel-building  { background: var(--color-warning-bg); color: var(--color-warning-dark); border-color: var(--color-warning-border); }
.badge--rel-stable    { background: var(--color-success-bg); color: var(--color-success-dark); border-color: var(--color-success-border); }
.badge--rel-deep      { background: #F0E6FB; color: #4B2680; border-color: #D6C4F0; }
.badge--rel-attention { background: var(--color-error-bg); color: var(--color-error); border-color: var(--color-error-border); }
.badge--warning   { background: var(--color-warning); color: #fff; border-color: var(--color-warning); }
.badge--primary   { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* ------------------------------------------------------------
 * フォーム拡張：必須マーク／グリッド／注釈
 * ------------------------------------------------------------ */
.form-required {
  color: var(--color-error);
  margin-left: 4px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
/* タブレット幅での 2 列化は窮屈なので 900px から */
@media (min-width: 900px) {
  .form-grid--2 { grid-template-columns: 1fr 1fr; gap: 24px; }
}
.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
}
.form-error-list {
  margin: 0 0 14px;
  padding: 12px 16px;
  background: var(--color-error-bg);
  border: 1px solid var(--color-error-border);
  color: var(--color-error);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.form-error-list ul { margin: 4px 0 0; padding-left: 20px; }

/* ------------------------------------------------------------
 * F3 テナント設定・F7 KPI 設定 用：チェックカード・ラジオカード
 * ------------------------------------------------------------ */
.checkbox-row,
.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.checkbox-card,
.radio-card {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  transition: background 0.12s ease, border-color 0.12s ease;
  user-select: none;
}
.checkbox-card:hover,
.radio-card:hover {
  background: var(--color-bg-soft);
  border-color: var(--color-primary);
}
.checkbox-card input,
.radio-card input { margin: 0; }
.checkbox-card input:checked + .checkbox-card__label,
.radio-card    input:checked + .radio-card__label {
  font-weight: 700;
  color: var(--color-primary-dark);
}
.checkbox-card:has(input:checked),
.radio-card:has(input:checked) {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
}
.radio-card--busy:has(input:checked) {
  background: var(--color-warning-bg);
  border-color: var(--color-warning-border);
}
.radio-card--peak:has(input:checked) {
  background: var(--color-error-bg);
  border-color: var(--color-error-border);
}
.radio-card--normal:has(input:checked) {
  background: var(--color-success-bg);
  border-color: var(--color-success-border);
}

/* 繁忙期カレンダー：12 ヶ月行レイアウト */
.busy-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 4px;
}
.busy-grid__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--color-bg-soft);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}
.busy-grid__month {
  flex: 0 0 64px;
  font-weight: 700;
  font-size: 15px;
  color: var(--color-text);
}
.busy-grid__levels {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 6px;
}
@media (min-width: 768px) {
  .busy-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* KPI テーブル：入力セル */
.kpi-table th { white-space: nowrap; font-size: 13px; }
.kpi-table td { vertical-align: top; }
.form-input--sm {
  width: 96px;
  padding: 6px 8px;
  font-size: 14px;
  display: inline-block;
}
.form-help-inline {
  display: inline-block;
  margin-left: 6px;
  color: var(--color-text-muted);
  font-size: 11px;
}
.kpi-ref {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--color-text-muted);
}

/* 一回限り表示用のパスワード（リセット結果） */
.one-time-password {
  display: inline-block;
  padding: 6px 12px;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  border-radius: var(--radius-sm);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* ------------------------------------------------------------
 * 取次店カルテ（D1/D2/D3）
 * ------------------------------------------------------------ */
.store-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #EEE8DE;
  border-radius: 12px;
}

/* 3 段のツールバー行 */
.store-toolbar__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 0;
}
.store-toolbar__row + .store-toolbar__row {
  padding-top: 10px;
  border-top: 1px dashed #EEE8DE;
}
.store-toolbar__row--search { gap: 8px; }
.store-toolbar__row--attr   { gap: 8px 14px; }
.store-toolbar__row--toggles { justify-content: flex-start; gap: 10px; }

/* セクション区切り（グループ間の縦ハーフライン） */
.toolbar-sep {
  display: inline-block;
  width: 1px;
  height: 18px;
  background: #EEE8DE;
  margin: 0 2px;
}

/* 互換用：以前のクラス名が残っている場合でも崩れないように */
.store-toolbar__selects {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

/* 小型 select（プレフィックスラベル付き） */
.select-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px 0 12px;
  background: #FAF7F2;
  border: 1px solid #E3DBCC;
  border-radius: 999px;
  font-size: 13px;
  color: #1F1A13;
  transition: border-color 0.15s, background 0.15s;
}
.select-pill:hover { border-color: #F5A623; background: #fff; }
.select-pill__label {
  font-size: 11px;
  font-weight: 600;
  color: #8A7F6F;
  letter-spacing: 0.04em;
}
.select-pill select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: #1F1A13;
  cursor: pointer;
  padding-right: 14px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'><path d='M2 3.5l3 3 3-3' fill='none' stroke='%238A7F6F' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0 center;
  outline: none;
}
.select-pill select:focus { color: #C87A1F; }

/* 店舗名検索 pill（入力＋検索ボタン一体型）*/
.search-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 4px 0 12px;
  background: #FAF7F2;
  border: 1px solid #E3DBCC;
  border-radius: 999px;
  color: #8A7F6F;
  transition: border-color 0.15s, background 0.15s;
}
.search-pill:focus-within { border-color: #F5A623; background: #fff; }
.search-pill__icon { flex-shrink: 0; }
.search-pill input[type="search"] {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: #1F1A13;
  width: 180px;
  outline: none;
  padding: 0;
}
.search-pill input[type="search"]::placeholder {
  color: #A69C8B;
  font-weight: 500;
}
.search-pill input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
.search-pill__btn {
  flex-shrink: 0;
  height: 24px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: #F5A623;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.15s;
}
.search-pill__btn:hover  { background: #E0921C; }
.search-pill__btn:active { transform: translateY(1px); }

/* chip 群 */
.chip-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.chip-group__label {
  font-size: 11px;
  font-weight: 600;
  color: #8A7F6F;
  letter-spacing: 0.04em;
  margin-right: 2px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 600;
  color: #4D463D;
  background: #fff;
  border: 1px solid #E3DBCC;
  border-radius: 999px;
  text-decoration: none;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
  white-space: nowrap;
}
.chip:hover { border-color: #F5A623; color: #C87A1F; }
.chip:active { transform: translateY(1px); }
.chip.is-active {
  background: #F5A623;
  border-color: #F5A623;
  color: #fff;
}
.chip.is-active:hover { color: #fff; }

/* ランク chip のアクティブ色（S=強調、C=控えめ） */
.chip--rank-S.is-active { background: #C6302B; border-color: #C6302B; }
.chip--rank-A.is-active { background: #E0851F; border-color: #E0851F; }
.chip--rank-B.is-active { background: #7FA86C; border-color: #7FA86C; }
.chip--rank-C.is-active { background: #8A7F6F; border-color: #8A7F6F; }

/* 関係性 chip のアクティブ色 */
.chip--rel-new.is-active       { background: #4A90E2; border-color: #4A90E2; }
.chip--rel-building.is-active  { background: #7FA86C; border-color: #7FA86C; }
.chip--rel-stable.is-active    { background: #5A7D4A; border-color: #5A7D4A; }
.chip--rel-deep.is-active      { background: #8A5A2B; border-color: #8A5A2B; }
.chip--rel-attention.is-active { background: #C6302B; border-color: #C6302B; }

/* 自分の担当のみ トグル */
.chip--toggle { padding-left: 10px; }
.chip--toggle .chip__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: 1px solid #C7BEB0;
  border-radius: 3px;
  font-size: 10px;
  color: #fff;
  background: #fff;
  line-height: 1;
}
.chip--toggle.is-active .chip__check {
  background: #fff;
  color: #F5A623;
  border-color: #fff;
}

/* クリア chip */
.chip--clear {
  color: #8A7F6F;
  background: transparent;
  border-style: dashed;
}
.chip--clear:hover { color: #C6302B; border-color: #C6302B; border-style: solid; }

@media (max-width: 640px) {
  .store-toolbar { padding: 10px 12px; }
  .store-toolbar__row { gap: 6px 8px; }
  .chip-group { width: 100%; }
  .store-toolbar__selects { width: 100%; }
  .select-pill { flex: 1; min-width: 0; }
  .select-pill select { flex: 1; min-width: 0; }
  .search-pill { flex: 1 1 100%; }
  .search-pill input[type="search"] { flex: 1; width: auto; min-width: 0; }
  .toolbar-sep { display: none; }
}

.store-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 640px) {
  .store-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1024px) {
  .store-grid { grid-template-columns: 1fr 1fr 1fr; }
}

.store-section-title {
  font-size: 16px;
  color: var(--color-text);
  margin: 20px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--color-primary-light);
}

/* 取次店リスト（高密度テーブル、200〜500件想定） */
.store-table__scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #EEE8DE;
  border-radius: 8px;
  background: #fff;
}
.store-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  color: #1F1A13;
  min-width: 780px;
}
.store-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 11px;
  font-weight: 600;
  color: #8A7F6F;
  letter-spacing: 0.04em;
  text-align: left;
  padding: 8px 10px;
  background: #FAF7F2;
  border-bottom: 1px solid #EEE8DE;
  white-space: nowrap;
}
.store-table tbody td {
  padding: 9px 10px;
  border-bottom: 1px solid #F3EEE4;
  vertical-align: middle;
  white-space: nowrap;
}
.store-table tbody tr:last-child td { border-bottom: 0; }
.store-table tbody tr:hover { background: #FFFBF4; }
.store-table tbody tr[data-href] { cursor: pointer; }
.store-table tbody tr[data-href]:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
  background: #FFF6E6;
}

/* 列幅・整形 */
.store-table__col-name    { width: 28%; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.store-table__col-rank    { width: 56px;  text-align: center; }
.store-table__col-rel     { width: 96px; }
.store-table__col-meta    { color: #6B6257; font-size: 12px; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.store-table__col-primary { width: 110px; color: #4D463D; }
.store-table__col-visit   { width: 96px;  color: #4D463D; font-variant-numeric: tabular-nums; }
.store-table__col-alert   { width: 80px; }
.store-table__col-action  { width: 36px; text-align: right; padding-right: 12px !important; }

/* 自担当テーブル：行頭にオレンジバー */
.store-row__name {
  color: #1F1A13;
  font-weight: 600;
  text-decoration: none;
}
.store-row__name:hover { color: #C87A1F; text-decoration: underline; text-underline-offset: 2px; }

.store-table--mine tbody tr {
  box-shadow: inset 3px 0 0 #F5A623;
}

.store-row__open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: #8A7F6F;
  border-radius: 6px;
  transition: background 0.12s, color 0.12s;
}
.store-row__open:hover { background: #FFF2DE; color: #C87A1F; }

/* バッジがテーブル内で縦中央揃いになるよう統一サイズ */
.store-table .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  padding: 2px 8px;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .store-table__col-meta,
  .store-table__col-primary { display: none; }
  .store-table { min-width: 0; }
}

.store-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow 0.12s ease, border-color 0.12s ease;
}
.store-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}
.store-card--mine {
  border-left: 4px solid var(--color-primary);
}
.store-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.store-card__name {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
}
.store-card__badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.store-card__type {
  font-size: 12px;
  color: var(--color-text-muted);
}
.store-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px dashed var(--color-border);
  font-size: 12px;
  color: var(--color-text-muted);
}

.store-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0;
  padding: 0;
  font-size: 14px;
}
@media (min-width: 640px) {
  .store-meta { grid-template-columns: 1fr 1fr; }
}
.store-meta__item {
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.store-meta__label {
  flex: 0 0 96px;
  color: var(--color-text-muted);
  font-size: 12px;
}
.store-meta__value {
  flex: 1;
  color: var(--color-text);
  word-break: break-word;
}
.store-meta__value--memo {
  white-space: pre-wrap;
}

.store-assignees {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.store-assignee {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  font-size: 13px;
}
.store-assignee--primary {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
  font-weight: 600;
}

.store-visits {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 880px;
}
.store-visit-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  padding: 8px 12px;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}
.store-visit-row__top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  line-height: 1.3;
}
.store-visit-row__meta {
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1.35;
}
.store-visit-row__note {
  font-size: 12px;
  color: var(--color-text);
  line-height: 1.4;
}
.store-visit-row__note strong { font-weight: 600; color: var(--color-text-muted); margin-right: 4px; }

/* ============================================================
   訪問ログテーブル（store-table と同じ密度）
   ============================================================ */
.visits-table__scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #EEE8DE;
  border-radius: 8px;
  background: #fff;
}
.visits-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  color: #1F1A13;
  min-width: 720px;
}
.visits-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 11px;
  font-weight: 600;
  color: #8A7F6F;
  letter-spacing: 0.04em;
  text-align: left;
  padding: 8px 10px;
  background: #FAF7F2;
  border-bottom: 1px solid #EEE8DE;
  white-space: nowrap;
}
.visits-table tbody td {
  padding: 9px 10px;
  border-bottom: 1px solid #F3EEE4;
  vertical-align: middle;
  white-space: nowrap;
}
.visits-table tbody tr:last-child td { border-bottom: 0; }
.visits-table tbody tr:hover { background: #FFFBF4; }
.visits-table tbody tr[data-href] { cursor: pointer; }
.visits-table tbody tr[data-href]:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
  background: #FFF6E6;
}
.visits-row--mine td { box-shadow: inset 3px 0 0 #F5A623; }
.visits-row--mine td:not(:first-child) { box-shadow: none; }

.visits-table__col-date    { width: 130px; font-variant-numeric: tabular-nums; }
.visits-table__col-date strong { font-weight: 700; }
.visits-row__time { margin-left: 4px; color: #6B6257; font-size: 12px; }
.visits-table__col-visitor { width: 110px; color: #4D463D; }
.visits-table__col-time    { width: 100px; color: #4D463D; font-variant-numeric: tabular-nums; }
.visits-table__col-rate    { width: 70px;  text-align: right; font-variant-numeric: tabular-nums; }
.visits-table__col-purpose {
  max-width: 0;
  width: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #4D463D;
  font-size: 12px;
}
.visits-table__col-action  { width: 64px; text-align: right; padding-right: 12px !important; }

.visits-row__open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: #8A7F6F;
  border-radius: 6px;
  transition: background 0.12s, color 0.12s;
  vertical-align: middle;
}
.visits-row__open:hover { background: #FFF2DE; color: #C87A1F; }
.visits-row__delete { display: inline-block; margin-left: 4px; vertical-align: middle; }
.visits-row__delete button { padding: 2px 6px; font-size: 11px; line-height: 1.2; }

.badge--muted {
  background: #F3EEE4;
  color: #6B6257;
  font-size: 10px;
  padding: 1px 6px;
  margin-left: 4px;
}

@media (max-width: 720px) {
  .visits-table__col-visitor,
  .visits-table__col-time { display: none; }
  .visits-table { min-width: 0; }
}
.admin-table__sum td { background: #FAF6ED; border-top: 1px solid var(--color-border); }
.admin-table__group td { background: #F4EEDF; border-top: 2px solid var(--color-border); color: #6b5a2f; font-size: 13px; padding-top: 10px; padding-bottom: 10px; }
.value-rate--low { color: var(--color-error); font-weight: 700; }
.value-rate--mid { color: var(--color-warning); font-weight: 600; }
.value-rate--high { color: var(--color-success); font-weight: 600; }

.layout-image {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  margin-bottom: 12px;
}
.layout-image--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  background: var(--color-bg-soft);
  color: var(--color-text-muted);
  font-size: 14px;
  margin-bottom: 12px;
}

/* 店舗外観・店内の 2 枠 */
.layout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 720px) {
  .layout-grid { grid-template-columns: 1fr 1fr; }
}
.layout-slot {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.layout-slot__title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--color-text);
}
.layout-slot__meta {
  font-size: 12px;
  margin: 0 0 8px;
}
.layout-slot__controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  flex-wrap: wrap;
}
.layout-slot__controls .btn { white-space: nowrap; }
.layout-slot__upload {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}
.layout-slot__file {
  flex: 1 1 auto;
  min-width: 0;
  padding: 4px 6px;
  font-size: 12px;
}
.layout-slot__delete { flex: 0 0 auto; }

/* キーマン一覧（カード型） */
.keyperson-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
@media (min-width: 720px) {
  .keyperson-list { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1100px) {
  .keyperson-list { grid-template-columns: 1fr 1fr 1fr; }
}
.keyperson-card {
  position: relative;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: box-shadow 0.15s, transform 0.15s;
}
.keyperson-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.keyperson-card--auth {
  border-left-color: #E0A400;
  background: linear-gradient(180deg, #FFFBF0 0%, #FFFFFF 30%);
}
.keyperson-card__body {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.keyperson-card__avatar {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-bg-soft);
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  border: 1px solid var(--color-border);
}
.keyperson-card--auth .keyperson-card__avatar {
  background: #FFE9A8;
  border-color: #E0A400;
  color: #6A4500;
}
.keyperson-card__info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.keyperson-card__role {
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  font-weight: 600;
  text-transform: uppercase;
}
.keyperson-card__name {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  line-height: 1.3;
}
.keyperson-card__auth {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: #FFE9A8;
  color: #6A4500;
  border: 1px solid #E0A400;
  letter-spacing: 0.02em;
}
.keyperson-card__notes {
  font-size: 13px;
  color: var(--color-text);
  background: var(--color-bg-soft);
  border-left: 3px solid var(--color-border);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 6px 10px;
  line-height: 1.55;
  white-space: pre-wrap;
  margin-top: 2px;
}
.keyperson-card__meta {
  font-size: 12px;
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.keyperson-card__clock { opacity: 0.7; }

.keyperson-card__actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0.55;
  transition: opacity 0.15s;
}
.keyperson-card:hover .keyperson-card__actions { opacity: 1; }
.keyperson-card__delete { display: inline; margin: 0; }
.keyperson-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}
.keyperson-card__icon:hover {
  background: var(--color-bg-soft);
  border-color: var(--color-border);
  color: var(--color-text);
}
.keyperson-card__icon--danger:hover {
  background: var(--color-error-bg);
  border-color: var(--color-error-border);
  color: var(--color-error);
}

/* 追加／編集フォーム（折りたたみ） */
.keyperson-form {
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-soft);
  margin-top: 8px;
}
.keyperson-form[open] {
  background: #fff;
  border-style: solid;
}
.keyperson-form__summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.keyperson-form__summary::-webkit-details-marker { display: none; }
.keyperson-form__summary-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  transition: transform 0.2s;
}
.keyperson-form[open] .keyperson-form__summary-icon {
  transform: rotate(45deg);
}
.keyperson-form__body {
  padding: 4px 14px 14px;
  border-top: 1px solid var(--color-border);
}
.keyperson-form__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 720px) {
  .keyperson-form__row { grid-template-columns: 1fr 1fr; }
}
.keyperson-form__adv {
  margin-top: 4px;
  font-size: 13px;
}
.keyperson-form__adv summary {
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 4px 0;
  list-style: none;
}
.keyperson-form__adv summary::-webkit-details-marker { display: none; }
.keyperson-form__adv summary::before {
  content: '▸ ';
  display: inline-block;
  transition: transform 0.15s;
}
.keyperson-form__adv[open] summary::before {
  content: '▾ ';
}

/* 決裁権トグル */
.keyperson-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}
.keyperson-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.keyperson-toggle__chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  transition: all 0.15s;
}
.keyperson-toggle:hover .keyperson-toggle__chip {
  border-color: #E0A400;
  color: #6A4500;
}
.keyperson-toggle input:checked + .keyperson-toggle__chip {
  background: #FFE9A8;
  border-color: #E0A400;
  color: #6A4500;
  box-shadow: 0 0 0 3px rgba(224, 164, 0, 0.15);
}
.keyperson-toggle input:focus-visible + .keyperson-toggle__chip {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.form-input--narrow { max-width: 120px; }

.org-chart-preview {
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.7;
  min-height: 80px;
}
.org-chart-preview ul { margin: 4px 0; padding-left: 20px; }
.org-chart-preview p  { margin: 4px 0; }
.org-chart-preview h1,
.org-chart-preview h2,
.org-chart-preview h3,
.org-chart-preview h4 { margin: 8px 0 4px; }

.checklist-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}
.checklist-summary__cell {
  text-align: center;
  padding: 10px;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}
.checklist-summary__cell strong {
  display: block;
  font-size: 22px;
  color: var(--color-text);
}
.checklist-summary__cell span {
  font-size: 12px;
  color: var(--color-text-muted);
}
.checklist-summary__cell--good    { background: var(--color-success-bg); border-color: var(--color-success-border); }
.checklist-summary__cell--good strong    { color: var(--color-success-dark); }
.checklist-summary__cell--partial { background: var(--color-warning-bg); border-color: var(--color-warning-border); }
.checklist-summary__cell--partial strong { color: var(--color-warning-dark); }
.checklist-summary__cell--bad     { background: var(--color-error-bg); border-color: var(--color-error-border); }
.checklist-summary__cell--bad strong     { color: var(--color-error); }

/* 見出し行（タイトル + 右側ボタン） */
.card__head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.card__head-row .card__title { margin: 0; }

/* チェックリスト詳細（カテゴリ別） */
.checklist-detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 16px;
}
@media (min-width: 900px) {
  .checklist-detail { grid-template-columns: 1fr 1fr; }
}
.checklist-group {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  overflow: hidden;
}
.checklist-group__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  background: var(--color-bg-soft);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}
.checklist-group__code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.checklist-group__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
/* back.php チェックリスト項目行（リンク、1 行表示） */
.checklist-group__list > li { list-style: none; }
.checklist-group .checklist-item {
  display: grid;
  grid-template-columns: 28px 40px 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  font-size: 13px;
  text-decoration: none;
  color: inherit;
  transition: background 0.12s;
}
.checklist-group .checklist-item:last-child { border-bottom: none; }
.checklist-group .checklist-item:hover { background: var(--color-bg-soft); }
.checklist-group .checklist-item:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}
.checklist-group .checklist-item__status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text-muted);
}
.checklist-group .checklist-item--good .checklist-item__status    { background: var(--color-success-bg); color: var(--color-success-dark); border-color: var(--color-success-border); }
.checklist-group .checklist-item--partial .checklist-item__status { background: var(--color-warning-bg); color: var(--color-warning-dark); border-color: var(--color-warning-border); }
.checklist-group .checklist-item--bad .checklist-item__status     { background: var(--color-error-bg); color: var(--color-error); border-color: var(--color-error-border); }
.checklist-group .checklist-item--unset .checklist-item__status   { opacity: 0.4; }
.checklist-group .checklist-item__code {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}
.checklist-group .checklist-item__name {
  color: var(--color-text);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.checklist-group .checklist-item--unset .checklist-item__name { color: var(--color-text-muted); }
.checklist-group .checklist-item__cmt-flag {
  font-size: 12px;
  opacity: 0.75;
}
.checklist-group .checklist-item__chevron {
  font-size: 16px;
  color: var(--color-text-muted);
  opacity: 0.6;
  transition: transform 0.12s, opacity 0.12s;
}
.checklist-group .checklist-item:hover .checklist-item__chevron {
  opacity: 1;
  transform: translateX(2px);
}

/* 遷移先（checklist.php）でアンカーされた項目をハイライト */
.checklist-item:target,
#item-A1:target, #item-A2:target, #item-A3:target, #item-A4:target {
  /* 実際のハイライトは下記の generic ルールで */
}
[id^="item-"]:target {
  border-radius: var(--radius-md);
  animation: kp-flash 1.6s ease-out 1;
}
@keyframes kp-flash {
  0%   { box-shadow: 0 0 0 6px rgba(234, 139, 48, 0.55); }
  60%  { box-shadow: 0 0 0 3px rgba(234, 139, 48, 0.30); }
  100% { box-shadow: 0 0 0 0 rgba(234, 139, 48, 0); }
}

.future-note {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  background: var(--color-warning-bg);
  color: var(--color-warning-dark);
  border: 1px solid var(--color-warning-border);
  border-radius: 999px;
  margin-left: 6px;
}

.store-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.empty-note {
  padding: 16px;
  background: var(--color-bg-soft);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  text-align: center;
  font-size: 14px;
}

/* ------------------------------------------------------------
 * 課題対策表（B1 / B2 / B3）
 * ------------------------------------------------------------ */
/* モバイル限定の「週次へ ↓」ジャンプボタン */
.cm-jump-week { display: none; }
@media (max-width: 768px) {
  .cm-jump-week { display: inline-flex; }
}

.cm-ym-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  margin: 12px 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}
.cm-ym-nav > .btn { flex: 0 1 auto; min-width: 0; }
.cm-ym-nav__current {
  font-size: 18px;
  color: var(--color-primary-dark);
}
.cm-ym-nav__form { margin: 0; flex: 1 1 auto; min-width: 0; display: flex; justify-content: center; }
.cm-ym-nav__form .form-input { width: 100%; max-width: 200px; }

@media (max-width: 768px) {
  .cm-ym-nav {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "picker picker"
      "prev   next";
    gap: 8px;
    padding: 10px 12px;
  }
  .cm-ym-nav__form {
    grid-area: picker;
    justify-content: stretch;
  }
  .cm-ym-nav__form .form-input,
  .cm-ym-nav__form .form-input--sm {
    width: 100% !important;
    max-width: none !important;
  }
  .cm-ym-nav > .btn:first-of-type { grid-area: prev; }
  .cm-ym-nav > .btn:last-of-type  { grid-area: next; }
  .cm-ym-nav > .btn {
    width: 100%;
    justify-content: center;
  }
}

.cm-half-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
  flex-wrap: wrap;
}
.cm-half-toggle__buttons {
  display: flex;
  gap: 6px;
}

.cm-strategy-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.cm-strategy-card__theme {
  font-size: 16px;
  margin: 8px 0;
}
.cm-kpi-readonly {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 8px;
}
.cm-kpi-readonly__item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}
.cm-kpi-readonly__label { color: var(--color-text-muted); }
.cm-kpi-readonly__value { font-weight: 600; }

.cm-kpi-row {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--color-border);
  position: relative;
}
.cm-kpi-row:first-of-type { border-top: 0; }
.cm-kpi-row__num {
  grid-row: span 3;
  font-weight: 600;
  color: var(--color-primary-dark);
  padding-top: 4px;
}
.cm-kpi-row label {
  display: block;
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}
.cm-kpi-row__remove {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.cm-monthly-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--color-border);
  position: relative;
}
.cm-monthly-row:first-of-type { border-top: 0; }
.cm-monthly-row__num {
  font-weight: 600;
  color: var(--color-primary-dark);
}
.cm-monthly-row__body label {
  display: block;
  font-size: 12px;
  color: var(--color-text-muted);
  margin: 6px 0 2px;
}
.cm-monthly-row__remove {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.cm-dyn-list { }
.cm-dyn-actions {
  margin: 10px 0 4px;
  text-align: right;
}
.cm-dyn-remove {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--color-danger, #c0392b);
  background: transparent;
  border: 1px solid rgba(192, 57, 43, 0.35);
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
.cm-dyn-remove:hover {
  background: rgba(192, 57, 43, 0.08);
  border-color: var(--color-danger, #c0392b);
}

.cm-monthly-card .cm-monthly-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}
.cm-monthly-list__item {
  padding: 10px 12px;
  margin-bottom: 6px;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}
.cm-monthly-list__priority {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-primary-dark);
  background: var(--color-primary-light);
  padding: 1px 8px;
  border-radius: 999px;
  margin-right: 8px;
}
.cm-monthly-list__note {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* 週次テーブル */
#weekly-plan { scroll-margin-top: 16px; }
.cm-week-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 16px;
  padding: 6px;
  background: var(--color-bg-soft);
  border: 1px solid #E5DFD1;
  border-radius: var(--radius-md);
}
.cm-week-tab {
  flex: 1 1 auto;
  min-width: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.2;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.cm-week-tab:hover {
  background: rgba(255, 255, 255, 0.7);
  color: var(--color-text);
}
.cm-week-tab.is-active {
  background: #fff;
  border-color: #CFC8B6;
  color: var(--color-text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.cm-week-tab__num {
  font-size: 13px;
  font-weight: 700;
}
.cm-week-tab.is-active .cm-week-tab__num {
  color: var(--color-primary-dark);
}
.cm-week-tab__range {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
}
.cm-week-table-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cm-week-block {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  padding: 12px;
}
.cm-week-block__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}
.cm-week-block__title {
  margin: 0;
  font-size: 16px;
  color: var(--color-primary-dark);
}
.cm-week-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.cm-week-col {
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px;
}
.cm-week-col__title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.5px;
}

/* 先週未達リスト */
.cm-carry-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cm-carry-list__item {
  padding: 8px 10px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}
.cm-carry-list__title {
  font-weight: 600;
  margin-bottom: 4px;
}
.cm-carry-list__actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.cm-small { font-size: 12px; }

/* btn--xs (schedule で使用) */
.btn--xs {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.cm-carryover {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  background: var(--color-warning-bg);
  color: var(--color-warning-dark);
  border: 1px solid var(--color-warning-border);
  border-radius: 999px;
}

/* 今週実行計画 item */
.cm-item-row {
  border: 1px solid #E5DFD1;
  border-left: 3px solid #D6CFBF;
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 12px 14px 10px;
  margin-bottom: 10px;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
}
.cm-item-row:hover { border-color: #CFC8B6; }
.cm-item-row.is-done {
  background: #FBFCF9;
  border-left-color: var(--color-success);
}
.cm-item-row.is-done .cm-item-row__title {
  text-decoration: line-through;
  color: var(--color-text-muted);
}
.cm-item-row.is-done .cm-item-row__mid { opacity: 0.55; }
.cm-item-row.is-done .cm-why5 { display: none; }
.cm-item-row.is-abandoned {
  background: #F7F5F0;
  border-left-color: #B8B0A0;
  opacity: 0.75;
}
.cm-item-row.is-abandoned .cm-item-row__title {
  text-decoration: line-through;
}
.cm-item-row.is-abandoned .cm-why5 { display: none; }

.cm-item-row__top {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.cm-item-row__top .form-input { flex: 1 1 auto; min-width: 200px; }
.cm-item-row__title {
  font-weight: 600;
  transition: color 0.15s, text-decoration-color 0.15s;
}
.cm-item-row__check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
  padding: 4px 8px;
  border: 1px solid #E5DFD1;
  border-radius: 999px;
  background: #FAF8F2;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.cm-item-row__check:hover { background: #F3F0E5; }
.cm-item-row__check input[type="checkbox"] {
  accent-color: var(--color-success);
  margin: 0;
}
.cm-item-row.is-done .cm-item-row__check {
  background: var(--color-success-bg);
  border-color: var(--color-success-border);
  color: var(--color-success);
}

.cm-item-row__mid {
  display: grid;
  gap: 6px;
  grid-template-columns: 1fr;
  margin-bottom: 8px;
  transition: opacity 0.15s;
}
.cm-item-row__meta { margin-top: 4px; }
.cm-item-row__abandoned {
  font-size: 12px;
  color: var(--color-error);
  margin-top: 4px;
}
.cm-item-row__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}
.cm-item-row__del-btn {
  background: transparent;
  border: none;
  color: #B09A98;
  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}
.cm-item-row__del-btn:hover {
  color: var(--color-error);
  background: var(--color-error-bg);
}
.cm-item-row__save-btn {
  min-width: 72px;
}

.cm-why5 {
  margin: 8px 0 4px;
  border: 1px dashed #D6CFBF;
  border-radius: var(--radius-sm);
  background: transparent;
}
.cm-why5__summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  user-select: none;
}
.cm-why5__summary::-webkit-details-marker { display: none; }

/* コラプス時のタイトル表示（全文折返し） */
.cm-item-row__title-display {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--color-text);
  word-break: break-word;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}
.cm-item-row__title-placeholder { color: var(--color-text-muted); font-weight: 500; font-size: 13px; }
.cm-item-row.is-done .cm-item-row__title-display { text-decoration: line-through; color: var(--color-text-muted); }

/* スクリーンリーダー専用テキスト */
.u-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* --- 詳細を編集アコーディオン（各プラン項目） --- */
.cm-item-editor {
  border: 1px dashed var(--color-border);
  border-radius: 8px;
  margin-top: 4px;
}
.cm-item-editor[open] {
  border-style: solid;
  background: #fdfaf2;
}
.cm-item-editor__summary {
  list-style: none;
  cursor: pointer;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  user-select: none;
}
.cm-item-editor__summary::-webkit-details-marker { display: none; }
.cm-item-editor__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cm-item-editor__label::before {
  content: '✎';
  font-size: 12px;
  color: #b9ad8e;
}
.cm-item-editor__chev {
  transition: transform 0.18s ease;
  font-size: 12px;
  color: #b9ad8e;
}
.cm-item-editor[open] .cm-item-editor__chev { transform: rotate(180deg); }
.cm-item-editor__body {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cm-why5__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cm-why5__label::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #C8BFA8;
}
.cm-why5__chev {
  font-size: 11px;
  color: var(--color-text-muted);
  transition: transform 0.15s ease;
}
.cm-why5[open] .cm-why5__chev { transform: rotate(180deg); }
.cm-why5[open] {
  background: var(--color-bg-soft);
  border-style: solid;
  border-color: #E5DFD1;
}
.cm-why5__body {
  padding: 4px 12px 10px;
}
.cm-why5-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 8px;
  align-items: start;
  margin-bottom: 6px;
}
.cm-why5-row:last-child { margin-bottom: 0; }
.cm-why5-row__num {
  font-size: 11px;
  color: var(--color-text-muted);
  padding-top: 6px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.cm-why5-row textarea {
  font-size: 13px;
  min-height: 44px;
}

.cm-item-new {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 8px;
  background: var(--color-bg);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}
.cm-item-new .form-input { flex: 1 1 200px; min-width: 0; }

/* 追加トリガー：通常はボタンのみ、押下後にフォームが展開 */
.cm-item-add { margin-top: 4px; }
.cm-item-add__trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cm-item-add__form[hidden] { display: none !important; }

.cm-inline-form {
  display: inline-block;
  margin: 0;
}

.btn--danger-ghost {
  color: var(--color-error);
  border: 1px solid var(--color-error);
  background: transparent;
}
.btn--danger-ghost:hover {
  background: var(--color-error);
  color: #fff;
}

.form-row { margin-bottom: 12px; }
.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------
 * メディアクエリ：タブレット以上
 * ------------------------------------------------------------ */
@media (min-width: 768px) {
  .home-grid { grid-template-columns: 1fr 1fr; }
  .cm-week-grid {
    grid-template-columns: 320px 1fr;
  }
  .cm-item-row__mid {
    grid-template-columns: 2fr 1fr;
  }
  .cm-kpi-readonly { grid-template-columns: repeat(3, 1fr); }
  .cm-kpi-row {
    grid-template-columns: 60px 1fr 160px 120px;
  }
  .cm-kpi-row__num { grid-row: auto; }
  .cm-kpi-row label { display: block; }
}
@media (min-width: 1024px) {
  .home-grid { grid-template-columns: 1fr 1fr 1fr; }
}

/* ------------------------------------------------------------
 * Step 4b：訪問ログ / 課題 / チェックリスト
 * ------------------------------------------------------------ */

/* 訪問ログ一覧：編集・削除ボタン行 */
.visit-row__actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* 訪問ログ・他、ページネーション */
.visit-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}
.visit-pager__info {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* 課題ステータスタブ */
.issue-tabs {
  display: flex;
  gap: 4px;
  margin: 12px 0;
  border-bottom: 1px solid var(--color-border);
}
.issue-tabs__tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--color-text-muted);
  text-decoration: none;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.issue-tabs__tab:hover {
  background: var(--color-bg-soft);
  color: var(--color-text);
}
.issue-tabs__tab.is-active {
  background: var(--color-bg);
  color: var(--color-primary-dark);
  border-color: var(--color-border);
  font-weight: 600;
}
.issue-tabs__count {
  display: inline-block;
  min-width: 22px;
  padding: 0 6px;
  text-align: center;
  font-size: 11px;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text);
}
.issue-tabs__tab.is-active .issue-tabs__count {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
}

/* チェックリスト：24 項目グリッド */
.checklist-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}
.checklist-item {
  padding: 10px 12px;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 6px;
}
.checklist-item__head {
  font-size: 14px;
}

/* ○/△/× ラジオ */
.rating-radio {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}
.rating-radio__label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.rating-radio__label input { margin: 0; }
.rating-radio__label--good    { color: var(--color-success-dark); }
.rating-radio__label--partial { color: var(--color-warning-dark); }
.rating-radio__label--bad     { color: var(--color-error); }
.rating-radio__label:has(input:checked) {
  font-weight: 700;
  box-shadow: 0 0 0 2px rgba(245, 166, 35, 0.25);
  border-color: var(--color-primary);
}

@media (min-width: 768px) {
  .checklist-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================================
 * チェックリスト編集：カテゴリ見出し
 * ============================================================ */
.ck-category { padding: 16px 18px; }
.ck-category__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--color-border);
}
.ck-category__badge {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border-radius: 50%;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 3px rgba(184, 115, 25, 0.25);
}
.ck-category__text {
  flex: 1 1 auto;
  min-width: 0;
}
.ck-category__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
  letter-spacing: 0.01em;
}
.ck-category__desc {
  margin: 2px 0 0;
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1.5;
}
.ck-category__count {
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}
.ck-category__count small {
  font-size: 10px;
  font-weight: 500;
  margin-left: 2px;
  letter-spacing: 0.05em;
}

/* ============================================================
 * チェックリスト編集：1 列横並び（.ck-item）
 * ============================================================ */
.checklist-grid:has(.ck-item) {
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 8px;
}
.ck-item {
  position: relative;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  padding: 10px 4px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ck-item:last-child { border-bottom: none; }
/* 左端に細い状態アクセント（罫線とは別レイヤー、擬似要素） */
.ck-item::before {
  content: '';
  position: absolute;
  left: 0; top: 10px; bottom: 10px;
  width: 2px;
  border-radius: 2px;
  background: transparent;
  transition: background 0.15s;
}
.ck-item--good::before    { background: var(--color-success); }
.ck-item--partial::before { background: #E0A400; }
.ck-item--bad::before     { background: #C94747; }

.ck-item__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}
.ck-item__top > .ck-info { flex: 1 1 0%; min-width: 0; width: 100%; }
.ck-item__top > .ck-rating { flex: 0 0 auto; margin-left: auto; }
.ck-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ck-info__head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}
.ck-info__desc {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ck-item:hover .ck-info__desc,
.ck-item:focus-within .ck-info__desc {
  white-space: normal;      /* ホバー／フォーカス時のみ折返しで全文表示 */
}

/* コード番号：アクセントカラーの小さな英数字 */
.ck-item__code {
  color: var(--color-primary-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
  min-width: 28px;
  text-transform: uppercase;
}

.ck-item__title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.35;
  letter-spacing: 0.01em;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ck-item:hover .ck-item__title,
.ck-item:focus-within .ck-item__title { white-space: normal; }

/* タイトル横の現在ステータスドット（一列レイアウトでは非表示） */
.ck-dot { display: none; }

/* 評価（○△× 素のアイコンボタン、囲いなし） */
.ck-rating {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: center;
}
.ck-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  color: var(--color-text-muted);
  background: transparent;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s, color 0.12s;
}
.ck-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.ck-pill:hover { background: var(--color-bg-soft); color: var(--color-text); }
.ck-pill--good:has(input:checked) {
  background: var(--color-success); color: #fff;
}
.ck-pill--partial:has(input:checked) {
  background: #E0A400; color: #fff;
}
.ck-pill--bad:has(input:checked) {
  background: #C94747; color: #fff;
}

/* メモトグル：テキストリンク風（囲いなし） */
.ck-item__cmt-toggle {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 12px;
  cursor: pointer;
  margin-top: 2px;
}
.ck-item__cmt-toggle:hover { color: var(--color-primary-dark); }
.ck-item__cmt-toggle[aria-expanded="true"] { color: var(--color-text); }
.ck-item__cmt-toggle[aria-expanded="true"] .ck-item__cmt-label::before {
  content: '▾ ';
}
.ck-item__cmt-toggle[aria-expanded="false"] .ck-item__cmt-label::before {
  content: '+ ';
  font-weight: 700;
}
.ck-item__cmt-icon { font-size: 13px; }
.ck-item__cmt { margin-top: 4px; padding-left: 2px; }
.ck-item__cmt input.form-input {
  font-size: 13px;
  padding: 6px 10px;
}

/* 狭幅対応：rating をタイトル下に落とす（.ck-item__top は通常 grid なので flex に切替） */
@media (max-width: 520px) {
  .ck-item__top {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .ck-info { width: 100%; }
  .ck-item__title { white-space: normal; }
  .ck-info__desc { white-space: normal; }
  .ck-rating {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 8px;
  }
  .ck-pill {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    height: 36px;
    border-radius: 8px;
    background: var(--color-bg-soft, #f3f5f8);
  }
}

/* ============================================================
 * サイドバー（PC >=1024px のみ表示）
 * モバイルでは上部の .site-header を使い、サイドバーは非表示。
 * ============================================================ */
.site-sidebar {
  display: none;            /* モバイルでは非表示、PC で flex に */
}

.site-sidebar__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 14px;
  color: var(--color-text);
  font-weight: 700;
  border-bottom: 1px solid var(--color-border);
}
.site-sidebar__logo:hover { text-decoration: none; }
.site-sidebar__logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.site-sidebar__logo-text { font-size: 15px; }

.site-sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
}
.site-sidebar__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-sidebar__link {
  display: block;
  padding: 11px 20px;
  color: var(--color-text);
  font-size: 15px;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.site-sidebar__link:hover {
  background: rgba(0, 0, 0, 0.03);            /* hover: 背景色を3%だけ濃く */
  color: var(--color-primary-dark);
  text-decoration: none;
}
.site-sidebar__link.is-active {
  background: rgba(0, 0, 0, 0.06);            /* active: 背景色を6%濃く（同系色のまま） */
  color: var(--color-primary-dark);
  font-weight: 600;
}
/* ----- 詳細分析サブメニュー（minimal） ----- */
.site-sidebar__link--sub {
  display: block;
  margin: 1px 10px 1px 26px;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--color-text-muted);
  border-radius: 6px;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.site-sidebar__link--sub:hover {
  color: var(--color-primary-dark);
  background: rgba(0, 0, 0, 0.03);
  text-decoration: none;
}
.site-sidebar__link--sub.is-active {
  color: var(--color-primary-dark);
  font-weight: 600;
  background: rgba(0, 0, 0, 0.06);
}

/* マウス位置を最優先: ナビ内に hover が発生したら active の塗りを消す */
.site-sidebar__nav:has(.site-sidebar__link:hover, .site-sidebar__link--sub:hover) .site-sidebar__link.is-active,
.site-sidebar__nav:has(.site-sidebar__link:hover, .site-sidebar__link--sub:hover) .site-sidebar__link--sub.is-active {
  background: transparent;
}
.site-drawer__nav:has(.site-drawer__link:hover, .site-drawer__link--sub:hover) .site-drawer__link.is-active,
.site-drawer__nav:has(.site-drawer__link:hover, .site-drawer__link--sub:hover) .site-drawer__link--sub.is-active {
  background: transparent;
}

.site-drawer__link--sub {
  display: block;
  margin: 1px 10px 1px 26px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--color-text-muted);
  border-radius: 6px;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.site-drawer__link--sub:hover {
  color: var(--color-primary-dark);
  background: rgba(0, 0, 0, 0.03);
  text-decoration: none;
}
.site-drawer__link--sub.is-active {
  color: var(--color-primary-dark);
  font-weight: 600;
  background: rgba(0, 0, 0, 0.06);
}

.site-sidebar__section {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--color-border);
}
.site-sidebar__section-title {
  margin: 0 0 6px;
  padding: 0 20px;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: 0.04em;
}

/* アコーディオン化されたセクション */
.site-sidebar__section--accordion .site-sidebar__section-title {
  margin: 0;
  padding: 0;
}
.site-sidebar__section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 11px 20px;
  margin: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}
.site-sidebar__section-toggle:hover { background: var(--color-warning-bg); }
.site-sidebar__section-toggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}
.site-sidebar__section-chevron {
  font-size: 12px;
  color: var(--color-text-muted);
  transition: transform 0.18s ease;
}
.site-sidebar__section--accordion.is-open .site-sidebar__section-chevron {
  transform: rotate(180deg);
}
.site-sidebar__section-body {
  display: none;
}
.site-sidebar__section--accordion.is-open > .site-sidebar__section-body,
.site-sidebar__section--accordion.is-open > ul.site-sidebar__section-body {
  display: block;
}

.site-sidebar__footer {
  border-top: 1px solid var(--color-border);
  padding: 14px 16px 16px;
  background: var(--color-bg-soft);
}
.site-sidebar__user {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.site-sidebar__user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-sidebar__logout { margin: 0; }

/* ボタンを幅いっぱいに伸ばすモディファイア */
.btn--block {
  display: block;
  width: 100%;
  text-align: center;
}

/* ------------------------------------------------------------
 * PC（>=1024px）用レイアウト切り替え
 * ------------------------------------------------------------ */
@media (min-width: 1024px) {
  /* ログイン済み（is-authed）のみサイドバーを表示し、本体を右へオフセット
     ログイン画面 (is-guest) はサイドバーが描画されないため、
     .site-main / .site-footer のオフセットも適用しない。 */
  .is-authed .site-sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 240px;
    background: #FFF7E8;          /* 薄いクリーム／オレンジ基調 */
    border-right: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    z-index: 30;
  }

  /* PC では上部ヘッダ・ボトムタブ・ドロワーを完全に非表示（サイドバーに集約） */
  .is-authed .site-header,
  .is-authed .site-bottomtab,
  .is-authed .site-drawer,
  .is-authed .site-drawer__backdrop {
    display: none !important;
  }

  /* PC では本体下部の余白を元に戻す */
  .is-authed .site-main {
    padding-bottom: 56px;
  }

  /* メインコンテンツはサイドバー幅ぶん右へ */
  .is-authed .site-main {
    margin-left: 240px;
    max-width: none;
    padding: 24px 28px 56px;
  }

  /* 1200px の内寄せを維持したい場合のコンテンツ最大幅 */
  .is-authed .site-main > * {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
  }

  .is-authed .site-footer {
    margin-left: 240px;
  }
}

/* ============================================================
 * C1/C2 週間スケジュール表
 * ============================================================ */
.sc-week-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}
.sc-week-nav__form { margin-left: auto; }

/* 上部の対策表自動反映エリア（3 カード） */
.sc-context {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
@media (min-width: 768px) {
  .sc-context { grid-template-columns: repeat(3, 1fr); }
}
.sc-context__card {
  padding: 14px 16px;
}
.sc-context__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.sc-context__head .card__title { margin: 0; font-size: 15px; }
.sc-context__title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.sc-context__period-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-primary-dark, #0b5ed7);
  background: var(--color-primary-bg, #e8f0fe);
  border: 1px solid var(--color-primary-border, #b6d0f7);
  border-radius: 999px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.sc-context__card--strategy {
  position: relative;
  padding-left: 18px;
}
.sc-context__card--strategy::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--color-primary, #1967d2), var(--color-primary-dark, #0b5ed7));
}
.sc-context__theme {
  margin: 4px 0 10px;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.55;
  background: var(--color-surface-subtle, #f7f9fc);
  border-left: 3px solid var(--color-primary, #1967d2);
  border-radius: 0 var(--radius-sm, 4px) var(--radius-sm, 4px) 0;
}
.sc-context__theme-label {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--color-primary, #1967d2);
  border-radius: 3px;
  letter-spacing: 0.04em;
  vertical-align: 1px;
}
.sc-context__theme-text { font-weight: 600; }
.sc-context__kpi,
.sc-context__issues,
.sc-context__items {
  margin: 0;
  padding-left: 18px;
  list-style: none;
  font-size: 13px;
}
.sc-context__kpi { padding-left: 0; }
.sc-context__kpi li { margin-bottom: 4px; }
.sc-context__kpi-grid {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
@media (max-width: 480px) {
  .sc-context__kpi-grid { grid-template-columns: 1fr; }
}
.sc-context__kpi-item {
  padding: 8px 10px;
  background: var(--color-surface-subtle, #f7f9fc);
  border: 1px solid var(--color-border, #e3e8ef);
  border-radius: var(--radius-sm, 6px);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.sc-context__kpi-num {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-primary-dark, #0b5ed7);
  letter-spacing: 0.06em;
}
.sc-context__kpi-label {
  font-size: 12px;
  color: var(--color-text-muted, #6b7280);
  line-height: 1.35;
  word-break: break-word;
}
.sc-context__kpi-target {
  margin-top: 2px;
  font-size: 13px;
  color: var(--color-text, #1f2937);
}
.sc-context__kpi-target strong {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
}
.sc-context__kpi-unit {
  margin-left: 2px;
  font-size: 11px;
  color: var(--color-text-muted, #6b7280);
}
.sc-context__issues li {
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.sc-context__items li {
  padding: 4px 0;
  border-top: 1px dashed var(--color-border);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.sc-context__items li:first-child { border-top: 0; }
.sc-context__items li.is-done .sc-context__item-title {
  text-decoration: line-through;
  color: var(--color-text-muted);
}
.sc-context__items li.is-abandoned .sc-context__item-title {
  color: var(--color-text-muted);
}
.sc-context__item-mark {
  display: inline-block;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: #F0F0F0;
  color: #555;
  font-size: 11px;
  min-width: 32px;
  text-align: center;
}
.sc-context__items li.is-done .sc-context__item-mark {
  background: var(--color-success-bg);
  color: var(--color-success-dark);
}
.sc-context__item-mark--done {
  background: var(--color-success);
  color: #fff;
}
.sc-context__item-mark--todo {
  background: var(--color-warning-bg);
  color: var(--color-warning-dark);
  border: 1px solid var(--color-warning-border);
}
.sc-context__item-mark--abandoned {
  background: #EEE;
  color: #888;
}
.sc-context__item-sub { font-size: 12px; }

/* 店舗名タグ（アイコン+淡色チップ） */
.sc-context__item-store {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--color-bg-subtle, #F5F2EC);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 11px;
  color: var(--color-text-muted);
}
.sc-context__item-store-icon { font-size: 11px; }

/* 優先度別バッジ（1=最重要→3=補助） */
.badge--priority-1 {
  background: var(--color-error-bg);
  color: var(--color-error);
  border-color: var(--color-error-border);
  font-weight: 600;
}
.badge--priority-2 {
  background: var(--color-warning-bg);
  color: var(--color-warning-dark);
  border-color: var(--color-warning-border);
}
.badge--priority-3 {
  background: var(--color-info-bg);
  color: var(--color-info-dark);
  border-color: var(--color-info-border);
}

/* タイムテーブル */
.sc-timetable-card {
  padding: 12px 12px 16px;
}
.sc-timetable-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.sc-timetable-card__head .card__title { margin: 0; font-size: 15px; }
.sc-timetable-card__legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
/* legend 用の色サンプル（実セルと同じ色を確認できるように） */
.sc-timetable-card__legend .sc-slot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  line-height: 1.2;
}
.sc-timetable-card__legend-label {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-right: 4px;
}
.sc-timetable-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.sc-timetable {
  border-collapse: collapse;
  width: 100%;
  min-width: 760px; /* モバイルでは横スクロール */
  table-layout: fixed;
  font-size: 12px;
}
.sc-timetable th,
.sc-timetable td {
  border: 1px solid var(--color-border);
  padding: 0;
  vertical-align: top;
}
.sc-timetable__th-time {
  width: 64px;
  text-align: center;
  padding: 4px 6px;
  background: var(--color-bg-soft);
  font-weight: 500;
  color: var(--color-text-muted);
  white-space: nowrap;
  /* 横スクロール時に時刻列を固定 */
  position: sticky;
  left: 0;
  z-index: 2;
  border-right: 1px solid var(--color-border);
}
.sc-timetable thead .sc-timetable__th-time {
  z-index: 3;
}
.sc-timetable__th {
  padding: 6px 4px;
  background: var(--color-bg-soft);
  text-align: center;
  font-weight: 600;
  vertical-align: middle;
}
.sc-timetable__th.is-holiday {
  background: #F0F0F0;
  color: var(--color-text-muted);
}
.sc-timetable__th-wd { font-size: 13px; }
.sc-timetable__th-date {
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 400;
}
.sc-badge-holiday {
  display: inline-block;
  margin-top: 2px;
  font-size: 10px;
  background: #DDD;
  color: #555;
  border-color: #CCC;
  padding: 1px 5px;
}

.sc-cell {
  height: 44px;
  position: relative;
}
.sc-cell--holiday {
  background-color: #F7F8FA;
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 8px,
    rgba(148, 163, 184, 0.10) 8px,
    rgba(148, 163, 184, 0.10) 9px
  );
  position: relative;
}
.sc-cell--holiday::after {
  content: "公休";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  letter-spacing: 0.05em;
  color: #94A3B8;
  pointer-events: none;
  opacity: 0.8;
}
.sc-cell--holiday.sc-cell--filled::after { content: ""; }
.sc-empty-btn {
  width: 100%;
  height: 100%;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  opacity: 0.25;
  transition: opacity 0.1s ease, background-color 0.1s ease;
}
.sc-empty-btn:hover {
  opacity: 1;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}
.sc-cell--holiday .sc-empty-btn { opacity: 0.15; }
.sc-cell--holiday .sc-empty-btn:hover { opacity: 0.8; }

.sc-cell--filled {
  padding: 2px;
}
.sc-slot-btn {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 2px;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  overflow: hidden;
}
.sc-slot-btn:hover { filter: brightness(0.96); }
.sc-slot__type {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 0 4px;
  border-radius: 3px;
  align-self: flex-start;
}
.sc-slot__title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  word-break: break-all;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.sc-slot__store {
  font-size: 11px;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 種別ごとの色分け */
.sc-slot { /* legend 用 */
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}
.sc-slot--visit,
.sc-cell--filled.sc-slot--visit {
  background: var(--color-warning-bg);
  border-color: var(--color-warning-border);
  color: var(--color-warning-dark);
}
.sc-slot--office,
.sc-cell--filled.sc-slot--office {
  background: var(--color-info-bg);
  border-color: var(--color-info-border);
  color: var(--color-info-dark);
}
.sc-slot--move,
.sc-cell--filled.sc-slot--move {
  background: #F0F0F0;
  border-color: #DDD;
  color: #555;
}
.sc-slot--other,
.sc-cell--filled.sc-slot--other {
  background: #F0E6FB;
  border-color: #D6C4F0;
  color: #4B2680;
}
.sc-cell--filled .sc-slot__type {
  background: rgba(255, 255, 255, 0.6);
}

/* C2 モーダル */
.sc-modal {
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  max-width: 560px;
  width: calc(100% - 32px);
}
.sc-modal::backdrop {
  background: rgba(0, 0, 0, 0.35);
}
.sc-modal__form {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  max-height: 85vh;
}
.sc-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border);
}
.sc-modal__title {
  margin: 0;
  font-size: 16px;
}
.sc-modal__close {
  background: transparent;
  border: 0;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 4px 8px;
}
.sc-modal__close:hover { color: var(--color-text); }
.sc-modal__body {
  padding: 16px 18px;
  overflow-y: auto;
  flex: 1;
}
.sc-modal__meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 8px 10px;
  background: var(--color-bg-soft);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.sc-modal__date-label { font-weight: 600; }
.sc-modal__time-label { color: var(--color-text-muted); }
.sc-modal__field {
  display: block;
  margin-bottom: 12px;
}
.sc-modal__label {
  display: block;
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}
.sc-modal__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 640px) {
  .sc-modal__row { grid-template-columns: 1fr 1fr 1fr; }
}
.sc-modal__field--holiday {
  padding: 8px 10px;
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius-sm);
}
.sc-modal__warn {
  display: block;
  color: var(--color-warning-dark);
  font-weight: 600;
  margin-bottom: 4px;
}
.sc-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-soft);
}
.sc-modal__delete-form {
  position: absolute;
  left: 16px;
  bottom: 16px;
  margin: 0;
}
.required { color: var(--color-error); }

/* ============================================================
 * Step 7 ダッシュボード（E1〜E3）
 * ============================================================ */
.dash-section__head {
  margin-bottom: 16px;
}
.dash-section__detail-link {
  margin-left: 12px;
  font-size: 13px;
  color: var(--color-primary);
  text-decoration: none;
}
.dash-section__detail-link:hover { text-decoration: underline; }

.dash-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.dash-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
@media (min-width: 768px) {
  .dash-card { padding: 18px; gap: 12px; }
}
/* 長すぎるリスト系は内部スクロール（直近訪問・未解決課題など） */
.dash-card .dash-list,
.dash-card .dash-kpi-list {
  max-height: 280px;
  overflow-y: auto;
}
.dash-card--alert {
  border-color: var(--color-error-border);
  background: linear-gradient(180deg, var(--color-error-bg) 0%, #FFF7F7 80%);
  border-left: 4px solid var(--color-error);
}
.dash-card--alert .dash-card__title {
  color: var(--color-error);
}
.dash-card--alert .dash-card__metric-num {
  color: var(--color-error);
  font-size: 38px;
}
.dash-card__title {
  margin: 0;
  font-size: 16px;
  color: var(--color-text);
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.dash-card__subtitle {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: normal;
}
.dash-card__empty {
  color: var(--color-text-muted);
  font-size: 13px;
  margin: 0;
  padding: 20px 8px;
  text-align: center;
  background: var(--color-bg-soft);
  border-radius: var(--radius-sm);
}
.dash-card__empty::before {
  content: "—";
  display: block;
  font-size: 24px;
  opacity: 0.3;
  margin-bottom: 4px;
}
.dash-card__meta {
  color: var(--color-text-muted);
  font-size: 12px;
  margin: 0;
}
.dash-card__actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.dash-card__metric {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.dash-card__metric-num {
  font-size: 34px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
}
.dash-card__metric-unit {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-left: 2px;
}
.dash-card__metric-sub {
  font-size: 12px;
  color: var(--color-text-muted);
}
.dash-card__metric--alert .dash-card__metric-num {
  color: var(--color-error);
}
.dash-pass-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  padding: 4px 0 10px;
}
.dash-pass-summary__metric {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}
.dash-pass-summary__num {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.1;
}
.dash-pass-summary__num--muted {
  color: var(--color-text-muted);
}
.dash-pass-summary__unit {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-left: 2px;
  font-weight: 500;
}
.dash-pass-summary__label {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
  letter-spacing: 0.03em;
}
.dash-card__chart {
  border-top: 1px dashed var(--color-border);
  padding-top: 10px;
}
.dash-card__chart-title {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.dash-svg-chart {
  width: 100%;
  height: auto;
  max-height: 240px;
  display: block;
}

.dash-kpi-list {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dash-kpi-list__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px dotted var(--color-border);
}
.dash-kpi-list__row:last-child { border-bottom: 0; }
.dash-kpi-list__row dt {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted);
}
.dash-kpi-list__row dd {
  margin: 0;
  font-size: 14px;
  color: var(--color-text);
  font-weight: 500;
}
.dash-kpi-list--cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 14px;
}

.dash-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dash-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px dotted var(--color-border);
  font-size: 13px;
}
.dash-list li:last-child { border-bottom: 0; }
.dash-list__meta {
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
}
.dash-list--scroll {
  max-height: 240px;
  overflow: auto;
}

.dash-focus-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dash-focus-list__item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 6px 0;
  border-bottom: 1px dotted var(--color-border);
}
.dash-focus-list__item:last-child { border-bottom: 0; }
.dash-focus-list__check {
  font-size: 16px;
  color: var(--color-text-muted);
}
.dash-focus-list__check.is-done { color: var(--color-primary); }
.dash-focus-list__title {
  font-size: 13px;
  color: var(--color-text);
  font-weight: 500;
}
.dash-focus-list__meta {
  font-size: 11px;
  color: var(--color-text-muted);
}

.dash-shortcut-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dash-shortcut-list li a {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  background: var(--color-bg-soft);
  text-decoration: none;
  font-size: 13px;
}
.dash-shortcut-list li a:hover {
  background: #FFF3DD;
}

.dash-subtitle {
  font-size: 13px;
  margin: 6px 0 4px;
  color: var(--color-text-muted);
}

.dash-subsection {
  margin-top: 8px;
}

.dash-table th, .dash-table td {
  font-size: 13px;
}

/* 繁忙度バッジ */
.dash-busy-badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 12px;
  border-radius: 999px;
  font-weight: 600;
  background: #EEE;
  color: #555;
}
.dash-busy-badge--normal { background: #E8F3FF; color: #2F80ED; }
.dash-busy-badge--busy   { background: #FFF3DD; color: #C77D13; }
.dash-busy-badge--peak   { background: #FFE4E4; color: #C0392B; }

/* KPI スコープバッジ（user/team/office/tenant/fallback） */
.dash-scope-badge {
  display: inline-block;
  padding: 1px 7px;
  font-size: 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  margin-left: 4px;
  vertical-align: middle;
}
.dash-scope-badge--user     { background: #FFF3DD; color: #C77D13; border-color: #F5A62355; }
.dash-scope-badge--team     { background: #E8F3FF; color: #2F80ED; border-color: #2F80ED55; }
.dash-scope-badge--office   { background: #EDE9FE; color: #6D28D9; border-color: #6D28D955; }
.dash-scope-badge--tenant   { background: #DCFCE7; color: #15803D; border-color: #15803D55; }
.dash-scope-badge--fallback { background: #F4F4F4; color: #666; border-color: #CCC; }

/* 期間フィルタ */
.dash-filter__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}
.dash-filter__row label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: var(--color-text-muted);
  gap: 3px;
}
.dash-filter__row .form-input {
  min-width: 120px;
}

/* テキストカラーのユーティリティ（共通の text-warning が無ければ） */
.text-success { color: var(--color-success); font-weight: 600; }
.text-warning { color: var(--color-warning); font-weight: 600; }
.text-error   { color: var(--color-error); font-weight: 600; }

/* ダッシュボード用 ページネーション */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  font-size: 13px;
}
.pagination__link {
  color: var(--color-primary-dark, #D88B12);
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm, 6px);
  background: var(--color-bg);
}
.pagination__link:hover { background: var(--color-bg-soft, #FAF7F2); }
.pagination__current { color: var(--color-text-muted); }

@media (min-width: 768px) {
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .dash-card--wide { grid-column: 1 / -1; }
}
@media (min-width: 1024px) {
  .dash-grid { grid-template-columns: 1fr 1fr 1fr; }
  .dash-card--wide { grid-column: 1 / -1; }
}

/* ============================================================
   Tutorial Modal（初回ログインのみ表示されるウェルカムモーダル）
   ============================================================ */
.tutorial-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.tutorial-modal.is-hidden { display: none; }

.tutorial-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(24, 20, 14, 0.55);
  backdrop-filter: blur(2px);
  cursor: pointer;
}

.tutorial-modal__dialog {
  position: relative;
  width: min(1160px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  padding: 28px 28px 22px;
  animation: tutorialModalIn 0.18s ease-out;
}
@keyframes tutorialModalIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.tutorial-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #EEE8DE;
  padding-bottom: 12px;
  margin-bottom: 14px;
}
.tutorial-modal__title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #1F1A13;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tutorial-modal__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: #F5A623;
  border-radius: 50%;
}
.tutorial-modal__close {
  border: 0;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: #8A7F6F;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.tutorial-modal__close:hover { background: #FAF7F2; color: #1F1A13; }

.tutorial-modal__intro { margin-bottom: 18px; }
.tutorial-modal__lead {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.7;
  color: #333;
}
.tutorial-modal__note {
  margin: 0;
  font-size: 13px;
  color: #6B6257;
}
.tutorial-modal__note a {
  color: #C87A1F;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tutorial-modal__grid {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 640px) {
  .tutorial-modal__grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 960px) {
  .tutorial-modal__grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (min-width: 1100px) {
  .tutorial-modal__grid { grid-template-columns: repeat(4, 1fr); }
}

.tutorial-card {
  position: relative;
  border: 1px solid #EEE8DE;
  border-radius: 10px;
  background: #FFFBF4;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.tutorial-card:hover {
  border-color: #F5A623;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(245, 166, 35, 0.12);
}
.tutorial-card.is-read { background: var(--color-success-bg); border-color: var(--color-success-border); }

.tutorial-card__link {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
}
.tutorial-card__num {
  font-family: 'Georgia', 'Hiragino Mincho ProN', serif;
  font-size: 22px;
  font-weight: 800;
  color: #F5A623;
  line-height: 1;
  letter-spacing: 0.02em;
}
.tutorial-card.is-read .tutorial-card__num { color: #7FA86C; }

.tutorial-card__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tutorial-card__eyebrow {
  font-size: 11px;
  font-weight: 600;
  color: #8A7F6F;
  letter-spacing: 0.05em;
}
.tutorial-card__main {
  font-size: 14px;
  font-weight: 700;
  color: #1F1A13;
  line-height: 1.4;
}
.tutorial-card__summary {
  font-size: 12px;
  color: #6B6257;
  margin-top: 2px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tutorial-card__status {
  font-size: 11px;
  font-weight: 600;
  color: #B4A995;
  padding: 3px 8px;
  border: 1px solid #E3DBCC;
  border-radius: 999px;
  background: #fff;
  white-space: nowrap;
}
.tutorial-card__status.is-read {
  color: #5A7D4A;
  border-color: #C3D8B5;
  background: #EAF2E4;
}

.tutorial-modal__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid #EEE8DE;
}
.tutorial-modal__check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #4D463D;
  cursor: pointer;
  user-select: none;
}
.tutorial-modal__check input { accent-color: #F5A623; }

.tutorial-modal__actions { display: inline-flex; gap: 8px; }

@media (max-width: 640px) {
  .tutorial-modal__dialog { padding: 20px 18px 16px; }
  .tutorial-modal__title { font-size: 18px; }
  .tutorial-modal__footer { flex-direction: column; align-items: stretch; }
  .tutorial-modal__actions { justify-content: flex-end; }
}

/* ============================================================
   訪問ログ × スケジュール 連動 UI
   ============================================================ */
.sc-slot__badge {
  position: absolute;
  top: 4px;
  right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.6);
}
.sc-slot__badge--done {
  background: #2E7D4F;
  color: #fff;
}
.sc-slot__badge--missing {
  background: #C23934;
  color: #fff;
  animation: sc-pulse 1.6s ease-in-out infinite;
}
@keyframes sc-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}
.sc-slot-btn { position: relative; }
.sc-slot__rate {
  font-size: 10px;
  font-weight: 600;
  color: #2E7D4F;
  margin-top: 2px;
}
.sc-cell--visit-done .sc-slot-btn {
  box-shadow: inset 0 0 0 2px #A8D5B8;
}
.sc-cell--visit-missing .sc-slot-btn {
  box-shadow: inset 0 0 0 2px #F5B7B3;
}

/* モーダル内 訪問ログセクション */
.sc-modal__visitlog {
  margin: 0 20px 12px;
  padding: 12px 14px;
  background: #FAFBFC;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sc-modal__visitlog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sc-modal__visitlog-state {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ECEEF1;
  color: var(--color-text-muted);
}
.sc-modal__visitlog-state.is-done {
  background: #E3F1E8;
  color: #2E7D4F;
}
.sc-modal__visitlog-state.is-missing {
  background: #FCE6E4;
  color: #C23934;
}
.sc-modal__visitlog-state.is-warn {
  background: #FFF4D6;
  color: #8A6100;
}
.sc-modal__visitlog-meta {
  font-size: 12px;
  color: var(--color-text-muted);
  min-height: 0;
}
.sc-modal__visitlog-meta:empty { display: none; }
.sc-modal__visitlog-actions {
  display: flex;
  gap: 8px;
}
.sc-modal__visitlog-note {
  margin: 0;
  font-size: 11px;
  color: var(--color-text-muted);
}

/* ============================================================
   Member Dashboard v3 — CamuQuotes 風 SaaS ダッシュボード
   （member role 専用・他ロールに影響しない独立名前空間）
   ============================================================ */
.dash-v3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 8px;
}
.dash-v3__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  min-width: 0;
}

/* ベースカード */
.dash-v3-card {
  position: relative;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: 0 1px 3px rgba(40, 30, 10, 0.04), 0 6px 18px rgba(40, 30, 10, 0.03);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

/* カードヘッダ */
.dash-v3-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  flex-wrap: wrap;
}
.dash-v3-card__period {
  font-size: 11px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* UPPERCASE tracking wide ラベル */
.dash-v3-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  text-transform: uppercase;
  margin: 0;
}
.dash-v3-eyebrow__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(216, 139, 18, 0.12);
}

/* pill バッジ（モノトーン＋ティール/赤系の状態色のみ） */
.dash-v3-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.dash-v3-pill--success { background: var(--color-success-bg); color: var(--color-success); }
.dash-v3-pill--warning { background: var(--color-warning-bg); color: var(--color-warning); }
.dash-v3-pill--error   { background: var(--color-error-bg); color: var(--color-error); }
.dash-v3-pill--info    { background: var(--color-bg-soft); color: var(--color-text-muted); }
.dash-v3-pill--busy-normal { background: var(--color-bg-soft); color: var(--color-text-muted); }
.dash-v3-pill--busy-busy   { background: var(--color-warning-bg); color: var(--color-warning); }
.dash-v3-pill--busy-peak   { background: var(--color-error-bg); color: var(--color-error); }

/* 空状態 */
.dash-v3-empty {
  margin: 0;
  padding: 14px 16px;
  font-size: 12px;
  color: var(--color-text-muted);
  background: var(--color-bg-soft);
  border-radius: 12px;
  text-align: center;
}
.dash-v3-empty--inline {
  padding: 8px 12px;
  text-align: left;
}

/* 警告色の数値 */
.dash-v3-num--warning { color: var(--color-warning); }

/* 大きな単独数値（件） */
.dash-v3-big-num {
  margin: 0;
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}
.dash-v3-big-num small {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-left: 4px;
}

/* リンク表記 */
.dash-v3-link {
  color: var(--color-text);
  font-weight: 600;
  text-decoration: none;
}
.dash-v3-link:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

/* ------------------------------------------------------------
   第1層: Overview 大カード（ヒーロー実績 + 達成率バー）
   ------------------------------------------------------------ */
.dash-v3-overview {
  background:
    radial-gradient(1200px 240px at -10% -50%, rgba(216,139,18,0.06), transparent 60%),
    var(--color-bg);
}

/* ヒーロー：実績 + 達成率バー */
.dash-v3-hero {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 18px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fafaf6 0%, #f5f3ec 100%);
  border: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
}
.dash-v3-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary) 0%, #d8a64b 100%);
}
.dash-v3-hero__main {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dash-v3-hero__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--color-text-muted);
  text-transform: uppercase;
}
.dash-v3-hero__value-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.dash-v3-hero__value {
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #1f7a5c 0%, #2aa57f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
.dash-v3-hero__value small {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-left: 4px;
  -webkit-text-fill-color: var(--color-text-muted);
}
.dash-v3-hero__progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dash-v3-hero__progress-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--color-text-muted);
}
.dash-v3-hero__progress-rate strong {
  font-size: 13px;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.01em;
  margin-left: 2px;
}
.dash-v3-hero__progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(40,30,10,0.06);
  overflow: hidden;
}
.dash-v3-hero__progress-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 600ms cubic-bezier(.2,.7,.2,1);
}
.dash-v3-hero__progress-bar.is-success {
  background: linear-gradient(90deg, #2aa57f 0%, #1f7a5c 100%);
  box-shadow: 0 0 0 1px rgba(31,122,92,0.15) inset;
}
.dash-v3-hero__progress-bar.is-warn {
  background: linear-gradient(90deg, #e6b14a 0%, #d88b12 100%);
}
.dash-v3-hero__progress-bar.is-low {
  background: linear-gradient(90deg, #e07b6e 0%, #c64a3d 100%);
}

/* サブメトリクス（見込み・不足） */
.dash-v3-submetrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.dash-v3-submetric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
}
.dash-v3-submetric__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  text-transform: uppercase;
}
.dash-v3-submetric__value {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}
.dash-v3-submetric__value small {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-left: 3px;
}
.dash-v3-submetric--ok {
  background: linear-gradient(180deg, #f1f8f4 0%, #e8f3ec 100%);
  border-color: #cfe6d8;
}
.dash-v3-submetric--ok .dash-v3-submetric__value {
  color: var(--color-success-dark, #1f7a5c);
}
.dash-v3-submetric--warning {
  background: linear-gradient(180deg, #fcf2ec 0%, #fae6dd 100%);
  border-color: #f1c9b6;
}
.dash-v3-submetric--warning .dash-v3-submetric__value {
  color: var(--color-error-dark, #a3312b);
}

/* 旧 .dash-v3-metrics / .dash-v3-metric は他箇所互換のため残す */
.dash-v3-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 4px 0 2px;
}
.dash-v3-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
}
.dash-v3-metric__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  text-transform: uppercase;
}
.dash-v3-metric__value {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--color-text);
}
.dash-v3-metric__value small {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-left: 3px;
}
.dash-v3-metric__value--hero {
  font-size: 36px;
  color: var(--color-success);
}
.dash-v3-metric__value--warning { color: var(--color-warning); }

/* 前年比バッジ（▲▼ 矢印つき） */
.dash-v3-yoy {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 4px;
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.4;
  border-radius: 999px;
  letter-spacing: 0.02em;
  max-width: 100%;
  word-break: break-all;
  vertical-align: top;
  font-variant-numeric: tabular-nums;
}
.dash-v3-yoy__arrow {
  font-size: 9px;
  line-height: 1;
}
.dash-v3-yoy--up {
  color: var(--color-success-dark, #1f7a5c);
  background: var(--color-success-bg, #e4f3ec);
}
.dash-v3-yoy--down {
  color: var(--color-error-dark, #a3312b);
  background: var(--color-error-bg, #fbe7e4);
}
.dash-v3-yoy--muted {
  color: var(--color-text-muted, #6b7280);
  background: var(--color-bg-soft, #f3f5f8);
}

.dash-v3-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  text-transform: uppercase;
  margin-top: 4px;
}

/* 種別 2x2 タイル（上端アクセント色） */
.dash-v3-types {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.dash-v3-type {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 12px;
  border-radius: 14px;
  background: #FFFFFF;
  border: 1px solid var(--color-border);
  min-width: 0;
  overflow: hidden;
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.dash-v3-type::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  border-radius: 14px 14px 0 0;
  background: var(--accent, var(--color-primary));
  opacity: 0.85;
}
.dash-v3-type:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(40,30,10,0.06);
}
.dash-v3-type--accent-1 { --accent: linear-gradient(90deg, #d88b12 0%, #e6b14a 100%); }
.dash-v3-type--accent-2 { --accent: linear-gradient(90deg, #2aa57f 0%, #4cc4a0 100%); }
.dash-v3-type--accent-3 { --accent: linear-gradient(90deg, #6b7280 0%, #9aa3ad 100%); }
.dash-v3-type--accent-4 { --accent: linear-gradient(90deg, #8367c7 0%, #a98fe0 100%); }
.dash-v3-type__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}
.dash-v3-type__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.dash-v3-type__name {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  word-break: break-all;
}
.dash-v3-type__value {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  color: var(--color-text);
}
.dash-v3-type__value small {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-left: 2px;
}

/* Worst 5 テーブル */
.dash-v3-worst { padding: 20px 22px; }

.dash-v3-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.dash-v3-table thead th {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--color-border);
}
.dash-v3-table thead th.col-num { text-align: right; }
.dash-v3-table tbody td {
  padding: 10px 8px;
  border-bottom: 1px dashed var(--color-border);
  vertical-align: middle;
}
.dash-v3-table tbody td.col-num { text-align: right; font-variant-numeric: tabular-nums; }
.dash-v3-table tbody tr:last-child td { border-bottom: 0; }

/* ------------------------------------------------------------
   第2層: ドーナツ ＋ KPI行（with スタック棒）
   ------------------------------------------------------------ */
.dash-v3-donut {
  align-items: center;
  text-align: center;
}
.dash-v3-donut .dash-v3-card__head {
  width: 100%;
}
.dash-v3-donut__chart {
  width: 100%;
  max-width: 240px;
  margin: 0 auto;
}
.dash-v3-donut-svg { width: 100%; height: auto; display: block; }
.dash-v3-donut__legend {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 100%;
  padding-top: 8px;
  border-top: 1px dashed var(--color-border);
}
.dash-v3-donut__leg {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}
.dash-v3-donut__leg-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  text-transform: uppercase;
}
.dash-v3-donut__leg-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--color-text);
}

/* Deal Value 風 */
.dash-v3-deal__body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  min-width: 0;
}

.dash-v3-klist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dash-v3-klist__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--color-border);
}
.dash-v3-klist__row:last-child { border-bottom: 0; }
.dash-v3-klist__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.dash-v3-klist__icon--gold { background: #F1ECE0; color: #5A5A5A; }
.dash-v3-klist__icon--info { background: #F1ECE0; color: #5A5A5A; }
.dash-v3-klist__icon--teal { background: var(--color-success-bg); color: var(--color-success); }
.dash-v3-klist__icon--pink { background: var(--color-error-bg); color: var(--color-error); }
.dash-v3-klist__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.dash-v3-klist__value {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--color-text);
}
.dash-v3-klist__value small {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-left: 3px;
}
.dash-v3-klist__sub {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* スタック棒エリア */
.dash-v3-deal__chart {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.dash-v3-chart-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  text-transform: uppercase;
}
.dash-v3-stack-svg { width: 100%; height: auto; display: block; }
.dash-v3-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--color-text-muted);
}
.dash-v3-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dash-v3-legend__sw {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.dash-v3-legend__sw--a { background: var(--color-success); }
.dash-v3-legend__sw--b { background: #EDE8DC; border: 1px solid #DED7C6; }

/* ------------------------------------------------------------
   第2.5層: 今月の時間構成（円グラフ）
   ------------------------------------------------------------ */
.dash-v3-time {
  padding: 20px 22px;
}
.dash-v3-time__body {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.dash-v3-time__pie {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dash-v3-pie-svg {
  width: 170px;
  height: auto;
  display: block;
}
.dash-v3-card__head-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dash-v3-time__tabs {
  display: inline-flex;
  gap: 2px;
  background: var(--color-bg-soft, #F7F8FA);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 2px;
}
.dash-v3-time__tab {
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: none;
  border-radius: 999px;
  transition: background-color 0.15s, color 0.15s;
}
.dash-v3-time__tab:hover {
  color: var(--color-primary-dark);
}
.dash-v3-time__tab.is-active {
  background: var(--color-primary);
  color: #fff;
}
.dash-v3-time__legend {
  flex: 0 1 360px;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 280px;
  max-width: 380px;
}
.dash-v3-time__item {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed #E5DFD1;
  font-size: 13px;
  color: var(--color-text);
}
.dash-v3-time__sw {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}
.dash-v3-time__label {
  font-weight: 600;
}
.dash-v3-time__value {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--color-text);
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.dash-v3-time__value small {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-left: -2px;
}
.dash-v3-time__pct {
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 46px;
  text-align: right;
}
.dash-v3-time__total {
  margin-top: 4px;
  text-align: right;
  font-size: 12px;
  color: var(--color-text-muted);
  border-bottom: none;
  padding: 4px 0 0;
}
.dash-v3-time__total strong {
  color: var(--color-text);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  margin-left: 4px;
}
@media (max-width: 640px) {
  .dash-v3-time__body {
    gap: 18px;
    justify-content: center;
  }
  .dash-v3-pie-svg {
    width: 170px;
  }
  .dash-v3-time__legend {
    flex-basis: 100%;
  }
}

/* ------------------------------------------------------------
   第3層: 3 カラム パネル
   ------------------------------------------------------------ */
.dash-v3-panel {
  padding: 20px 22px;
}
.dash-v3-panel__title {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.dash-v3-panel__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.dash-v3-panel__icon--gold { background: #F1ECE0; color: #5A5A5A; }
.dash-v3-panel__icon--info { background: #F1ECE0; color: #5A5A5A; }
.dash-v3-panel__icon--teal { background: var(--color-success-bg); color: var(--color-success); }
.dash-v3-panel__icon--pink { background: var(--color-error-bg); color: var(--color-error); }

.dash-v3-count {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--color-bg-soft);
  color: var(--color-text-muted);
}
.dash-v3-count--alert   { background: var(--color-error-bg); color: var(--color-error); }
.dash-v3-count--warning { background: #F1EDE3; color: #8A6320; }

.dash-v3-panel__meta {
  margin: 0;
  font-size: 11px;
  color: var(--color-text-muted);
}
.dash-v3-panel__actions {
  margin-top: auto;
  padding-top: 4px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* リスト */
.dash-v3-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.dash-v3-list > li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
  min-width: 0;
}
.dash-v3-list > li:last-child { border-bottom: 0; }
.dash-v3-list a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 auto;
}
.dash-v3-list__meta {
  font-size: 11px;
  color: var(--color-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* 重点 checklist */
.dash-v3-focus {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.dash-v3-focus__item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  align-items: flex-start;
}
.dash-v3-focus__item:last-child { border-bottom: 0; }
.dash-v3-focus__check {
  font-size: 16px;
  line-height: 1.2;
  color: var(--color-text-muted);
}
.dash-v3-focus__check.is-done { color: var(--color-primary); }
.dash-v3-focus__body { flex: 1 1 auto; min-width: 0; }
.dash-v3-focus__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  overflow-wrap: anywhere;
}
.dash-v3-focus__meta {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* 直近訪問テーブル */
.dash-v3-table--recent tbody td { padding: 9px 8px; }

/* ------------------------------------------------------------
   レスポンシブ
   既定は 1 列。720px 以上で 2 列、1024px 以上で設計通りの幅比で配置。
   ------------------------------------------------------------ */
@media (min-width: 720px) {
  .dash-v3-metrics { grid-template-columns: repeat(4, 1fr); }
  .dash-v3__row--trio {
    grid-template-columns: repeat(2, 1fr);
  }
  .dash-v3-deal__body {
    grid-template-columns: 1fr 1.4fr;
    align-items: stretch;
  }
}
@media (min-width: 1024px) {
  /* 第1層: 1.3 : 1 */
  .dash-v3__row--overview {
    grid-template-columns: 1.3fr 1fr;
  }
  /* 第2層: ドーナツ削除につき 1 カラム（Deal カードが全幅） */
  .dash-v3__row--insight {
    grid-template-columns: 1fr;
  }
  /* 第3層: 3 カラム */
  .dash-v3__row--trio {
    grid-template-columns: repeat(3, 1fr);
  }
  /* Deal 内部 KPI : チャート = 1 : 1.6 */
  .dash-v3-deal__body {
    grid-template-columns: 1fr 1.6fr;
  }
  .dash-v3-types {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================
 * C3 本日のスケジュール（デイリービュー）
 * ============================================================ */
.sc-day-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}
.sc-day-nav__form { margin-left: auto; }

/* 週間ビュー：日付ヘッダのリンク化 */
.sc-timetable__th-link {
  display: block;
  color: inherit;
  text-decoration: none;
  padding: 4px 2px;
  border-radius: var(--radius-sm);
  transition: background 0.12s;
}
.sc-timetable__th-link:hover {
  background: var(--color-primary-light);
}

/* サマリ 3 カード（モバイルでもコンパクト横並び） */
.sc-day-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
@media (min-width: 640px) {
  .sc-day-summary { gap: 12px; }
}
.sc-day-summary__card {
  padding: 10px 10px 12px;
  min-width: 0;
}
@media (min-width: 640px) {
  .sc-day-summary__card { padding: 14px 16px; }
}
.sc-day-summary__label {
  font-size: 11px;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sc-day-summary__value {
  font-size: 15px;
  line-height: 1.1;
  font-weight: 700;
  color: var(--color-text);
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
}
.sc-day-summary__value strong { font-size: 22px; }
@media (min-width: 640px) {
  .sc-day-summary__label { font-size: 12px; margin-bottom: 6px; }
  .sc-day-summary__value { font-size: 22px; gap: 6px; }
  .sc-day-summary__value strong { font-size: 28px; }
}
.sc-day-summary__rate {
  font-size: 11px;
  color: var(--color-primary-dark);
  font-weight: 600;
  background: var(--color-primary-light);
  padding: 1px 6px;
  border-radius: 999px;
}
@media (min-width: 640px) {
  .sc-day-summary__rate { font-size: 12px; padding: 2px 8px; margin-left: 4px; }
}
.sc-day-summary__sub {
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.35;
}
@media (min-width: 640px) {
  .sc-day-summary__sub { margin-top: 4px; font-size: 12px; }
}

/* タイムライン */
.sc-day-timeline { padding: 14px 16px 18px; }

.sc-day-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sc-day-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  min-height: 44px;
  align-items: flex-start;
}

.sc-day-row--empty {
  background: transparent;
  opacity: 0.55;
}
.sc-day-row--empty.is-past { opacity: 0.35; }

.sc-day-row--slot {
  background: var(--color-bg-soft);
  border-color: var(--color-border);
}
.sc-day-row--slot.sc-slot--visit  { border-left: 4px solid var(--color-cat-visit); }
.sc-day-row--slot.sc-slot--office { border-left: 4px solid var(--color-cat-office); }
.sc-day-row--slot.sc-slot--move   { border-left: 4px solid var(--color-cat-move); }
.sc-day-row--slot.sc-slot--other  { border-left: 4px solid var(--color-cat-other); }

.sc-day-row--slot.is-done {
  background: var(--color-success-bg);
  border-color: var(--color-success-border);
}
.sc-day-row--slot.is-missing {
  background: var(--color-error-bg);
  border-color: var(--color-error-border);
}

.sc-day-row__time {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
}
.sc-day-row__time-start {
  font-size: 15px;
  font-weight: 700;
}
.sc-day-row__time-end {
  font-size: 11px;
  color: var(--color-text-muted);
}
.sc-day-row__duration {
  font-size: 10px;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
}

.sc-day-row__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.sc-day-row__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 14px;
  line-height: 1.4;
}
.sc-day-row__title {
  font-weight: 700;
  color: var(--color-text);
}
.sc-day-row__store {
  color: var(--color-text-muted);
  font-size: 13px;
}
.sc-day-row__rate {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--color-success-bg);
  color: var(--color-success-dark);
  border: 1px solid var(--color-success-border);
}

.sc-slot__type--inline {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  color: #fff;
}
.sc-slot__type--inline.sc-slot--visit  { background: var(--color-cat-visit); }
.sc-slot__type--inline.sc-slot--office { background: var(--color-cat-office); }
.sc-slot__type--inline.sc-slot--move   { background: #948971; }
.sc-slot__type--inline.sc-slot--other  { background: var(--color-cat-other); }

.sc-day-row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sc-day-row__empty-mark {
  font-size: 12px;
}
.sc-day-row__empty-link { margin-left: auto; }

.sc-day-row--empty .sc-day-row__body {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

/* 予定外訪問カード */
.sc-day-adhoc { margin-top: 16px; padding: 14px 16px 18px; }
.sc-day-adhoc__list {
  list-style: none;
  padding: 0;
  margin: 8px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sc-day-adhoc__item {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.sc-day-adhoc__time {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  min-width: 48px;
}
.sc-day-adhoc__store { font-weight: 600; }
.sc-day-adhoc__minutes {
  color: var(--color-text-muted);
  font-size: 12px;
}

.sc-day-adhoc__form {
  margin-top: 10px;
  padding: 12px;
  background: var(--color-bg-soft);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
}
.sc-day-adhoc__form .form-row { margin-bottom: 8px; }
.form-row--grid3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
@media (min-width: 560px) {
  .form-row--grid3 { grid-template-columns: repeat(3, 1fr); }
}

.text-warning { color: var(--color-warning-dark); }

.dash-member-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 1024px) {
  .dash-member-split { grid-template-columns: 1fr 1fr; }
}

.dash-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 768px) {
  .dash-row--2 { grid-template-columns: 1fr 1fr; }
}

.dash-office-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.dash-office-filter__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-muted);
}
.dash-office-filter__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-soft);
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s, border-color 0.15s;
}
.dash-office-filter__item:hover { background: var(--color-primary-light); }
.dash-office-filter__item:has(input:checked) {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 600;
}
.dash-office-filter__item input { margin: 0; accent-color: var(--color-primary); }
.dash-office-filter__actions { margin-left: auto; }
.dash-member-split__col { min-width: 0; }
.dash-member-split__col .table-basic { font-size: 12.5px; }
.dash-member-split__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-muted);
  margin: 0 0 8px;
  letter-spacing: 0.04em;
}

/* ============================================================
   AI 行動アドバイスカード（home.php / member セクション）
   ============================================================ */
.dash-v3__row--advice { margin-bottom: 16px; }
.dash-v3-advice {
  background: linear-gradient(180deg, #fffbee 0%, #fffdf5 100%);
  border: 1px solid #e6dcbc;
}
.dash-v3-advice__body {
  font-size: 14px;
  line-height: 1.8;
  color: #3b372a;
  margin: 8px 0 0;
  white-space: pre-wrap;
}
.dash-v3-advice__rule {
  font-size: 12.5px;
  line-height: 1.7;
  color: #555;
  background: #f6f3ea;
  padding: 10px 12px;
  border-radius: 6px;
  white-space: pre-wrap;
  margin: 8px 0 0;
  overflow-x: auto;
}

/* ============================================================
 * チーム対策表 横並びビュー（pages/countermeasure/team_view.php）
 * ============================================================ */
.tv-section { margin-bottom: 20px; }
.tv-section__head { margin-bottom: 12px; }
.tv-section__desc { font-size: 12px; margin: 2px 0 0; }

/* メンバーヘッダ（アバター + 名前 + 所属） */
.tv-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary) 0%, #d8a64b 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}
.tv-avatar--sm { width: 26px; height: 26px; font-size: 11px; }
.tv-member-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.tv-member-head--compact { gap: 8px; }
.tv-member-head__meta { min-width: 0; flex: 1; }
.tv-member-head__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  overflow-wrap: anywhere;
}
.tv-member-head__sub {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 1px;
}
.tv-field-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  text-transform: uppercase;
  margin-right: 6px;
}

/* ---------- ① 半期戦略グリッド ---------- */
.tv-strategy-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 720px)  { .tv-strategy-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .tv-strategy-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1400px) { .tv-strategy-grid { grid-template-columns: repeat(4, 1fr); } }

.tv-strategy-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  min-width: 0;
}
.tv-strategy-card.is-empty { background: var(--color-bg-soft); }
.tv-strategy-card__theme {
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text);
  overflow-wrap: anywhere;
}
.tv-kpi-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tv-kpi-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 6px;
  padding: 6px 8px;
  background: var(--color-bg-soft);
  border-radius: 6px;
  font-size: 12px;
  align-items: center;
}
.tv-kpi-list__n {
  font-size: 10px;
  font-weight: 800;
  color: var(--color-primary-dark, #8a5a0a);
  letter-spacing: 0.04em;
}
.tv-kpi-list__label { overflow-wrap: anywhere; }
.tv-kpi-list__val {
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.tv-empty-inline {
  text-align: center;
  padding: 18px 10px;
  font-size: 12px;
  color: var(--color-text-muted);
  background: var(--color-bg-soft);
  border-radius: 8px;
}

/* ---------- ② 月次重点課題マトリクス ---------- */
.tv-monthly-wrap {
  overflow-x: auto;
  margin: 0 -4px;
  padding: 0 4px;
}
.tv-monthly-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  min-width: 640px;
}
.tv-monthly-table thead th {
  position: sticky;
  top: 0;
  background: var(--color-bg-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border);
  text-transform: uppercase;
  text-align: left;
}
.tv-monthly-table tbody th,
.tv-monthly-table tbody td {
  padding: 10px 10px;
  border-bottom: 1px dashed var(--color-border);
  vertical-align: top;
}
.tv-monthly-table tbody tr:last-child th,
.tv-monthly-table tbody tr:last-child td { border-bottom: 0; }
.tv-monthly-table__member-col {
  width: 180px;
  min-width: 180px;
  position: sticky;
  left: 0;
  background: var(--color-bg);
  z-index: 1;
  border-right: 1px solid var(--color-border);
}
.tv-monthly-table tbody th.tv-monthly-table__member-col { font-weight: normal; }
.tv-monthly-table td.is-empty { background: var(--color-bg-soft); }
.tv-issue { display: flex; flex-direction: column; gap: 3px; }
.tv-issue__title {
  font-weight: 700;
  color: var(--color-text);
  overflow-wrap: anywhere;
  line-height: 1.4;
}
.tv-issue__note {
  font-size: 11px;
  color: var(--color-text-muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.tv-empty-chip {
  color: var(--color-text-muted);
  font-size: 14px;
}

/* ---------- ③ 週次アクションアコーディオン ---------- */
.tv-weekly-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.tv-weekly-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
}
.tv-weekly-card[open] { box-shadow: 0 2px 6px rgba(40,30,10,0.05); }
.tv-weekly-card__summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
  background: var(--color-bg-soft);
  min-width: 0;
}
.tv-weekly-card__summary::-webkit-details-marker { display: none; }
.tv-weekly-card__meta { flex: 1; min-width: 0; }
.tv-rate {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.tv-rate--done  { color: var(--color-success-dark, #1f7a5c); background: var(--color-success-bg, #e4f3ec); }
.tv-rate--half  { color: #8a5a0a; background: #fcf1dc; }
.tv-rate--low   { color: var(--color-error-dark, #a3312b);  background: var(--color-error-bg, #fbe7e4); }
.tv-rate--muted { color: var(--color-text-muted, #6b7280);  background: var(--color-bg-soft, #f3f5f8); }
.tv-chev {
  color: var(--color-text-muted);
  transition: transform 180ms ease;
  flex-shrink: 0;
}
.tv-weekly-card[open] .tv-chev { transform: rotate(180deg); }
.tv-weekly-card__body {
  padding: 10px 12px 14px;
  border-top: 1px solid var(--color-border);
}
.tv-item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.tv-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--color-border);
  align-items: flex-start;
}
.tv-item:last-child { border-bottom: 0; }
.tv-item.is-done .tv-item__title { color: var(--color-text-muted); text-decoration: line-through; }
.tv-item.is-abandoned .tv-item__title { color: var(--color-text-muted); }
.tv-item__check {
  font-size: 16px;
  line-height: 1.2;
  flex-shrink: 0;
  color: var(--color-text-muted);
}
.tv-item.is-done .tv-item__check { color: var(--color-success-dark, #1f7a5c); }
.tv-item.is-abandoned .tv-item__check { color: var(--color-error-dark, #a3312b); }
.tv-item__body { flex: 1; min-width: 0; }
.tv-item__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  overflow-wrap: anywhere;
  line-height: 1.5;
}
.tv-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 3px;
}
.tv-item__store { white-space: nowrap; }
.tv-item__abandoned {
  margin-top: 4px;
  font-size: 11px;
  color: var(--color-error-dark, #a3312b);
}

/* モバイル調整 */
@media (max-width: 600px) {
  .tv-monthly-table { min-width: 520px; font-size: 12px; }
  .tv-monthly-table__member-col { width: 130px; min-width: 130px; }
  .tv-strategy-card { padding: 12px; }
}

/* ============================================================
   取次店 組織メンバー名簿（show.php）
   ============================================================ */
.om-group { margin-top: 16px; }
.om-group:first-of-type { margin-top: 0; }
.om-group__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.om-affil {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
}
.om-affil--hq    { background: #FFF7E6; border-color: #F2C46B; color: #8A5A00; }
.om-affil--area  { background: #E8F1FF; border-color: #7FA8E0; color: #1F4E8C; }
.om-affil--store { background: #EAF5EE; border-color: #7CB392; color: #1E5A37; }

.om-table {
  table-layout: fixed;
  width: 100%;
}
.om-table th, .om-table td {
  font-size: 13px;
  padding: 8px 10px;
  vertical-align: top;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.om-table th:nth-child(1), .om-table td:nth-child(1) { width: 14%; }
.om-table th:nth-child(2), .om-table td:nth-child(2) { width: 11%; }
.om-table th:nth-child(3), .om-table td:nth-child(3) { width: 9%; }
.om-table th:nth-child(4), .om-table td:nth-child(4) { width: 9%; }
.om-table th:nth-child(5), .om-table td:nth-child(5) { width: 17%; }
.om-table th:nth-child(6), .om-table td:nth-child(6) { width: 22%; }
.om-table th:nth-child(7), .om-table td:nth-child(7) { width: 8%; }
.om-table th:nth-child(8), .om-table td:nth-child(8) { width: 10%; }
.om-table .om-notes {
  white-space: normal;
  word-break: break-word;
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1.5;
}
.om-row--left {
  background: #FAFAFA;
  color: var(--color-text-muted);
}
.om-row--left strong { color: var(--color-text-muted); font-weight: 500; }

.om-form { margin-top: 18px; border-top: 1px dashed var(--color-border); padding-top: 14px; }
.om-form__summary {
  cursor: pointer;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--color-bg-secondary, #F5F5F5);
  list-style: none;
}
.om-form__summary::-webkit-details-marker { display: none; }
.om-form__summary-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.om-form[open] .om-form__summary { background: var(--color-primary-light, #FFF3DC); }
.om-form__body { margin-top: 14px; }
.om-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 6px;
}
.om-form__adv {
  margin-top: 8px;
  font-size: 12px;
  color: var(--color-text-muted);
}
.om-form__adv summary { cursor: pointer; padding: 4px 0; }

@media (max-width: 600px) {
  .om-form__row { grid-template-columns: 1fr; }
  .om-table .om-notes { max-width: none; }
}

/* ============================================================
   訪問後10秒振り返り（visit_edit / show）
   ============================================================ */
.reflect-card {
  background: linear-gradient(180deg, #FFF7E6 0%, #FFFCF5 100%);
  border: 1px solid #F2C46B;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.reflect-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 14px;
}
.reflect-card__icon { font-size: 18px; }
.reflect-card__sub  { font-size: 12px; color: var(--color-text-muted); margin-left: auto; }
.reflect-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}
.reflect-label {
  width: 88px;
  font-weight: 700;
  font-size: 13px;
  color: #6E521A;
  flex: 0 0 88px;
}

.reflect-stars { display: flex; flex-wrap: wrap; gap: 6px; }
.reflect-star {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 6px 8px;
  border: 1.5px solid #E0CDA0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.reflect-star input { display: none; }
.reflect-star__icon {
  font-size: 18px;
  color: #C8B26A;
  line-height: 1;
}
.reflect-star__label {
  font-size: 10.5px;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.reflect-star:hover { border-color: #B8893A; }
.reflect-star.is-active {
  background: #B8893A;
  border-color: #8A5A00;
}
.reflect-star.is-active .reflect-star__icon,
.reflect-star.is-active .reflect-star__label { color: #fff; }
.reflect-star--clear {
  font-size: 14px;
  color: var(--color-text-muted);
  border: 1.5px dashed #DCC8A0;
  background: transparent;
  min-width: 36px;
  padding: 6px;
  cursor: pointer;
}

.reflect-temps { display: flex; gap: 8px; }
.reflect-temp {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 8px 10px;
  border: 1.5px solid #DBD3C0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.reflect-temp input { display: none; }
.reflect-temp__icon { font-size: 16px; font-weight: 800; line-height: 1; }
.reflect-temp__label { font-size: 10.5px; margin-top: 2px; color: var(--color-text-muted); }
.reflect-temp--cold { color: #4A7BB8; }
.reflect-temp--warm { color: #8A5A00; }
.reflect-temp--hot  { color: #C94747; }
.reflect-temp:hover { border-color: currentColor; }
.reflect-temp.is-active.reflect-temp--cold { background: #E8F1FF; border-color: #4A7BB8; }
.reflect-temp.is-active.reflect-temp--warm { background: #FFF7E6; border-color: #8A5A00; }
.reflect-temp.is-active.reflect-temp--hot  { background: #FBE9E9; border-color: #C94747; }
.reflect-temp.is-active .reflect-temp__label { color: inherit; font-weight: 700; }
.reflect-temp--clear {
  border: 1.5px dashed #D8D2C2;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 14px;
  min-width: 36px;
  padding: 6px;
  cursor: pointer;
}

/* show.php / visits.php 用ミニ表示 */
.reflect-mini {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.5px;
  color: #C8A14A;
  font-weight: 700;
}
.reflect-mini--m1 { color: #B89A4A; }
.reflect-mini--m2 { color: #C8A14A; }
.reflect-mini--m3 { color: #D8B85A; }
.reflect-mini--m4 { color: #C49344; }
.reflect-mini--m5 { color: #B86A1A; }

.temp-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: #FAF8F2;
  border: 1px dashed var(--color-border);
  border-radius: 6px;
}
.temp-trend__label {
  font-size: 11.5px;
  color: var(--color-text-muted);
  margin-right: 6px;
  font-weight: 700;
}
.temp-trend__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}
.temp-trend__chip.tt-cold { background: #E8F1FF; color: #4A7BB8; border: 1px solid #7FA8E0; }
.temp-trend__chip.tt-warm { background: #FFF7E6; color: #8A5A00; border: 1px solid #F2C46B; }
.temp-trend__chip.tt-hot  { background: #FBE9E9; color: #C94747; border: 1px solid #E0A0A0; }
.temp-trend__arrow {
  color: var(--color-text-muted);
  font-size: 14px;
  margin: 0 -2px;
}

@media (max-width: 600px) {
  .reflect-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .reflect-label { width: auto; }
  .reflect-stars, .reflect-temps { width: 100%; }
}

/* ============================================================
   休眠店舗アラート（home.php）
   ============================================================ */
.dormant-banner {
  margin: 10px 0 12px;
  background: #FBE9E9;
  border: 1px solid #E0A0A0;
  border-radius: 8px;
  padding: 10px 14px;
}
.dormant-banner__head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.dormant-banner__icon { font-size: 18px; }
.dormant-banner__msg {
  flex: 1 1 auto;
  font-size: 13px;
}
.dormant-banner__msg strong {
  color: #B23E3E;
  font-size: 16px;
  margin-right: 8px;
}
.dormant-banner__sub { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.dormant-pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #fff;
  border: 1px solid #C97A2E;
  color: #B23E3E;
}
.dormant-pill--both { background: #B23E3E; color: #fff; border-color: #B23E3E; }
.dormant-pill--nv   { background: #FFF6E0; color: #C97A2E; border-color: #C97A2E; }
.dormant-pill--drop { background: #FFE7D0; color: #8A4A14; border-color: #C97A2E; }
.dormant-banner__toggle {
  margin-left: auto;
  padding: 5px 12px;
  background: #fff;
  border: 1px solid #B23E3E;
  border-radius: 6px;
  color: #B23E3E;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.dormant-banner__toggle:hover { background: #B23E3E; color: #fff; }

.dormant-banner__list {
  margin-top: 10px;
  background: #fff;
  border-radius: 6px;
  padding: 6px;
}
.dormant-row {
  display: grid;
  grid-template-columns: 50px 1fr 100px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid #F0E5E5;
  font-size: 12.5px;
  text-decoration: none;
  color: var(--color-text);
}
.dormant-row:last-child { border-bottom: none; }
.dormant-row:hover { background: #FFF6E0; }
.dormant-row__rank { display: inline-flex; }
.dormant-row__name { font-weight: 700; }
.dormant-row__office { color: var(--color-text-muted); font-size: 11.5px; }
.dormant-row__meta { color: var(--color-text-muted); font-size: 11.5px; }
.dormant-row__chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  background: #FFF6E0;
  border: 1px solid #C97A2E;
  color: #B23E3E;
  white-space: nowrap;
}
.dormant-row__chip.dormant--both { background: #B23E3E; color: #fff; border-color: #B23E3E; }
.dormant-row__chip.dormant--no-visit { background: #FFF6E0; color: #C97A2E; }
.dormant-row__chip.dormant--info-drop { background: #FFE7D0; color: #8A4A14; }

@media (max-width: 600px) {
  .dormant-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "rank chip"
      "name name"
      "office meta";
    row-gap: 4px;
  }
  .dormant-row__rank { grid-area: rank; }
  .dormant-row__name { grid-area: name; }
  .dormant-row__office { grid-area: office; }
  .dormant-row__meta { grid-area: meta; text-align: right; }
  .dormant-row__chip { grid-area: chip; justify-self: end; }
}

/* ============================================================
   取次店 健全度スコア
   ============================================================ */
.sh-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
  border: 1.5px solid;
  white-space: nowrap;
}
.sh-pill small { font-size: 10px; font-weight: 600; opacity: 0.7; }
.sh-pill.sh-great { background: #EAF5EE; color: #1E5A37; border-color: #7CB392; }
.sh-pill.sh-good  { background: #E8F1FF; color: #1F4E8C; border-color: #7FA8E0; }
.sh-pill.sh-mid   { background: #FFF7E6; color: #8A5A00; border-color: #F2C46B; }
.sh-pill.sh-low   { background: #FBE9E9; color: #B23E3E; border-color: #E0A0A0; }

.store-table__col-health { text-align: center; }

.sh-card {
  border-left: 6px solid #B8893A;
  background: linear-gradient(135deg, #FFF7E6 0%, #FFFCF5 100%);
}
.sh-card--great { border-left-color: #1E5A37; color: #1E5A37; }
.sh-card--good  { border-left-color: #1F4E8C; color: #1F4E8C; }
.sh-card--mid   { border-left-color: #8A5A00; color: #8A5A00; }
.sh-card--low   { border-left-color: #B23E3E; color: #B23E3E; }

.sh-card__main {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.sh-card__circle {
  position: relative;
  width: 120px; height: 120px;
  flex-shrink: 0;
}
.sh-card__svg { width: 100%; height: 100%; }
.sh-card__num {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  line-height: 1;
}
.sh-card__num strong { font-size: 32px; font-weight: 800; }
.sh-card__num small { font-size: 11px; opacity: 0.7; margin-top: 2px; }

.sh-card__body { flex: 1 1 320px; min-width: 0; color: var(--color-text); }
.sh-card__title-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 4px;
}
.sh-card__title { margin: 0; font-size: 18px; }
.sh-card__sub {
  font-size: 12px; color: var(--color-text-muted);
  margin: 4px 0 12px;
}

.sh-axes {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}
.sh-axis {
  background: #fff;
  border: 1px solid #E5DCC8;
  border-radius: 6px;
  padding: 8px 10px;
}
.sh-axis__label {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
  font-weight: 700;
}
.sh-axis__bar {
  height: 6px;
  background: #F0E7D2;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 4px;
}
.sh-axis__bar-fill {
  display: block;
  height: 100%;
  background: currentColor;
  border-radius: 999px;
  transition: width 0.4s;
}
.sh-axis__num {
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.sh-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11.5px;
  color: var(--color-text-muted);
  border-top: 1px dashed #E5DCC8;
  padding-top: 8px;
}
.sh-detail span { white-space: nowrap; }

@media (max-width: 700px) {
  .sh-axes { grid-template-columns: 1fr 1fr; }
  .sh-card__circle { width: 100px; height: 100px; }
  .sh-card__num strong { font-size: 26px; }
}

/* ============================================================
   名刺スキャン（show.php 組織メンバー追加）
   ============================================================ */
.om-scan {
  background: linear-gradient(135deg, #FFF7E6 0%, #FFFCF5 100%);
  border: 1.5px dashed #C8A14A;
  border-radius: 8px;
  padding: 14px 16px;
  margin: 12px 0 14px;
  text-align: center;
}
.om-scan__btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 20px;
  background: #fff;
  border: 1.5px solid #B8893A;
  border-radius: 8px;
  color: #8A5A00;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
  user-select: none;
}
.om-scan__btn:hover {
  background: #B8893A;
  color: #fff;
}
.om-scan__icon { font-size: 22px; }
.om-scan__sub { font-size: 10.5px; opacity: 0.75; font-weight: 500; }
.om-scan__status {
  margin-top: 10px;
  font-size: 12.5px;
  padding: 6px 10px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--color-border);
}
.om-scan__status.is-loading { background: #FFF7E6; color: #8A5A00; border-color: #F2C46B; }
.om-scan__status.is-success { background: #EAF5EE; color: #1E5A37; border-color: #7CB392; }
.om-scan__status.is-error   { background: #FBE9E9; color: #B23E3E; border-color: #E0A0A0; }

/* ============================================================
   ナレッジ共有
   ============================================================ */
.kn-filter { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.kn-filter__cats { display: flex; gap: 6px; flex-wrap: wrap; }
.kn-filter__search { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.kn-filter__search .form-input { width: 200px; }

.kn-cat {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1.5px solid var(--color-border);
  background: #fff;
  color: var(--color-text-muted);
  text-decoration: none;
  white-space: nowrap;
}
.kn-cat:hover { background: #FFF7E6; }
.kn-cat.is-active { border-color: #B8893A; color: #8A5A00; background: #FFF7E6; }
.kn-cat.kn-cat-success { color: #1E5A37; border-color: #7CB392; }
.kn-cat.kn-cat-howto   { color: #1F4E8C; border-color: #7FA8E0; }
.kn-cat.kn-cat-lesson  { color: #B23E3E; border-color: #E0A0A0; }
.kn-cat.kn-cat-other   { color: #5A4F3A; border-color: #C8B26A; }

.kn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.kn-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.kn-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.kn-card__inner {
  display: block;
  padding: 12px 14px;
  text-decoration: none;
  color: var(--color-text);
}
.kn-card__head { display: flex; justify-content: space-between; margin-bottom: 6px; }
.kn-pin { font-size: 14px; }
.kn-card__title { font-size: 14.5px; font-weight: 700; margin: 4px 0 6px; line-height: 1.4; color: var(--color-text); }
.kn-card__body  { font-size: 12px; color: var(--color-text-muted); line-height: 1.5; margin-bottom: 8px; }
.kn-card__meta {
  display: flex; gap: 8px; flex-wrap: wrap;
  font-size: 11px; color: var(--color-text-muted);
  border-top: 1px dashed var(--color-border);
  padding-top: 6px;
}
.kn-card__date { margin-left: auto; }
.kn-card__stats { display: flex; gap: 10px; font-size: 12px; margin-top: 6px; color: #8A5A00; }

.kn-post__store {
  font-size: 13px;
  background: #FFF7E6;
  padding: 6px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
}
.kn-post__body {
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-text);
}
.kn-post__body p { margin: 6px 0; }
.kn-post__body ul { padding-left: 22px; }
.kn-post__body strong { color: #8A5A00; }
.kn-post__actions { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--color-border); }
.kn-like-btn {
  background: #fff;
  border: 1.5px solid #E0A0A0;
  color: #B23E3E;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.kn-like-btn:hover { background: #FBE9E9; }
.kn-like-btn.is-liked { background: #C94747; color: #fff; border-color: #C94747; }
.kn-like-btn strong { font-size: 14px; }

.kn-comments { margin-bottom: 14px; }
.kn-comment {
  border-bottom: 1px solid var(--color-border);
  padding: 10px 0;
}
.kn-comment:last-child { border-bottom: none; }
.kn-comment__head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
  font-size: 12px;
}
.kn-comment__body { font-size: 13px; color: var(--color-text); }
.kn-comment-form {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--color-border);
}

/* ============================================================
   月初ヒアリング 入居見込
   ============================================================ */
.fc-progress-card { padding: 14px 16px; }
.fc-progress-card.is-overdue { background: #FBE9E9; border-left: 4px solid #B23E3E; }
.fc-progress-card__head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.fc-progress-card__head .card__title { margin: 0; }
.fc-progress-card__pct { font-size: 13px; color: var(--color-text-muted); font-weight: 500; }
.fc-progress-card__bar {
  width: 100%; height: 10px;
  background: #F0E7D2;
  border-radius: 999px;
  overflow: hidden;
}
.fc-progress-card__bar--row { height: 6px; max-width: 200px; }
.fc-progress-card__bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #C97A2E, #1E5A37);
  border-radius: 999px;
  transition: width 0.3s;
}

.fc-table .fc-input {
  width: 80px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.fc-row--filled td { background: #FCFAF4; }
.fc-row--empty td { background: #FFF; }
.fc-row--empty .fc-input { border-color: #C97A2E; background: #FFF6E0; }
.fc-row--overdue td { background: #FBE9E9; }

.home-fc-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px;
  background: #FFF6E0;
  border: 1px solid #FFD7A8;
  border-radius: 8px;
  margin: 8px 0 12px;
  font-size: 13px;
}
.home-fc-banner.is-overdue { background: #FBE9E9; border-color: #E0A0A0; }
.home-fc-banner__icon { font-size: 18px; }
.home-fc-banner__msg strong { color: #C97A2E; font-size: 16px; margin-right: 4px; }
.home-fc-banner.is-overdue .home-fc-banner__msg strong { color: #B23E3E; }
.home-fc-banner__btn {
  margin-left: auto;
  padding: 6px 14px;
  background: #C97A2E;
  color: #FFF;
  border-radius: 6px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}
.home-fc-banner.is-overdue .home-fc-banner__btn { background: #B23E3E; }
.home-fc-banner__btn:hover { filter: brightness(0.95); text-decoration: none; }

/* ============================================================
   オリジナルアイコン（Canva 生成、ブランド統一）
   ============================================================ */
.ico {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.18em;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  font-style: normal;
  flex-shrink: 0;
}
.ico--md { width: 20px; height: 20px; vertical-align: middle; }
.ico--lg { width: 32px; height: 32px; vertical-align: middle; }
.ico--xl { width: 48px; height: 48px; vertical-align: middle; }
.ico--ai        { background-image: url("../icons/ai_advisor.png"); }
.ico--announce  { background-image: url("../icons/announce.png"); }
.ico--dormant   { background-image: url("../icons/dormant.png"); }
.ico--report    { background-image: url("../icons/report.png"); }
.ico--trophy    { background-image: url("../icons/trophy.png"); }
.ico--tip       { background-image: url("../icons/tip.png"); }
.ico--lesson    { background-image: url("../icons/lesson.png"); }
.ico--pin       { background-image: url("../icons/pin.png"); }
.ico--camera    { background-image: url("../icons/camera.png"); }
.ico--warning   { background-image: url("../icons/warning.png"); }
.ico--thermometer { background-image: url("../icons/thermometer.png"); }
.ico--analytics { background-image: url("../icons/analytics.png"); }
.ico--target    { background-image: url("../icons/target.png"); }
.ico--location  { background-image: url("../icons/location.png"); }
.ico--search    { background-image: url("../icons/search.png"); }
.ico--printer   { background-image: url("../icons/printer.png"); }
.ico--manual    { background-image: url("../icons/manual.png"); }

/* ============================================================
   ホーム：🤖 直近のおすすめアクション
   ============================================================ */
.home-advisor {
  margin: 8px 0 14px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #FFF9D6 0%, #FFFCF5 100%);
  border: 1px solid #DCC8A0;
  border-radius: 10px;
}
.home-advisor__head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 8px;
}
.home-advisor__title { font-size: 15px; font-weight: 800; color: #8A5A00; margin: 0; }
.home-advisor__mode  { font-size: 11.5px; font-weight: 500; color: var(--color-text-muted); }
.home-advisor__more  {
  font-size: 12px; color: #8A5A00; font-weight: 700; text-decoration: none;
}
.home-advisor__more:hover { text-decoration: underline; }
.home-advisor__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.home-advisor__row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-left: 4px solid #C8B26A;
  border-radius: 8px;
  text-decoration: none;
  color: var(--color-text);
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}
.home-advisor__row:hover {
  background: #FFFCF5;
  transform: translateX(2px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.home-advisor__row.is-done { opacity: 0.5; }
.home-advisor__row--p1 { border-left-color: #B23E3E; }
.home-advisor__row--p2 { border-left-color: #C97A2E; }
.home-advisor__row--p3 { border-left-color: #7CB392; }

.home-advisor__row-icon {
  font-size: 16px;
  text-align: center;
  color: #8A5A00;
}
.home-advisor__row--p1 .home-advisor__row-icon { color: #B23E3E; }
.home-advisor__row--p3 .home-advisor__row-icon { color: #1E5A37; }

.home-advisor__row-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}
.home-advisor__row-title {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--color-text);
}
.home-advisor__row-line {
  font-size: 11.5px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-advisor__row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--color-text-muted);
  white-space: nowrap;
}
.home-advisor__row-store { color: #1F4E8C; }
.home-advisor__row-chev {
  font-size: 18px;
  line-height: 1;
  color: var(--color-text-muted);
  font-weight: 600;
}

@media (max-width: 600px) {
  .home-advisor__row { padding: 8px 10px; }
  .home-advisor__row-store { display: none; }
}

/* ============================================================
   モバイル最適化（担当者ロール中心 / max-width: 768px）
   ============================================================ */
@media (max-width: 768px) {

  /* 共通：タップ域・余白の最適化 */
  .btn { min-height: 44px; padding: 10px 16px; }
  .btn--sm { min-height: 38px; padding: 8px 12px; }
  .form-input, .form-select, .form-textarea {
    font-size: 16px;
    min-height: 44px;
  }
  textarea.form-textarea { min-height: 80px; }

  .admin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 12px;
  }
  .admin-header__title { font-size: 18px; }
  .admin-header__sub { font-size: 12px; }
  .admin-toolbar { width: 100%; flex-wrap: wrap; gap: 6px; }
  .admin-toolbar .btn { flex: 1 1 auto; }

  .card { padding: 12px; }
  .card__title { font-size: 16px; }
  .card__subtitle { font-size: 12px; }

  /* ホーム：3バナー圧縮 */
  .home-greeting { font-size: 18px; line-height: 1.4; }
  .home-ann-banner,
  .home-fc-banner,
  .dormant-banner {
    padding: 8px 12px;
    font-size: 12.5px;
    margin: 6px 0;
  }
  .home-ann-banner__msg strong,
  .home-fc-banner__msg strong { font-size: 14px; }
  .home-ann-banner__btn,
  .home-fc-banner__btn {
    flex: 0 0 auto;
    margin-left: auto;
    padding: 6px 10px;
    font-size: 11.5px;
  }
  .dormant-banner__head { gap: 6px; }
  .dormant-banner__msg strong { font-size: 14px; }
  .dormant-pill { font-size: 10.5px; padding: 1px 6px; }
  .dormant-banner__toggle {
    flex: 0 0 100%;
    margin: 4px 0 0;
    text-align: center;
  }

  /* 取次店一覧：テーブル → 2行カード（コンパクト版） */
  .store-table__scroll { overflow: visible; }
  .store-table { display: block; width: 100%; border: none; }
  .store-table thead { display: none; }
  .store-table tbody { display: block; }
  .store-table tr {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    grid-template-areas:
      "rank name health"
      "rank meta visit";
    column-gap: 8px;
    row-gap: 2px;
    padding: 9px 10px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 6px;
    background: #fff;
    align-items: center;
  }
  .store-table td { display: block; padding: 0; border: none; }
  .store-table__col-rank   { grid-area: rank; align-self: center; }
  .store-table__col-rank .badge {
    width: 28px; height: 28px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; padding: 0; border-radius: 50%;
  }
  .store-table__col-name   { grid-area: name; min-width: 0; }
  .store-table__col-name a {
    font-size: 14px; font-weight: 700;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block;
  }
  .store-table__col-health { grid-area: health; text-align: right; align-self: center; }
  .store-table__col-meta {
    grid-area: meta;
    font-size: 11px;
    color: var(--color-text-muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .store-table__col-visit {
    grid-area: visit;
    font-size: 11px;
    color: var(--color-text-muted);
    text-align: right;
    white-space: nowrap;
  }
  .store-table__col-rel { display: none; }
  .store-table__col-primary { display: none; }
  .store-table__col-alert { display: none; }
  .store-table__col-action { display: none; }
  .store-table tr.store-row--mine { border-left: 3px solid #B8893A; }
  .store-table .sh-pill { font-size: 11px; padding: 1px 7px; }

  /* 取次店詳細 */
  .sh-card__main { gap: 14px; }
  .sh-card__circle { width: 90px; height: 90px; }
  .sh-card__num strong { font-size: 24px; }
  .sh-axes { grid-template-columns: 1fr 1fr; gap: 6px; }
  .sh-axis { padding: 6px 8px; }
  .sh-axis__label { font-size: 10.5px; }
  .sh-detail { font-size: 11px; gap: 6px; }

  /* 組織メンバー：テーブル → カード化 */
  .om-table { display: block; }
  .om-table thead { display: none; }
  .om-table tbody { display: block; }
  .om-table tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 8px;
    padding: 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    margin-bottom: 6px;
    background: #fff;
  }
  .om-table td { display: block; padding: 0; border: none; }
  .om-table td::before {
    content: attr(data-label) "：";
    color: var(--color-text-muted);
    font-size: 10.5px;
    font-weight: 700;
    margin-right: 4px;
  }
  .om-table td[data-label="役職"]::before,
  .om-table td[data-label="氏名"]::before { display: none; }
  .om-table td[data-label="役職"] { font-size: 11.5px; color: var(--color-text-muted); }
  .om-table td[data-label="氏名"] { font-size: 14px; font-weight: 700; }
  .om-table td[data-label="状態"] { grid-column: 2; grid-row: 1; text-align: right; }
  .om-table td[data-label="操作"] { grid-column: 1 / -1; display: flex; gap: 6px; }
  .om-table td[data-label="操作"]::before { display: none; }

  .visits-table__scroll { -webkit-overflow-scrolling: touch; }
  .visits-table { font-size: 12px; }
  .visits-table th, .visits-table td { padding: 6px 8px; }

  .keyperson-card__body { flex-wrap: wrap; }
  .keyperson-card__avatar { width: 36px; height: 36px; font-size: 14px; }
  .keyperson-card__name { font-size: 14px; }

  /* チェックリスト */
  .ck-pill {
    width: 36px !important;
    height: 36px !important;
    font-size: 18px;
  }
  .ck-rating { gap: 6px; }
  .ck-info__head { flex-wrap: wrap; }
  .ck-item__title { font-size: 13.5px; }
  .ck-info__desc { font-size: 11.5px; white-space: normal; }
  .ck-category { padding: 10px; }
  .ck-category__head { gap: 8px; }
  .ck-category__title { font-size: 14px; }

  /* 訪問履歴入力（10秒振り返り） */
  .reflect-card { padding: 10px 12px; }
  .reflect-card__head { flex-wrap: wrap; }
  .reflect-card__sub { width: 100%; margin-left: 0; font-size: 11px; }
  .reflect-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .reflect-label { width: auto; flex: none; font-size: 12px; }
  .reflect-stars, .reflect-temps { display: flex; gap: 4px; }
  .reflect-star { min-width: 0; flex: 1 1 0; padding: 6px 4px; }
  .reflect-star__icon { font-size: 16px; }
  .reflect-star__label { font-size: 9.5px; }
  .reflect-star--clear { flex: 0 0 36px; }
  .reflect-temp { flex: 1 1 0; padding: 8px 6px; }

  /* 入居見込：テーブル → 縦並びカード */
  .fc-table { display: block; }
  .fc-table thead { display: none; }
  .fc-table tbody { display: block; }
  .fc-table tr {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "name rank"
      "office office"
      "input input"
      "meta meta";
    gap: 4px 8px;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 8px;
    background: #fff;
  }
  .fc-table td { display: block; padding: 0; border: none; }
  .fc-table tr td:nth-child(1) { grid-area: name; font-size: 14px; font-weight: 700; }
  .fc-table tr td:nth-child(2) { grid-area: rank; }
  .fc-table tr td:nth-child(3) { grid-area: office; font-size: 11px; color: var(--color-text-muted); }
  .fc-table tr td:nth-child(4) { grid-area: input; }
  .fc-table tr td:nth-child(4) .fc-input {
    width: 100%; height: 48px; font-size: 18px; text-align: center;
  }
  .fc-table tr td:nth-child(4)::before {
    content: "当月の入居見込";
    display: block;
    font-size: 11px;
    color: var(--color-text-muted);
    margin-bottom: 4px;
    font-weight: 700;
  }
  .fc-table tr td:nth-child(5),
  .fc-table tr td:nth-child(6) {
    grid-area: meta;
    display: inline-block;
    font-size: 10.5px;
    color: var(--color-text-muted);
  }
  .fc-row--empty { border-color: #C97A2E; background: #FFF6E0; }
  .fc-progress-card { padding: 10px 12px; }
  .fc-progress-card__head { gap: 6px; }
  .fc-progress-card__head .card__title { font-size: 14px; }

  /* 成長グラフ */
  .growth-grid { grid-template-columns: 1fr; gap: 12px; }
  .growth-cell { padding: 10px; }
  .growth-cell__num { font-size: 18px; }
  .growth-svg { height: 70px; }
  .growth-cell__axis { font-size: 9px; }
  .growth-cell__axis span:nth-child(odd) { visibility: hidden; }
  .growth-risk__head { gap: 8px; }
  .growth-risk__bar { min-width: 0; height: 8px; }

  /* 月次レポート */
  .report-paper { padding: 14px 12px; margin: 8px 0; }
  .report-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .report-head__title { font-size: 18px; }
  .report-kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .report-kpi { padding: 8px 10px; }
  .report-kpi__num { font-size: 18px; }
  .report-temp-grid { grid-template-columns: 1fr; gap: 8px; }
  .report-table { font-size: 11px; }
  .report-table th, .report-table td { padding: 4px 6px; }

  /* ナレッジ共有 */
  .kn-grid { grid-template-columns: 1fr; }
  .kn-filter { flex-direction: column; align-items: stretch; gap: 8px; }
  .kn-filter__cats { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
  .kn-filter__search { margin-left: 0; flex-wrap: wrap; }
  .kn-filter__search .form-input { flex: 1 1 auto; width: auto; }
  .kn-like-btn { width: 100%; }
  .kn-comment-form .form-textarea { min-height: 80px; }

  /* 名刺スキャン */
  .om-scan { padding: 10px; }
  .om-scan__btn { width: 100%; padding: 12px; }

  /* AB店舗比較 */
  .ab-table { font-size: 11.5px; }
  .ab-table th, .ab-table td { padding: 5px 6px; }
  .ab-store-list li { font-size: 12px; padding: 3px 4px; }

  /* 関係温度トレンド */
  .temp-trend { font-size: 11px; padding: 6px 10px; flex-wrap: wrap; }
  .temp-trend__chip { width: 20px; height: 20px; font-size: 10px; }
}

@media (max-width: 380px) {
  .sh-axes { grid-template-columns: 1fr; }
  .reflect-star__label { display: none; }
  .reflect-temp__label { font-size: 9.5px; }
  .home-fc-banner__btn,
  .home-ann-banner__btn { width: 100%; margin-left: 0; text-align: center; }
}
