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

:root {
 --primary: #2563eb; /* blue-600（MUST-ONEロゴ青、デフォルト） */
 --primary-dark: #1d4ed8;
 --primary-light: #dbeafe;
 --accent: #0ea5e9;
 --accent-2: #38bdf8;
 --success: #64c465;
 --success-dark: #4ea84f;
 --warning: #f59e0b;
 --danger: #ef4444;
 --neutral: #64748b;
 --ai: #7c3aed;
 --ai-light: #ede9fe;
 --ai-dark: #6d28d9;
 --score-high: #16a34a;
 --score-mid: #f59e0b;
 --score-low: #ef4444;
 --text: #1e293b;
 --text-sub: #64748b;
 --text-muted: #94a3b8;
 --border: #e2e8f0;
 --bg: #f8fafc;
 --bg-card: #ffffff;
 --bg-soft: #fafbfc;
 --bg-alt: #f1f5f9;
 --bg-sidebar: #0f172a;
 --bg-sidebar-hover: #1e293b;
 --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
 --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
 --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
 --radius: 10px;
 --radius-sm: 6px;
}

/* ============ ダークモード ============ */
body.dark {
 --text: #f1f5f9;
 --text-sub: #cbd5e1;
 --text-muted: #94a3b8;
 --border: #334155;
 --bg: #0f172a;
 --bg-card: #1e293b;
 --bg-soft: #1e293b;
 --bg-alt: #334155;
 --bg-sidebar: #020617;
 --bg-sidebar-hover: #1e293b;
 --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
 --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5), 0 4px 6px -4px rgba(0,0,0,0.4);
}
body.dark .topbar { background: var(--bg-card); border-color: var(--border); }
body.dark .search input { background: var(--bg); color: var(--text); border-color: var(--border); }
body.dark .btn-secondary,
body.dark .btn-icon { background: var(--bg); color: var(--text); border-color: var(--border); }
body.dark .crm-filter,
body.dark .crm-pagination,
body.dark .kanban-col,
body.dark .alert-info { background: var(--bg-alt); }
body.dark .alert-warning { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
body.dark .alert-danger { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
body.dark .crm-table thead th,
body.dark table.std th { background: var(--bg-alt); color: var(--text-sub); }
body.dark .crm-table tbody tr:hover,
body.dark table.std tr:hover { background: rgba(37, 99, 235, 0.15); }
body.dark .lib-card,
body.dark .form-card,
body.dark .process-step-card,
body.dark .knowledge-card { background: var(--bg-card); }
body.dark .form-input,
body.dark .form-select,
body.dark .form-textarea,
body.dark .field-input,
body.dark .field-select,
body.dark .field-textarea,
body.dark .filter-search,
body.dark .crm-table .link,
body.dark input,
body.dark select,
body.dark textarea { background: var(--bg-alt); color: var(--text); border-color: var(--border); }
body.dark .cal-cell { background: var(--bg-card); }
body.dark .cal-cell.head { background: var(--bg-alt); }
body.dark .insight,
body.dark .ai-suggestion {
 background: linear-gradient(135deg, rgba(124, 58, 237, 0.15) 0%, rgba(109, 40, 217, 0.15) 100%);
 border-color: rgba(124, 58, 237, 0.3);
}
body.dark .merge-row .before { background: rgba(239, 68, 68, 0.1); color: #fecaca; }
body.dark .merge-row .before.unchanged,
body.dark .merge-row .before.added { background: var(--bg-alt); color: var(--text-muted); }
body.dark .merge-row .after { background: rgba(37, 99, 235, 0.15); }
body.dark .url-input-block { background: var(--bg-alt); }
body.dark .meeting-status-pill { background: var(--bg-alt); }
body.dark .meeting-status-pill.done { background: rgba(37, 99, 235, 0.2); }
body.dark .lib-upload-card { background: var(--bg-alt); border-color: var(--border); }
body.dark .lib-pill { background: var(--bg-alt); }
body.dark .kanban-card { background: var(--bg-card); }
body.dark .lib-card-thumb-badge { background: var(--bg-card); color: var(--text); }
body.dark .lib-card-fav { background: var(--bg-card); }
body.dark .lib-card-actions { background: var(--bg-alt); }
body.dark .detail-panel { background: var(--bg-card); }
body.dark .detail-header { background: var(--bg-card); }
body.dark .collapse-head { background: var(--bg-alt); }
body.dark .collapse-body { background: var(--bg-card); }
body.dark .chip { background: rgba(37, 99, 235, 0.25); color: var(--accent-2); }
body.dark .chip-input { background: var(--bg-alt); }

html, body {
 font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI",
 "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
 color: var(--text);
 background: #1e293b;
 font-size: 14px;
 line-height: 1.5;
 -webkit-font-smoothing: antialiased;
}

.app {
 display: grid;
 grid-template-columns: 180px 1fr;
 min-height: 100vh;
 transition: grid-template-columns 0.22s ease;
}
.app.sidebar-collapsed { grid-template-columns: 64px 1fr; }

/* サイドバー折りたたみ時：アイコンのみ表示 */
.app.sidebar-collapsed .sidebar { overflow-x: hidden; }
.app.sidebar-collapsed .nav-fav-header,
.app.sidebar-collapsed .nav-fav-list,
.app.sidebar-collapsed .nav-group,
.app.sidebar-collapsed .nav-item .nav-text,
.app.sidebar-collapsed .nav-item .nav-badge,
.app.sidebar-collapsed .user-info { display: none; }

/* サイドバーヘッダー（ロゴ + 名前 + トグル） */
.sidebar-header {
 display: flex;
 align-items: center;
 gap: 10px;
 padding: 10px 14px 8px;
 position: relative;
}
.sidebar-brand {
 display: flex;
 align-items: center;
 gap: 10px;
 flex: 1;
 min-width: 0;
 transition: opacity .15s;
}
.sidebar-brand-logo {
 width: 26px;
 height: 26px;
 display: flex;
 align-items: center;
 justify-content: center;
 flex-shrink: 0;
}
.sidebar-brand-logo img,
.sidebar-brand-logo svg { width: 26px; height: 26px; display: block; object-fit: contain; }
.sidebar-brand { gap: 8px; }
.sidebar-brand-name { font-size: 14px; }
.sidebar-brand-name {
 color: #fff;
 font-weight: 700;
 font-size: 15px;
 letter-spacing: 0.02em;
 white-space: nowrap;
 overflow: hidden;
 text-overflow: ellipsis;
}
.sidebar-toggle {
 background: transparent;
 border: none;
 width: 30px;
 height: 30px;
 border-radius: 6px;
 cursor: pointer;
 color: #94a3b8;
 display: flex;
 align-items: center;
 justify-content: center;
 padding: 0;
 transition: background .15s, color .15s, opacity .15s;
 flex-shrink: 0;
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.08); color: #fff; }

/* 折りたたみ時：ロゴ中央寄せ、ホバーでトグルに切替 */
.app.sidebar-collapsed .sidebar-header {
 padding: 14px 0 12px;
 justify-content: center;
}
.app.sidebar-collapsed .sidebar-brand {
 flex: none;
 justify-content: center;
}
.app.sidebar-collapsed .sidebar-brand-name { display: none; }
.app.sidebar-collapsed .sidebar-toggle {
 position: absolute;
 top: 50%;
 left: 50%;
 transform: translate(-50%, -50%);
 opacity: 0;
 pointer-events: none;
}
.app.sidebar-collapsed .sidebar-header:hover .sidebar-brand { opacity: 0; }
.app.sidebar-collapsed .sidebar-header:hover .sidebar-toggle {
 opacity: 1;
 pointer-events: auto;
}

/* 折りたたみ時の nav-item を円形に */
.app.sidebar-collapsed .nav-item {
 justify-content: center;
 padding: 0;
 width: 40px;
 height: 40px;
 margin: 4px auto;
 border-radius: 50%;
 transition: background .15s;
}
.app.sidebar-collapsed .nav-item:hover {
 background: rgba(255, 255, 255, 0.08);
}
.app.sidebar-collapsed .nav-item.active {
 background: rgba(255, 255, 255, 0.18);
}
.app.sidebar-collapsed .nav { padding: 6px 0; }
.app.sidebar-collapsed .nav-item .nav-icon { margin: 0; }

/* 折りたたみ時、グループ間に区切り線（ホーム/営業 などの境目） */
.app.sidebar-collapsed .nav-item[data-view="meeting"] {
 margin-top: 12px;
 position: relative;
}
.app.sidebar-collapsed .nav-item[data-view="meeting"]::before {
 content: '';
 position: absolute;
 top: -8px;
 left: 12px;
 right: 12px;
 height: 1px;
 background: rgba(255, 255, 255, 0.1);
}
.app.sidebar-collapsed .nav-item[data-view="strategy"] {
 margin-top: 12px;
 position: relative;
}
.app.sidebar-collapsed .nav-item[data-view="strategy"]::before {
 content: '';
 position: absolute;
 top: -8px;
 left: 12px;
 right: 12px;
 height: 1px;
 background: rgba(255, 255, 255, 0.1);
}

.app.sidebar-collapsed .user-card {
 justify-content: center;
 padding: 14px 0;
}


/* ============ Sidebar (DealHub-like) ============ */
.sidebar {
 background: #1e293b;
 color: #cbd5e1;
 display: flex;
 flex-direction: column;
 padding: 0;
 position: sticky;
 top: 0;
 height: 100vh;
 overflow-y: auto;
 scrollbar-width: none; /* Firefox */
 -ms-overflow-style: none; /* IE/Edge */
}
.sidebar::-webkit-scrollbar { display: none; width: 0; height: 0; }
.sidebar .nav-bottom {
 margin-top: auto;
 border-top: 1px solid rgba(255,255,255,0.08);
 padding: 8px 8px;
}
.app.sidebar-collapsed .nav-bottom { padding: 8px 0; }
.nav-fav-list-inline:empty { display: none; }
.nav-fav-list-inline { padding: 4px 8px 8px; }
.app.sidebar-collapsed .nav-fav-list-inline { display: none; }

.brand {
 display: flex;
 align-items: center;
 gap: 8px;
 padding: 18px 18px;
 border-bottom: 1px solid #1e293b;
 margin-bottom: 4px;
}
.brand-logo {
 width: 28px; height: 28px;
 background: transparent;
 border: none;
 color: #fff;
 display: grid;
 place-items: center;
 flex-shrink: 0;
}
.brand-logo svg { width: 28px; height: 28px; display: block; }
.brand-title {
 color: #fff;
 font-weight: 800;
 font-size: 17px;
 letter-spacing: 0.02em;
 font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", sans-serif;
}
.brand-sub {
 color: #64748b;
 font-size: 11px;
}

.nav-fav-header {
 display: flex;
 align-items: center;
 gap: 8px;
 padding: 18px 18px 8px;
 font-size: 13px;
 font-weight: 700;
 color: #fbbf24;
}

/* トップバー左端の SalesFlow ロゴ */
.topbar-brand {
 display: flex;
 align-items: center;
 gap: 8px;
 padding-right: 18px;
 flex-shrink: 0;
}
.topbar-brand-logo {
 width: 34px;
 height: 34px;
 display: flex;
 align-items: center;
 justify-content: center;
}
.topbar-brand-logo svg { width: 34px; height: 34px; display: block; }
.topbar-brand-name {
 font-size: 16px;
 font-weight: 700;
 color: var(--text);
 letter-spacing: 0.01em;
 display: inline-flex;
 align-items: baseline;
 gap: 4px;
}
.topbar-brand-suffix {
 font-size: 11px;
 font-weight: 700;
 color: var(--primary);
 background: var(--primary-light);
 padding: 2px 6px;
 border-radius: 4px;
 letter-spacing: 0.04em;
}
.nav-fav-icon { font-size: 14px; }
.nav-fav-hint {
 margin-left: auto;
 width: 16px; height: 16px;
 border-radius: 50%;
 background: #1e293b;
 color: #94a3b8;
 font-size: 10px;
 font-weight: 600;
 display: grid;
 place-items: center;
 cursor: help;
}

.nav-fav-list {
 display: flex;
 flex-direction: column;
 gap: 1px;
 padding: 0 8px 4px;
}
.nav-fav-list .nav-item { padding-left: 14px; }
.nav-fav-list:empty { display: none; }
.nav-fav-empty {
 font-size: 11px;
 color: #475569;
 padding: 4px 14px 8px;
 font-style: italic;
}

/* ============ 右クリック文脈メニュー ============ */
.ctx-menu {
 position: fixed;
 background: #1e293b;
 border: 1px solid #334155;
 border-radius: 6px;
 padding: 4px;
 z-index: 1000;
 min-width: 200px;
 box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.ctx-item {
 padding: 8px 12px;
 font-size: 13px;
 color: #cbd5e1;
 cursor: pointer;
 border-radius: 4px;
 display: flex;
 align-items: center;
 gap: 8px;
 white-space: nowrap;
}
.ctx-item:hover { background: #334155; color: #fff; }

.nav { display: flex; flex-direction: column; gap: 1px; flex: 1; padding: 0 8px 8px; }
.nav-group {
 font-size: 10px;
 color: #64748b;
 letter-spacing: 0.05em;
 padding: 14px 10px 6px;
 font-weight: 600;
}
.nav-item {
 display: flex;
 align-items: center;
 gap: 12px;
 padding: 10px 10px;
 color: #cbd5e1;
 text-decoration: none;
 border-radius: 8px;
 font-size: 13.5px;
 transition: all 0.15s;
 position: relative;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-item.active {
 background: rgba(255, 255, 255, 0.12);
 color: #fff;
 font-weight: 600;
}
.nav-icon {
 width: 22px;
 height: 20px;
 display: grid;
 place-items: center;
 flex-shrink: 0;
}
.nav-icon .ic {
 width: 18px;
 height: 18px;
 stroke: currentColor;
 stroke-width: 1.6;
 stroke-linecap: round;
 stroke-linejoin: round;
 fill: none;
 display: block;
}
.nav-text { flex: 1; }
.nav-badge {
 background: #ef4444;
 color: #fff;
 font-size: 10px;
 font-weight: 700;
 min-width: 18px;
 height: 18px;
 padding: 0 5px;
 border-radius: 9px;
 display: grid;
 place-items: center;
}
/* .nav-star 廃止（右クリックメニューでお気に入り化） */

.user-card {
 display: flex;
 align-items: center;
 gap: 10px;
 padding: 12px 14px;
 background: #0f172a;
 border-top: 1px solid #1e293b;
 margin-top: 8px;
}
.user-avatar {
 width: 34px; height: 34px;
 background: var(--primary);
 border-radius: 50%;
 display: grid;
 place-items: center;
 color: #fff;
 font-weight: 600;
}
.user-name { color: #fff; font-size: 13px; font-weight: 600; }
.user-role { color: #94a3b8; font-size: 11px; }

/* ============ Main ============ */
.main { display: flex; flex-direction: column; min-width: 0; background: #1f2937; }

.topbar {
 display: flex;
 align-items: center;
 justify-content: space-between;
 background: #fff;
 padding: 6px 16px;
 position: sticky;
 top: 0;
 z-index: 10;
}
.topbar.no-ctx-nav { border-bottom: 1px solid var(--border); }

/* Addness風 細いトップバー */
.topbar.topbar-slim {
 background: #1f2937;
 padding: 0 16px;
 height: 48px;
 gap: 14px;
 border-bottom: 1px solid rgba(255,255,255,0.06);
}
.topbar.topbar-slim .topbar-menu-btn {
 background: transparent;
 border: none;
 color: #fff;
 width: 32px;
 height: 32px;
 display: flex; align-items: center; justify-content: center;
 cursor: pointer;
 border-radius: 6px;
 opacity: 0.9;
}
.topbar.topbar-slim .topbar-menu-btn:hover { background: rgba(255,255,255,0.08); }
.topbar.topbar-slim .topbar-search-wrap {
 flex: 1;
 max-width: 720px;
 margin: 0 auto;
}
.topbar.topbar-slim .search {
 background: rgba(255,255,255,0.08);
 border-radius: 99px;
 padding: 0 14px 0 36px;
 height: 32px;
 display: flex; align-items: center;
}
.topbar.topbar-slim .search input {
 background: transparent;
 border: none;
 outline: none;
 color: #fff;
 font-size: 13px;
 width: 100%;
 height: 100%;
}
.topbar.topbar-slim .search input::placeholder { color: rgba(255,255,255,0.55); }
.topbar.topbar-slim .topbar-search-icon {
 position: absolute;
 left: 14px;
 top: 50%;
 transform: translateY(-50%);
 color: rgba(255,255,255,0.7);
 pointer-events: none;
}
.topbar.topbar-slim .topbar-streak {
 display: flex; align-items: center; gap: 5px;
 background: rgba(255,255,255,0.08);
 color: #fff;
 padding: 5px 12px 5px 10px;
 border-radius: 99px;
 font-size: 13px;
 font-weight: 600;
 cursor: pointer;
}
.topbar.topbar-slim .topbar-streak:hover { background: rgba(255,255,255,0.14); }
.topbar.topbar-slim .topbar-right {
 display: flex; align-items: center; gap: 10px;
}
.topbar.topbar-slim .topbar-slim-btn {
 background: transparent;
 border: none;
 color: rgba(255,255,255,0.85);
 width: 32px; height: 32px;
 display: flex; align-items: center; justify-content: center;
 cursor: pointer;
 border-radius: 50%;
 transition: background 0.15s;
}
.topbar.topbar-slim .topbar-slim-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.topbar.topbar-slim .topbar-slim-avatar {
 width: 28px; height: 28px;
 border-radius: 50%;
 background: var(--primary);
 color: #fff;
 display: flex; align-items: center; justify-content: center;
 font-size: 12px; font-weight: 700;
 cursor: pointer;
}
.breadcrumb {
 font-weight: 600;
 font-size: 16px;
 color: var(--text);
}
.topbar-actions {
 display: flex;
 align-items: center;
 gap: 6px;
}
.topbar-logo {
 width: 36px;
 height: 36px;
 display: flex;
 align-items: center;
 justify-content: center;
 flex-shrink: 0;
 margin-right: 14px;
}
.topbar-logo img { width: 36px; height: 36px; object-fit: contain; display: block; }
.topbar-left {
 flex: 1;
 display: flex;
 justify-content: center;
}
.search input {
 padding: 7px 14px 7px 36px;
 border: 1px solid var(--border);
 border-radius: 8px;
 width: 420px;
 max-width: 100%;
 font-size: 13px;
 background: var(--bg) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>") 12px center/14px no-repeat;
}
.search input:focus { outline: 2px solid var(--primary-light); border-color: var(--primary); background-color: #fff; }

/* Salesforce風 トップバーアイコンボタン */
.topbar-icon-btn {
 position: relative;
 background: transparent;
 border: none;
 width: 36px;
 height: 36px;
 border-radius: 50%;
 cursor: pointer;
 color: var(--text-sub);
 display: flex;
 align-items: center;
 justify-content: center;
 padding: 0;
 transition: background .15s, color .15s;
}
.topbar-icon-btn:hover { background: var(--bg-alt); color: var(--text); }
.topbar-badge {
 position: absolute;
 top: 2px;
 right: 2px;
 background: var(--danger);
 color: #fff;
 font-size: 9px;
 padding: 1px 5px;
 border-radius: 9px;
 font-weight: 700;
 min-width: 14px;
 line-height: 1.4;
 text-align: center;
}
.topbar-profile {
 width: 32px;
 height: 32px;
 border-radius: 50%;
 background: linear-gradient(135deg, #fef3c7, #fde68a);
 color: #78350f;
 display: flex;
 align-items: center;
 justify-content: center;
 font-size: 13px;
 font-weight: 700;
 cursor: pointer;
 margin-left: 4px;
 border: 2px solid #fff;
 box-shadow: 0 1px 3px rgba(0,0,0,0.08);
 transition: transform .15s;
}
.topbar-profile:hover { transform: scale(1.05); }

.btn-icon {
 position: relative;
 background: var(--bg);
 border: 1px solid var(--border);
 width: 36px; height: 36px;
 border-radius: 8px;
 cursor: pointer;
 font-size: 15px;
}
.btn-icon .badge {
 position: absolute;
 top: -4px; right: -4px;
 background: var(--danger);
 color: #fff;
 font-size: 10px;
 padding: 2px 5px;
 border-radius: 10px;
 font-weight: 700;
}
.btn-primary {
 background: var(--primary);
 color: #fff;
 border: none;
 padding: 8px 16px;
 border-radius: 8px;
 cursor: pointer;
 font-weight: 600;
 font-size: 13px;
 transition: background 0.15s;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary {
 background: #fff;
 color: var(--text);
 border: 1px solid var(--border);
 padding: 7px 14px;
 border-radius: 8px;
 cursor: pointer;
 font-size: 13px;
 font-weight: 500;
}
.btn-secondary:hover { background: var(--bg); }

.content {
 padding: 18px 28px 28px;
 background: #fff;
 border-top-left-radius: 18px;
 flex: 1;
 min-height: 0;
}
body.dark .content { background: var(--bg); }

/* ============ Common Components ============ */
.page-header {
 display: flex;
 justify-content: space-between;
 align-items: end;
 margin-bottom: 18px;
 gap: 16px;
}
.page-title {
 font-size: 20px;
 font-weight: 700;
 letter-spacing: 0.01em;
}

.card {
 background: var(--bg-card);
 border: 1px solid var(--border);
 border-radius: var(--radius);
 padding: 20px;
 box-shadow: var(--shadow-sm);
}
.card-title {
 font-size: 14px;
 font-weight: 600;
 color: var(--text);
 margin-bottom: 14px;
 display: flex;
 align-items: center;
 justify-content: space-between;
}
.card-title .label {
 font-size: 11px;
 color: var(--text-sub);
 font-weight: 500;
 background: var(--bg);
 padding: 3px 8px;
 border-radius: 12px;
}

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-2-1 { grid-template-columns: 2fr 1fr; }

.kpi {
 background: var(--bg-card);
 border: 1px solid var(--border);
 border-radius: var(--radius);
 padding: 18px;
 position: relative;
 overflow: hidden;
 box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.kpi-label { color: var(--text-sub); font-size: 12px; font-weight: 500; }
.kpi-value { font-size: 26px; font-weight: 700; margin: 6px 0 4px; letter-spacing: -0.01em; }
.kpi-delta { font-size: 12px; font-weight: 600; }
.kpi-delta.up { color: var(--success); }
.kpi-delta.down { color: var(--danger); }
.kpi-icon {
 position: absolute;
 top: 18px; right: 18px;
 width: 36px; height: 36px;
 border-radius: 8px;
 background: var(--primary-light);
 display: grid;
 place-items: center;
 color: var(--primary);
 font-size: 16px;
}

.tag {
 display: inline-block;
 padding: 3px 10px;
 border-radius: 999px;
 font-size: 11px;
 font-weight: 600;
}
.tag-blue { background: #dbeafe; color: #1e40af; }
.tag-green { background: #d1fae5; color: #065f46; }
.tag-yellow { background: #fef3c7; color: #92400e; }
.tag-red { background: #fee2e2; color: #991b1b; }
.tag-purple { background: #e0f2fe; color: #075985; } /* sky系（旧紫を青系に統一） */
.tag-gray { background: #f1f5f9; color: #475569; }

/* Bar chart (CSS only) */
.bar-chart { display: flex; align-items: end; gap: 12px; height: 180px; padding: 12px 0; }
.bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bar-stack { display: flex; flex-direction: column; gap: 3px; width: 100%; align-items: center; }
.bar {
 width: 28px;
 border-radius: 4px 4px 0 0;
 background: var(--primary);
 position: relative;
}
.bar.alt { background: var(--accent); }
.bar.alt2 { background: var(--accent-2); }
.bar-label { font-size: 11px; color: var(--text-sub); margin-top: 6px; }
.bar-wrap { display: flex; flex-direction: column; align-items: center; }
.bar-value {
 font-size: 10px;
 color: var(--text);
 margin-bottom: 3px;
 font-weight: 700;
}

.legend { display: flex; gap: 14px; margin-top: 8px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-sub); }
.legend-dot { width: 10px; height: 10px; border-radius: 2px; }

/* Progress */
.progress {
 width: 100%; height: 8px;
 background: #e2e8f0;
 border-radius: 999px;
 overflow: hidden;
}
.progress-bar {
 height: 100%;
 background: linear-gradient(90deg, var(--primary), var(--accent));
 border-radius: 999px;
}

/* List */
.list { display: flex; flex-direction: column; }
.list-item {
 display: flex;
 align-items: center;
 justify-content: space-between;
 padding: 12px 0;
 border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }
.list-item-main { display: flex; align-items: center; gap: 10px; }
.list-bullet {
 width: 8px; height: 8px;
 border-radius: 50%;
 background: var(--primary);
 flex-shrink: 0;
}
.list-bullet.warning { background: var(--warning); }
.list-bullet.danger { background: var(--danger); }
.list-bullet.success { background: var(--success); }

/* Donut */
.donut {
 --p: 75;
 width: 140px; height: 140px;
 border-radius: 50%;
 background: conic-gradient(var(--primary) 0% calc(var(--p) * 1%), #e2e8f0 calc(var(--p) * 1%) 100%);
 display: grid;
 place-items: center;
 position: relative;
 margin: 8px auto;
}
.donut::after {
 content: '';
 position: absolute;
 inset: 14px;
 background: #fff;
 border-radius: 50%;
}
.donut-text {
 position: relative;
 z-index: 1;
 font-size: 22px;
 font-weight: 700;
 color: var(--text);
}

/* Table */
table.std {
 width: 100%;
 border-collapse: collapse;
}
table.std th {
 text-align: left;
 font-size: 12px;
 color: var(--text-sub);
 font-weight: 600;
 padding: 10px 12px;
 background: var(--bg);
 border-bottom: 1px solid var(--border);
}
table.std td {
 padding: 12px;
 border-bottom: 1px solid var(--border);
 font-size: 13px;
}
table.std tr:hover { background: var(--bg); }

/* Alerts */
.alert {
 display: flex;
 align-items: start;
 gap: 10px;
 padding: 12px 14px;
 border-radius: 8px;
 margin-bottom: 8px;
 font-size: 13px;
 border-left: 3px solid;
}
.alert-warning { background: #fffbeb; border-color: var(--warning); color: #78350f; }
.alert-danger { background: #fef2f2; border-color: var(--danger); color: #7f1d1d; }
.alert-info { background: #eff6ff; border-color: var(--primary); color: #1e3a8a; }

/* Tabs */
.tabs {
 display: flex;
 gap: 4px;
 border-bottom: 1px solid var(--border);
 margin-bottom: 18px;
}
.tab {
 padding: 10px 16px;
 cursor: pointer;
 font-size: 13px;
 color: var(--text-sub);
 font-weight: 500;
 border-bottom: 2px solid transparent;
 margin-bottom: -1px;
}
.tab.active { color: var(--primary); border-color: var(--primary); font-weight: 600; }

/* Kanban */
.kanban {
 display: grid;
 grid-template-columns: repeat(9, minmax(180px, 1fr));
 gap: 10px;
 overflow-x: auto;
 padding-bottom: 8px;
}
.kanban-col {
 background: var(--bg);
 border-radius: 8px;
 padding: 10px;
 min-height: 400px;
}
.kanban-col-header {
 display: flex;
 justify-content: space-between;
 align-items: center;
 margin-bottom: 10px;
 font-size: 12px;
 font-weight: 700;
 color: var(--text);
}
.kanban-col-header .count {
 background: #fff;
 padding: 2px 8px;
 border-radius: 12px;
 font-weight: 600;
 color: var(--text-sub);
 border: 1px solid var(--border);
}
.kanban-card {
 background: #fff;
 border: 1px solid var(--border);
 border-radius: 6px;
 padding: 10px;
 margin-bottom: 8px;
 font-size: 12px;
 cursor: grab;
 box-shadow: var(--shadow-sm);
 transition: box-shadow 0.15s;
}
.kanban-card:hover { box-shadow: var(--shadow); }
.kanban-card .name { font-weight: 600; margin-bottom: 4px; }
.kanban-card .meta { color: var(--text-sub); font-size: 11px; }
.kanban-card .amount { color: var(--primary); font-weight: 700; margin-top: 6px; font-size: 12px; }

/* Step pipeline */
.steps {
 display: flex;
 align-items: center;
 margin: 14px 0;
}
.step {
 flex: 1;
 text-align: center;
 position: relative;
}
.step-dot {
 width: 28px; height: 28px;
 border-radius: 50%;
 background: var(--bg);
 border: 2px solid var(--border);
 margin: 0 auto;
 display: grid;
 place-items: center;
 font-size: 12px;
 font-weight: 700;
 color: var(--text-sub);
 position: relative;
 z-index: 1;
}
.step.active .step-dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.step.done .step-dot { background: var(--success); border-color: var(--success); color: #fff; }
.step-label { font-size: 11px; color: var(--text-sub); margin-top: 6px; }
.step.active .step-label { color: var(--primary); font-weight: 600; }
.step:not(:last-child)::after {
 content: '';
 position: absolute;
 top: 14px; left: 50%; right: -50%;
 height: 2px;
 background: var(--border);
 z-index: 0;
}
.step.done:not(:last-child)::after { background: var(--success); }

/* Score / Radar */
.icp-axis {
 display: grid;
 grid-template-columns: 100px 1fr 50px;
 gap: 12px;
 align-items: center;
 padding: 10px 0;
 border-bottom: 1px dashed var(--border);
}
.icp-axis:last-child { border: none; }
.icp-axis-label { font-size: 13px; font-weight: 600; }
.icp-axis-score { font-weight: 700; color: var(--primary); text-align: right; }

/* Insight box */
.insight {
 background: linear-gradient(135deg, var(--ai-light) 0%, #ddd6fe 100%);
 border: 1px solid #c4b5fd;
 border-left: 4px solid var(--ai);
 border-radius: 10px;
 padding: 16px;
 margin-bottom: 16px;
}
.insight-title {
 font-size: 12px;
 font-weight: 700;
 color: var(--ai);
 text-transform: uppercase;
 letter-spacing: 0.05em;
 margin-bottom: 8px;
 display: flex;
 align-items: center;
 gap: 6px;
}
.insight-text { font-size: 13.5px; color: var(--text); line-height: 1.6; }

/* Chat bubble (Data Merger) */
.transcript {
 display: flex;
 flex-direction: column;
 gap: 10px;
 max-height: 300px;
 overflow-y: auto;
 padding: 6px;
}
.bubble {
 padding: 10px 12px;
 border-radius: 10px;
 font-size: 13px;
 max-width: 80%;
 line-height: 1.5;
}
.bubble.them { background: var(--bg); align-self: flex-start; }
.bubble.us { background: var(--primary-light); color: var(--text); align-self: flex-end; }
.bubble .speaker { font-size: 10px; color: var(--text-sub); font-weight: 600; margin-bottom: 4px; }

/* Section gap */
.section-stack { display: flex; flex-direction: column; gap: 18px; }

/* Funnel */
.funnel { display: flex; flex-direction: column; gap: 6px; }
.funnel-row {
 display: grid;
 grid-template-columns: 100px 1fr 60px;
 align-items: center;
 gap: 10px;
}
.funnel-bar {
 height: 24px;
 background: linear-gradient(90deg, var(--primary), var(--accent));
 border-radius: 4px;
 display: flex;
 align-items: center;
 padding-left: 10px;
 color: #fff;
 font-size: 11px;
 font-weight: 600;
}

/* Tag cloud */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }

/* ============ Zoho/HubSpot-like CRM/SFA ============ */
.list-toolbar {
 display: flex;
 align-items: center;
 justify-content: space-between;
 background: #fff;
 border: 1px solid var(--border);
 border-radius: var(--radius);
 padding: 10px 14px;
 margin-bottom: 0;
}
.list-toolbar-left, .list-toolbar-right { display: flex; align-items: center; gap: 8px; }
.toolbar-btn {
 background: transparent;
 border: 1px solid transparent;
 padding: 6px 10px;
 border-radius: 6px;
 cursor: pointer;
 font-size: 12.5px;
 color: var(--text-sub);
 display: flex;
 align-items: center;
 gap: 6px;
 font-weight: 500;
}
.toolbar-btn:hover { background: var(--bg); color: var(--primary); }
.toolbar-btn.active { background: var(--primary-light); color: var(--primary); }
.toolbar-divider { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }

.view-tabs {
 display: flex;
 align-items: center;
 gap: 4px;
 margin-bottom: 12px;
}
.view-tab {
 padding: 6px 14px;
 background: var(--primary-light);
 border-radius: 6px;
 font-size: 12.5px;
 color: var(--primary);
 font-weight: 500;
 cursor: pointer;
}
.view-tab.more { background: transparent; color: var(--text-sub); padding: 6px 8px; }

/* CRM/SFA Layout */
.crm-layout {
 display: grid;
 grid-template-columns: 220px 1fr;
 gap: 0;
 background: #fff;
 border: 1px solid var(--border);
 border-radius: var(--radius);
 overflow: hidden;
 min-height: 600px;
}
.crm-layout.crm-layout-no-filter { grid-template-columns: 1fr; }
.crm-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
/* インラインプレビューボタン（ホバー時のみ表示） */
.crm-preview-btn {
  margin-left: 8px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  opacity: 0.6;
  transition: opacity .15s, background .15s, border-color .15s, color .15s;
}
body.dark .crm-preview-btn { background: var(--bg-card); }
.crm-table tbody tr:hover .crm-preview-btn,
.crm-table tbody tr:focus-within .crm-preview-btn {
  opacity: 1;
  pointer-events: auto;
}
.crm-preview-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* SFA：商談名 + プレビュー横並び */
.sfa-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 担当者アバター（Notion風） */
.owner-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.owner-av {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.owner-av-i {
  /* 個別の bg/color はインライン指定 */
}
.owner-av-s {
  background: #e2e8f0;
  color: #94a3b8;
}
body.dark .owner-av-s { background: #334155; color: #64748b; }
.owner-av-s svg { display: block; }
.owner-name { font-size: 12.5px; color: var(--text); }
.crm-logo {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  background: #e2e8f0;
  color: #475569;
  border: 1px solid #e2e8f0;
}
body.dark .crm-logo { background: #334155; color: #cbd5e1; border-color: #334155; }
.crm-filter {
 background: #fafbfc;
 border-right: 1px solid var(--border);
 padding: 14px;
 font-size: 12.5px;
}
.filter-group { margin-bottom: 16px; }
.filter-group-title {
 font-size: 12px;
 font-weight: 600;
 color: var(--text);
 margin-bottom: 8px;
 display: flex;
 align-items: center;
 gap: 4px;
 cursor: pointer;
}
.filter-group-title::before {
 content: '▼';
 font-size: 8px;
 color: var(--text-sub);
}
.filter-search {
 width: 100%;
 padding: 6px 8px;
 border: 1px solid var(--border);
 border-radius: 4px;
 font-size: 12px;
 margin-bottom: 8px;
 background: #fff;
}
.filter-item {
 display: flex;
 align-items: center;
 gap: 6px;
 padding: 4px 0;
 font-size: 12px;
 color: var(--text-sub);
 cursor: pointer;
}
.filter-item:hover { color: var(--primary); }
.filter-item input { cursor: pointer; }

.crm-main { padding: 0; min-width: 0; overflow: hidden; }
.crm-table {
 width: 100%;
 border-collapse: collapse;
 font-size: 13px;
}
.crm-table thead th {
 text-align: left;
 font-size: 12px;
 font-weight: 600;
 color: var(--text-sub);
 padding: 10px 14px;
 background: #fafbfc;
 border-bottom: 1px solid var(--border);
 white-space: nowrap;
}
.crm-table tbody td {
 padding: 12px 14px;
 border-bottom: 1px solid var(--border);
 font-size: 13px;
}
.crm-table tbody tr {
 cursor: pointer;
 transition: background 0.1s;
}
.crm-table tbody tr:hover { background: #f0f4ff; }
.crm-table tbody tr.selected { background: var(--primary-light); }
.crm-table .col-check { width: 36px; }

/* SFAリスト カラム区切り線 + リサイズハンドル */
.sfa-list thead th {
 position: relative;
 border-right: 1px solid var(--border);
}
.sfa-list thead th:last-child { border-right: none; }
.sfa-list tbody td { white-space: nowrap; }
.sfa-list tbody td .sfa-name-cell .link { white-space: nowrap; }
.sfa-list thead th { white-space: nowrap; }
.col-resizer {
 position: absolute;
 top: 0;
 right: -3px;
 width: 6px;
 height: 100%;
 cursor: col-resize;
 user-select: none;
 z-index: 5;
 background: transparent;
 transition: background 0.15s;
}
.col-resizer:hover { background: var(--primary); opacity: 0.4; }
.col-resizer.resizing { background: var(--primary); opacity: 0.8; }
.crm-table .link {
 color: var(--primary);
 font-weight: 500;
}

.crm-pagination {
 display: flex;
 justify-content: space-between;
 align-items: center;
 padding: 10px 14px;
 border-top: 1px solid var(--border);
 font-size: 12px;
 color: var(--text-sub);
 background: #fafbfc;
}
.page-btn {
 background: #fff;
 border: 1px solid var(--border);
 width: 26px; height: 26px;
 border-radius: 4px;
 cursor: pointer;
 font-size: 12px;
}

/* Detail panel (slide-in) */
.detail-panel {
 position: fixed;
 top: 0; right: 0;
 width: 540px;
 height: 100vh;
 background: #fff;
 border-left: 1px solid var(--border);
 box-shadow: -8px 0 24px rgba(0,0,0,0.08);
 z-index: 100;
 overflow-y: auto;
 display: none;
 flex-direction: column;
}
.detail-panel.open { display: flex; }

/* 商談詳細パネルはフルスクリーン */
.detail-panel.meeting-full {
  width: 100vw;
  max-width: 100vw;
  border-left: none;
  box-shadow: none;
  background: var(--bg);
}
body.dark .detail-panel.meeting-full { background: var(--bg); }
.detail-panel.meeting-full .detail-header {
  background: #fff;
  padding: 16px 32px;
}
body.dark .detail-panel.meeting-full .detail-header { background: var(--bg-card); }

/* 商談A案：左ステップ × 中コンテンツ × resizer × 右メモ */
.meeting-layout {
  display: grid;
  /* grid-template-columns は inline style で動的設定 */
  flex: 1;
  min-height: calc(100vh - 80px);
}

.meeting-notes-resizer {
  background: transparent;
  cursor: ew-resize;
  position: sticky;
  top: 80px;
  height: calc(100vh - 80px);
  border-left: 1px solid var(--border);
  transition: background 0.15s, border-color 0.15s;
  z-index: 10;
}
.meeting-notes-resizer:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}
.meeting-notes-resizer.dragging {
  background: var(--primary);
  border-color: var(--primary);
}
.meeting-step-nav {
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 24px 14px;
  position: sticky;
  top: 80px;
  align-self: start;
  height: calc(100vh - 80px);
  overflow-y: auto;
}
body.dark .meeting-step-nav { background: var(--bg-card); }
.meeting-step-nav-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 8px 12px;
}
.meeting-step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  margin-bottom: 6px;
  transition: background 0.15s;
}
.meeting-step-item::before {
  content: '';
  position: absolute;
  left: 24px;
  top: 38px;
  bottom: -8px;
  width: 2px;
  background: var(--border);
  z-index: 0;
}
.meeting-step-item:last-of-type::before { display: none; }
.meeting-step-item.done::before { background: #22c55e; }
.meeting-step-item:hover { background: var(--bg); }
.meeting-step-item.active {
  background: var(--primary-light);
}
body.dark .meeting-step-item.active { background: rgba(37, 99, 235, 0.18); }
.meeting-step-icon {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  background: #fff;
  color: var(--text-sub);
  border: 2px solid var(--border);
  z-index: 1;
  position: relative;
}
.meeting-step-item.done .meeting-step-icon {
  background: #22c55e;
  color: #fff;
  border-color: #22c55e;
}
.meeting-step-item.active .meeting-step-icon {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.meeting-step-info { flex: 1; min-width: 0; }
.meeting-step-title {
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 1px;
}
.meeting-step-item.active .meeting-step-title { color: var(--primary); }
.meeting-step-status {
  font-size: 11px;
  color: var(--text-sub);
}
.meeting-step-item.done .meeting-step-status { color: #16a34a; font-weight: 600; }

/* 右メイン */
.meeting-step-content {
  padding: 28px 36px;
  width: 100%;
  min-width: 0;
}
.meeting-content-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px;
  margin-bottom: 16px;
}
body.dark .meeting-content-section { background: var(--bg-card); }
.meeting-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.meeting-section-head h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}
.ms-label {
  font-size: 11px;
  color: var(--text-sub);
  font-weight: 600;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-ok {
  background: #dcfce7;
  color: #166534;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
}
body.dark .badge-ok { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.badge-wait {
  background: var(--bg-alt);
  color: var(--text-sub);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
}
.badge-warn {
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
}
body.dark .badge-warn { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.muted {
  font-size: 11px;
  color: var(--text-sub);
}

/* SFAステータスチップ（ヘッダー内） */
.kt-sfa-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 12px;
  margin-left: 10px;
  background: #dcfce7;
  color: #166534;
  vertical-align: middle;
}
body.dark .kt-sfa-chip { background: rgba(34,197,94,.2); color: #86efac; }
.kt-sfa-chip-wait {
  background: var(--bg-alt);
  color: var(--text-sub);
}

/* 議事録URL入力ベルト */
.kt-record-belt {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 14px;
  align-items: center;
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 16px;
}
body.dark .kt-record-belt { background: rgba(37,99,235,.15); }
.kt-record-belt.kt-record-done {
  background: #dcfce7;
  border-color: #16a34a;
}
body.dark .kt-record-belt.kt-record-done { background: rgba(34,197,94,.15); border-color: #22c55e; }
.kt-record-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kt-record-done .kt-record-icon { background: #16a34a; }
.kt-record-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}
.kt-record-sub {
  font-size: 11.5px;
  color: var(--text-sub);
  line-height: 1.4;
}
.kt-record-link {
  font-family: monospace;
  font-size: 10.5px;
  background: rgba(255,255,255,.6);
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 4px;
}
body.dark .kt-record-link { background: rgba(0,0,0,.3); }
.kt-record-input-area {
  display: flex;
  gap: 6px;
  align-items: center;
}
.kt-record-input {
  width: 280px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  background: #fff;
  color: var(--text);
}
body.dark .kt-record-input { background: var(--bg-card); }
.kt-record-input:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: var(--primary); }
.kt-record-btn {
  white-space: nowrap;
  padding: 8px 14px;
  font-size: 12.5px;
}

/* === タブ切替アニメーションのみ === */
@keyframes kt-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.kt-tab-pane { animation: kt-fade-in 0.2s ease-out; }
.kt-tab { transition: color .15s, border-color .15s, background .15s; }

/* 開閉トグルボタン */
.kt-collapse-btn {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-sub);
  transition: all .15s;
  padding: 0;
  flex-shrink: 0;
}
body.dark .kt-collapse-btn { background: var(--bg-card); }
.kt-collapse-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}
.kt-collapse-abs {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
}
.kt-collapse-vert {
  margin: 8px auto 12px;
}
.kt-collapsed-label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub);
  letter-spacing: 0.1em;
  margin: 0 auto;
  padding: 8px 0;
  white-space: nowrap;
}
.kt-card-collapsed {
  padding: 8px 4px !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  background: var(--bg-alt) !important;
}
.kt-card-collapsed:hover { background: var(--primary-light) !important; }
.meeting-notes-panel.collapsed {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  cursor: pointer;
}
.meeting-notes-panel.collapsed:hover { background: var(--primary-light); }

/* === 事前リサーチ カルテ === */
.prep-card { position: relative; }

/* 親折りたたみセクション（基本情報など） */
.kt-super {
  margin-bottom: 14px;
}
.kt-super-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 8px 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  user-select: none;
}
.kt-super-title {
  letter-spacing: 0.04em;
}
.kt-super-toggle {
  background: transparent;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background .15s, color .15s;
}
.kt-super-toggle:hover { background: var(--bg-alt); color: var(--primary); }
.kt-super-caret { transition: transform .2s ease; }
.kt-super:not(.kt-super-open) .kt-super-caret { transform: rotate(-90deg); }
.kt-super-body { padding-top: 12px; }
.kt-super:not(.kt-super-open) .kt-super-body { display: none; }
.kt-super-body .kt-section { margin-bottom: 14px; }
.kt-super-body .kt-section:last-child { margin-bottom: 0; }

/* サブセクション（企業／主担当／パーソナル情報） */
.kt-subsec { margin-bottom: 12px; }
.kt-subsec:last-child { margin-bottom: 0; }
.kt-subsec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0 6px;
  user-select: none;
}
.kt-subsec-head .kt-sec-title {
  margin-bottom: 0;
  text-transform: none;
  letter-spacing: 0.04em;
  font-weight: 700;
  font-size: 11px;
  color: var(--text-sub);
}
.kt-subsec-toggle {
  background: transparent;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background .15s, color .15s;
}
.kt-subsec-toggle:hover { background: var(--bg-alt); color: var(--primary); }
.kt-subsec-caret { transition: transform .2s ease; }
.kt-subsec:not(.kt-subsec-open) .kt-subsec-caret { transform: rotate(-90deg); }
.kt-subsec:not(.kt-subsec-open) .kt-subsec-body { display: none; }
.prep-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.prep-grid-3 {
  grid-template-columns: 1.1fr 1fr 1.1fr;
}
.prep-grid-2 {
  grid-template-columns: minmax(320px, 1fr) 1.4fr;
}
/* メモパネルを閉じたとき：左カードは固定、空いた幅は右の詳細タブが取得 */
.meeting-layout.notes-collapsed .prep-grid-2 {
  grid-template-columns: minmax(320px, 380px) 1fr;
}

/* 顧客プロフィール（左カラム最上部） */
.kt-profile {
  padding: 0 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.kt-profile-topbar {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}
.kt-back-btn {
  background: transparent;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background .15s, color .15s;
}
.kt-back-btn:hover { background: var(--bg-alt); color: var(--text); }

.kt-profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px 14px;
}
.kt-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #78350f;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  flex-shrink: 0;
}
body.dark .kt-avatar { border-color: var(--bg-card); }
.kt-profile-info { min-width: 0; flex: 1; }
.kt-profile-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.kt-profile-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.kt-edit-btn {
  background: transparent;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s, color .15s;
  padding: 0;
}
.kt-edit-btn:hover { background: var(--bg-alt); color: var(--primary); }

/* カスタムツールチップ */
[data-tooltip] { position: relative; }
[data-tooltip]::after,
[data-tooltip]::before {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease-out, transform .15s ease-out;
  transform: translate(-50%, 4px);
  z-index: 100;
  white-space: nowrap;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  background: #1f2937;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 5px 9px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}
[data-tooltip]::before {
  content: '';
  bottom: calc(100% + 1px);
  border: 5px solid transparent;
  border-top-color: #1f2937;
}
[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
  opacity: 1;
  transform: translate(-50%, 0);
}
.kt-profile-company {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  line-height: 1.3;
}
.kt-profile-email-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px 14px;
  margin-top: -4px;
}
.kt-profile-email {
  font-size: 11.5px;
  color: var(--primary);
  word-break: break-all;
  line-height: 1.35;
  text-decoration: underline;
  text-decoration-color: rgba(37,99,235,0.4);
  text-underline-offset: 2px;
  cursor: text;
}
.kt-copy-btn {
  background: transparent;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s, color .15s;
  padding: 0;
}
.kt-copy-btn:hover { background: var(--bg-alt); color: var(--text); }
.kt-copy-btn.kt-copied { background: #dcfce7; color: #166534; }
body.dark .kt-copy-btn.kt-copied { background: rgba(34,197,94,.2); color: #86efac; }

/* アクションボタン行 */
.kt-action-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 0 4px;
}
.kt-act-btn {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  cursor: pointer;
  border-radius: 6px;
  transition: background .15s;
}
.kt-act-btn:hover { background: var(--bg-alt); }
.kt-act-ic {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-alt);
  color: var(--text-sub);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.kt-act-ic svg { width: 17px; height: 17px; }
.kt-act-btn:hover .kt-act-ic { background: var(--primary-light); color: var(--primary); }
.kt-act-lbl {
  font-size: 11px;
  color: var(--text-sub);
  font-weight: 500;
  white-space: nowrap;
}

/* ステージパイプライン（chevron） */
.kt-pipeline-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.kt-pipeline {
  display: flex;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  overflow-x: auto;
  flex: 1;
  min-width: 0;
}
.kt-mark-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.kt-mark-btn.kt-mark-disabled {
  background: #fff;
  color: var(--text-muted);
  cursor: not-allowed;
  border-color: var(--border);
}
body.dark .kt-mark-btn.kt-mark-disabled { background: var(--bg-card); }
.kt-mark-btn.kt-mark-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  cursor: pointer;
}
.kt-mark-btn.kt-mark-active:hover { background: var(--primary-dark); }
body.dark .kt-pipeline { background: var(--bg-card); }
.kt-stage {
  flex: 1;
  min-width: 86px;
  padding: 9px 14px 9px 22px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  text-align: center;
  position: relative;
  margin-right: -10px;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%);
  white-space: nowrap;
}
body.dark .kt-stage { background: var(--bg-alt); }
.kt-stage:first-child {
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%);
  padding-left: 14px;
}
.kt-stage:last-child {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 12px 50%);
  padding-right: 14px;
  margin-right: 0;
}
.kt-stage.passed {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #fff;
}
.kt-stage.passed::before { content: '✓ '; font-weight: 800; }
.kt-stage.current {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  font-weight: 700;
}
.kt-stage.future { background: var(--bg); color: var(--text-muted); }
body.dark .kt-stage.future { background: var(--bg-alt); }
.kt-stage[data-stage] { cursor: pointer; transition: filter .15s; }
.kt-stage[data-stage]:hover { filter: brightness(0.96); }
.kt-stage.selected,
.kt-stage.selected.passed,
.kt-stage.selected.current,
.kt-stage.selected.future {
  background: var(--primary);
  color: var(--primary);
  font-weight: 700;
  outline: none;
  z-index: 3;
  position: relative;
}
/* シェブロン形状の内側を白く塗って青枠効果を作る */
.kt-stage.selected::before {
  content: '';
  position: absolute;
  top: 1px; bottom: 1px; left: 1px; right: 1px;
  background: #fff;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%);
  z-index: -1;
  pointer-events: none;
}
.kt-stage.selected:first-child::before {
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%);
}
.kt-stage.selected:last-child::before {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 12px 50%);
}
body.dark .kt-stage.selected,
body.dark .kt-stage.selected.passed,
body.dark .kt-stage.selected.current,
body.dark .kt-stage.selected.future {
  background: rgba(96, 165, 250, 0.08);
  color: #93c5fd;
  outline-color: #93c5fd;
}
.kt-stage.selected::after { display: none; }
.kt-stage.selected.passed::before { color: var(--primary); content: '✓ '; }

/* 顧客カルテ：セクション */
.kt-section {
  margin-bottom: 16px;
}
.kt-section:last-child { margin-bottom: 0; }
.kt-sec-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.kt-sec-hint {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
}

/* 定義リスト（ラベル + 値） */
.kt-dl {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 6px 10px;
  margin: 0;
  font-size: 12px;
}
.kt-dl dt {
  color: var(--text-sub);
  font-weight: 500;
  font-size: 11.5px;
}
.kt-dl dd {
  margin: 0;
  color: var(--text);
  word-break: break-word;
}
.kt-link {
  color: var(--primary);
  text-decoration: none;
}
.kt-link:hover { text-decoration: underline; }

.kt-stage-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}
body.dark .kt-stage-badge { background: rgba(37, 99, 235, 0.18); }

/* 中央：詳細タブ */
.prep-detail {
  padding: 0 !important;
  display: flex;
  flex-direction: column;
}
.kt-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 12px;
  gap: 0;
  flex-shrink: 0;
}
.kt-tab {
  flex: 1;
  min-width: 0;
  padding: 13px 8px 12px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s, background .12s;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  user-select: none;
  text-align: center;
  white-space: nowrap;
}
.kt-tab-grip {
  font-size: 11px;
  letter-spacing: -1px;
  color: var(--text-sub);
  cursor: grab;
  transition: color .15s, background .15s, opacity .15s, max-width .2s, margin-left .2s;
  font-weight: 700;
  padding: 2px 3px;
  border-radius: 3px;
  display: inline-block;
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  margin-left: 0;
  pointer-events: none;
}
.kt-tabs.kt-tabs-editing .kt-tab-grip {
  opacity: 1;
  max-width: 18px;
  margin-left: 4px;
  pointer-events: auto;
}
.kt-tab-grip:hover { color: var(--primary); background: var(--primary-light); }
.kt-tab-grip:active { cursor: grabbing; }

/* タブ「順番編集 / 完了」ボタン */
.kt-tabs-edit-btn {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-sub);
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  align-self: center;
  transition: background .15s, color .15s, border-color .15s;
}
.kt-tabs-edit-btn:hover { background: var(--bg-alt); color: var(--text); }
.kt-tabs-edit-btn.kt-tabs-edit-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.kt-tabs.kt-tabs-editing { background: var(--bg-alt); }
body.dark .kt-tabs.kt-tabs-editing { background: rgba(37,99,235,0.06); }
.kt-tab.kt-tab-dragging {
  opacity: 0.4;
  background: var(--bg-alt);
}
.kt-tab.kt-tab-drop-before::before,
.kt-tab.kt-tab-drop-after::after {
  content: '';
  position: absolute;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--primary);
  border-radius: 2px;
}
.kt-tab.kt-tab-drop-before::before { left: -1px; }
.kt-tab.kt-tab-drop-after::after { right: -1px; }
.kt-tab:hover { color: var(--text); }
.kt-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.kt-tab-pane {
  padding: 18px 20px;
  flex: 1;
  overflow-y: auto;
}

/* 詳細タブ：セクション化されたフィールドグリッド */
.kt-fsec {
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
body.dark .kt-fsec { background: var(--bg-card); }
.kt-fsec-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.kt-fsec-bar {
  width: 3px;
  height: 14px;
  background: var(--primary);
  border-radius: 2px;
}
.kt-fsec-edit {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  color: var(--primary);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
}
.kt-fsec-edit:hover { background: var(--primary-light); }
.kt-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.kt-field {
  padding: 9px 14px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.kt-field:nth-child(2n) { border-right: none; }
.kt-fields .kt-field-wide {
  grid-column: span 2;
  border-right: none;
}
.kt-field:hover { background: var(--bg-alt); }
.kt-field-label {
  font-size: 10.5px;
  color: var(--text-sub);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
  font-weight: 600;
}
.kt-field-value {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text);
  word-break: break-word;
}
.kt-field-num { font-weight: 700; font-size: 14px; }
.kt-field-accent { color: var(--primary); font-weight: 600; }
.kt-field-memo {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-sub);
  background: var(--bg-alt);
  padding: 8px 10px;
  border-radius: 4px;
  border-left: 3px solid var(--primary);
}
/* BANT要件のラベル色付け */
.kt-bant-b, .kt-bant-a, .kt-bant-n, .kt-bant-t {
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}
.kt-bant-b { color: #2563eb; }
.kt-bant-a { color: #16a34a; }
.kt-bant-n { color: #f59e0b; }
.kt-bant-t { color: #dc2626; }
body.dark .kt-bant-b { color: #93c5fd; }
body.dark .kt-bant-a { color: #86efac; }
body.dark .kt-bant-n { color: #fcd34d; }
body.dark .kt-bant-t { color: #fca5a5; }

.kt-memo-cell { line-height: 1.55; }

.kt-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.6;
}

/* NAタブ：垂直タイムライン */
.kt-na-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.kt-na-stats {
  display: flex;
  gap: 18px;
}
.kt-na-stat {
  display: flex;
  flex-direction: column;
  font-size: 10.5px;
}
.kt-na-stat-label {
  color: var(--text-sub);
  font-weight: 500;
}
.kt-na-stat-num {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  margin-top: 2px;
}
.kt-na-stat-num.kt-na-completed-c { color: #16a34a; }
.kt-na-stat-num.kt-na-failed-c { color: #dc2626; }

.kt-na-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}
.kt-na-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  padding-bottom: 18px;
  position: relative;
}
.kt-na-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 22px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.kt-na-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
body.dark .kt-na-dot { background: var(--bg-card); }
.kt-na-completed .kt-na-dot {
  background: #16a34a;
  border-color: #16a34a;
}
.kt-na-failed .kt-na-dot {
  background: #dc2626;
  border-color: #dc2626;
}
.kt-na-current .kt-na-dot {
  background: var(--primary);
  border-color: var(--primary);
}
.kt-na-pulse {
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  animation: kt-na-pulse-anim 1.6s ease-in-out infinite;
}
@keyframes kt-na-pulse-anim {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.6); opacity: 0.5; }
}
.kt-na-pending .kt-na-dot {
  background: #fff;
  border: 2px dashed var(--text-muted);
}
body.dark .kt-na-pending .kt-na-dot { background: var(--bg-card); }
.kt-na-body {
  padding-top: 1px;
}
.kt-na-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}
.kt-na-date {
  font-size: 11px;
  color: var(--text-sub);
  font-weight: 600;
}
.kt-na-type {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9px;
  background: var(--bg-alt);
  color: var(--text-sub);
}
.kt-na-type-completed { background: #dcfce7; color: #166534; }
.kt-na-type-failed { background: #fee2e2; color: #b91c1c; }
.kt-na-type-current { background: var(--primary-light); color: var(--primary); }
.kt-na-type-pending { background: #f1f5f9; color: #475569; }
body.dark .kt-na-type-completed { background: rgba(34,197,94,.2); color: #86efac; }
body.dark .kt-na-type-failed { background: rgba(239,68,68,.2); color: #fca5a5; }
body.dark .kt-na-type-current { background: rgba(37,99,235,.2); color: #93c5fd; }
body.dark .kt-na-type-pending { background: rgba(148,163,184,.2); color: #cbd5e1; }
.kt-na-text {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text);
}
.kt-na-failed .kt-na-text { color: var(--text-sub); }
.kt-na-pending .kt-na-text { color: var(--text-sub); font-style: italic; }

.kt-na-section-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text);
  margin: 4px 0 12px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.kt-na-section-hint { font-size: 10.5px; color: var(--text-sub); font-weight: 500; }
.kt-na-stat-num.kt-na-ai-c { color: var(--ai); }
.kt-empty-mini {
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  background: var(--bg-alt);
  border-radius: 6px;
  margin-bottom: 4px;
}

/* NAスマートタスクテーブル */
.kt-tasks-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.kt-tasks-title {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
  color: var(--text-sub);
}
.kt-tasks-count {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.kt-tasks-tools { display: flex; gap: 6px; align-items: center; }
.kt-tasks-sel {
  font-size: 11px;
  padding: 5px 24px 5px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>") right 6px center/10px no-repeat;
  appearance: none;
  color: var(--text);
  cursor: pointer;
}
body.dark .kt-tasks-sel { background-color: var(--bg-card); color: var(--text); }
.kt-tasks-add {
  font-size: 11px;
  padding: 5px 12px;
}

.kt-tasks-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.kt-tasks-table thead th {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.kt-tasks-table thead th:first-child { border-top-left-radius: 4px; }
.kt-tasks-table thead th:last-child { border-top-right-radius: 4px; }
.kt-tasks-table .kt-tk-check { width: 28px; padding-right: 0; }
.kt-tasks-table .kt-tk-pri { width: 50px; }
.kt-tasks-table .kt-tk-due { width: 60px; color: var(--text-sub); white-space: nowrap; }
.kt-tasks-table .kt-tk-owner { width: 100px; }
.kt-tasks-table .kt-tk-source { width: 80px; text-align: right; }

.kt-tk-row td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.kt-tk-row:hover td { background: var(--bg-alt); }
.kt-tk-row input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--primary);
}
.kt-pri-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-top: 5px;
}
.kt-pri-high { background: #dc2626; }
.kt-pri-mid  { background: var(--primary); }
.kt-pri-low  { background: var(--text-muted); }
.kt-tk-title {
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 2px;
}
.kt-tk-detail {
  font-size: 11.5px;
  color: var(--text-sub);
  line-height: 1.45;
}
.kt-tk-row td.kt-tk-owner {
  display: table-cell;
  white-space: nowrap;
}
.kt-tk-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #78350f;
  margin-right: 6px;
  vertical-align: middle;
}
.kt-tk-ai {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9px;
  background: var(--primary-light);
  color: var(--primary);
  letter-spacing: 0.04em;
}
body.dark .kt-tk-ai { background: rgba(1, 118, 211, .25); color: #7fc4f5; }

/* 活動タブ：フィルタチップ */
.kt-act-filters { display: flex; gap: 4px; }
.kt-act-chip {
  background: transparent;
  border: 1px solid var(--border);
  font-size: 10.5px;
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  color: var(--text-sub);
  font-weight: 600;
}
.kt-act-chip.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* 詳細タブ：リードスコア行 */
.kt-score-detail {
  margin-bottom: 18px;
  padding: 12px 14px;
  background: var(--bg-alt);
  border-radius: 8px;
  border: none;
}

/* 議事録タブ */
.kt-min-add {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}
.kt-min-add-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.kt-min-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.kt-min-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12.5px;
  background: #fff;
  color: var(--text);
  min-width: 0;
}
body.dark .kt-min-input { background: var(--bg-card); }
.kt-min-input:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: var(--primary); }
.kt-min-btn {
  white-space: nowrap;
  padding: 8px 14px;
  font-size: 12.5px;
}
.kt-min-add-hint {
  font-size: 11px;
  color: var(--text-sub);
  margin-top: 8px;
  line-height: 1.4;
}

.kt-min-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.kt-min-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  padding-bottom: 14px;
  position: relative;
}
.kt-min-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 14px;
}
.kt-min-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.kt-min-dot.kt-min-dot-latest {
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}
.kt-min-line {
  width: 2px;
  flex: 1;
  background: var(--border);
  margin-top: 4px;
}
.kt-min-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}
body.dark .kt-min-card { background: var(--bg-card); }
.kt-min-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.kt-min-date {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
}
.kt-min-time {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-sub);
  margin-left: 4px;
}
.kt-min-label {
  font-size: 11.5px;
  color: var(--text-sub);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.kt-min-latest-tag {
  font-size: 10px;
  font-weight: 700;
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 7px;
  border-radius: 9px;
}
.kt-min-badges { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.kt-min-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 9px;
  white-space: nowrap;
}
.kt-min-ok { background: #dcfce7; color: #166534; }
body.dark .kt-min-ok { background: rgba(34,197,94,.2); color: #86efac; }
.kt-min-wait { background: var(--bg-alt); color: var(--text-sub); }
.kt-min-url-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: var(--bg-alt);
  border-radius: 5px;
  margin-bottom: 8px;
}
.kt-min-url {
  flex: 1;
  font-family: monospace;
  font-size: 11px;
  color: var(--primary);
  word-break: break-all;
  min-width: 0;
}

/* ニュースタブ */
.kt-news-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.kt-news-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.kt-news-item {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.kt-news-item:last-child { border-bottom: none; }
.kt-news-item:hover { background: var(--bg-alt); }
.kt-news-item .prep-sig-tag {
  margin-top: 1px;
}
.kt-news-body { min-width: 0; }
.kt-news-text {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 4px;
}
.kt-news-meta {
  font-size: 10.5px;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 5px;
}
.kt-news-date { font-weight: 500; }
.kt-news-sep { opacity: 0.5; }
.kt-news-source { color: var(--primary); }
.kt-news-link {
  background: transparent;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s, color .15s;
  padding: 0;
}
.kt-news-link:hover { background: var(--primary-light); color: var(--primary); }

/* 関連タブ */
.kt-rel-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.kt-rel-contact, .kt-rel-deal, .kt-rel-file {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-alt);
  border-radius: 6px;
}
.kt-rel-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dbeafe, #93c5fd);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #1e40af;
}
body.dark .kt-rel-avatar { background: linear-gradient(135deg, rgba(59,130,246,.3), rgba(37,99,235,.4)); color: #93c5fd; }
.kt-rel-deal-icon, .kt-rel-file-icon {
  width: 32px;
  height: 32px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.kt-rel-deal-icon { background: var(--primary); font-size: 16px; }
.kt-rel-file-icon { font-size: 9px; }
.kt-file-pdf { background: #dc2626; }
.kt-file-excel { background: #16a34a; }
.kt-file-md { background: #475569; }
.kt-file-doc { background: #2563eb; }
.kt-rel-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.kt-rel-tag {
  font-size: 10px;
  font-weight: 700;
  background: #dcfce7;
  color: #166534;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 4px;
}
body.dark .kt-rel-tag { background: rgba(34,197,94,.2); color: #86efac; }
.kt-rel-sub {
  font-size: 11px;
  color: var(--text-sub);
  margin-top: 2px;
}

/* メモタブ */
.kt-memo-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.kt-memo-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.kt-memo-item {
  padding: 12px 14px;
  background: var(--bg-alt);
  border-radius: 6px;
  border-left: 3px solid var(--primary);
}
.kt-memo-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 11px;
}
.kt-memo-author { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text); }
.kt-memo-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #78350f;
}
.kt-memo-date { color: var(--text-sub); font-size: 10.5px; }
.kt-memo-text { font-size: 12.5px; line-height: 1.55; color: var(--text); }

/* リードスコアカード */
.kt-score-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.kt-score-mini {
  --p: 0;
  --ring: #16a34a;
  --track: #e5e7eb;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: conic-gradient(var(--ring) calc(var(--p) * 1%), var(--track) 0);
}
.kt-score-mini::before {
  content: '';
  position: absolute;
  inset: 3px;
  background: #fff;
  border-radius: 50%;
}
body.dark .kt-score-mini { --track: #334155; }
body.dark .kt-score-mini::before { background: var(--bg-card); }
.kt-score-mini > span {
  position: relative;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.kt-score-mini.tier-1 { --ring: #16a34a; }
.kt-score-mini.tier-2 { --ring: #2563eb; }
.kt-score-mini.tier-3 { --ring: #f59e0b; }
.kt-score-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.prep-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
}
body.dark .prep-card { background: var(--bg-card); }
.prep-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}
.prep-card-head h4 {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}
.prep-card-hint {
  font-size: 11px;
  color: var(--text-sub);
  font-weight: 500;
}

/* ICPマッチカード */
.prep-icp-body {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 16px;
  align-items: center;
}
.prep-donut {
  width: 110px !important;
  height: 110px !important;
  margin: 4px auto !important;
}
.prep-donut .donut-text {
  font-size: 24px !important;
}
.prep-strengths {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.prep-strengths li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  background: var(--bg-alt);
  border-radius: 6px;
  border-left: 3px solid var(--primary);
}
.prep-str-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.04em;
}
.prep-str-text {
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.5;
}
.prep-tier {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
}
.prep-tier.tier-1 { background: #dcfce7; color: #166534; }
.prep-tier.tier-2 { background: #dbeafe; color: #1e40af; }
.prep-tier.tier-3 { background: #fef3c7; color: #92400e; }
body.dark .prep-tier.tier-1 { background: rgba(34,197,94,.2); color: #86efac; }
body.dark .prep-tier.tier-2 { background: rgba(59,130,246,.2); color: #93c5fd; }
body.dark .prep-tier.tier-3 { background: rgba(245,158,11,.2); color: #fcd34d; }

/* 企業シグナル */
.prep-signal-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.prep-signal-list li {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  align-items: start;
}
.prep-sig-tag {
  font-size: 10.5px;
  font-weight: 700;
  text-align: center;
  padding: 4px 6px;
  border-radius: 4px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.prep-sig-tag.sig-press { background: #fee2e2; color: #b91c1c; }
.prep-sig-tag.sig-news  { background: #dbeafe; color: #1e40af; }
.prep-sig-tag.sig-sns   { background: #f3e8ff; color: #6b21a8; }
.prep-sig-tag.sig-hr    { background: #dcfce7; color: #166534; }
body.dark .prep-sig-tag.sig-press { background: rgba(239,68,68,.2); color: #fca5a5; }
body.dark .prep-sig-tag.sig-news  { background: rgba(59,130,246,.2); color: #93c5fd; }
body.dark .prep-sig-tag.sig-sns   { background: rgba(168,85,247,.2); color: #d8b4fe; }
body.dark .prep-sig-tag.sig-hr    { background: rgba(34,197,94,.2); color: #86efac; }
.prep-sig-text {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text);
}
.prep-sig-date {
  font-size: 10.5px;
  color: var(--text-sub);
  margin-top: 2px;
}

/* 右メモパネル */
.meeting-notes-panel {
  background: #fffef7;
  border-left: 1px solid var(--border);
  padding: 18px 16px;
  position: sticky;
  top: 80px;
  align-self: start;
  height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
}
body.dark .meeting-notes-panel { background: var(--bg-card); }

.meeting-notes-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.meeting-notes-status {
  font-size: 10px;
  font-weight: 500;
  color: #16a34a;
  text-transform: none;
  letter-spacing: 0;
}

.meeting-notes-toolbar {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
  align-items: center;
}
.meeting-notes-btn {
  font-size: 11px;
  padding: 4px 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-sub);
  transition: all 0.1s;
}
body.dark .meeting-notes-btn { background: var(--bg-alt); }
.meeting-notes-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.meeting-notes-textarea {
  flex: 1;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.6;
  resize: none;
  outline: none;
  background: #fff;
  color: var(--text);
  min-height: 0;
}
body.dark .meeting-notes-textarea { background: var(--bg-alt); }
.meeting-notes-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.meeting-notes-hint {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.5;
}
.detail-overlay {
 position: fixed;
 inset: 0;
 background: rgba(15,23,42,0.3);
 z-index: 99;
 display: none;
}
.detail-overlay.open { display: block; }
.detail-header {
 padding: 16px 20px;
 border-bottom: 1px solid var(--border);
 display: flex;
 align-items: center;
 justify-content: space-between;
 position: sticky;
 top: 0;
 background: #fff;
 z-index: 1;
}
.detail-title-wrap { display: flex; align-items: center; gap: 12px; }
.detail-avatar {
 width: 40px; height: 40px;
 border-radius: 8px;
 background: linear-gradient(135deg, var(--primary), var(--accent));
 color: #fff;
 font-weight: 700;
 display: grid;
 place-items: center;
 font-size: 16px;
}
.detail-title { font-size: 16px; font-weight: 700; }
.detail-sub { font-size: 11px; color: var(--text-sub); }
.detail-close {
 width: 30px; height: 30px;
 border: 1px solid var(--border);
 background: #fff;
 border-radius: 6px;
 cursor: pointer;
 font-size: 16px;
}
.detail-body { padding: 20px; }
.detail-section { margin-bottom: 22px; }
.detail-section-title {
 font-size: 12px;
 font-weight: 700;
 color: var(--text);
 margin-bottom: 10px;
 text-transform: uppercase;
 letter-spacing: 0.05em;
 border-bottom: 1px solid var(--border);
 padding-bottom: 6px;
}

.field {
 display: grid;
 grid-template-columns: 130px 1fr;
 gap: 8px;
 padding: 8px 0;
 align-items: center;
 font-size: 13px;
}
.field-label { color: var(--text-sub); font-size: 12px; font-weight: 500; }
.field-input,
.field-select,
.field-textarea {
 border: 1px solid transparent;
 background: transparent;
 padding: 6px 8px;
 font-size: 13px;
 border-radius: 4px;
 width: 100%;
 font-family: inherit;
 color: var(--text);
 transition: all 0.15s;
}
.field-input:hover,
.field-select:hover,
.field-textarea:hover {
 background: var(--bg);
}
.field-input:focus,
.field-select:focus,
.field-textarea:focus {
 outline: none;
 background: #fff;
 border-color: var(--primary);
 box-shadow: 0 0 0 3px var(--primary-light);
}
.field-textarea { resize: vertical; min-height: 60px; }

.timeline {
 position: relative;
 padding-left: 18px;
 border-left: 2px solid var(--border);
 margin-left: 6px;
}
.timeline-item {
 position: relative;
 padding: 0 0 16px 14px;
}
.timeline-item::before {
 content: '';
 position: absolute;
 left: -22px; top: 4px;
 width: 10px; height: 10px;
 background: var(--primary);
 border-radius: 50%;
 border: 2px solid #fff;
 box-shadow: 0 0 0 1px var(--primary);
}
.timeline-time { font-size: 11px; color: var(--text-sub); margin-bottom: 4px; }
.timeline-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.timeline-body { font-size: 12px; color: var(--text-sub); }

/* SFA Sub-tabs (商談支援内) */
.sub-tabs {
 display: flex;
 gap: 4px;
 margin-bottom: 18px;
 background: var(--bg);
 padding: 4px;
 border-radius: 8px;
 width: fit-content;
}
.sub-tab {
 padding: 8px 16px;
 cursor: pointer;
 font-size: 13px;
 color: var(--text-sub);
 font-weight: 500;
 border-radius: 6px;
}
.sub-tab.active {
 background: #fff;
 color: var(--primary);
 font-weight: 600;
 box-shadow: var(--shadow-sm);
}

/* SFA Stage Flow（シェブロン型ステージ可視化バー） */
.sfa-stage-flow {
 display: flex;
 background: #fff;
 border: 1px solid var(--border);
 border-radius: 10px;
 padding: 8px;
 margin-bottom: 16px;
 gap: 0;
 overflow-x: auto;
}
body.dark .sfa-stage-flow { background: var(--bg-card); }

.sfa-stage-step {
 flex: 1;
 min-width: 100px;
 padding: 11px 18px 11px 24px;
 background: var(--bg);
 color: var(--text-muted);
 font-size: 12px;
 font-weight: 600;
 text-align: center;
 position: relative;
 margin-right: -10px;
 clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%);
 transition: all 0.15s;
 white-space: nowrap;
}
body.dark .sfa-stage-step { background: var(--bg-alt); }

.sfa-stage-step:first-child {
 clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%);
 padding-left: 14px;
}
.sfa-stage-step:last-child {
 clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 12px 50%);
 padding-right: 14px;
 margin-right: 0;
}

.sfa-stage-step .stage-name {
 font-weight: 600;
 margin-bottom: 2px;
 font-size: 11px;
}
.sfa-stage-step .stage-count {
 font-size: 16px;
 font-weight: 800;
 line-height: 1.1;
}
.sfa-stage-step .stage-amount {
 font-size: 10px;
 font-weight: 500;
 opacity: 0.8;
 margin-top: 2px;
}

.sfa-stage-step.has-deals {
 background: var(--primary-light);
 color: var(--primary);
}
body.dark .sfa-stage-step.has-deals { background: rgba(37, 99, 235, 0.18); }

.sfa-stage-step.has-deals.peak {
 background: linear-gradient(135deg, var(--primary), var(--accent));
 color: #fff;
}

/* Salesforce風 3色フロー */
.sfa-stage-step.passed {
 background: linear-gradient(135deg, #16a34a, #22c55e);
 color: #fff;
}
.sfa-stage-step.passed .stage-name::before {
 content: '✓ ';
 font-weight: 800;
 font-size: 12px;
}

.sfa-stage-step.current {
 background: linear-gradient(135deg, var(--primary-dark), var(--primary));
 color: #fff;
 font-weight: 700;
}

.sfa-stage-step.active {
 background: var(--primary-light);
 color: var(--primary);
}
body.dark .sfa-stage-step.active { background: rgba(37, 99, 235, 0.18); }

.sfa-stage-step.future {
 background: var(--bg);
 color: var(--text-muted);
}
body.dark .sfa-stage-step.future { background: var(--bg-alt); }

/* カンバン上部のステージシェブロン帯（カラム幅と整列） */
.kanban-stages-strip {
 display: grid;
 grid-template-columns: repeat(9, minmax(180px, 1fr));
 gap: 10px;
 margin-bottom: 14px;
 overflow-x: auto;
 min-width: 1640px;
}
.kanban-stage-chev {
 padding: 11px 10px 11px 22px;
 background: var(--bg);
 color: var(--text-muted);
 font-size: 12px;
 font-weight: 700;
 text-align: center;
 position: relative;
 clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%);
 margin-right: -10px;
 white-space: nowrap;
 transition: all 0.15s;
}
.kanban-stage-chev:first-child {
 clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%);
 padding-left: 14px;
}
.kanban-stage-chev:last-child {
 clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 12px 50%);
 padding-right: 14px;
 margin-right: 0;
}
.kanban-stage-chev.passed,
.kanban-stage-chev.current,
.kanban-stage-chev.active {
 background: var(--primary-light);
 color: var(--primary);
}
body.dark .kanban-stage-chev.active { background: rgba(37, 99, 235, 0.18); }
body.dark .kanban-stage-chev.future { background: var(--bg-alt); color: var(--text-muted); }

/* SFA list view */
.sfa-list-row td {
 padding: 14px 12px;
}
.sfa-amount { font-weight: 700; color: var(--primary); }
.sfa-stage-pill {
 display: inline-block;
 padding: 4px 10px;
 border-radius: 4px;
 background: var(--primary-light);
 color: var(--primary);
 font-size: 11px;
 font-weight: 600;
}
.confidence-bar {
 width: 80px;
 height: 6px;
 background: var(--border);
 border-radius: 3px;
 overflow: hidden;
 display: inline-block;
 vertical-align: middle;
}
.confidence-fill {
 height: 100%;
 background: linear-gradient(90deg, var(--primary), var(--accent));
}
.avatar-sm {
 width: 24px; height: 24px;
 border-radius: 50%;
 background: var(--accent);
 color: #fff;
 font-weight: 600;
 font-size: 11px;
 display: inline-grid;
 place-items: center;
 margin-right: 6px;
}

/* ============ セールス タブバー ============ */
/* Salesforce風 コンテキストナビバー */
.ctx-nav {
 display: flex;
 align-items: stretch;
 gap: 0;
 background: #fff;
 border-bottom: 1px solid var(--border);
 margin: 0 -28px 18px;
 padding: 0 28px;
 position: sticky;
 top: 48px;
 z-index: 5;
 overflow-x: auto;
 border-top-left-radius: 18px;
}
body.dark .ctx-nav { background: var(--bg-card); }
.ctx-nav-title {
 font-size: 15px;
 font-weight: 700;
 color: var(--text);
 padding: 10px 22px 10px 0;
 border-right: 1px solid var(--border);
 margin-right: 18px;
 display: flex;
 align-items: center;
 flex-shrink: 0;
}
.ctx-nav-tabs {
 display: flex;
 gap: 0;
 align-items: stretch;
}
.ctx-nav-tab {
 padding: 10px 14px;
 font-size: 13px;
 color: var(--text-sub);
 cursor: pointer;
 display: flex;
 align-items: center;
 gap: 4px;
 white-space: nowrap;
 border-bottom: 2px solid transparent;
 transition: color 0.15s, border-color 0.15s;
 font-weight: 500;
}
.ctx-nav-tab:hover { color: var(--text); }
.ctx-nav-tab.active {
 color: var(--primary);
 border-bottom-color: var(--primary);
 font-weight: 600;
}
.ctx-nav-caret {
 color: var(--text-muted);
 margin-left: 2px;
 transition: color .15s, transform .2s;
 flex-shrink: 0;
 display: inline-block;
 vertical-align: middle;
 pointer-events: none;
}
.ctx-nav-tab:hover .ctx-nav-caret { color: var(--text-sub); }
.ctx-nav-tab.active .ctx-nav-caret { color: var(--primary); }
.ctx-nav-body { padding-top: 0; }

/* ============ カレンダー カラーピッカー ============ */
.cal-color-popup {
  position: fixed;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 1000;
}
body.dark .cal-color-popup { background: var(--bg-card); }

.cal-color-grid {
  display: grid;
  grid-template-columns: repeat(6, 22px);
  gap: 5px;
}
.cal-color-swatch {
  width: 22px; height: 22px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  transition: transform 0.1s;
}
.cal-color-swatch:hover { transform: scale(1.15); }
.cal-color-add {
  background: var(--bg-alt) !important;
  color: var(--text-sub) !important;
  font-size: 13px;
}
body.dark .cal-color-add { background: #334155 !important; color: #cbd5e1 !important; }

/* カスタム カラー モーダル */
.cal-color-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
}
.cal-color-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}
.cal-color-modal-card {
  position: relative;
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 480px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.25);
}
body.dark .cal-color-modal-card { background: var(--bg-card); }

.cal-color-modal-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 18px;
  margin-bottom: 14px;
}
.cal-color-modal-preview {
  width: 60px; height: 60px;
  border-radius: 50%;
  margin: 8px auto;
  background: #b1007c;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 700;
}
.cal-color-modal-preview::before { content: 'A'; }

.cal-color-modal-sl {
  position: relative;
  height: 150px;
  border-radius: 8px;
  overflow: hidden;
  cursor: crosshair;
  user-select: none;
}
.cal-color-modal-sl-bg {
  position: absolute;
  inset: 0;
}
.cal-color-modal-sl-cursor {
  position: absolute;
  width: 14px; height: 14px;
  border: 2px solid #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.3);
  pointer-events: none;
}

.cal-color-modal-hue { margin-bottom: 16px; padding: 0 4px; }
.cal-color-modal-hue input[type="range"] {
  width: 100%;
  height: 14px;
  -webkit-appearance: none;
  background: linear-gradient(to right,
    #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
  border-radius: 7px;
  outline: none;
}
.cal-color-modal-hue input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  background: #fff;
  border: 2px solid var(--text);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.cal-color-modal-hex {
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
}
.cal-color-modal-hex label {
  display: block;
  font-size: 11px;
  color: var(--text-sub);
  margin-bottom: 2px;
}
.cal-color-modal-hex input {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-family: -apple-system, monospace;
  width: 100%;
  outline: none;
}

.cal-color-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  align-items: center;
}
.cal-color-modal-cancel {
  background: transparent;
  color: var(--primary);
  border: none;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
}
.cal-color-modal-cancel:hover { background: var(--primary-light); }
.cal-color-modal-save {
  background: var(--primary-light);
  color: var(--primary);
  border: none;
  padding: 8px 24px;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.cal-color-modal-save:hover { background: var(--primary); color: #fff; }

/* ============ Google Calendar 風（フル機能） ============ */
.gcal-app {
  display: grid;
  grid-template-columns: 240px 1fr;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  min-height: 700px;
  user-select: none;
  -webkit-user-select: none;
}
.gcal-app input,
.gcal-app textarea { user-select: text; -webkit-user-select: text; }

@keyframes gcal-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.gcal-day-wrap,
.gcal-week-wrap,
.gcal-month-wrap,
.gcal-year-wrap {
  animation: gcal-fade-in 0.22s ease-out;
}
.gcal-header .gcal-month {
  transition: color 0.2s;
  animation: gcal-fade-in 0.22s ease-out;
}
body.dark .gcal-app { background: var(--bg-card); }

.gcal-sidebar {
  border-right: 1px solid var(--border);
  padding: 16px 12px;
  background: var(--bg-soft);
}
body.dark .gcal-sidebar { background: var(--bg-card); }

.gcal-create-big {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 24px 12px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  width: fit-content;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.gcal-create-big:hover { box-shadow: 0 2px 6px rgba(0,0,0,0.1); }

.gcal-mini-cal { margin-bottom: 20px; }
.gcal-mini-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 6px;
  font-size: 12px;
}
.gcal-mini-month { font-weight: 600; }
.gcal-mini-nav {
  border: none;
  background: transparent;
  width: 24px; height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-sub);
}
.gcal-mini-nav:hover { background: var(--bg); }

.gcal-mini-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  margin-top: 4px;
}
.gcal-mini-day {
  text-align: center;
  font-size: 10px;
  color: var(--text-sub);
  padding: 4px 0;
}
.gcal-mini-cell {
  text-align: center;
  font-size: 11px;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  width: 26px; height: 26px;
  margin: 1px auto;
  display: grid;
  place-items: center;
}
.gcal-mini-cell:hover { background: var(--bg); }
.gcal-mini-cell.other { color: var(--text-muted); }
.gcal-mini-cell.today { background: var(--primary); color: #fff; font-weight: 700; }
.gcal-mini-cell.selected:not(.today) { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.gcal-mini-cell.in-range {
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 0;
  width: 100%;
  margin: 1px 0;
}
.gcal-mini-cell.range-start { border-radius: 50% 0 0 50%; }
.gcal-mini-cell.range-end   { border-radius: 0 50% 50% 0; }
.gcal-mini-cell.range-start.today,
.gcal-mini-cell.range-end.today,
.gcal-mini-cell.in-range.today {
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  width: 26px;
}

.gcal-side-section { margin-bottom: 20px; }
.gcal-side-title {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 8px;
  font-weight: 500;
}
.gcal-side-search {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  background: #fff;
}
body.dark .gcal-side-search { background: var(--bg-alt); color: var(--text); }
.gcal-side-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 4px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 4px;
}
.gcal-side-item:hover { background: var(--bg); }
.gcal-side-item input[type="checkbox"] {
  width: 14px; height: 14px;
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}
.gcal-side-item > span:nth-child(2),
.gcal-side-item .cal-color-dot {
  width: 12px; height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
  display: inline-block;
}
.gcal-side-item > span:nth-child(3) {
  flex: 1;
  color: var(--text);
}
.gcal-side-menu {
  background: transparent;
  border: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-sub);
  font-size: 14px;
  font-weight: 700;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  margin-left: 4px;
  flex-shrink: 0;
}
.gcal-side-item:hover .gcal-side-menu {
  opacity: 1;
}
.gcal-side-menu:hover { background: var(--bg-alt); color: var(--text); }

.gcal-main { display: flex; flex-direction: column; overflow: hidden; }
.gcal-search {
  border: 1px solid var(--border);
  background: var(--bg);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  width: 200px;
}

/* 日表示 */
.gcal-day-wrap, .gcal-week-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
.gcal-day-allday {
  display: grid;
  grid-template-columns: 60px 1fr;
  border-bottom: 1px solid var(--border);
  min-height: 36px;
}
.gcal-day-allday-label {
  font-size: 10px;
  color: var(--text-sub);
  padding: 8px;
  text-align: right;
  border-right: 1px solid var(--border);
}
.gcal-day-allday-events {
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.gcal-day-grid {
  display: grid;
  grid-template-columns: 60px 1fr;
  overflow-y: auto;
  max-height: 600px;
}
.gcal-time-labels {
  position: relative;
  border-right: 1px solid var(--border);
  height: 1152px;
}
.gcal-time-label {
  position: absolute;
  right: 8px;
  font-size: 10px;
  color: var(--text-sub);
  background: #fff;
  padding-right: 4px;
  transform: translateY(-50%);
}
body.dark .gcal-time-label { background: var(--bg-card); }
.gcal-time-slots {
  position: relative;
  height: 1152px;
}
.gcal-time-slot {
  height: 48px;
  border-bottom: 1px solid var(--border);
}

.gcal-event-block {
  position: absolute;
  left: 6px;
  right: 8px;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  overflow: hidden;
  z-index: 2;
  border-left: 3px solid;
}
.gcal-event-block:hover { filter: brightness(0.98); }
.gcal-event-block-time { font-size: 10px; opacity: 0.85; }
.gcal-event-block-title { font-weight: 600; line-height: 1.3; }
.gcal-event-block-meta { font-size: 10px; opacity: 0.7; margin-top: 1px; }

.gcal-event-block.g-blue   { background: rgba(25, 103, 210, 0.15); border-color: #1967d2; color: #1967d2; }
.gcal-event-block.g-violet { background: rgba(132, 48, 206, 0.15); border-color: #8430ce; color: #8430ce; }
.gcal-event-block.g-cyan   { background: rgba(18, 158, 175, 0.15); border-color: #129eaf; color: #129eaf; }
.gcal-event-block.g-orange { background: rgba(232, 113, 10, 0.15); border-color: #e8710a; color: #e8710a; }
.gcal-event-block.g-green  { background: rgba(11, 128, 67, 0.15); border-color: #0b8043; color: #0b8043; }
.gcal-event-block.g-gray   { background: rgba(95, 99, 104, 0.15); border-color: #5f6368; color: #5f6368; }

.gcal-event-allday {
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 3px;
  font-weight: 500;
  color: #fff;
}
.gcal-event-allday.g-blue   { background: #1967d2; }
.gcal-event-allday.g-violet { background: #8430ce; }
.gcal-event-allday.g-gray   { background: #5f6368; }
.gcal-event-allday.g-green  { background: #0b8043; }

.gcal-now-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 2px solid #ea4335;
  z-index: 3;
}
.gcal-now-dot {
  position: absolute;
  left: -6px; top: -6px;
  width: 12px; height: 12px;
  background: #ea4335;
  border-radius: 50%;
}

/* 週表示 */
.gcal-week-header {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
}
.gcal-week-tz { border-right: 1px solid var(--border); }
.gcal-week-day-header {
  text-align: center;
  padding: 8px 4px;
  border-right: 1px solid var(--border);
  font-size: 11px;
}
.gcal-week-day-header:last-child { border-right: none; }
.gcal-week-dow { font-size: 10px; color: var(--text-sub); text-transform: uppercase; }
.gcal-week-date { font-size: 22px; color: var(--text); margin-top: 2px; }
.gcal-week-day-header.today .gcal-week-date {
  background: var(--primary);
  color: #fff;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-weight: 700;
}
.gcal-week-day-header.today .gcal-week-dow { color: var(--primary); font-weight: 700; }
.gcal-week-day-header.other { opacity: 0.4; }

.gcal-week-allday {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
  min-height: 28px;
}
.gcal-week-allday-cell {
  border-right: 1px solid var(--border);
  padding: 3px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gcal-week-allday-cell:last-child { border-right: none; }

.gcal-week-grid {
  display: grid;
  grid-template-columns: 60px 1fr;
  overflow-y: auto;
  max-height: 600px;
}
.gcal-week-cols {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  position: relative;
  height: 1152px;
}
.gcal-week-col {
  position: relative;
  border-right: 1px solid var(--border);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 47px, var(--border) 47px, var(--border) 48px);
}
.gcal-week-col:last-child { border-right: none; }

/* 年表示 */
.gcal-year-wrap {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 16px;
}
.gcal-yr-month {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
}
body.dark .gcal-yr-month { background: var(--bg-alt); }
.gcal-yr-month-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--primary);
}
.gcal-yr-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
}
.gcal-yr-dow {
  font-size: 9px;
  color: var(--text-sub);
  text-align: center;
  padding: 2px 0;
}
.gcal-yr-cell {
  font-size: 10px;
  text-align: center;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  width: 20px; height: 20px;
  margin: 1px auto;
  display: grid;
  place-items: center;
  position: relative;
}
.gcal-yr-cell:hover { background: var(--bg); }
.gcal-yr-cell.other { color: transparent; cursor: default; }
.gcal-yr-cell.today { background: var(--primary); color: #fff; font-weight: 700; }
.gcal-yr-cell.has::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  background: var(--accent);
  border-radius: 50%;
}

/* 月表示は下記 .gcal で既存維持 */

/* ============ Google Calendar 風（旧スタイル維持） ============ */
.gcal {
 background: #fff;
 border-radius: 8px;
 overflow: hidden;
}
body.dark .gcal { background: var(--bg-card); }

.gcal-header {
 display: flex;
 justify-content: space-between;
 align-items: center;
 padding: 12px 16px;
 border-bottom: 1px solid var(--border);
 gap: 8px;
}
.gcal-header-left, .gcal-header-right {
 display: flex;
 align-items: center;
 gap: 8px;
}
.gcal-create {
 background: var(--primary);
 color: #fff;
 border: none;
 padding: 8px 16px;
 border-radius: 20px;
 font-size: 13px;
 font-weight: 600;
 cursor: pointer;
 margin-right: 8px;
 box-shadow: var(--shadow-sm);
}
.gcal-create:hover { background: var(--primary-dark); }
.gcal-today-btn {
 background: #fff;
 border: 1px solid var(--border);
 padding: 6px 14px;
 border-radius: 6px;
 font-size: 13px;
 cursor: pointer;
 color: var(--text);
}
body.dark .gcal-today-btn { background: var(--bg-alt); color: var(--text); }
.gcal-today-btn:hover { background: var(--bg); }
.gcal-nav-btn {
 width: 32px; height: 32px;
 background: transparent;
 border: none;
 border-radius: 50%;
 font-size: 16px;
 cursor: pointer;
 color: var(--text-sub);
}
.gcal-nav-btn:hover { background: var(--bg); }
.gcal-month {
 font-size: 18px;
 font-weight: 500;
 color: var(--text);
 margin-left: 6px;
}
.gcal-view-toggle {
 display: flex;
 background: var(--bg);
 border-radius: 8px;
 padding: 2px;
 gap: 0;
}
.gcal-view-btn {
 padding: 5px 12px;
 border: none;
 background: transparent;
 cursor: pointer;
 font-size: 12px;
 color: var(--text-sub);
 border-radius: 6px;
 font-weight: 500;
}
.gcal-view-btn.active {
 background: #fff;
 color: var(--primary);
 font-weight: 600;
 box-shadow: var(--shadow-sm);
}
body.dark .gcal-view-btn.active { background: var(--bg-alt); }

.gcal-day-headers {
 display: grid;
 grid-template-columns: repeat(7, 1fr);
 border-bottom: 1px solid var(--border);
}
.gcal-day-header {
 padding: 8px 4px;
 text-align: center;
 font-size: 11px;
 font-weight: 500;
 color: var(--text-sub);
 text-transform: uppercase;
 letter-spacing: 0.05em;
}

.gcal-cells {
 display: grid;
 grid-template-columns: repeat(7, 1fr);
 background: var(--border);
 gap: 1px;
}
.gcal-cell {
 background: #fff;
 min-height: 100px;
 padding: 4px 6px;
 position: relative;
 cursor: pointer;
}
body.dark .gcal-cell { background: var(--bg-card); }
.gcal-cell:hover { background: var(--bg); }
body.dark .gcal-cell:hover { background: var(--bg-alt); }

.gcal-cell.other-month { background: var(--bg-soft); }
body.dark .gcal-cell.other-month { background: var(--bg-alt); }
.gcal-cell.other-month .gcal-date { color: var(--text-muted); }

.gcal-date {
 font-size: 12px;
 font-weight: 500;
 color: var(--text);
 padding: 4px 0 4px 4px;
 display: inline-block;
}
.gcal-cell.today .gcal-date {
 background: var(--primary);
 color: #fff;
 width: 24px; height: 24px;
 border-radius: 50%;
 display: grid;
 place-items: center;
 padding: 0;
 font-weight: 700;
 margin: 2px;
}

.gcal-event {
 display: flex;
 align-items: center;
 gap: 4px;
 padding: 2px 4px;
 font-size: 11px;
 border-radius: 3px;
 margin-bottom: 1px;
 cursor: pointer;
 white-space: nowrap;
 overflow: hidden;
 text-overflow: ellipsis;
 color: var(--text);
 font-weight: 500;
 line-height: 1.4;
}
.gcal-event:hover { filter: brightness(0.95); }

.gcal-event-dot {
 width: 8px; height: 8px;
 border-radius: 50%;
 flex-shrink: 0;
 background: currentColor;
}
.gcal-event-time { font-size: 10px; opacity: 0.85; flex-shrink: 0; }
.gcal-event-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }

.gcal-event.g-blue { color: #1967d2; }
.gcal-event.g-green { color: #0b8043; }
.gcal-event.g-violet { color: #8430ce; }
.gcal-event.g-orange { color: #e8710a; }
.gcal-event.g-cyan { color: #129eaf; }
.gcal-event.g-gray { color: #5f6368; }

.gcal-event.all-day {
 background: var(--primary);
 color: #fff !important;
 padding: 3px 8px;
 font-weight: 600;
}
.gcal-event.all-day.g-gray { background: #5f6368; }
.gcal-event.all-day.g-violet { background: #8430ce; }

/* Calendar grid */
.calendar {
 display: grid;
 grid-template-columns: repeat(7, 1fr);
 gap: 1px;
 background: var(--border);
 border: 1px solid var(--border);
 border-radius: 8px;
 overflow: hidden;
}
.cal-cell {
 background: #fff;
 min-height: 90px;
 padding: 8px;
 font-size: 11px;
}
.cal-cell.head {
 background: #fafbfc;
 text-align: center;
 font-weight: 600;
 min-height: auto;
 padding: 8px;
 color: var(--text-sub);
}
.cal-date { font-weight: 600; margin-bottom: 4px; }
.cal-event {
 background: var(--primary-light);
 color: var(--primary);
 padding: 2px 6px;
 border-radius: 3px;
 font-size: 10px;
 margin-bottom: 2px;
 cursor: pointer;
 font-weight: 500;
 white-space: nowrap;
 overflow: hidden;
 text-overflow: ellipsis;
}
.cal-event.violet { background: #e0f2fe; color: #0369a1; } /* sky */
.cal-event.blue { background: #dbeafe; color: #1e40af; } /* indigo blue */
.cal-cell.today .cal-date {
 background: var(--primary);
 color: #fff;
 width: 22px; height: 22px;
 border-radius: 50%;
 display: grid;
 place-items: center;
}

/* ============ Form Components (戦略設計) ============ */
.form-card {
 background: #fff;
 border: 1px solid var(--border);
 border-radius: 10px;
 padding: 22px;
 margin-bottom: 16px;
}
.form-section-header {
 display: flex;
 align-items: center;
 justify-content: space-between;
 margin-bottom: 14px;
 padding-bottom: 12px;
 border-bottom: 1px solid var(--border);
}
.form-section-title {
 font-size: 15px;
 font-weight: 700;
 display: flex;
 align-items: center;
 gap: 8px;
}
.form-section-title .axis-num {
 width: 24px; height: 24px;
 border-radius: 50%;
 background: linear-gradient(135deg, var(--primary), var(--accent));
 color: #fff;
 display: grid;
 place-items: center;
 font-size: 12px;
 font-weight: 700;
}
.form-section-desc {
 font-size: 12px;
 color: var(--text-sub);
 margin-bottom: 12px;
 line-height: 1.5;
}
.form-row {
 margin-bottom: 14px;
}
.form-label {
 font-size: 12px;
 font-weight: 600;
 color: var(--text);
 margin-bottom: 6px;
 display: flex;
 align-items: center;
 justify-content: space-between;
}
.form-label .hint {
 font-weight: 400;
 color: var(--text-sub);
 font-size: 11px;
}
.form-input,
.form-textarea,
.form-select {
 width: 100%;
 padding: 9px 12px;
 border: 1px solid var(--border);
 border-radius: 6px;
 font-size: 13px;
 font-family: inherit;
 background: #fff;
 color: var(--text);
 transition: all 0.15s;
}
.form-textarea { resize: vertical; min-height: 64px; line-height: 1.6; }
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
 outline: none;
 border-color: var(--primary);
 box-shadow: 0 0 0 3px var(--primary-light);
}

.ai-button {
 background: linear-gradient(135deg, var(--ai), var(--ai-dark));
 color: #fff;
 border: none;
 padding: 6px 12px;
 border-radius: 6px;
 font-size: 11px;
 font-weight: 600;
 cursor: pointer;
 display: inline-flex;
 align-items: center;
 gap: 4px;
 transition: opacity 0.15s;
}
.ai-button:hover { opacity: 0.85; }
.ai-button.outline {
 background: #fff;
 color: var(--ai);
 border: 1px solid var(--ai);
}

.ai-suggestion {
 background: linear-gradient(135deg, var(--ai-light) 0%, #ddd6fe 100%);
 border: 1px solid #c4b5fd;
 border-left: 3px solid var(--ai);
 border-radius: 8px;
 padding: 10px 12px;
 margin-top: 6px;
 font-size: 12px;
 color: var(--text);
 line-height: 1.6;
 display: none;
}
.ai-suggestion.open { display: block; }
.ai-suggestion .label {
 font-size: 10px;
 font-weight: 700;
 color: var(--ai);
 text-transform: uppercase;
 letter-spacing: 0.05em;
 margin-bottom: 4px;
 display: flex;
 align-items: center;
 gap: 4px;
}

/* Process step editor */
.process-step-card {
 background: #fff;
 border: 1px solid var(--border);
 border-left: 4px solid var(--primary);
 border-radius: 8px;
 padding: 18px;
 margin-bottom: 12px;
}
.process-step-header {
 display: flex;
 align-items: center;
 justify-content: space-between;
 margin-bottom: 12px;
 padding-bottom: 8px;
 border-bottom: 1px solid var(--border);
}
.process-step-title {
 display: flex;
 align-items: center;
 gap: 10px;
 font-size: 14px;
 font-weight: 700;
}
.process-step-num {
 width: 26px; height: 26px;
 background: linear-gradient(135deg, var(--primary), var(--accent));
 color: #fff;
 border-radius: 50%;
 display: grid;
 place-items: center;
 font-size: 12px;
 font-weight: 700;
}
.process-step-grid {
 display: grid;
 grid-template-columns: 1fr 1fr;
 gap: 12px;
}

.action-list {
 background: var(--bg);
 border-radius: 6px;
 padding: 8px;
}
.action-list-item {
 display: flex;
 align-items: center;
 gap: 6px;
 padding: 4px 0;
 font-size: 12px;
}
.action-list-item input {
 flex: 1;
 border: 1px solid transparent;
 background: transparent;
 padding: 4px 6px;
 font-size: 12px;
 border-radius: 4px;
}
.action-list-item input:focus {
 outline: none;
 background: #fff;
 border-color: var(--primary);
}
.action-list-add {
 font-size: 11px;
 color: var(--primary);
 background: transparent;
 border: 1px dashed var(--primary);
 padding: 5px 10px;
 border-radius: 4px;
 cursor: pointer;
 margin-top: 4px;
 width: 100%;
}

/* Knowledge cards */
.knowledge-card {
 background: #fff;
 border: 1px solid var(--border);
 border-radius: 8px;
 padding: 14px;
 margin-bottom: 10px;
}
.knowledge-card-header {
 display: flex;
 justify-content: space-between;
 align-items: start;
 gap: 8px;
 margin-bottom: 8px;
}
.knowledge-card-input {
 flex: 1;
 border: 1px solid transparent;
 background: transparent;
 padding: 4px 6px;
 font-size: 13px;
 font-weight: 600;
 border-radius: 4px;
 width: 100%;
}
.knowledge-card-input:focus {
 outline: none;
 background: var(--bg);
 border-color: var(--primary);
}
.add-knowledge-btn {
 width: 100%;
 background: var(--primary-light);
 color: var(--primary);
 border: 1px dashed var(--primary);
 padding: 12px;
 border-radius: 8px;
 font-size: 13px;
 font-weight: 600;
 cursor: pointer;
 margin-top: 8px;
}

/* ============ Multi-select chip input ============ */
.chip-input {
 display: flex;
 flex-wrap: wrap;
 gap: 6px;
 padding: 7px 9px;
 border: 1px solid var(--border);
 border-radius: 6px;
 background: #fff;
 align-items: center;
 min-height: 38px;
}
.chip-input:focus-within {
 border-color: var(--primary);
 box-shadow: 0 0 0 3px var(--primary-light);
}
.chip {
 display: inline-flex;
 align-items: center;
 gap: 4px;
 background: var(--primary-light);
 color: var(--primary);
 padding: 3px 8px 3px 10px;
 border-radius: 16px;
 font-size: 12px;
 font-weight: 600;
}
.chip-x {
 cursor: pointer;
 font-size: 11px;
 width: 16px; height: 16px;
 display: grid;
 place-items: center;
 border-radius: 50%;
 margin-left: 2px;
}
.chip-x:hover { background: rgba(99,102,241,0.2); }
.chip-add {
 border: none;
 background: transparent;
 font-size: 12px;
 color: var(--text-sub);
 cursor: pointer;
 outline: none;
 padding: 2px 4px;
}

/* ============ Library (Knowledge Work-like) ============ */
.library-toolbar {
 display: flex;
 align-items: center;
 justify-content: space-between;
 gap: 12px;
 margin-bottom: 14px;
}
.library-search {
 flex: 1;
 position: relative;
 max-width: 360px;
}
.library-search input {
 width: 100%;
 padding: 9px 12px 9px 36px;
 border: 1px solid var(--border);
 border-radius: 8px;
 font-size: 13px;
 background: var(--bg);
}
.library-search::before {
 content: '';
 position: absolute;
 left: 12px; top: 50%;
 transform: translateY(-50%);
 font-size: 13px;
}

.library-filters {
 display: flex;
 gap: 6px;
 flex-wrap: wrap;
 margin-bottom: 14px;
 padding-bottom: 12px;
 border-bottom: 1px solid var(--border);
}
.lib-pill {
 padding: 6px 14px;
 background: var(--bg);
 color: var(--text-sub);
 border-radius: 16px;
 font-size: 12px;
 font-weight: 500;
 cursor: pointer;
 border: 1px solid transparent;
}
.lib-pill:hover { background: var(--primary-light); color: var(--primary); }
.lib-pill.active {
 background: var(--primary);
 color: #fff;
}
.lib-pill .count {
 margin-left: 6px;
 opacity: 0.6;
 font-size: 11px;
}

.library-grid {
 display: grid;
 grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
 gap: 14px;
}

.lib-card {
 background: #fff;
 border: 1px solid var(--border);
 border-radius: 8px;
 overflow: hidden;
 cursor: pointer;
 transition: all 0.15s;
 position: relative;
}
.lib-card:hover {
 box-shadow: var(--shadow-lg);
 transform: translateY(-2px);
 border-color: var(--primary);
}
.lib-card-thumb {
 aspect-ratio: 4/3;
 display: grid;
 place-items: center;
 font-size: 30px;
 color: #fff;
 position: relative;
 overflow: hidden;
}
.lib-card-thumb.pdf { background: linear-gradient(135deg, #dc2626, #ef4444); }
.lib-card-thumb.pptx { background: linear-gradient(135deg, #ea580c, #f97316); }
.lib-card-thumb.docx { background: linear-gradient(135deg, #1e40af, #3b82f6); }
.lib-card-thumb.xlsx { background: linear-gradient(135deg, #047857, #10b981); }
.lib-card-thumb.txt { background: linear-gradient(135deg, #475569, #64748b); }
.lib-card-thumb.fig { background: linear-gradient(135deg, #0369a1, #0ea5e9); }
.lib-card-thumb-badge {
 position: absolute;
 top: 8px; right: 8px;
 background: rgba(255,255,255,0.95);
 color: var(--text);
 font-size: 9px;
 font-weight: 700;
 padding: 2px 6px;
 border-radius: 3px;
 letter-spacing: 0.05em;
}
.lib-card-fav {
 position: absolute;
 top: 8px; left: 8px;
 background: rgba(255,255,255,0.95);
 width: 22px; height: 22px;
 border-radius: 50%;
 display: grid;
 place-items: center;
 font-size: 12px;
 cursor: pointer;
}
.lib-card-body {
 padding: 10px 12px;
}
.lib-card-title {
 font-size: 12.5px;
 font-weight: 600;
 line-height: 1.4;
 color: var(--text);
 display: -webkit-box;
 -webkit-line-clamp: 2;
 -webkit-box-orient: vertical;
 overflow: hidden;
 margin-bottom: 6px;
 min-height: 36px;
}
.lib-card-meta {
 font-size: 10px;
 color: var(--text-sub);
 display: flex;
 justify-content: space-between;
 align-items: center;
}
.lib-card-tags {
 display: flex;
 gap: 4px;
 flex-wrap: wrap;
 margin-bottom: 6px;
}
.lib-card-tag {
 font-size: 9px;
 padding: 1px 6px;
 background: var(--primary-light);
 color: var(--primary);
 border-radius: 3px;
 font-weight: 600;
}
.lib-card-actions {
 display: flex;
 gap: 4px;
 padding: 6px 10px;
 border-top: 1px solid var(--border);
 background: var(--bg);
 font-size: 10px;
 color: var(--text-sub);
}
.lib-card-action {
 flex: 1;
 text-align: center;
 padding: 4px;
 border-radius: 4px;
 cursor: pointer;
}
.lib-card-action:hover { background: var(--primary-light); color: var(--primary); }

.lib-upload-card {
 border: 2px dashed var(--border);
 background: var(--bg);
 display: grid;
 place-items: center;
 aspect-ratio: 1;
 border-radius: 8px;
 cursor: pointer;
 text-align: center;
 padding: 14px;
 transition: all 0.15s;
}
.lib-upload-card:hover {
 border-color: var(--primary);
 background: var(--primary-light);
}
.lib-upload-icon {
 font-size: 28px;
 margin-bottom: 6px;
}
.lib-upload-text {
 font-size: 12px;
 font-weight: 600;
 color: var(--primary);
}
.lib-upload-sub {
 font-size: 10px;
 color: var(--text-sub);
 margin-top: 2px;
}

/* ============ Meeting Detail Panel ============ */
.meeting-status-row {
 display: grid;
 grid-template-columns: repeat(4, 1fr);
 gap: 8px;
 margin-bottom: 18px;
}
.meeting-status-pill {
 background: var(--bg);
 border: 1px solid var(--border);
 border-radius: 8px;
 padding: 10px 12px;
 text-align: center;
}
.meeting-status-pill .label {
 font-size: 10px;
 color: var(--text-sub);
 margin-bottom: 4px;
}
.meeting-status-pill .state {
 font-size: 12px;
 font-weight: 700;
}
.meeting-status-pill.done .state { color: var(--primary); }
.meeting-status-pill.done { background: var(--primary-light); border-color: var(--primary); }
.meeting-status-pill.pending .state { color: var(--warning); }
.meeting-status-pill.idle .state { color: var(--text-muted); }

.collapse-section {
 margin-bottom: 18px;
 border: 1px solid var(--border);
 border-radius: 8px;
 overflow: hidden;
}
.collapse-head {
 background: var(--bg);
 padding: 12px 14px;
 display: flex;
 justify-content: space-between;
 align-items: center;
 cursor: pointer;
 font-size: 13px;
 font-weight: 700;
}
.collapse-head:hover { background: var(--primary-light); }
.collapse-body { padding: 14px; background: #fff; }
.collapse-section.collapsed .collapse-body { display: none; }

.merge-row {
 display: grid;
 grid-template-columns: 110px 1fr 1fr;
 gap: 10px;
 align-items: start;
 padding: 10px 0;
 border-bottom: 1px dashed var(--border);
 font-size: 12px;
}
.merge-row:last-child { border: none; }
.merge-row .field-name { font-weight: 600; color: var(--text); }
.merge-row .before {
 background: #fef2f2;
 border-left: 2px solid var(--danger);
 padding: 6px 8px;
 border-radius: 0 4px 4px 0;
 color: #7f1d1d;
 text-decoration: line-through;
 text-decoration-color: rgba(127, 29, 29, 0.4);
}
.merge-row .before.unchanged {
 background: var(--bg);
 border-left-color: var(--text-muted);
 color: var(--text-sub);
 text-decoration: none;
}
.merge-row .before.added {
 background: var(--bg);
 border-left-color: transparent;
 color: var(--text-muted);
 font-style: italic;
}
.merge-row .after {
 background: #eff6ff;
 border-left: 2px solid var(--primary);
 padding: 6px 8px;
 border-radius: 0 4px 4px 0;
 color: var(--text);
 font-weight: 500;
}
.merge-badge {
 display: inline-block;
 padding: 2px 8px;
 border-radius: 10px;
 font-size: 10px;
 font-weight: 700;
 margin-left: 6px;
}
.merge-badge.match { background: var(--primary-light); color: var(--primary); }
.merge-badge.fix { background: #fee2e2; color: var(--danger); }
.merge-badge.new { background: #ecfeff; color: #0369a1; }

.url-input-block {
 display: flex;
 gap: 8px;
 align-items: center;
 background: var(--bg);
 border: 1px dashed var(--primary);
 border-radius: 8px;
 padding: 12px;
 margin-bottom: 10px;
}
.url-input-block input {
 flex: 1;
 border: 1px solid var(--border);
 border-radius: 6px;
 padding: 8px 10px;
 font-size: 12px;
 background: #fff;
}

.meeting-card-clickable {
 cursor: pointer;
 border: 1px solid transparent;
 border-radius: 8px;
 padding: 10px;
 transition: all 0.15s;
 margin-bottom: 6px;
}
.meeting-card-clickable:hover {
 background: var(--primary-light);
 border-color: var(--primary);
 transform: translateX(2px);
}
.cal-event { transition: transform 0.1s; }
.cal-event:hover { transform: scale(1.05); }

/* ============ Settings ============ */
.settings-layout {
 display: grid;
 grid-template-columns: 220px 1fr;
 gap: 20px;
}
.settings-side {
 background: var(--bg-card);
 border: 1px solid var(--border);
 border-radius: 10px;
 padding: 12px;
 height: fit-content;
}
.settings-side-item {
 padding: 10px 12px;
 font-size: 13px;
 border-radius: 6px;
 cursor: pointer;
 display: flex;
 align-items: center;
 gap: 8px;
 color: var(--text-sub);
 margin-bottom: 2px;
}
.settings-side-item:hover { background: var(--bg); color: var(--text); }
.settings-side-item.active {
 background: var(--primary-light);
 color: var(--primary);
 font-weight: 600;
}
.settings-main {
 background: var(--bg-card);
 border: 1px solid var(--border);
 border-radius: 10px;
 padding: 24px;
}
.settings-section { margin-bottom: 28px; }
.settings-section-title {
 font-size: 15px;
 font-weight: 700;
 margin-bottom: 4px;
}
.settings-section-desc {
 font-size: 12px;
 color: var(--text-sub);
 margin-bottom: 14px;
}

/* テーマカラーパレット */
.color-palette {
 display: grid;
 grid-template-columns: repeat(7, 1fr);
 gap: 12px;
 margin-bottom: 12px;
}
.color-swatch {
 aspect-ratio: 1;
 border-radius: 12px;
 cursor: pointer;
 border: 3px solid transparent;
 transition: all 0.15s;
 position: relative;
 display: grid;
 place-items: center;
 color: #fff;
 font-size: 18px;
}
.color-swatch:hover { transform: scale(1.05); }
.color-swatch.active {
 border-color: var(--text);
 box-shadow: 0 0 0 2px var(--bg-card);
}
.color-swatch-label {
 position: absolute;
 bottom: -22px;
 font-size: 10px;
 color: var(--text-sub);
 white-space: nowrap;
}

/* モード切替トグル */
.mode-toggle {
 display: flex;
 gap: 0;
 background: var(--bg-alt);
 padding: 4px;
 border-radius: 10px;
 width: fit-content;
}
.mode-toggle-btn {
 padding: 8px 18px;
 border: none;
 background: transparent;
 cursor: pointer;
 border-radius: 8px;
 font-size: 13px;
 font-weight: 500;
 color: var(--text-sub);
 display: flex;
 align-items: center;
 gap: 6px;
}
.mode-toggle-btn.active {
 background: var(--bg-card);
 color: var(--primary);
 font-weight: 600;
 box-shadow: var(--shadow-sm);
}

/* スイッチ */
.switch {
 position: relative;
 display: inline-block;
 width: 38px;
 height: 22px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
 position: absolute;
 cursor: pointer;
 inset: 0;
 background: #cbd5e1;
 border-radius: 22px;
 transition: 0.2s;
}
.switch-slider::before {
 content: '';
 position: absolute;
 height: 16px;
 width: 16px;
 left: 3px;
 bottom: 3px;
 background: #fff;
 border-radius: 50%;
 transition: 0.2s;
}
.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider::before { transform: translateX(16px); }

.switch-row {
 display: flex;
 justify-content: space-between;
 align-items: center;
 padding: 10px 0;
 border-bottom: 1px solid var(--border);
}
.switch-row:last-child { border: none; }
.switch-row-text { font-size: 13px; }
.switch-row-text small { display: block; color: var(--text-sub); font-size: 11px; margin-top: 2px; }

/* メンバー権限テーブル */
.role-pill {
 display: inline-block;
 padding: 3px 10px;
 border-radius: 12px;
 font-size: 11px;
 font-weight: 600;
}
.role-pill.admin { background: rgba(220, 38, 38, 0.12); color: #b91c1c; }
.role-pill.manager { background: rgba(37, 99, 235, 0.12); color: var(--primary); }
.role-pill.member { background: var(--bg-alt); color: var(--text-sub); }
.role-pill.viewer { background: var(--bg-alt); color: var(--text-muted); }

/* Dashboard view toggle */
.view-toggle {
 display: flex;
 background: var(--bg-alt);
 border-radius: 8px;
 padding: 3px;
 gap: 0;
}
.view-toggle-btn {
 padding: 6px 14px;
 border: none;
 background: transparent;
 cursor: pointer;
 font-size: 12.5px;
 color: var(--text-sub);
 border-radius: 6px;
 font-weight: 500;
}
.view-toggle-btn.active {
 background: var(--bg-card);
 color: var(--primary);
 font-weight: 600;
 box-shadow: var(--shadow-sm);
}
.member-pills {
 display: flex;
 gap: 6px;
 flex-wrap: wrap;
 margin-top: 12px;
}
.member-pill {
 padding: 6px 12px;
 border-radius: 18px;
 background: var(--bg);
 border: 1px solid var(--border);
 cursor: pointer;
 font-size: 12px;
 display: flex;
 align-items: center;
 gap: 6px;
}
.member-pill.active {
 background: var(--primary);
 color: #fff;
 border-color: var(--primary);
}
.member-pill .avatar-sm {
 width: 18px; height: 18px; font-size: 9px;
}

/* ============ Pill Funnel（チャネル別ファネル） ============ */
.pfunnel-wrap {
 display: grid;
 grid-template-columns: 1fr 130px;
 gap: 18px;
 align-items: center;
}

.pfunnel {
 display: flex;
 flex-direction: column;
 align-items: center;
 gap: 6px;
}
.pfunnel-pill {
 color: #fff;
 border-radius: 999px;
 padding: 6px 16px;
 text-align: center;
 font-weight: 600;
 position: relative;
 display: flex;
 flex-direction: row;
 align-items: center;
 justify-content: center;
 gap: 6px;
 line-height: 1.2;
 box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.pfunnel-pill .pfunnel-stage {
 font-size: 11px;
 font-weight: 600;
 opacity: 0.95;
}
.pfunnel-pill .pfunnel-num {
 font-size: 13px;
 font-weight: 800;
 letter-spacing: 0.02em;
}

.pfunnel-pill.c1 { background: linear-gradient(135deg, #ef4444, #f87171); }
.pfunnel-pill.c2 { background: linear-gradient(135deg, #f97316, #fb923c); }
.pfunnel-pill.c3 { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.pfunnel-pill.c4 { background: linear-gradient(135deg, #84cc16, #a3e635); }
.pfunnel-pill.c5 { background: linear-gradient(135deg, #10b981, #34d399); }
.pfunnel-pill.c6 { background: linear-gradient(135deg, #06b6d4, #22d3ee); }

.pfunnel-conv {
 font-size: 13px;
 font-weight: 700;
 color: var(--text);
 padding: 2px 10px;
}
body.dark .pfunnel-conv { color: var(--text); }

.pfunnel-summary {
 background: var(--bg);
 border: 1px solid var(--border);
 border-radius: 10px;
 padding: 16px 8px;
 text-align: center;
 display: flex;
 flex-direction: column;
 align-items: center;
 gap: 4px;
}
.pfunnel-summary .num {
 font-size: 22px;
 font-weight: 800;
 color: var(--text);
}
.pfunnel-summary .num.start { color: #ef4444; }
.pfunnel-summary .num.end { color: #06b6d4; }
.pfunnel-summary .arrow {
 color: var(--text-muted);
 font-size: 18px;
 line-height: 1;
}
.pfunnel-summary .label-sm {
 font-size: 10px;
 color: var(--text-sub);
 font-weight: 500;
}
.pfunnel-summary .rate-label {
 font-size: 11px;
 color: var(--text-sub);
 font-weight: 600;
 margin-top: 2px;
}
.pfunnel-summary .rate-value {
 font-size: 24px;
 font-weight: 800;
 color: var(--primary);
 line-height: 1.1;
}

/* ============ Value Map（仮説立案フロー） ============ */
.vmap-intro {
 background: linear-gradient(135deg, var(--primary-light), #e0f2fe);
 border: 1px solid var(--border);
 border-radius: 8px;
 padding: 10px 14px;
 margin-bottom: 14px;
 font-size: 12px;
 line-height: 1.6;
}
.vmap-intro b { color: var(--primary); }
body.dark .vmap-intro {
 background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(14, 165, 233, 0.18));
}

.vmap-legend {
 display: flex;
 gap: 14px;
 font-size: 11px;
 color: var(--text-sub);
 margin-bottom: 12px;
}
.vmap-legend-item { display: flex; align-items: center; gap: 5px; }
.vmap-legend-dot {
 width: 12px; height: 12px;
 border: 2px solid #dc2626;
 border-radius: 3px;
}
.vmap-legend-dot.solution { border-color: var(--primary); }
.vmap-legend-dot.dim { border: 1px dashed #cbd5e1; }
.vmap-legend-line {
 width: 24px; height: 2px;
 background: #16a34a;
}

.vmap-wrapper {
 position: relative;
 overflow-x: auto;
 background: var(--bg-soft);
 border: 1px solid var(--border);
 border-radius: 10px;
 padding: 18px 16px;
}
body.dark .vmap-wrapper { background: var(--bg-alt); }

.vmap {
 display: grid;
 grid-template-columns: repeat(6, minmax(150px, 1fr));
 gap: 14px;
 position: relative;
 min-width: 920px;
 z-index: 1;
}

.vmap-col-title {
 font-size: 11px;
 font-weight: 700;
 color: #b91c1c;
 border-bottom: 2px solid #fecaca;
 padding-bottom: 6px;
 margin-bottom: 10px;
 letter-spacing: 0.05em;
}
.vmap-col-title.solution {
 color: var(--primary);
 border-bottom-color: var(--primary-light);
}

.vmap-col {
 display: flex;
 flex-direction: column;
 gap: 8px;
 position: relative;
}

.vmap-card {
 background: #fff;
 border: 1px solid var(--border);
 border-radius: 5px;
 padding: 9px 11px 9px 28px;
 font-size: 11.5px;
 line-height: 1.4;
 color: var(--text-sub);
 position: relative;
 min-height: 36px;
 display: flex;
 align-items: center;
 font-weight: 500;
}
body.dark .vmap-card { background: var(--bg-card); }

.vmap-card::before {
 content: '';
 position: absolute;
 left: 8px; top: 50%;
 transform: translateY(-50%);
 width: 12px; height: 12px;
 border: 1.5px solid #cbd5e1;
 border-radius: 2px;
}

.vmap-card.lit {
 background: #fff;
 border: 1.5px solid #dc2626;
 color: var(--text);
 font-weight: 700;
 box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.1), 0 1px 4px rgba(220, 38, 38, 0.15);
}
.vmap-card.lit::before {
 background: #dc2626;
 border-color: #dc2626;
 box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.25);
}
body.dark .vmap-card.lit { background: rgba(220, 38, 38, 0.1); }

.vmap-card.lit .lit-num {
 position: absolute;
 top: -7px; right: -7px;
 background: #dc2626;
 color: #fff;
 width: 18px; height: 18px;
 border-radius: 50%;
 font-size: 10px;
 font-weight: 700;
 display: grid;
 place-items: center;
 border: 2px solid #fff;
}
body.dark .vmap-card.lit .lit-num { border-color: var(--bg-alt); }

.vmap-card.solution {
 border-color: var(--border);
}
.vmap-card.solution::before {
 border-color: var(--text-muted);
}
.vmap-card.solution.lit {
 border-color: var(--primary);
 box-shadow: 0 0 0 2px var(--primary-light), 0 1px 4px rgba(37, 99, 235, 0.2);
}
.vmap-card.solution.lit::before {
 background: var(--primary);
 border-color: var(--primary);
 box-shadow: 0 0 0 3px var(--primary-light);
}
.vmap-card.solution.lit .lit-num {
 background: var(--primary);
}
body.dark .vmap-card.solution.lit { background: rgba(37, 99, 235, 0.15); }

.vmap-svg {
 position: absolute;
 inset: 0;
 pointer-events: none;
 z-index: 0;
}

.hypothesis-card {
 border: 1px solid var(--border);
 border-radius: 10px;
 background: #fff;
 display: flex;
 flex-direction: column;
 overflow: hidden;
}
body.dark .hypothesis-card { background: var(--bg-card); }

.hypothesis-card-head {
 padding: 10px 12px;
 color: #fff;
 font-weight: 700;
 font-size: 12px;
 display: flex;
 align-items: center;
 justify-content: space-between;
}
.hypothesis-card.sales .hypothesis-card-head { background: linear-gradient(135deg, #dc2626, #f87171); }
.hypothesis-card.hiring .hypothesis-card-head { background: linear-gradient(135deg, #d97706, #fb923c); }
.hypothesis-card.dx .hypothesis-card-head { background: linear-gradient(135deg, var(--primary-dark), var(--accent)); }

.hypothesis-card.sales { border-color: rgba(220, 38, 38, 0.25); }
.hypothesis-card.hiring { border-color: rgba(217, 119, 6, 0.25); }
.hypothesis-card.dx { border-color: rgba(37, 99, 235, 0.25); }

.hypothesis-confidence {
 background: rgba(255, 255, 255, 0.25);
 padding: 2px 8px;
 border-radius: 10px;
 font-size: 10px;
 font-weight: 700;
}

.hypothesis-body {
 padding: 12px;
 flex: 1;
 display: flex;
 flex-direction: column;
}

.hypothesis-title {
 font-size: 13.5px;
 font-weight: 700;
 margin-bottom: 8px;
 line-height: 1.4;
}

.hypothesis-block {
 margin-bottom: 12px;
}
.hypothesis-block-label {
 font-size: 9.5px;
 font-weight: 700;
 text-transform: uppercase;
 letter-spacing: 0.05em;
 color: var(--text-sub);
 margin-bottom: 5px;
}
.hypothesis-card.sales .hypothesis-block-label { color: #b91c1c; }
.hypothesis-card.hiring .hypothesis-block-label { color: #b45309; }
.hypothesis-card.dx .hypothesis-block-label { color: var(--primary); }

.hypothesis-evidence {
 font-size: 11.5px;
 color: var(--text);
 line-height: 1.5;
 background: var(--bg);
 padding: 8px 10px;
 border-radius: 6px;
 border-left: 3px solid var(--text-muted);
}

.hypothesis-questions {
 list-style: none;
 padding: 0;
 margin: 0;
 display: flex;
 flex-direction: column;
 gap: 6px;
}
.hypothesis-question {
 position: relative;
 padding: 7px 9px 7px 24px;
 font-size: 11.5px;
 line-height: 1.45;
 background: var(--bg);
 border-radius: 6px;
 color: var(--text);
}
.hypothesis-question::before {
 content: counter(q);
 counter-increment: q;
 position: absolute;
 left: 6px; top: 7px;
 width: 14px; height: 14px;
 border-radius: 50%;
 display: grid;
 place-items: center;
 font-size: 9px;
 font-weight: 700;
 color: #fff;
}
.hypothesis-card.sales .hypothesis-questions { counter-reset: q; }
.hypothesis-card.hiring .hypothesis-questions { counter-reset: q; }
.hypothesis-card.dx .hypothesis-questions { counter-reset: q; }
.hypothesis-card.sales .hypothesis-question::before { background: #dc2626; }
.hypothesis-card.hiring .hypothesis-question::before { background: #d97706; }
.hypothesis-card.dx .hypothesis-question::before { background: var(--primary); }

.hypothesis-question .talk {
 display: block;
 margin-top: 4px;
 font-size: 10.5px;
 color: var(--text-sub);
 font-style: italic;
}

.hypothesis-true-pain {
 background: #fef2f2;
 border: 1px solid #fecaca;
 border-radius: 6px;
 padding: 8px 10px;
 font-size: 11.5px;
 font-weight: 600;
 color: #7f1d1d;
}
body.dark .hypothesis-true-pain {
 background: rgba(239, 68, 68, 0.12);
 color: #fecaca;
 border-color: rgba(239, 68, 68, 0.35);
}

.hypothesis-arrow {
 text-align: center;
 font-size: 16px;
 color: var(--text-muted);
 margin: 4px 0;
}

.hypothesis-solution {
 background: linear-gradient(135deg, var(--primary-light), #e0f2fe);
 border: 1px solid var(--primary);
 border-radius: 8px;
 padding: 10px 12px;
 margin-top: auto;
}
body.dark .hypothesis-solution {
 background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(14, 165, 233, 0.18));
}
.hypothesis-solution-label {
 font-size: 10px;
 font-weight: 700;
 color: var(--primary);
 text-transform: uppercase;
 letter-spacing: 0.05em;
 margin-bottom: 4px;
 display: flex;
 align-items: center;
 gap: 4px;
}
.hypothesis-solution-name {
 font-size: 12.5px;
 font-weight: 700;
 margin-bottom: 4px;
}
.hypothesis-solution-detail {
 font-size: 11px;
 color: var(--text-sub);
 line-height: 1.5;
}
.hypothesis-solution-tags {
 display: flex;
 flex-wrap: wrap;
 gap: 4px;
 margin-top: 6px;
}
.hypothesis-solution-tag {
 font-size: 9.5px;
 font-weight: 600;
 padding: 2px 7px;
 border-radius: 10px;
 background: #fff;
 color: var(--primary);
 border: 1px solid var(--primary);
}
body.dark .hypothesis-solution-tag {
 background: var(--bg-card);
}

/* ============ Multi-select chips ============ */
.multi-select {
 border: 1px solid var(--border);
 border-radius: 6px;
 padding: 6px 8px;
 background: #fff;
 display: flex;
 flex-wrap: wrap;
 gap: 5px;
 min-height: 38px;
 align-items: center;
}
.multi-select:focus-within {
 border-color: var(--primary);
 box-shadow: 0 0 0 3px var(--primary-light);
}
.chip {
 display: inline-flex;
 align-items: center;
 gap: 4px;
 background: var(--primary-light);
 color: var(--primary);
 padding: 3px 8px;
 border-radius: 12px;
 font-size: 12px;
 font-weight: 500;
}
.chip .chip-x {
 cursor: pointer;
 font-size: 14px;
 line-height: 1;
 opacity: 0.6;
 margin-left: 2px;
}
.chip .chip-x:hover { opacity: 1; }
.chip-add {
 background: transparent;
 border: 1px dashed var(--primary);
 color: var(--primary);
 padding: 2px 8px;
 border-radius: 12px;
 font-size: 11px;
 font-weight: 500;
 cursor: pointer;
}
.chip-add:hover { background: var(--primary-light); }

/* ============ KnowledgeWork-like Content Library ============ */
.content-toolbar {
 display: flex;
 align-items: center;
 gap: 8px;
 margin-bottom: 14px;
 flex-wrap: wrap;
}
.content-search {
 flex: 1;
 min-width: 240px;
 padding: 8px 14px;
 border: 1px solid var(--border);
 border-radius: 8px;
 font-size: 13px;
 background: #fff;
}
.content-search:focus {
 outline: none;
 border-color: var(--primary);
 box-shadow: 0 0 0 3px var(--primary-light);
}
.content-filter-btn {
 padding: 8px 14px;
 background: #fff;
 border: 1px solid var(--border);
 border-radius: 8px;
 font-size: 12.5px;
 cursor: pointer;
 color: var(--text-sub);
}
.content-filter-btn:hover { border-color: var(--primary); color: var(--primary); }

.content-grid {
 display: grid;
 grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
 gap: 14px;
 margin-bottom: 14px;
}
.content-card {
 background: #fff;
 border: 1px solid var(--border);
 border-radius: 10px;
 overflow: hidden;
 cursor: pointer;
 transition: all 0.15s;
 display: flex;
 flex-direction: column;
}
.content-card:hover {
 transform: translateY(-2px);
 box-shadow: var(--shadow-lg);
 border-color: var(--primary);
}
.content-thumb {
 height: 120px;
 display: grid;
 place-items: center;
 position: relative;
 font-size: 36px;
 color: #fff;
}
.content-thumb.pdf { background: linear-gradient(135deg, #ef4444, #dc2626); }
.content-thumb.ppt { background: linear-gradient(135deg, #f97316, #ea580c); }
.content-thumb.docx { background: linear-gradient(135deg, #3b82f6, #1e40af); }
.content-thumb.xlsx { background: linear-gradient(135deg, #10b981, #059669); }
.content-thumb.video { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.content-thumb.image { background: linear-gradient(135deg, #ec4899, #be185d); }
.content-thumb.link { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.content-type-badge {
 position: absolute;
 top: 8px; right: 8px;
 background: rgba(255,255,255,0.95);
 color: var(--text);
 padding: 2px 8px;
 border-radius: 4px;
 font-size: 10px;
 font-weight: 700;
 letter-spacing: 0.05em;
}
.content-favorite {
 position: absolute;
 top: 8px; left: 8px;
 background: rgba(255,255,255,0.95);
 width: 24px; height: 24px;
 border-radius: 50%;
 display: grid;
 place-items: center;
 font-size: 12px;
 color: #f59e0b;
}
.content-info { padding: 12px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.content-title {
 font-size: 13px;
 font-weight: 600;
 line-height: 1.4;
 color: var(--text);
 display: -webkit-box;
 -webkit-line-clamp: 2;
 -webkit-box-orient: vertical;
 overflow: hidden;
}
.content-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.content-tags .tag { font-size: 10px; padding: 2px 6px; }
.content-stats {
 display: flex;
 justify-content: space-between;
 font-size: 11px;
 color: var(--text-sub);
 margin-top: auto;
 padding-top: 6px;
 border-top: 1px solid var(--border);
}

.content-upload {
 border: 2px dashed var(--border);
 border-radius: 10px;
 padding: 24px;
 text-align: center;
 background: var(--bg);
 cursor: pointer;
 transition: all 0.15s;
}
.content-upload:hover {
 border-color: var(--primary);
 background: var(--primary-light);
}
.content-upload .upload-icon {
 font-size: 28px;
 color: var(--primary);
 margin-bottom: 8px;
}
.content-upload .upload-text { font-size: 13px; color: var(--text); margin-bottom: 4px; }
.content-upload .upload-hint { font-size: 11px; color: var(--text-sub); }
.content-upload a { color: var(--primary); font-weight: 600; cursor: pointer; }

.collection-strip {
 display: flex;
 gap: 8px;
 margin-bottom: 14px;
 flex-wrap: wrap;
}
.collection-pill {
 padding: 6px 12px;
 border-radius: 20px;
 background: #fff;
 border: 1px solid var(--border);
 font-size: 12px;
 color: var(--text-sub);
 cursor: pointer;
 font-weight: 500;
}
.collection-pill.active {
 background: var(--primary);
 color: #fff;
 border-color: var(--primary);
}
.collection-pill:hover:not(.active) {
 border-color: var(--primary);
 color: var(--primary);
}

@keyframes spin {
 to { transform: rotate(360deg); }
}

/* ============ AIブリーフィングカード ============ */
.ai-briefing-card {
 background: var(--ai-light);
 border: 1px solid #c4b5fd;
 border-left: 4px solid var(--ai);
 border-radius: var(--radius);
 padding: 16px 20px;
 box-shadow: 0 2px 8px rgba(124,58,237,0.08);
 min-height: 56px;
}
.ai-briefing-loading {
 display: flex;
 align-items: center;
 color: var(--ai);
 font-size: 13px;
 font-weight: 500;
 padding: 8px 0;
}
.ai-briefing-header {
 display: flex;
 align-items: center;
 gap: 10px;
 margin-bottom: 12px;
}
.ai-briefing-badge {
 display: inline-flex;
 align-items: center;
 gap: 5px;
 background: var(--ai);
 color: #fff;
 font-size: 11px;
 font-weight: 700;
 padding: 3px 10px;
 border-radius: 99px;
}
.ai-briefing-body {}
.ai-briefing-items {
 display: flex;
 flex-direction: column;
 gap: 10px;
}
.ai-briefing-item {
 display: flex;
 align-items: flex-start;
 gap: 10px;
 padding: 10px 12px;
 background: rgba(255,255,255,0.7);
 border-radius: 8px;
 border: 1px solid rgba(196,181,253,0.4);
}
.ai-briefing-item-icon {
 width: 28px;
 height: 28px;
 border-radius: 6px;
 display: grid;
 place-items: center;
 flex-shrink: 0;
 margin-top: 1px;
}
.ai-ic-meet { background: rgba(37,99,235,0.12); color: var(--primary); }
.ai-ic-action { background: rgba(22,163,74,0.12); color: var(--success); }
.ai-ic-goal { background: rgba(124,58,237,0.12); color: var(--ai); }
.ai-briefing-item-label {
 font-size: 11px;
 color: var(--text-sub);
 font-weight: 500;
 margin-bottom: 2px;
}
.ai-briefing-item-val {
 font-size: 13px;
 font-weight: 600;
 color: var(--text);
}
.ai-briefing-link {
 font-size: 11px;
 color: var(--ai);
 font-weight: 600;
 text-decoration: none;
 white-space: nowrap;
 margin-top: 2px;
 flex-shrink: 0;
}
.ai-briefing-link:hover { text-decoration: underline; }
.ai-briefing-progress {
 height: 4px;
 background: rgba(124,58,237,0.15);
 border-radius: 2px;
 margin-top: 6px;
 overflow: hidden;
}
.ai-briefing-progress-bar {
 height: 100%;
 background: var(--ai);
 border-radius: 2px;
 transition: width 0.4s ease;
}

/* ============ ICPスコアバッジ ============ */
.icp-tier-badge {
 display: inline-flex;
 align-items: center;
 gap: 4px;
 padding: 2px 8px;
 border-radius: 99px;
 font-size: 11px;
 font-weight: 700;
}
.icp-tier-1 { background: rgba(22,163,74,0.12); color: var(--score-high); }
.icp-tier-2 { background: rgba(245,158,11,0.12); color: var(--score-mid); }
.icp-tier-3 { background: rgba(239,68,68,0.12); color: var(--score-low); }
.industry-pill {
 display: inline-block;
 padding: 2px 8px;
 background: var(--bg-alt);
 color: var(--text-sub);
 border-radius: 99px;
 font-size: 11px;
 font-weight: 500;
 white-space: nowrap;
}
.contact-date-warn { color: var(--warning); font-weight: 600; }
.contact-date-danger { color: var(--danger); font-weight: 600; }

/* ============ メンバー別売上進捗 ============ */
.member-progress-list {
 display: flex;
 flex-direction: column;
 background: var(--bg);
 border-radius: 10px;
 padding: 6px 14px;
}
.member-progress-row {
 display: grid;
 grid-template-columns: 24px 36px 1fr auto auto;
 gap: 14px;
 align-items: center;
 padding: 12px 0;
 border-bottom: 1px solid var(--border);
}
.member-progress-row:last-child { border-bottom: none; }
.mp-rank { font-size: 13px; font-weight: 700; color: var(--text-sub); text-align: center; }
.mp-avatar {
 width: 32px; height: 32px;
 border-radius: 50%;
 color: #fff;
 display: flex; align-items: center; justify-content: center;
 font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
}
.mp-info { min-width: 0; }
.mp-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.mp-name { font-size: 14px; font-weight: 700; color: var(--text); }
.mp-target { font-size: 11px; color: var(--text-sub); }
.mp-bar-wrap {
 height: 8px;
 background: var(--bg-alt);
 border-radius: 4px;
 overflow: hidden;
}
.mp-bar-fill { height: 100%; border-radius: 4px; transition: width 0.6s ease; }
.mp-actual { font-size: 18px; font-weight: 800; color: var(--text); }
.mp-actual-unit { font-size: 12px; font-weight: 600; color: var(--text-sub); margin-left: 2px; }
.mp-pct {
 font-size: 11px; font-weight: 700;
 padding: 3px 8px;
 border-radius: 99px;
 white-space: nowrap;
}
.mp-pct.high { background: rgba(22,163,74,0.12); color: var(--success); }
.mp-pct.mid  { background: rgba(245,158,11,0.12); color: var(--warning); }
.mp-pct.low  { background: rgba(239,68,68,0.12); color: var(--danger); }

/* ============ 今月の受注一覧 ============ */
.recent-wins { display: flex; flex-direction: column; }
.recent-win-row {
 display: grid;
 grid-template-columns: 50px 28px 1fr auto;
 gap: 12px;
 align-items: center;
 padding: 10px 8px;
 border-bottom: 1px solid var(--border);
}
.recent-win-row:last-child { border-bottom: none; }
.rw-date { font-size: 11px; color: var(--text-sub); font-weight: 600; }
.rw-avatar {
 width: 26px; height: 26px;
 border-radius: 50%;
 color: #fff;
 display: flex; align-items: center; justify-content: center;
 font-size: 11px; font-weight: 700;
}
.rw-info { min-width: 0; }
.rw-deal { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rw-owner { font-size: 11px; color: var(--text-sub); }
.rw-amount { font-size: 15px; font-weight: 800; color: var(--primary); white-space: nowrap; }

/* ============ 失注理由分析 ============ */
.loss-list { display: flex; flex-direction: column; gap: 10px; }
.loss-row {
 display: grid;
 grid-template-columns: 12px 90px 1fr 36px;
 gap: 10px;
 align-items: center;
}
.loss-dot { width: 8px; height: 8px; border-radius: 50%; }
.loss-label { font-size: 13px; color: var(--text); white-space: nowrap; }
.loss-bar-wrap {
 height: 26px;
 background: var(--bg-alt);
 border-radius: 6px;
 overflow: hidden;
 position: relative;
}
.loss-bar {
 height: 100%;
 border-radius: 6px;
 display: flex;
 align-items: center;
 padding: 0 10px;
 min-width: 40px;
 transition: width 0.5s ease;
}
.loss-count { color: #fff; font-size: 11px; font-weight: 700; }
.loss-pct { font-size: 12px; color: var(--text-sub); text-align: right; font-weight: 600; }

/* ============ 全体ファネル分析 ============ */
.of-grid { display: grid; grid-template-columns: 1fr 140px; gap: 20px; align-items: stretch; min-height: 460px; }
.of-funnel {
 display: flex; flex-direction: column; align-items: center;
 justify-content: space-between;
 padding: 8px 0;
 flex: 1;
}
.of-pill {
 height: 44px;
 border-radius: 99px;
 display: flex; align-items: center; justify-content: center;
 color: #fff; font-size: 14px; font-weight: 600;
 box-shadow: 0 2px 6px rgba(0,0,0,0.08);
 transition: width 0.5s ease;
 min-width: 100px;
}
.of-pill b { font-weight: 800; margin-left: 4px; }
.of-rate { font-size: 13px; color: var(--text-sub); font-weight: 700; padding: 2px 0; }
.of-side {
 display: flex; flex-direction: column; align-items: center;
 justify-content: center; gap: 8px;
 padding: 24px 12px;
 background: var(--bg);
 border: 1px solid var(--border);
 border-radius: 12px;
 align-self: center;
}
.of-side-block { text-align: center; }
.of-side-l { font-size: 11px; color: var(--text-sub); margin-bottom: 2px; }
.of-side-v { font-size: 26px; font-weight: 800; line-height: 1.1; }
.of-side-arrow { color: var(--text-muted); font-size: 13px; }

/* ============ ダッシュボード 3×3 グリッドシステム ============ */
/* 1マス = 1/3列幅 × 160px。各カードに data-w（1〜3）data-h（1〜3）で占有マスを指定 */
.dash-grid {
 display: grid;
 grid-template-columns: repeat(3, 1fr);
 grid-auto-rows: 160px;
 gap: 16px;
 align-items: stretch;
}
.dash-grid > [data-w="1"] { grid-column: span 1; }
.dash-grid > [data-w="2"] { grid-column: span 2; }
.dash-grid > [data-w="3"] { grid-column: span 3; }
.dash-grid > [data-h="1"] { grid-row: span 1; }
.dash-grid > [data-h="2"] { grid-row: span 2; }
.dash-grid > [data-h="3"] { grid-row: span 3; }
.dash-grid > .card,
.dash-grid > [data-w] {
 display: flex;
 flex-direction: column;
 min-height: 0;
 overflow: hidden;
}
.dash-grid > .card > *:last-child:not(.card-title) {
 flex: 1;
 min-height: 0;
 overflow: auto;
}
.dash-grid > .dash-hero-dark { overflow: visible; }

/* ============ ダッシュボード ヒーロー（白基調） ============ */
.dash-hero-dark {
 padding: 28px 32px;
 background: linear-gradient(135deg, #fff 0%, var(--primary-light) 100%);
 color: var(--text);
 border-radius: 14px;
 border: 1px solid var(--border);
 box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.dash-hero-dark-grid {
 display: grid;
 grid-template-columns: 1.4fr 160px 1fr;
 gap: 32px;
 align-items: center;
}
.dash-hero-dark-main { min-width: 0; }
.dash-hero-dark-label { font-size: 13px; color: var(--text-sub); font-weight: 600; margin-bottom: 6px; }
.dash-hero-dark-value { font-size: 38px; font-weight: 800; color: var(--text); letter-spacing: -0.02em; line-height: 1.05; }
.dash-hero-dark-sub { font-size: 13px; color: var(--text-sub); margin: 8px 0 14px; }
.dash-hero-dark-bar { height: 8px; background: rgba(0,0,0,0.07); border-radius: 4px; overflow: hidden; }
.dash-hero-dark-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 4px; }
.dash-hero-dark-ring { position: relative; display: flex; align-items: center; justify-content: center; }
.dash-hero-dark-ring-text { position: absolute; text-align: center; }
.dash-hero-dark-ring-text .ring-pct { font-size: 28px; font-weight: 800; color: var(--primary); }
.dash-hero-dark-ring-text .ring-lbl { font-size: 11px; color: var(--text-sub); margin-top: 2px; }
.dash-hero-dark-stats { display: flex; flex-direction: column; gap: 10px; }
.hero-stat-row { display: flex; align-items: center; gap: 12px; }
.hero-stat-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.hero-stat-l { font-size: 11px; color: var(--text-sub); font-weight: 600; }
.hero-stat-v { font-size: 18px; font-weight: 700; color: var(--text); }

/* ミニKPIカード（カラフル） */
.mini-kpi { padding: 16px 18px; position: relative; }
.mini-kpi-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 15px; margin-bottom: 10px; }
.mini-kpi-label { font-size: 11px; color: var(--text-sub); font-weight: 600; margin-bottom: 4px; }
.mini-kpi-value { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1; letter-spacing: -0.02em; }
.mini-kpi-unit { font-size: 13px; font-weight: 600; color: var(--text-sub); margin-left: 2px; }
.mini-kpi-spark { margin: 8px 0 4px; height: 24px; }
.mini-kpi-spark svg { width: 100%; height: 100%; }
.mini-kpi-delta { font-size: 11px; font-weight: 700; }
.mini-kpi-delta.up { color: var(--success); }
.mini-kpi-delta.down { color: var(--danger); }

/* メンバー別ランキング */
.member-rank { display: flex; flex-direction: column; gap: 10px; }
.member-rank-row { display: grid; grid-template-columns: 20px 32px 1fr auto; gap: 10px; align-items: center; }
.member-rank-num { font-size: 13px; font-weight: 800; color: var(--text-sub); text-align: center; }
.member-rank-avatar { width: 28px; height: 28px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.member-rank-info { min-width: 0; }
.member-rank-name { font-size: 12px; font-weight: 700; color: var(--text); }
.member-rank-amt { font-size: 11px; color: var(--text-sub); }
.member-rank-bar { width: 80px; height: 6px; background: var(--bg-alt); border-radius: 3px; overflow: hidden; }
.member-rank-bar-fill { height: 100%; border-radius: 3px; }

/* ============ 歩留まりファネル（白カード） ============ */
.funnel-dark-card {
 background: var(--bg-card);
 color: var(--text);
 padding: 24px 28px;
 border-radius: 14px;
 box-shadow: 0 2px 8px rgba(0,0,0,0.04);
 border: 1px solid var(--border);
}
.funnel-dark-card .card-title { color: var(--text) !important; }
.funnel-dark-head {
 display: flex; align-items: center; justify-content: space-between;
 margin-bottom: 22px;
 gap: 18px;
}
.funnel-dark-tabs { display: flex; gap: 8px; }
.funnel-dark-tab {
 background: transparent;
 color: var(--text-sub);
 border: 1px solid var(--border);
 padding: 6px 16px;
 border-radius: 99px;
 font-size: 12px;
 cursor: pointer;
 transition: all 0.15s;
}
.funnel-dark-tab:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.funnel-dark-tab.active { background: var(--primary); color: #fff; font-weight: 700; border-color: var(--primary); }
.funnel-dark-grid {
 display: grid;
 grid-template-columns: 1fr 180px;
 gap: 28px;
 align-items: center;
}
.funnel-dark-main {
 display: flex; flex-direction: column; align-items: center; gap: 4px;
 background: var(--bg);
 border-radius: 12px;
 padding: 22px 18px;
}
.funnel-dark-bar {
 height: 40px;
 border-radius: 6px;
 display: flex; align-items: center; justify-content: center;
 color: #fff; font-size: 14px; font-weight: 700;
 min-width: 100px;
 transition: width 0.4s ease;
}
.funnel-dark-rate {
 font-size: 12px; color: var(--text-muted);
 padding: 2px 0;
}
.funnel-dark-summary {
 background: var(--bg);
 border-radius: 12px;
 padding: 26px 20px;
 display: flex; flex-direction: column; align-items: center;
 gap: 8px;
}
.fds-block { text-align: center; }
.fds-lbl { font-size: 12px; color: var(--text-sub); margin-bottom: 4px; }
.fds-val { font-size: 32px; font-weight: 800; color: var(--text); line-height: 1; }
.fds-val.accent { color: var(--primary); }
.fds-arrow { color: var(--text-muted); font-size: 14px; }

/* ============ ダッシュボード ヒーロー（旧、念のため残す） ============ */
.dash-hero {
 padding: 28px 32px;
 background: linear-gradient(135deg, #fff, var(--primary-light));
 border: 1px solid var(--border);
 border-radius: 14px;
 box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.dash-hero-grid {
 display: grid;
 grid-template-columns: 1.6fr 1fr 1fr 1fr;
 gap: 28px;
 align-items: center;
}
.dash-hero-main { min-width: 0; }
.dash-hero-label { font-size: 13px; color: var(--text-sub); font-weight: 600; margin-bottom: 6px; }
.dash-hero-value { font-size: 32px; font-weight: 800; color: var(--text); letter-spacing: -0.02em; line-height: 1.1; }
.dash-hero-target { font-size: 14px; color: var(--text-sub); font-weight: 500; }
.dash-hero-progress {
 margin-top: 12px;
 position: relative;
 height: 28px;
 background: rgba(0,0,0,0.05);
 border-radius: 6px;
 overflow: hidden;
}
.dash-hero-progress-bar {
 height: 100%;
 background: linear-gradient(90deg, var(--primary), var(--accent));
 transition: width 0.8s ease;
}
.dash-hero-progress-text {
 position: absolute;
 top: 50%; left: 12px;
 transform: translateY(-50%);
 font-size: 12px; font-weight: 700;
 color: #fff;
 text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.dash-hero-stat { border-left: 1px solid var(--border); padding-left: 24px; }
.dash-hero-stat-label { font-size: 11px; color: var(--text-sub); font-weight: 600; margin-bottom: 6px; }
.dash-hero-stat-value { font-size: 24px; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }

/* ============ パイプラインファネル ============ */
.pipeline-funnel { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.pf-row { display: grid; grid-template-columns: 80px 1fr 70px; align-items: center; gap: 12px; }
.pf-stage { font-size: 12px; color: var(--text-sub); font-weight: 600; }
.pf-bar-wrap { background: rgba(0,0,0,0.04); border-radius: 6px; overflow: hidden; height: 28px; display: flex; align-items: center; }
.pf-bar { height: 100%; display: flex; align-items: center; padding: 0 10px; border-radius: 6px 0 0 6px; min-width: 60px; }
.pf-bar-n { color: #fff; font-size: 12px; font-weight: 700; }
.pf-amt { font-size: 12px; font-weight: 700; color: var(--text); text-align: right; }

/* ============ ダッシュボード 大型 KPI カード（旧、念のため残す） ============ */
.dash-kpi-big {
 padding: 28px 32px;
 background: linear-gradient(135deg, #fff, var(--primary-light));
 border: 1px solid var(--border);
 border-radius: 14px;
 box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.dash-kpi-label {
 font-size: 13px;
 color: var(--text-sub);
 font-weight: 600;
 margin-bottom: 12px;
 letter-spacing: 0.02em;
}
.dash-kpi-value {
 font-size: 36px;
 font-weight: 800;
 color: var(--text);
 line-height: 1.1;
 letter-spacing: -0.02em;
}
.dash-kpi-unit {
 font-size: 16px;
 font-weight: 600;
 color: var(--text-sub);
}
.dash-kpi-delta {
 margin-top: 10px;
 font-size: 13px;
 font-weight: 700;
}
.dash-kpi-delta.up { color: var(--success); }
.dash-kpi-delta.down { color: var(--danger); }

/* ============ アラート（1行コンパクト） ============ */
.alert-list {
 background: var(--card);
 border: 1px solid var(--border);
 border-radius: 10px;
 overflow: hidden;
 box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.alert-row {
 display: grid;
 grid-template-columns: 10px auto auto 1fr auto auto 28px;
 align-items: center;
 gap: 12px;
 padding: 12px 16px;
 border-bottom: 1px solid var(--border);
 transition: background 0.12s;
}
.alert-row:last-child { border-bottom: none; }
.alert-row:hover { background: var(--bg-alt); }
.alert-dot { width: 8px; height: 8px; border-radius: 50%; }
.alert-type {
 font-size: 11px; font-weight: 700;
 padding: 2px 8px; border-radius: 4px;
 letter-spacing: 0.02em;
}
.alert-type.danger  { background: rgba(239,68,68,0.1);  color: var(--danger); }
.alert-type.warning { background: rgba(245,158,11,0.1); color: var(--warning); }
.alert-type.info    { background: var(--primary-light); color: var(--primary); }
.alert-target { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; }
.alert-detail { font-size: 12px; color: var(--text-sub); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-time { font-size: 11px; color: var(--text-sub); white-space: nowrap; }
.alert-action {
 background: var(--primary);
 color: #fff;
 border: none;
 padding: 5px 12px;
 border-radius: 6px;
 font-size: 12px;
 font-weight: 600;
 cursor: pointer;
 white-space: nowrap;
}
.alert-action:hover { background: var(--primary-dark); }
.alert-done {
 width: 28px; height: 28px;
 border: 1px solid var(--border);
 background: var(--card);
 color: var(--text-sub);
 border-radius: 50%;
 cursor: pointer;
 font-size: 13px;
 display: flex; align-items: center; justify-content: center;
}
.alert-done:hover { background: var(--success); color: #fff; border-color: var(--success); }

/* ============ 通知タブ ============ */
.notif-list { display: flex; flex-direction: column; gap: 0; }
.notif-item {
 display: grid;
 grid-template-columns: 40px 1fr auto;
 gap: 14px;
 align-items: center;
 padding: 14px 12px;
 border-bottom: 1px solid var(--border);
 transition: background 0.15s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-alt); }
.notif-item.unread { background: rgba(37, 99, 235, 0.04); border-left: 3px solid var(--primary); padding-left: 9px; }
.notif-item.unread.danger { background: rgba(239, 68, 68, 0.05); border-left-color: var(--danger); }
.notif-item.unread.warning { background: rgba(245, 158, 11, 0.05); border-left-color: var(--warning); }
.notif-item.unread.info { background: var(--primary-light); border-left-color: var(--primary); }
.notif-icon {
 width: 36px; height: 36px; border-radius: 8px;
 display: flex; align-items: center; justify-content: center;
 font-size: 16px; font-weight: 700;
}
.notif-body { min-width: 0; }
.notif-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.notif-desc { font-size: 12px; color: var(--text-sub); line-height: 1.5; margin-bottom: 4px; }
.notif-meta { font-size: 11px; color: var(--text-sub); opacity: 0.75; }
.notif-action { color: var(--primary); font-size: 12px; font-weight: 600; white-space: nowrap; text-decoration: none; }
.notif-action:hover { text-decoration: underline; }

/* ============ アクティビティタブ ============ */
.activity-list { display: flex; flex-direction: column; position: relative; padding-left: 8px; }
.activity-list::before {
 content: ''; position: absolute; left: 13px; top: 8px; bottom: 8px;
 width: 2px; background: var(--border);
}
.activity-item {
 display: grid; grid-template-columns: 24px 1fr; gap: 14px;
 padding: 12px 0; position: relative;
}
.activity-marker {
 width: 12px; height: 12px; border-radius: 50%;
 background: var(--primary); margin-top: 5px;
 border: 3px solid var(--bg); z-index: 1;
 box-shadow: 0 0 0 2px var(--primary);
}
.activity-marker.success { background: var(--success); box-shadow: 0 0 0 2px var(--success); }
.activity-marker.warning { background: var(--warning); box-shadow: 0 0 0 2px var(--warning); }
.activity-marker.danger { background: var(--danger); box-shadow: 0 0 0 2px var(--danger); }
.activity-body { min-width: 0; }
.activity-head { font-size: 13px; color: var(--text); line-height: 1.6; margin-bottom: 2px; }
.activity-head b { color: var(--primary); font-weight: 600; }
.activity-meta { font-size: 11px; color: var(--text-sub); opacity: 0.85; }

/* ============ ctx-nav バッジ ============ */
.ctx-nav-badge {
 display: inline-block; min-width: 18px; height: 18px;
 padding: 0 5px; line-height: 18px;
 background: var(--danger); color: white;
 border-radius: 99px; font-size: 10px; font-weight: 700;
 text-align: center; margin-left: 6px; vertical-align: middle;
}

/* ============ ゴールツリー（Addness風） ============ */
.goals-tree {
 background: var(--card);
 border: 1px solid var(--border);
 border-radius: 12px;
 padding: 8px 0;
 box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.goal-row { position: relative; }
.goal-children {
 position: relative;
 padding-left: 24px;
}
.goal-children::before {
 content: '';
 position: absolute;
 left: 39px;
 top: 0;
 bottom: 12px;
 width: 2px;
 background: var(--border);
}
.goal-line {
 display: flex;
 align-items: center;
 gap: 10px;
 padding: 8px 16px;
 transition: background 0.12s;
 position: relative;
}
.goal-line:hover { background: var(--bg-alt); }
.goal-toggle {
 width: 18px; flex-shrink: 0;
 display: flex; align-items: center; justify-content: center;
}
.goal-toggle button {
 width: 18px; height: 18px;
 border: none; background: none;
 color: var(--text-sub);
 font-size: 9px;
 cursor: pointer;
 display: flex; align-items: center; justify-content: center;
 border-radius: 4px;
 padding: 0;
}
.goal-toggle button:hover { background: rgba(0,0,0,0.06); color: var(--text); }
.goal-count {
 width: 36px; height: 36px;
 border-radius: 50%;
 background: var(--primary);
 color: #fff;
 font-size: 13px;
 font-weight: 700;
 display: flex; align-items: center; justify-content: center;
 flex-shrink: 0;
 position: relative; z-index: 2;
}
.goal-icon {
 width: 36px; height: 36px;
 border-radius: 50%;
 display: flex; align-items: center; justify-content: center;
 flex-shrink: 0;
 color: #fff;
 position: relative; z-index: 2;
 transition: background-color 0.25s ease, transform 0.18s ease;
}
.goal-icon.todo { background: #3b82f6; }
.goal-icon.working { background: #f97316; }
.goal-icon.done { background: var(--success); }
.goal-icon-btn.is-animating .goal-icon.done svg { animation: goal-check-draw 0.45s ease-out 0.05s both; }

@keyframes goal-check-draw {
 0%   { stroke-dasharray: 24; stroke-dashoffset: 24; transform: scale(0.6); }
 60%  { stroke-dasharray: 24; stroke-dashoffset: 0;  transform: scale(1.18); }
 100% { stroke-dasharray: 24; stroke-dashoffset: 0;  transform: scale(1); }
}

/* クリック直後のステータス変化アニメーション */
.goal-icon-btn.is-animating .goal-icon,
.goal-icon-btn.is-animating .goal-count {
 animation: goal-pop 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.goal-icon-btn.is-animating::after {
 content: '';
 position: absolute;
 inset: -4px;
 border-radius: 50%;
 border: 2px solid var(--success);
 opacity: 0.6;
 animation: goal-ring 0.55s ease-out forwards;
 pointer-events: none;
}
.goal-icon-btn { position: relative; }
@keyframes goal-pop {
 0%   { transform: scale(1); }
 30%  { transform: scale(0.78); }
 60%  { transform: scale(1.15); }
 100% { transform: scale(1); }
}
@keyframes goal-ring {
 0%   { transform: scale(0.7); opacity: 0.6; }
 100% { transform: scale(1.6); opacity: 0;  }
}

/* 完了タイトルの取り消し線フェードイン */
.goal-title.is-done {
 color: var(--text-sub);
 text-decoration: line-through;
 text-decoration-color: var(--success);
 transition: color 0.25s ease, text-decoration-color 0.25s ease;
}

/* 行全体のホバーアニメ */
.goal-line {
 transition: background 0.12s, padding-left 0.18s;
}
.goal-title {
 flex: 1;
 font-size: 14px;
 color: var(--text);
 line-height: 1.5;
}
.goal-title.is-done {
 color: var(--text-sub);
 text-decoration: line-through;
}
.goal-menu {
 width: 28px; height: 28px;
 border: none; background: none;
 color: var(--text-sub);
 font-size: 18px;
 cursor: pointer;
 border-radius: 50%;
 display: flex; align-items: center; justify-content: center;
 opacity: 0;
 transition: opacity 0.12s, background 0.12s;
}
.goal-line:hover .goal-menu { opacity: 1; }
.goal-menu:hover { background: rgba(0,0,0,0.08); }

/* ゴール「⋯」メニューのポップアップ */
.goal-popup-menu {
 background: #fff;
 border: 1px solid var(--border);
 border-radius: 8px;
 box-shadow: 0 12px 32px rgba(0,0,0,0.18);
 padding: 6px;
 min-width: 180px;
 display: flex;
 flex-direction: column;
}
body.dark .goal-popup-menu { background: #1e293b; border-color: rgba(255,255,255,0.12); }
.goal-popup-item {
 display: flex;
 align-items: center;
 gap: 10px;
 padding: 8px 12px;
 border: none;
 background: transparent;
 color: var(--text);
 font-size: 13px;
 cursor: pointer;
 border-radius: 6px;
 text-align: left;
 width: 100%;
}
.goal-popup-item:hover { background: var(--bg-alt); }
.goal-popup-item svg { color: var(--text-sub); flex-shrink: 0; }

/* ドラッグ&ドロップ */
.goal-row { transition: background 0.12s; }
.goal-drag-handle {
 width: 16px;
 color: var(--text-muted);
 cursor: grab;
 user-select: none;
 font-size: 14px;
 letter-spacing: -2px;
 opacity: 0;
 transition: opacity 0.12s;
 line-height: 1;
}
.goal-line:hover .goal-drag-handle { opacity: 0.6; }
.goal-drag-handle:active { cursor: grabbing; }
.goal-row.is-dragging > .goal-line { opacity: 0.4; }
.goal-row.is-dragging { cursor: grabbing; }

/* ドロップ位置ガイド: 上に挿入 */
.goal-row.drop-before {
 position: relative;
}
.goal-row.drop-before::before {
 content: '';
 position: absolute;
 top: -1px;
 left: 0; right: 0;
 height: 2px;
 background: #3b82f6;
 border-radius: 1px;
 z-index: 10;
 pointer-events: none;
 animation: drop-line-in 0.12s ease;
}
/* 丸いドット（挿入位置の左端） */
.goal-row.drop-before::after {
 content: '';
 position: absolute;
 top: -4px;
 left: 0;
 width: 8px; height: 8px;
 border-radius: 50%;
 background: #3b82f6;
 z-index: 11;
 pointer-events: none;
}

/* ドロップ位置ガイド: 下に挿入 */
.goal-row.drop-after {
 position: relative;
}
.goal-row.drop-after::before {
 content: '';
 position: absolute;
 bottom: -1px;
 left: 0; right: 0;
 height: 2px;
 background: #3b82f6;
 border-radius: 1px;
 z-index: 10;
 pointer-events: none;
 animation: drop-line-in 0.12s ease;
}
.goal-row.drop-after::after {
 content: '';
 position: absolute;
 bottom: -4px;
 left: 0;
 width: 8px; height: 8px;
 border-radius: 50%;
 background: #3b82f6;
 z-index: 11;
 pointer-events: none;
}

/* ドロップ位置ガイド: 子として挿入 */
.goal-row.drop-inside > .goal-line {
 background: rgba(59,130,246,0.07);
 outline: 2px solid #3b82f6;
 outline-offset: 2px;
 border-radius: 6px;
}

@keyframes drop-line-in {
 from { opacity: 0; transform: scaleX(0.5); }
 to   { opacity: 1; transform: scaleX(1); }
}

/* ゴールタイトルインライン編集 */
.goal-title-edit {
 flex: 1;
 padding: 4px 8px;
 border: none;
 border-bottom: 2px solid var(--danger);
 background: transparent;
 font-size: 14px;
 color: var(--text);
 outline: none;
 font-family: inherit;
}
.goal-title-edit:focus { border-bottom-color: var(--primary); }
.goal-inline-new { border-bottom-color: var(--primary); }
.goal-row-new > .goal-line { background: rgba(99,102,241,0.04); border-radius: 6px; }

/* 見込み客タブ — 会社名ノード */
.goal-company-node {
 padding: 10px 16px 10px 8px;
 background: transparent;
 border-radius: 4px;
 cursor: pointer;
 outline: none;
}
.goal-company-node:hover { background: var(--bg-alt); }
.goal-company-node:focus { outline: 2px solid var(--primary); outline-offset: -2px; }
.goal-company-node.is-focused { background: var(--bg-alt); outline: 2px solid var(--primary); outline-offset: -2px; }
.goal-company-name {
 font-size: 16px;
 font-weight: 700;
 color: var(--text);
 letter-spacing: -0.01em;
 flex: 1;
}

/* キーボードフォーカス状態（視覚効果なし、内部状態のみ） */
.goal-row:focus { outline: none; }
.goal-edit-cancel,
.goal-edit-commit {
 width: 28px; height: 28px;
 border: none; background: transparent;
 color: var(--text-sub);
 cursor: pointer;
 font-size: 16px;
 display: flex; align-items: center; justify-content: center;
 border-radius: 50%;
 flex-shrink: 0;
}
.goal-edit-cancel:hover { background: rgba(239,68,68,0.12); color: var(--danger); }
.goal-edit-commit:hover { background: rgba(22,163,74,0.12); color: var(--success); }
.goal-icon-btn {
 border: none; background: none; padding: 0; cursor: pointer;
 display: flex; align-items: center; justify-content: center;
 border-radius: 50%;
 transition: transform 0.15s;
}
.goal-icon-btn:hover { transform: scale(1.08); }
.goal-icon-btn:active { transform: scale(0.95); }
.goal-title { cursor: text; user-select: none; -webkit-user-select: none; }
.goal-title:hover { color: var(--text); }
.goal-title.is-parent { cursor: default; font-weight: 600; }
.goal-title.is-parent:hover { color: var(--text); }
.goal-icon-btn.is-parent { cursor: default; }
.goal-icon-btn.is-parent:hover { transform: none; }

/* 見込み客タブ：SFAリスト1行風のコンパクト顧客行 */
.customer-row {
 display: flex; align-items: center; gap: 12px;
 padding: 10px 14px;
 background: var(--card);
 border: 1px solid var(--border);
 border-radius: 10px;
 box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.customer-row-logo {
 width: 28px; height: 28px;
 border-radius: 6px;
 background: linear-gradient(135deg, var(--primary), var(--ai));
 color: #fff;
 display: flex; align-items: center; justify-content: center;
 font-size: 11px; font-weight: 700;
 flex-shrink: 0;
}
.customer-row-name { font-size: 13px; font-weight: 700; color: var(--text); }
.customer-row-meta { font-size: 12px; color: var(--text-sub); }
.customer-row-pill {
 font-size: 11px; padding: 2px 8px;
 background: var(--bg-alt); color: var(--text-sub);
 border-radius: 99px;
}
.customer-row-score {
 font-size: 12px; font-weight: 700; color: var(--primary);
}
.customer-row-status {
 font-size: 11px; padding: 2px 8px;
 background: var(--primary-light); color: var(--primary);
 border-radius: 4px; font-weight: 600;
}
.customer-row .btn-sm {
 margin-left: auto; font-size: 12px; padding: 5px 12px;
}
.btn-sm { font-size: 12px; padding: 5px 12px; }

/* 今日のToDo バナー */
.today-banner {
 display: flex;
 align-items: center;
 justify-content: space-between;
 gap: 14px;
 padding: 16px 20px;
 margin-bottom: 14px;
 background: linear-gradient(135deg, rgba(124,58,237,0.06), rgba(37,99,235,0.04));
 border: 1px solid rgba(124,58,237,0.2);
 border-radius: 12px;
}
.today-banner-title {
 font-size: 15px; font-weight: 700; color: var(--ai); margin-bottom: 2px;
}
.today-banner-desc {
 font-size: 12px; color: var(--text-sub);
}
.today-banner-count {
 font-size: 32px; font-weight: 800; color: var(--ai);
 line-height: 1;
}

/* ====================== ⋯ 行メニュー（F-1-A 共通） ====================== */
.row-menu-wrap {
 position: relative;
 display: inline-block;
}
.row-menu-btn {
 width: 28px; height: 28px;
 border: none; background: none;
 color: var(--text-sub);
 font-size: 18px; font-weight: 700;
 cursor: pointer;
 border-radius: 50%;
 display: flex; align-items: center; justify-content: center;
 opacity: 0;
 transition: opacity 0.12s, background 0.12s;
 line-height: 1;
 letter-spacing: -1px;
}
tr:hover .row-menu-btn,
.card-row:hover .row-menu-btn,
.std tbody tr:hover .row-menu-btn,
.crm-table tbody tr:hover .row-menu-btn,
.sfa-list tbody tr:hover .row-menu-btn { opacity: 1; }
.row-menu-btn:hover { background: rgba(0,0,0,0.08); }
body.dark .row-menu-btn:hover { background: rgba(255,255,255,0.1); }

.row-popup-menu {
 position: absolute;
 right: 0; top: calc(100% + 4px);
 background: var(--card);
 border: 1px solid var(--border);
 border-radius: 8px;
 box-shadow: 0 8px 24px rgba(0,0,0,0.15);
 padding: 4px;
 min-width: 160px;
 z-index: 9990;
 display: flex;
 flex-direction: column;
}
body.dark .row-popup-menu { background: #1e293b; border-color: rgba(255,255,255,0.12); }

.row-popup-item {
 display: flex;
 align-items: center;
 gap: 8px;
 padding: 8px 12px;
 border: none;
 background: transparent;
 color: var(--text);
 font-size: 13px;
 cursor: pointer;
 border-radius: 6px;
 text-align: left;
 width: 100%;
 transition: background 0.1s;
}
.row-popup-item:hover { background: var(--bg-alt); }
.row-popup-item.danger { color: var(--danger); }
.row-popup-item.danger:hover { background: rgba(239,68,68,0.08); }

/* ====================== デモモードバッジ ====================== */
.demo-mode-badge {
 display: inline-flex;
 align-items: center;
 gap: 6px;
 padding: 4px 12px;
 background: rgba(249,115,22,0.12);
 border: 1px solid rgba(249,115,22,0.35);
 border-radius: 20px;
 font-size: 11px;
 font-weight: 600;
 color: #c2410c;
 white-space: nowrap;
}
body.dark .demo-mode-badge {
 background: rgba(249,115,22,0.18);
 color: #fb923c;
}

/* ====================== フィードバック適用ハイライト ====================== */
@keyframes feedbackHighlight {
 0%   { background: rgba(250,204,21,0.0); }
 20%  { background: rgba(250,204,21,0.35); }
 80%  { background: rgba(250,204,21,0.25); }
 100% { background: rgba(250,204,21,0.0); }
}
.feedback-highlight {
 animation: feedbackHighlight 2s ease-out forwards;
 border-radius: 8px;
}
