/* ============ カラートークン(検証済みリファレンスパレット) ============ */
:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface-1: #fcfcfb;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --grid: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --accent: #2a78d6;        /* sequential blue 450 */
  --accent-strong: #1c5cab; /* 550 */
  --meter-track: #cde2fb;   /* blue 100 */
  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-serious: #ec835a;
  --status-critical: #d03b3b;
  --violet: #4a3aa7;
  --violet: #4a3aa7;
  --delta-good: #006300;
  --shadow: 0 1px 2px rgba(11, 11, 11, 0.05);
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface-1: #1a1a19;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted: #898781;
    --grid: #2c2c2a;
    --baseline: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --accent: #3987e5;
    --accent-strong: #6da7ec;
    --violet: #9085e9;
    --meter-track: #0d366b;
    --delta-good: #0ca30c;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface-1: #1a1a19;
  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted: #898781;
  --grid: #2c2c2a;
  --baseline: #383835;
  --border: rgba(255, 255, 255, 0.10);
  --accent: #3987e5;
  --accent-strong: #6da7ec;
  --meter-track: #0d366b;
  --delta-good: #0ca30c;
  --shadow: none;
}

/* ============ ベース ============ */
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
}
main { max-width: 1080px; margin: 0 auto; padding: 16px; }
h3 { margin: 0 0 10px; }
code { background: var(--grid); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.muted { color: var(--text-muted); }
.muted-inline { color: var(--text-muted); font-weight: normal; font-size: 12px; }
.center { text-align: center; }

/* ============ ヘッダー・タブ ============ */
.topbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--grid);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; font-size: 16px; }
.month-nav { display: flex; align-items: center; gap: 4px; }
.month-label { font-weight: 600; min-width: 110px; text-align: center; }
.topbar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.icon-btn {
  border: 1px solid var(--border); background: var(--surface-1); color: var(--text-primary);
  border-radius: 8px; padding: 4px 10px; cursor: pointer; font-size: 13px;
}
.icon-btn:hover { border-color: var(--baseline); }

.tabs {
  display: flex; gap: 4px; padding: 8px 16px 0; max-width: 1080px; margin: 0 auto;
  overflow-x: auto;
}
.tab {
  border: none; background: none; color: var(--text-secondary);
  padding: 8px 14px; cursor: pointer; font-size: 14px;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab.active { color: var(--text-primary); font-weight: 600; border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============ カード ============ */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card-title { font-size: 14px; color: var(--text-secondary); font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 { margin-bottom: 14px; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

/* ============ ヒーロー・メーター ============ */
.hero-card { padding: 20px 22px; }
.stat-label { color: var(--text-secondary); font-size: 13px; }
.hero-row { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.hero-value { font-size: 48px; font-weight: 600; letter-spacing: -0.01em; }
.landing-row {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-top: 10px; padding: 8px 12px;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0;
}
.landing-label { font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.landing-value { font-size: 20px; font-weight: 700; }
.landing-value.landing-good { color: var(--delta-good); }
.landing-value.landing-short { color: var(--status-critical); }
.landing-diff { font-size: 12px; font-weight: 600; }
.landing-diff.landing-good { color: var(--delta-good); }
.landing-diff.landing-short { color: var(--status-critical); }

.meter {
  height: 10px; border-radius: 5px; background: var(--meter-track);
  margin-top: 10px; position: relative;
}
.meter-fill { max-width: 100%; }
.meter-marker {
  position: absolute; top: -3px; bottom: -3px; width: 2px;
  background: var(--text-primary); border-radius: 1px;
  box-shadow: 0 0 0 1px var(--surface-1);
}
.meter-fill {
  height: 100%; background: var(--accent); border-radius: 5px 4px 4px 5px;
  transition: width .4s ease;
}
.meter-caption { color: var(--text-secondary); font-size: 12px; margin-top: 6px; }

/* ============ statタイル ============ */
.tiles {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px;
}
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.tile {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; box-shadow: var(--shadow);
}
.tile .stat-value { font-size: 26px; font-weight: 600; }
.tile .stat-sub { font-size: 12px; color: var(--text-muted); }

/* ============ バッジ(ステータス: 色+アイコン+ラベル) ============ */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--text-primary);
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px;
}
.badge .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.badge.good .dot { background: var(--status-good); }
.badge.warning .dot { background: var(--status-warning); }
.badge.serious .dot { background: var(--status-serious); }
.badge.critical .dot { background: var(--status-critical); }

/* ============ 逆算プラン ============ */
.plan-box table { width: 100%; border-collapse: collapse; }
.plan-box th, .plan-box td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--grid); }
.plan-box td.num { text-align: right; font-variant-numeric: tabular-nums; }
.plan-scenario { font-weight: 600; margin: 10px 0 4px; font-size: 13px; }
.plan-note { font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.plan-warning {
  color: var(--status-critical); font-weight: 700; font-size: 13px;
  border: 1px solid var(--status-critical); border-radius: 8px;
  padding: 8px 12px; margin: 0 0 10px;
  background: color-mix(in srgb, var(--status-critical) 8%, var(--surface-1));
}

/* ============ フォーム ============ */
.form-card { max-width: 860px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid label, .inline-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.form-grid label.wide { grid-column: 1 / -1; }
input, select, textarea {
  font: inherit; color: var(--text-primary); background: var(--page);
  border: 1px solid var(--baseline); border-radius: 8px; padding: 8px 10px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.req { color: var(--status-critical); font-size: 11px; font-weight: normal; }
.form-actions { margin-top: 16px; display: flex; gap: 10px; }
.btn-primary {
  background: var(--accent); color: #fff; border: none; border-radius: 8px;
  padding: 9px 22px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost {
  background: none; border: 1px solid var(--baseline); color: var(--text-primary);
  border-radius: 8px; padding: 8px 16px; cursor: pointer; font-size: 13px;
}
.link-btn { background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }

.seg { display: inline-flex; border: 1px solid var(--baseline); border-radius: 8px; overflow: hidden; width: fit-content; }
#scopeSeg[hidden] { display: none; } /* .seg の display 指定に負けて、普通のメンバーにも「全体」が出ていた */
.seg button {
  border: none; background: var(--page); color: var(--text-secondary);
  padding: 8px 22px; cursor: pointer; font-size: 14px;
}
.seg button + button { border-left: 1px solid var(--baseline); }
.seg button.on { background: var(--accent); color: #fff; font-weight: 700; }

.seiyaku-fields {
  border: 1px solid var(--accent); border-radius: 10px;
  padding: 12px 14px; margin: 14px 0;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface-1));
}
.seiyaku-head { font-weight: 700; margin-bottom: 8px; }

.hint-banner {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-1));
  border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; margin-bottom: 14px; font-size: 13px;
}

/* ============ 一覧テーブル ============ */
.list-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.table-card { padding: 6px 0 10px; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
#dealTable th {
  text-align: left; color: var(--text-muted); font-weight: 600; font-size: 12px;
  padding: 8px 10px; border-bottom: 1px solid var(--baseline); white-space: nowrap;
}
#dealTable td { padding: 8px 10px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
#dealTable td.num { text-align: right; font-variant-numeric: tabular-nums; }
#dealTable tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); cursor: pointer; }
.result-chip { display: inline-flex; align-items: center; gap: 6px; }
.result-chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.row-actions button { margin-left: 6px; }
.mini-btn {
  border: 1px solid var(--border); background: none; color: var(--text-secondary);
  border-radius: 6px; padding: 2px 8px; cursor: pointer; font-size: 12px;
}
.mini-btn:hover { border-color: var(--baseline); color: var(--text-primary); }
.vid-inline { padding: 4px 8px; font-size: 12px; width: 190px; }

/* ============ フォロー一覧 ============ */
.follow-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--grid); font-size: 13px;
}
.follow-item:last-child { border-bottom: none; }
.follow-item .who { font-weight: 600; }
.follow-item .badge { margin-left: auto; }

/* ============ 日別チャート ============ */
.dc-wrap { display: flex; align-items: flex-end; gap: 2px; height: 132px; }
.dc-col { flex: 1; min-width: 4px; max-width: 24px; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.dc-bar { display: flex; flex-direction: column; justify-content: flex-end; flex: 1; }
.dc-seg { width: 100%; }
.dc-seg + .dc-seg { margin-top: 2px; }
.dc-bar .dc-seg:first-child { border-radius: 3px 3px 0 0; }
.dc-x { font-size: 10px; color: var(--text-muted); text-align: center; margin-top: 4px; height: 12px; }
.dc-legend { display: flex; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--text-secondary); flex-wrap: wrap; }
.lg-item { display: inline-flex; align-items: center; gap: 5px; }
.lg-item .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }

/* ============ 結果内訳バー ============ */
.rb-bar { display: flex; gap: 2px; height: 18px; margin: 6px 0 4px; }
.rb-seg { border-radius: 3px; min-width: 5px; }

/* ============ 失注理由一覧 ============ */
.lost-scroll { max-height: 240px; overflow-y: auto; }
.lost-item { padding: 8px 0; border-bottom: 1px solid var(--grid); font-size: 13px; cursor: pointer; }
.lost-item:last-child { border-bottom: none; }
.lost-item:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.lost-item .who { font-weight: 600; }
.lost-reason { color: var(--text-secondary); margin-top: 2px; }

/* ============ 詳細KPI表 ============ */
.detail-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.detail-table th { text-align: left; color: var(--text-muted); font-weight: 600; font-size: 12px; padding: 7px 10px; border-bottom: 1px solid var(--baseline); }
.detail-table th.num, .detail-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.detail-table td { padding: 7px 10px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
.rank-me td { background: color-mix(in srgb, var(--accent) 10%, transparent); font-weight: 600; }
.delta { font-weight: 600; }
.delta.up { color: var(--delta-good); }
.delta.down { color: var(--status-critical); }
.delta.zero { color: var(--text-muted); }

/* ============ 分析ボックス ============ */
.analysis-text { white-space: pre-wrap; font-size: 13px; }
.analysis-date { font-size: 11px; color: var(--text-muted); margin-top: 8px; }

/* ============ 商談動画分析(カルテ・比較レポート) ============ */
#videoReportCard[hidden], .kmodal[hidden] { display: none; }
.video-report { font-size: 13px; line-height: 1.7; }
.video-report .vr-h { margin: 14px 0 4px; font-size: 14px; }
.video-report ul, .video-report ol { margin: 4px 0; padding-left: 20px; }
.video-report p { margin: 4px 0; }
.kmodal { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.45); display: flex; justify-content: center; align-items: flex-start; overflow-y: auto; padding: 32px 12px; }
.kmodal-sheet { position: relative; width: 100%; max-width: 880px; background: var(--surface-1); color: var(--text-primary); border: 1px solid var(--border); border-radius: 12px; padding: 20px 24px; font-size: 13px; line-height: 1.7; }
.kmodal-close { position: absolute; top: 8px; right: 12px; border: 0; background: none; font-size: 24px; color: var(--text-muted); cursor: pointer; }
.kmodal-sheet h4 { margin: 14px 0 4px; font-size: 13px; color: var(--text-secondary); }
.k-title { margin: 0 32px 2px 0; font-size: 16px; }
.k-summary { border-left: 3px solid var(--accent); padding: 6px 10px; background: var(--page); border-radius: 6px; }
.k-note { color: var(--status-serious); font-size: 12px; margin: 4px 0; }
.k-list { margin: 0; padding-left: 18px; }
.k-list li { margin: 3px 0; }
.k-time { font-size: 11px; background: var(--grid); border-radius: 4px; padding: 0 4px; margin-right: 4px; font-variant-numeric: tabular-nums; }
.k-talk { background: var(--meter-track); border-radius: 6px; padding: 2px 8px; margin-top: 2px; }
.k-score { display: grid; grid-template-columns: 96px 1fr 40px; gap: 8px; align-items: center; margin: 3px 0; }
.k-bar { height: 8px; background: var(--grid); border-radius: 99px; overflow: hidden; }
.k-bar i { display: block; height: 100%; background: var(--accent); }

/* ============ 設定タブ ============ */
.inline-form { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 120px; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid var(--grid); font-size: 13px;
}
.plain-list li.member-row { display: block; }
.member-row-main { display: flex; align-items: center; gap: 10px; }
.member-row-sub { display: flex; gap: 6px; margin: 6px 0 2px; }
.member-row-sub input { flex: 1; padding: 4px 8px; font-size: 12px; min-width: 0; }
.plain-list li:last-child { border-bottom: none; }
.plain-list .spacer { margin-left: auto; }
.video-item { padding: 8px 0; border-bottom: 1px solid var(--grid); font-size: 13px; }
.video-item:last-child { border-bottom: none; }
.video-item select { margin: 6px 8px 0 0; max-width: 100%; }

/* ============ 権限による出し分け ============ */
body.member-mode .tab.admin-only { display: none; }
.user-chip { font-size: 12px; color: var(--text-secondary); font-weight: 600; white-space: nowrap; }
.seg-small button { padding: 5px 14px; font-size: 12px; }

/* ============ 利用者ゲート ============ */
.gate {
  position: fixed; inset: 0; background: var(--page); z-index: 50;
  display: flex; align-items: center; justify-content: center;
}
.gate[hidden] { display: none; }
.gate-card {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 16px;
  padding: 32px 36px; width: min(90vw, 360px); text-align: center; box-shadow: var(--shadow);
}
.gate-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.gate-card input { width: 100%; margin: 10px 0 14px; text-align: center; }
.gate-remember {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 12px; color: var(--text-secondary); margin-bottom: 12px; cursor: pointer;
}
.gate-remember input { width: auto; margin: 0; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 38px; }
.pw-toggle {
  position: absolute; right: 6px; top: calc(50% - 2px); transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 16px; padding: 2px 6px;
}
.gate-card .btn-primary { width: 100%; }
.gate-msg { color: var(--status-critical); font-size: 12px; min-height: 1.2em; margin: 10px 0 0; }

/* ============ アポ予定タイムライン ============ */
.sched-card { padding: 12px 14px; }
.sched-grid { min-width: 1100px; font-size: 12px; }
.sched-hrow, .sched-row { display: flex; align-items: stretch; }
.sched-label {
  flex: 0 0 88px; padding: 6px 8px; font-weight: 600; font-size: 13px;
  display: flex; align-items: center; border-bottom: 1px solid var(--grid);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sched-hrow .sched-label { border-bottom: 1px solid var(--baseline); }
.sched-htrack {
  position: relative; flex: 1; min-height: 26px;
  border-bottom: 1px solid var(--baseline);
}
.sched-hour {
  position: absolute; top: 5px; font-size: 11px; color: var(--text-muted);
  transform: translateX(2px);
}
.sched-track {
  position: relative; flex: 1; min-height: 48px;
  border-bottom: 1px solid var(--grid);
  background-image: repeating-linear-gradient(to right,
    var(--grid) 0, var(--grid) 1px, transparent 1px, transparent calc(100% / 16));
}
.sched-ev {
  position: absolute; top: 7px; bottom: 7px;
  display: flex; align-items: center; gap: 4px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-1));
  border: 1px solid var(--accent); border-left: 3px solid var(--accent);
  border-radius: 6px; padding: 2px 6px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  color: var(--text-primary);
}
.sched-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--status-critical); z-index: 2; }
#schedDate { padding: 6px 10px; }
.sched-track { user-select: none; }
.sched-track[data-code] { cursor: crosshair; }
.sched-ghost {
  position: absolute; top: 5px; bottom: 5px; z-index: 3;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  border: 1px dashed var(--accent); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: var(--text-primary);
  pointer-events: none; white-space: nowrap; overflow: hidden;
}
.sched-legend {
  display: inline-block; width: 22px; height: 10px; vertical-align: -1px;
  border-radius: 3px;
}
/* 応募者追客CRMで確定した面談。こちらからは編集できないので色と枠線で区別する */
.sched-ev-crm {
  background: color-mix(in srgb, var(--status-good) 12%, var(--surface-1));
  border-color: var(--status-good);
  border-left-style: dashed; border-left-width: 4px;
  cursor: default;
}
.sched-ev-edit { cursor: grab; }
.sched-ev-edit:hover { box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); }
.sched-ev-moving { cursor: grabbing; opacity: .85; z-index: 4; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); }
.sched-movelabel {
  position: absolute; left: 50%; top: -20px; transform: translateX(-50%);
  background: var(--text-primary); color: var(--page);
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px;
  white-space: nowrap; pointer-events: none;
}
.ev-card { width: min(92vw, 480px); text-align: left; }

/* ============ 商談一覧: 理由・備考の開閉 ============ */
.memo-cell { width: 34px; padding-right: 0 !important; }
.memo-toggle {
  border: 1px solid var(--border); background: var(--surface-1);
  border-radius: 6px; cursor: pointer; font-size: 12px;
  padding: 2px 6px; line-height: 1.4;
}
.memo-toggle:hover { border-color: var(--accent); }
.memo-toggle.on { background: var(--accent); border-color: var(--accent); }
#dealTable tr.memo-row td { padding: 0 10px 10px 34px; border-bottom: 1px solid var(--grid); white-space: normal; }
.memo-body {
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  border-left: 3px solid var(--accent); border-radius: 0 6px 6px 0;
  padding: 8px 12px; font-size: 12px; color: var(--text-secondary); line-height: 1.7;
}
.memo-body > div + div { margin-top: 6px; }
.memo-label {
  display: inline-block; min-width: 34px; margin-right: 8px;
  font-weight: 700; color: var(--text-primary); font-size: 11px;
}

/* ============ 商談録画のAIフィードバック ============ */
#dealTable tr.review-row td { padding: 0 10px 12px 34px; border-bottom: 1px solid var(--grid); white-space: normal; }
.review-body { font-size: 12px; line-height: 1.75; color: var(--text-secondary); }
.up-progress { font-size: 11px; color: var(--accent); font-variant-numeric: tabular-nums; }
.rec-player { width: 100%; max-width: 520px; height: 34px; margin-bottom: 10px; }
.face-avg { line-height: 1.9; }
.face-who { font-weight: 700; color: var(--text-primary); margin-right: 8px; }
.face-notable { margin: 8px 0 0; padding-left: 18px; }
.face-notable li { line-height: 1.8; }
.face-jump {
  border: none; background: none; padding: 0 4px 0 0; cursor: pointer;
  color: var(--accent); font: inherit; font-variant-numeric: tabular-nums;
}
.face-jump:hover { text-decoration: underline; }
.review-meta { color: var(--text-muted); margin-bottom: 8px; }
.tr-detail { display: inline-block; margin-left: 8px; }
.tr-detail summary { cursor: pointer; color: var(--accent); }
.tr-text {
  margin: 6px 0 0; padding: 10px; max-height: 320px; overflow: auto;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 6px;
  white-space: pre-wrap; font-size: 12px; line-height: 1.8;
}
.review-empty textarea {
  display: block; width: 100%; margin: 6px 0; padding: 8px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface-1); color: var(--text-primary); font-size: 12px;
}
.review-actions { margin-top: 10px; display: flex; align-items: center; gap: 10px; }
.review-running { color: var(--accent); }
.review-error { color: #c0392b; }

.insight {
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  border-left: 3px solid var(--accent); border-radius: 0 6px 6px 0; padding: 10px 14px;
}
.insight-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.insight-score { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.insight-score small { font-size: 11px; font-weight: 400; margin-left: 2px; }
.insight-temp { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.insight-temp.hot { background: #e8503a; color: #fff; }
.insight-temp.warm { background: #e2a13a; color: #fff; }
.insight-temp.cold { background: var(--text-muted); color: #fff; }
.insight-temp.unknown { background: var(--surface-1); color: var(--text-muted); }
.insight-summary { margin: 0 0 8px; color: var(--text-primary); }
.insight-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px 16px; margin-bottom: 8px; }
.insight-label { display: block; font-size: 10px; font-weight: 700; color: var(--text-muted); }
.insight-sec { margin-top: 10px; }
.insight-sec h4 { margin: 0 0 4px; font-size: 11px; color: var(--text-muted); letter-spacing: .04em; }
.insight-sec ul, .insight-sec ol { margin: 0; padding-left: 18px; }
.insight-sec li + li { margin-top: 6px; }
.insight-say { color: var(--text-primary); font-weight: 600; }
.obj-flag { display: inline-block; margin-right: 6px; padding: 1px 6px; border-radius: 4px; font-size: 10px; font-weight: 700; }
.obj-flag.ok { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-strong); }
.obj-flag.ng { background: rgba(232, 80, 58, .16); color: #c0392b; }
.followup { display: flex; align-items: flex-start; gap: 10px; }
.followup p {
  flex: 1; margin: 0; padding: 8px 10px; background: var(--surface-1);
  border: 1px solid var(--border); border-radius: 6px; color: var(--text-primary);
}
a.icon-btn { text-decoration: none; display: inline-flex; align-items: center; }

/* ============ 判定(コンプラ / Q&A) ============ */
.tab-badge {
  display: inline-block; min-width: 16px; margin-left: 5px; padding: 0 5px;
  background: #c0392b; color: #fff; border-radius: 999px;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}
.rul-switch { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.rul-switch .mini-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.rul-done { font-size: 12px; color: var(--text-muted); margin-left: auto; }
.rul {
  border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin-bottom: 12px;
  background: var(--surface-1);
}
.rul.done { opacity: .5; }
.rul-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.rul-count { font-size: 11px; color: var(--text-muted); }
.rul-verdict { margin-left: auto; font-size: 11px; font-weight: 700; }
.rul-verdict.ok { color: var(--accent-strong); }
.rul-verdict.ng { color: var(--text-muted); }
.rul-q { margin: 0 0 4px; font-size: 14px; font-weight: 700; color: var(--text-primary); line-height: 1.7; }
.rul-where { font-size: 11px; color: var(--text-muted); margin: 6px 0 10px; }
.rul-where a { color: var(--accent); }
.rul-form label { display: block; font-size: 11px; color: var(--text-muted); margin-top: 8px; }
.rul-form textarea {
  display: block; width: 100%; margin-top: 3px; padding: 7px 9px; font: inherit; font-size: 13px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface-2, var(--bg)); color: var(--text-primary); resize: vertical;
}
.rul-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.rul-btns .mini-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.rul-form .btn-primary { margin-top: 10px; }
.rul-msg { margin-left: 10px; font-size: 12px; }

/* ============ ロープレ ============ */
.rp-setup { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0; }
.rp-setup select { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface-1); color: var(--text-primary); }
.rp-log {
  max-height: 46vh; overflow-y: auto; padding: 10px; margin-bottom: 10px;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px;
}
.rp-turn { display: grid; grid-template-columns: 42px 1fr; gap: 8px; padding: 5px 0; font-size: 13px; line-height: 1.75; }
.rp-who { font-size: 10px; font-weight: 700; color: var(--text-muted); padding-top: 4px; }
.rp-turn.me .rp-text { color: var(--text-primary); font-weight: 600; }
.rp-turn.cx .rp-text { color: var(--text-secondary); }
.rp-text { white-space: pre-wrap; }
.rp-form { display: flex; gap: 8px; align-items: flex-end; }
.rp-form textarea {
  flex: 1; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-1); color: var(--text-primary); font: inherit; font-size: 13px; resize: vertical;
}
.rp-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.hearing { list-style: none; margin: 0; padding: 0; }
.hs { display: grid; grid-template-columns: 18px 150px 1fr; gap: 8px; align-items: baseline; padding: 2px 0; }
.hs + .hs { margin-top: 0; }
.hs-mark { font-weight: 700; text-align: center; }
.hs.on .hs-mark { color: var(--accent-strong); }
.hs.off .hs-mark { color: #c0392b; }
.hs-label { font-weight: 600; color: var(--text-primary); }
.hs.off .hs-label { color: #c0392b; }
.hs-note { color: var(--text-secondary); }
@media (max-width: 720px) { .hs { grid-template-columns: 18px 1fr; } .hs-note { grid-column: 2; } }
.compliance { border-left: 3px solid #c0392b; padding-left: 10px; margin-left: -13px; }
.cmp { line-height: 1.75; }
.cmp-lv {
  display: inline-block; margin-right: 6px; padding: 1px 6px; border-radius: 4px;
  font-size: 10px; font-weight: 700;
}
.cmp.grave .cmp-lv { background: #c0392b; color: #fff; }
.cmp.warn .cmp-lv { background: rgba(226, 161, 58, .2); color: #b57c14; }
.insight-risk { margin-top: 10px; color: #c0392b; font-weight: 600; }

/* コンプライアンス指摘。要約より上に置き、重大は枠ごと赤くする */
.insight-cmp { margin: 10px 0 12px; padding: 10px 12px; border-radius: 8px;
  background: rgba(232, 80, 58, .07); border: 1px solid rgba(232, 80, 58, .28); }
.insight-cmp.grave { background: rgba(232, 80, 58, .13); border-color: #c0392b; }
.insight-cmp h4 { margin: 0 0 8px; font-size: 12px; font-weight: 700; color: #c0392b; }
.cmp-list { margin: 0; padding: 0; list-style: none; }
.cmp-item { display: block; font-size: 12px; line-height: 1.8; padding: 6px 0; }
.cmp-item + .cmp-item { border-top: 1px dashed rgba(232, 80, 58, .3); }
.cmp-sev { display: inline-block; margin-right: 6px; padding: 1px 6px; border-radius: 4px;
  font-size: 10px; font-weight: 700; background: rgba(232, 80, 58, .18); color: #c0392b; }
.cmp-item.grave .cmp-sev { background: #c0392b; color: #fff; }
.cmp-quote { font-weight: 700; color: var(--text-primary); }
.cmp-why { display: block; color: var(--text-secondary); }


/* ============ KPI分析 ============ */
.an-toolbar-card { padding: 14px 18px; }
.an-toolbar { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.an-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.an-presets { display: flex; gap: 6px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.an-compare th, .an-compare td { white-space: nowrap; }
.an-total td { border-top: 2px solid var(--baseline); font-weight: 700; background: color-mix(in srgb, var(--accent) 5%, transparent); }
.an-barcell { width: 34%; min-width: 90px; }
.an-bar { display: block; height: 9px; border-radius: 4px; min-width: 2px; }
.an-reason { white-space: normal; max-width: 380px; color: var(--text-secondary); font-size: 12px; }
.an-pace { font-size: 11px; padding: 2px 8px; }
.tile .an-pace { margin-top: 2px; }
.an-sub { margin-top: 3px; font-size: 10px; font-weight: normal; white-space: nowrap; line-height: 1.6; }
.an-need-line { margin-top: 1px; }
.an-need { font-weight: 700; }
.an-need.short { color: var(--status-critical); }
.an-need.over { color: var(--delta-good); }
.tile .an-need-line { margin-top: 2px; }
.an-sub .an-pace { font-size: 10px; padding: 1px 6px; }
.an-exp { font-size: 10px; }
.an-compare td { vertical-align: top; }
.an-picker { position: relative; }
.an-picker-btn {
  min-width: 180px; text-align: left; font: inherit; font-weight: normal;
  color: var(--text-primary); background: var(--page);
  border: 1px solid var(--baseline); border-radius: 8px; padding: 8px 10px; cursor: pointer;
}
.an-picker-panel {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 30;
  width: 240px; max-height: 380px; overflow-y: auto;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18); padding: 8px;
}
.an-picker-actions { display: flex; gap: 6px; margin-bottom: 6px; }
.an-pick {
  display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-radius: 6px;
  font-size: 13px; font-weight: normal; color: var(--text-primary); cursor: pointer;
}
.an-pick:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.an-pick input { width: auto; margin: 0; padding: 0; }
.an-picker-hint { font-size: 11px; color: var(--text-muted); margin: 6px 4px 0; font-weight: normal; }
.an-picker-apply { width: 100%; margin-top: 6px; }

/* ============ トースト ============ */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text-primary); color: var(--page);
  border-radius: 10px; padding: 10px 20px; font-size: 13px; font-weight: 600;
  z-index: 100; box-shadow: 0 4px 16px rgba(0,0,0,.25);
}

/* ============ 応募者CRMから届いた面談 ============ */
.lead-card { border-color: var(--accent); }
.lead-card .muted-inline { display: block; margin: 4px 0 10px; }
.lead-count {
  display: inline-block; margin-left: 6px; padding: 1px 8px;
  border-radius: 999px; background: var(--meter-track); color: var(--accent-strong);
  font-size: 12px; font-weight: 700;
}
.lead-list { display: flex; flex-direction: column; gap: 6px; }
.lead-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--page);
}
.lead-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lead-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.lead-meta { font-size: 12px; color: var(--text-muted); }
.lead-unassigned { color: var(--status-warning); font-weight: 600; }
.lead-pick { flex: none; padding: 6px 12px; }
/* 手入力の商談を応募者CRMのリードに紐付ける候補(入力フォーム内) */
.lead-match { grid-column: 1 / -1; border: 1px dashed var(--accent); border-radius: 8px; padding: 8px 10px; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.lead-match-head { color: var(--text-secondary); font-weight: 600; }
.lead-match-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.lead-match-row .lead-meta { flex: 1 1 200px; min-width: 0; }
.lead-match input { max-width: 220px; }
.lead-linked { color: var(--status-good); font-weight: 600; }
.fn-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fn-table th, .fn-table td { padding: 6px 8px; border-bottom: 1px solid var(--grid); text-align: left; }
.fn-table th.num, .fn-table td.num { text-align: right; }
.fn-table tr.fn-sub td { color: var(--text-secondary); font-size: 12px; }
.fn-pending { margin: 8px 0 0; font-size: 12.5px; color: var(--status-warning); }
.lead-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.lead-chip {
  border: 1px solid var(--border); background: var(--surface-1); color: var(--text-secondary);
  border-radius: 999px; padding: 3px 11px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.lead-chip:hover { border-color: var(--accent); }
.lead-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.lead-chip.warn:not(.on) { color: var(--status-warning); border-color: var(--status-warning); }
.lead-group { font-size: 12px; font-weight: 700; color: var(--text-secondary); margin: 8px 2px 0; }
.lead-group:first-child { margin-top: 0; }
.lead-group.warn { color: var(--status-warning); }
.lead-group-n { font-weight: 400; color: var(--text-muted); margin-left: 6px; }
@media (max-width: 560px) {
  .lead-row { flex-direction: column; align-items: stretch; }
  .lead-pick { width: 100%; }
}

/* ============ Zoom→YouTube 接続状況 ============ */
.zoom-status { margin: 6px 0 10px; }
.zoom-status p { margin: 6px 0 0; font-size: 12px; }
.zoom-off {
  padding: 10px 12px; border-radius: 8px;
  background: var(--page); border: 1px solid var(--baseline);
  color: var(--text-secondary); font-size: 13px; line-height: 1.6;
}
.zoom-on {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  padding: 10px 12px; border-radius: 8px;
  background: var(--page); border: 1px solid var(--border);
  font-size: 13px;
}
.zoom-on > span:first-child { color: var(--status-good); font-weight: 600; }
.zoom-on .mini-btn { margin-left: auto; }
.zoom-link-card { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.zoom-link-card .zl-text { flex: 1 1 260px; line-height: 1.6; }
.zoom-link-card .zl-text strong { display: block; }
.zoom-link-card.broken { border-color: var(--status-warning); }
.zoom-link-card.ok { padding: 8px 14px; }
.zoom-link-card.ok strong { display: inline; margin-right: 6px; }
.zoom-link-card .zl-recent { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.zoom-links { list-style: none; margin: 0 0 10px; padding: 0; font-size: 13px; }
.zoom-open { display: flex; align-items: center; gap: 6px; font-size: 13px; margin: 4px 0 8px; }
.zoom-links li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
  padding: 6px 0; border-bottom: 1px solid var(--border); }
.zoom-links li:last-child { border-bottom: none; }
.zoom-links .zl-name { min-width: 7em; font-weight: 600; }
.zoom-links .zl-ok { color: var(--status-good); }
.zoom-links .zl-ng { color: var(--status-warning); }
.zoom-links .zl-none { color: var(--text-muted); }
.zoom-links .mini-btn { margin-left: auto; }
.rec-video-link { display: inline-block; margin: 0 0 8px; font-size: 13px; }
